From c17de070fb8caf5a36b065c7990c22c9f1e50638 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Wed, 27 Mar 2019 11:18:04 +0100 Subject: [PATCH] fix: update lego. --- Gopkg.lock | 237 +- Gopkg.toml | 4 +- docs/content/https-tls/acme.md | 1 + .../ArthurHlt/go-eureka-client/LICENSE | 21 - .../go-eureka-client/eureka/client.go | 357 - .../go-eureka-client/eureka/cluster.go | 51 - .../go-eureka-client/eureka/debug.go | 21 - .../go-eureka-client/eureka/delete.go | 10 - .../go-eureka-client/eureka/error.go | 48 - .../ArthurHlt/go-eureka-client/eureka/get.go | 64 - .../eureka/metadata_marshaller.go | 95 - .../ArthurHlt/go-eureka-client/eureka/post.go | 21 - .../ArthurHlt/go-eureka-client/eureka/put.go | 10 - .../go-eureka-client/eureka/requests.go | 439 - .../go-eureka-client/eureka/response.go | 21 - .../go-eureka-client/eureka/version.go | 3 - vendor/github.com/ArthurHlt/gominlog/LICENSE | 23 - .../github.com/ArthurHlt/gominlog/gominlog.go | 190 - vendor/github.com/BurntSushi/ty/COPYING | 13 - vendor/github.com/BurntSushi/ty/doc.go | 22 - vendor/github.com/BurntSushi/ty/fun/chan.go | 84 - vendor/github.com/BurntSushi/ty/fun/doc.go | 118 - vendor/github.com/BurntSushi/ty/fun/func.go | 35 - vendor/github.com/BurntSushi/ty/fun/list.go | 303 - vendor/github.com/BurntSushi/ty/fun/map.go | 46 - vendor/github.com/BurntSushi/ty/fun/rand.go | 94 - vendor/github.com/BurntSushi/ty/fun/set.go | 99 - vendor/github.com/BurntSushi/ty/fun/sort.go | 98 - vendor/github.com/BurntSushi/ty/fun/util.go | 37 - vendor/github.com/BurntSushi/ty/type-check.go | 338 - vendor/github.com/BurntSushi/ty/tyvars.go | 28 - .../abronan/valkeyrie/store/boltdb/boltdb.go | 476 - .../abronan/valkeyrie/store/consul/consul.go | 575 - .../abronan/valkeyrie/store/etcd/v3/etcd.go | 534 - .../valkeyrie/store/zookeeper/zookeeper.go | 593 - .../private/protocol/ec2query/build.go | 35 - .../private/protocol/ec2query/unmarshal.go | 63 - .../aws/aws-sdk-go/service/dynamodb/api.go | 12998 --- .../service/dynamodb/customizations.go | 109 - .../aws/aws-sdk-go/service/dynamodb/doc.go | 45 - .../aws-sdk-go/service/dynamodb/doc_custom.go | 27 - .../dynamodb/dynamodbattribute/converter.go | 443 - .../dynamodb/dynamodbattribute/decode.go | 761 - .../service/dynamodb/dynamodbattribute/doc.go | 95 - .../dynamodb/dynamodbattribute/encode.go | 641 - .../dynamodb/dynamodbattribute/field.go | 269 - .../service/dynamodb/dynamodbattribute/tag.go | 68 - .../dynamodb/dynamodbiface/interface.go | 214 - .../aws/aws-sdk-go/service/dynamodb/errors.go | 149 - .../aws-sdk-go/service/dynamodb/service.go | 95 - .../aws-sdk-go/service/dynamodb/waiters.go | 107 - .../aws/aws-sdk-go/service/ec2/api.go | 71742 ---------------- .../aws-sdk-go/service/ec2/customizations.go | 120 - .../aws/aws-sdk-go/service/ec2/doc.go | 30 - .../aws/aws-sdk-go/service/ec2/errors.go | 3 - .../aws/aws-sdk-go/service/ec2/service.go | 93 - .../aws/aws-sdk-go/service/ec2/waiters.go | 1626 - .../aws/aws-sdk-go/service/ecs/api.go | 11156 --- .../aws/aws-sdk-go/service/ecs/doc.go | 45 - .../aws/aws-sdk-go/service/ecs/errors.go | 145 - .../aws/aws-sdk-go/service/ecs/service.go | 95 - .../aws/aws-sdk-go/service/ecs/waiters.go | 224 - vendor/github.com/coreos/bbolt/LICENSE | 20 - vendor/github.com/coreos/bbolt/bolt_386.go | 10 - vendor/github.com/coreos/bbolt/bolt_amd64.go | 10 - vendor/github.com/coreos/bbolt/bolt_arm.go | 28 - vendor/github.com/coreos/bbolt/bolt_arm64.go | 12 - vendor/github.com/coreos/bbolt/bolt_linux.go | 10 - .../github.com/coreos/bbolt/bolt_mips64x.go | 12 - vendor/github.com/coreos/bbolt/bolt_mipsx.go | 12 - .../github.com/coreos/bbolt/bolt_openbsd.go | 27 - vendor/github.com/coreos/bbolt/bolt_ppc.go | 9 - vendor/github.com/coreos/bbolt/bolt_ppc64.go | 12 - .../github.com/coreos/bbolt/bolt_ppc64le.go | 12 - vendor/github.com/coreos/bbolt/bolt_s390x.go | 12 - vendor/github.com/coreos/bbolt/bolt_unix.go | 92 - .../coreos/bbolt/bolt_unix_solaris.go | 89 - .../github.com/coreos/bbolt/bolt_windows.go | 145 - .../github.com/coreos/bbolt/boltsync_unix.go | 8 - vendor/github.com/coreos/bbolt/bucket.go | 775 - vendor/github.com/coreos/bbolt/cursor.go | 400 - vendor/github.com/coreos/bbolt/db.go | 1137 - vendor/github.com/coreos/bbolt/doc.go | 44 - vendor/github.com/coreos/bbolt/errors.go | 71 - vendor/github.com/coreos/bbolt/freelist.go | 333 - vendor/github.com/coreos/bbolt/node.go | 604 - vendor/github.com/coreos/bbolt/page.go | 197 - vendor/github.com/coreos/bbolt/tx.go | 705 - vendor/github.com/coreos/etcd/LICENSE | 202 - vendor/github.com/coreos/etcd/NOTICE | 5 - .../coreos/etcd/auth/authpb/auth.pb.go | 807 - .../github.com/coreos/etcd/clientv3/auth.go | 233 - .../github.com/coreos/etcd/clientv3/client.go | 562 - .../coreos/etcd/clientv3/cluster.go | 114 - .../coreos/etcd/clientv3/compact_op.go | 51 - .../coreos/etcd/clientv3/compare.go | 140 - .../coreos/etcd/clientv3/concurrency/doc.go | 17 - .../etcd/clientv3/concurrency/election.go | 245 - .../coreos/etcd/clientv3/concurrency/key.go | 65 - .../coreos/etcd/clientv3/concurrency/mutex.go | 118 - .../etcd/clientv3/concurrency/session.go | 141 - .../coreos/etcd/clientv3/concurrency/stm.go | 387 - .../github.com/coreos/etcd/clientv3/config.go | 75 - vendor/github.com/coreos/etcd/clientv3/doc.go | 97 - .../coreos/etcd/clientv3/health_balancer.go | 609 - vendor/github.com/coreos/etcd/clientv3/kv.go | 177 - .../github.com/coreos/etcd/clientv3/lease.go | 584 - .../github.com/coreos/etcd/clientv3/logger.go | 135 - .../coreos/etcd/clientv3/maintenance.go | 226 - vendor/github.com/coreos/etcd/clientv3/op.go | 513 - .../coreos/etcd/clientv3/options.go | 49 - .../coreos/etcd/clientv3/ready_wait.go | 30 - .../github.com/coreos/etcd/clientv3/retry.go | 496 - .../github.com/coreos/etcd/clientv3/sort.go | 37 - vendor/github.com/coreos/etcd/clientv3/txn.go | 151 - .../github.com/coreos/etcd/clientv3/watch.go | 814 - .../etcd/etcdserver/api/v3rpc/rpctypes/doc.go | 16 - .../etcdserver/api/v3rpc/rpctypes/error.go | 215 - .../etcd/etcdserver/api/v3rpc/rpctypes/md.go | 20 - .../etcdserver/etcdserverpb/etcdserver.pb.go | 1035 - .../etcdserverpb/raft_internal.pb.go | 2077 - .../etcd/etcdserver/etcdserverpb/rpc.pb.go | 18665 ---- .../coreos/etcd/mvcc/mvccpb/kv.pb.go | 718 - .../github.com/coreos/etcd/pkg/types/doc.go | 17 - vendor/github.com/coreos/etcd/pkg/types/id.go | 41 - .../github.com/coreos/etcd/pkg/types/set.go | 178 - .../github.com/coreos/etcd/pkg/types/slice.go | 22 - .../github.com/coreos/etcd/pkg/types/urls.go | 82 - .../coreos/etcd/pkg/types/urlsmap.go | 107 - vendor/github.com/docker/leadership/LICENSE | 191 - .../github.com/docker/leadership/candidate.go | 150 - .../github.com/docker/leadership/follower.go | 74 - vendor/github.com/fatih/color/LICENSE.md | 20 - vendor/github.com/fatih/color/color.go | 600 - vendor/github.com/fatih/color/doc.go | 133 - .../acme/api/internal/sender/useragent.go | 4 +- .../lego/providers/dns/dns_providers.go | 3 + .../go-acme/lego/providers/dns/dode/client.go | 57 + .../go-acme/lego/providers/dns/dode/dode.go | 89 + .../lego/providers/dns/hostingde/hostingde.go | 4 +- .../go-acme/lego/providers/dns/pdns/client.go | 2 +- .../go-acme/lego/providers/dns/pdns/pdns.go | 18 +- .../github.com/gogo/protobuf/gogoproto/doc.go | 168 - .../gogo/protobuf/gogoproto/gogo.pb.go | 665 - .../gogo/protobuf/gogoproto/helper.go | 310 - .../descriptor/descriptor.pb.go | 1981 - .../descriptor/descriptor_gostring.gen.go | 658 - .../protoc-gen-gogo/descriptor/helper.go | 357 - vendor/github.com/hashicorp/consul/LICENSE | 354 - vendor/github.com/hashicorp/consul/api/acl.go | 193 - .../github.com/hashicorp/consul/api/agent.go | 624 - vendor/github.com/hashicorp/consul/api/api.go | 791 - .../hashicorp/consul/api/catalog.go | 199 - .../hashicorp/consul/api/coordinate.go | 106 - .../github.com/hashicorp/consul/api/event.go | 104 - .../github.com/hashicorp/consul/api/health.go | 215 - vendor/github.com/hashicorp/consul/api/kv.go | 420 - .../github.com/hashicorp/consul/api/lock.go | 385 - .../hashicorp/consul/api/operator.go | 11 - .../hashicorp/consul/api/operator_area.go | 193 - .../consul/api/operator_autopilot.go | 219 - .../hashicorp/consul/api/operator_keyring.go | 86 - .../hashicorp/consul/api/operator_raft.go | 89 - .../hashicorp/consul/api/operator_segment.go | 11 - .../hashicorp/consul/api/prepared_query.go | 198 - vendor/github.com/hashicorp/consul/api/raw.go | 24 - .../hashicorp/consul/api/semaphore.go | 513 - .../hashicorp/consul/api/session.go | 224 - .../hashicorp/consul/api/snapshot.go | 47 - .../github.com/hashicorp/consul/api/status.go | 43 - .../hashicorp/consul/website/LICENSE.md | 10 - .../github.com/hashicorp/go-cleanhttp/LICENSE | 363 - .../hashicorp/go-cleanhttp/cleanhttp.go | 56 - .../github.com/hashicorp/go-cleanhttp/doc.go | 20 - .../github.com/hashicorp/go-rootcerts/LICENSE | 363 - .../github.com/hashicorp/go-rootcerts/doc.go | 9 - .../hashicorp/go-rootcerts/rootcerts.go | 103 - .../hashicorp/go-rootcerts/rootcerts_base.go | 12 - .../go-rootcerts/rootcerts_darwin.go | 48 - vendor/github.com/hashicorp/serf/LICENSE | 354 - .../hashicorp/serf/coordinate/client.go | 180 - .../hashicorp/serf/coordinate/config.go | 70 - .../hashicorp/serf/coordinate/coordinate.go | 183 - .../hashicorp/serf/coordinate/phantom.go | 187 - .../hashicorp/serf/ops-misc/debian/copyright | 2 - .../hashicorp/serf/website/LICENSE.md | 10 - .../hashicorp/serf/website/source/LICENSE | 10 - vendor/github.com/mattn/go-colorable/LICENSE | 21 - .../mattn/go-colorable/colorable_others.go | 27 - .../mattn/go-colorable/colorable_windows.go | 820 - .../mattn/go-colorable/noncolorable.go | 61 - vendor/github.com/mattn/go-isatty/LICENSE | 9 - vendor/github.com/mattn/go-isatty/doc.go | 2 - .../mattn/go-isatty/isatty_appengine.go | 15 - .../github.com/mattn/go-isatty/isatty_bsd.go | 18 - .../mattn/go-isatty/isatty_linux.go | 18 - .../mattn/go-isatty/isatty_others.go | 10 - .../mattn/go-isatty/isatty_solaris.go | 16 - .../mattn/go-isatty/isatty_windows.go | 94 - vendor/github.com/mesos/mesos-go/LICENSE | 201 - vendor/github.com/mesos/mesos-go/NOTICE | 13 - .../github.com/mesos/mesos-go/detector/doc.go | 24 - .../mesos/mesos-go/detector/factory.go | 155 - .../mesos/mesos-go/detector/interface.go | 68 - .../mesos/mesos-go/detector/standalone.go | 244 - .../mesos/mesos-go/detector/zoo/client2.go | 88 - .../mesos/mesos-go/detector/zoo/detect.go | 369 - .../mesos/mesos-go/detector/zoo/doc.go | 3 - .../mesos-go/detector/zoo/mocked_conn.go | 71 - .../mesos/mesos-go/detector/zoo/plugin.go | 11 - .../mesos/mesos-go/detector/zoo/types.go | 27 - .../mesos-go/mesosproto/authentication.pb.go | 1974 - .../mesos-go/mesosproto/authorizer.pb.go | 2183 - .../mesos-go/mesosproto/containerizer.pb.go | 2622 - .../mesos/mesos-go/mesosproto/internal.pb.go | 77 - .../mesos/mesos-go/mesosproto/log.pb.go | 5146 -- .../mesos/mesos-go/mesosproto/mesos.pb.go | 34168 -------- .../mesos/mesos-go/mesosproto/messages.pb.go | 16836 ---- .../mesos/mesos-go/mesosproto/registry.pb.go | 1268 - .../mesos/mesos-go/mesosproto/scheduler.pb.go | 7176 -- .../mesos/mesos-go/mesosproto/state.pb.go | 1803 - .../mesos/mesos-go/mesosutil/constants.go | 6 - .../mesos-go/mesosutil/mesosprotoutil.go | 155 - .../mesos/mesos-go/mesosutil/node.go | 23 - vendor/github.com/mesos/mesos-go/upid/doc.go | 4 - vendor/github.com/mesos/mesos-go/upid/upid.go | 63 - .../github.com/mesosphere/mesos-dns/LICENSE | 202 - .../mesosphere/mesos-dns/detect/masters.go | 115 - .../mesos-dns/errorutil/errorutil.go | 12 - .../mesosphere/mesos-dns/logging/logging.go | 104 - .../mesosphere/mesos-dns/models/models.go | 26 - .../mesosphere/mesos-dns/records/chains.go | 80 - .../mesosphere/mesos-dns/records/config.go | 261 - .../mesosphere/mesos-dns/records/generator.go | 655 - .../mesos-dns/records/labels/labels.go | 83 - .../mesos-dns/records/state/state.go | 271 - .../mesos-dns/records/validation.go | 84 - .../mesosphere/mesos-dns/util/util.go | 54 - .../go-rancher-metadata/metadata/change.go | 64 - .../go-rancher-metadata/metadata/metadata.go | 277 - .../go-rancher-metadata/metadata/types.go | 156 - .../go-rancher-metadata/metadata/utils.go | 19 - vendor/github.com/rancher/go-rancher/LICENSE | 177 - .../rancher/go-rancher/v2/client.go | 39 - .../rancher/go-rancher/v2/common.go | 620 - .../go-rancher/v2/generated_account.go | 186 - .../go-rancher/v2/generated_active_setting.go | 87 - .../v2/generated_add_outputs_input.go | 79 - ...generated_add_remove_service_link_input.go | 79 - .../rancher/go-rancher/v2/generated_agent.go | 206 - .../v2/generated_amazonec2config.go | 137 - .../go-rancher/v2/generated_api_key.go | 173 - .../go-rancher/v2/generated_audit_log.go | 105 - .../go-rancher/v2/generated_azure_config.go | 121 - .../go-rancher/v2/generated_azureadconfig.go | 93 - .../rancher/go-rancher/v2/generated_backup.go | 133 - .../go-rancher/v2/generated_backup_target.go | 127 - .../v2/generated_base_machine_config.go | 77 - .../go-rancher/v2/generated_binding.go | 79 - .../v2/generated_blkio_device_option.go | 87 - .../v2/generated_catalog_template.go | 93 - .../go-rancher/v2/generated_certificate.go | 162 - .../v2/generated_change_secret_input.go | 81 - .../rancher/go-rancher/v2/generated_client.go | 353 - .../v2/generated_cluster_membership.go | 87 - .../go-rancher/v2/generated_compose_config.go | 81 - .../v2/generated_compose_config_input.go | 79 - .../v2/generated_compose_project.go | 191 - .../v2/generated_compose_service.go | 212 - .../go-rancher/v2/generated_config_item.go | 81 - .../v2/generated_config_item_status.go | 93 - .../go-rancher/v2/generated_container.go | 517 - .../v2/generated_container_event.go | 129 - .../go-rancher/v2/generated_container_exec.go | 85 - .../go-rancher/v2/generated_container_logs.go | 81 - .../v2/generated_container_proxy.go | 81 - .../go-rancher/v2/generated_credential.go | 173 - .../v2/generated_databasechangelog.go | 97 - .../v2/generated_databasechangeloglock.go | 83 - .../v2/generated_default_network.go | 183 - .../v2/generated_digitalocean_config.go | 101 - .../go-rancher/v2/generated_dns_service.go | 285 - .../go-rancher/v2/generated_docker_build.go | 89 - .../v2/generated_extension_implementation.go | 83 - .../v2/generated_extension_point.go | 87 - .../v2/generated_external_dns_event.go | 129 - .../go-rancher/v2/generated_external_event.go | 123 - .../v2/generated_external_handler.go | 175 - ...al_handler_external_handler_process_map.go | 175 - .../v2/generated_external_handler_process.go | 167 - ...nerated_external_handler_process_config.go | 81 - .../v2/generated_external_host_event.go | 129 - .../v2/generated_external_service.go | 252 - .../v2/generated_external_service_event.go | 127 - .../generated_external_storage_pool_event.go | 127 - .../v2/generated_external_volume_event.go | 125 - .../v2/generated_field_documentation.go | 79 - .../go-rancher/v2/generated_generic_object.go | 129 - .../go-rancher/v2/generated_ha_config.go | 85 - .../v2/generated_ha_config_input.go | 109 - ...generated_healthcheck_instance_host_map.go | 131 - .../rancher/go-rancher/v2/generated_host.go | 275 - .../go-rancher/v2/generated_host_access.go | 81 - .../v2/generated_host_api_proxy_token.go | 83 - .../go-rancher/v2/generated_host_template.go | 133 - .../go-rancher/v2/generated_identity.go | 97 - .../rancher/go-rancher/v2/generated_image.go | 169 - .../generated_in_service_upgrade_strategy.go | 91 - .../go-rancher/v2/generated_instance.go | 272 - .../v2/generated_instance_console.go | 83 - .../v2/generated_instance_console_input.go | 77 - .../v2/generated_instance_health_check.go | 99 - .../go-rancher/v2/generated_instance_link.go | 177 - .../go-rancher/v2/generated_instance_stop.go | 81 - .../go-rancher/v2/generated_ip_address.go | 195 - .../v2/generated_kubernetes_service.go | 275 - .../v2/generated_kubernetes_stack.go | 204 - .../v2/generated_kubernetes_stack_upgrade.go | 85 - .../rancher/go-rancher/v2/generated_label.go | 129 - .../go-rancher/v2/generated_launch_config.go | 518 - .../go-rancher/v2/generated_lb_config.go | 87 - .../v2/generated_lb_target_config.go | 79 - ..._load_balancer_cookie_stickiness_policy.go | 91 - .../v2/generated_load_balancer_service.go | 297 - .../v2/generated_local_auth_config.go | 87 - .../go-rancher/v2/generated_log_config.go | 81 - .../go-rancher/v2/generated_machine.go | 194 - .../go-rancher/v2/generated_machine_driver.go | 192 - .../rancher/go-rancher/v2/generated_mount.go | 144 - .../go-rancher/v2/generated_mount_entry.go | 87 - .../go-rancher/v2/generated_network.go | 185 - .../go-rancher/v2/generated_network_driver.go | 166 - .../v2/generated_network_driver_service.go | 305 - .../v2/generated_network_policy_rule.go | 89 - .../generated_network_policy_rule_between.go | 81 - .../generated_network_policy_rule_member.go | 79 - .../generated_network_policy_rule_within.go | 77 - .../go-rancher/v2/generated_nfs_config.go | 83 - .../go-rancher/v2/generated_openldapconfig.go | 129 - .../go-rancher/v2/generated_packet_config.go | 89 - .../go-rancher/v2/generated_password.go | 184 - .../go-rancher/v2/generated_physical_host.go | 162 - .../rancher/go-rancher/v2/generated_port.go | 183 - .../go-rancher/v2/generated_port_rule.go | 95 - .../v2/generated_process_definition.go | 91 - .../v2/generated_process_execution.go | 85 - .../v2/generated_process_instance.go | 118 - .../go-rancher/v2/generated_process_pool.go | 95 - .../v2/generated_process_summary.go | 85 - .../go-rancher/v2/generated_project.go | 211 - .../go-rancher/v2/generated_project_member.go | 175 - .../v2/generated_project_template.go | 131 - .../v2/generated_public_endpoint.go | 87 - .../go-rancher/v2/generated_publish.go | 99 - .../go-rancher/v2/generated_pull_task.go | 133 - ...ated_recreate_on_quorum_strategy_config.go | 79 - .../go-rancher/v2/generated_register.go | 144 - .../v2/generated_registration_token.go | 177 - .../go-rancher/v2/generated_registry.go | 181 - .../v2/generated_registry_credential.go | 175 - .../v2/generated_resource_definition.go | 79 - .../go-rancher/v2/generated_restart_policy.go | 81 - .../v2/generated_restore_from_backup_input.go | 79 - .../v2/generated_revert_to_snapshot_input.go | 79 - .../v2/generated_rolling_restart_strategy.go | 81 - .../go-rancher/v2/generated_scale_policy.go | 83 - .../v2/generated_scheduled_upgrade.go | 136 - .../v2/generated_secondary_launch_config.go | 520 - .../rancher/go-rancher/v2/generated_secret.go | 127 - .../v2/generated_secret_reference.go | 87 - .../go-rancher/v2/generated_service.go | 303 - .../v2/generated_service_binding.go | 81 - .../v2/generated_service_consume_map.go | 142 - .../go-rancher/v2/generated_service_event.go | 135 - .../v2/generated_service_expose_map.go | 133 - .../go-rancher/v2/generated_service_link.go | 83 - .../go-rancher/v2/generated_service_log.go | 101 - .../go-rancher/v2/generated_service_proxy.go | 87 - .../v2/generated_service_restart.go | 79 - .../v2/generated_service_upgrade.go | 81 - .../v2/generated_service_upgrade_strategy.go | 81 - .../v2/generated_services_port_range.go | 81 - .../v2/generated_set_project_members_input.go | 79 - .../v2/generated_set_service_links_input.go | 79 - .../go-rancher/v2/generated_setting.go | 87 - .../go-rancher/v2/generated_snapshot.go | 138 - .../v2/generated_snapshot_backup_input.go | 107 - .../rancher/go-rancher/v2/generated_stack.go | 265 - .../go-rancher/v2/generated_stack_upgrade.go | 89 - .../v2/generated_state_transition.go | 77 - .../go-rancher/v2/generated_stats_access.go | 81 - .../go-rancher/v2/generated_storage_driver.go | 168 - .../v2/generated_storage_driver_service.go | 305 - .../go-rancher/v2/generated_storage_pool.go | 185 - .../rancher/go-rancher/v2/generated_subnet.go | 181 - .../v2/generated_target_port_rule.go | 85 - .../rancher/go-rancher/v2/generated_task.go | 90 - .../go-rancher/v2/generated_task_instance.go | 89 - .../generated_to_service_upgrade_strategy.go | 87 - .../v2/generated_type_documentation.go | 81 - .../rancher/go-rancher/v2/generated_ulimit.go | 83 - .../v2/generated_user_preference.go | 173 - .../v2/generated_virtual_machine.go | 485 - .../v2/generated_virtual_machine_disk.go | 91 - .../rancher/go-rancher/v2/generated_volume.go | 230 - .../v2/generated_volume_activate_input.go | 79 - .../v2/generated_volume_snapshot_input.go | 79 - .../v2/generated_volume_template.go | 179 - .../rancher/go-rancher/v2/schemas.go | 131 - .../github.com/rancher/go-rancher/v2/types.go | 95 - vendor/github.com/samuel/go-zookeeper/LICENSE | 25 - .../github.com/samuel/go-zookeeper/zk/conn.go | 1032 - .../samuel/go-zookeeper/zk/constants.go | 240 - .../samuel/go-zookeeper/zk/dnshostprovider.go | 88 - .../github.com/samuel/go-zookeeper/zk/flw.go | 266 - .../github.com/samuel/go-zookeeper/zk/lock.go | 150 - .../samuel/go-zookeeper/zk/server_help.go | 216 - .../samuel/go-zookeeper/zk/server_java.go | 136 - .../samuel/go-zookeeper/zk/structs.go | 609 - .../github.com/samuel/go-zookeeper/zk/util.go | 54 - vendor/github.com/tv42/zbase32/LICENSE | 19 - vendor/github.com/tv42/zbase32/flag.go | 30 - vendor/github.com/tv42/zbase32/fuzz.go | 10 - vendor/github.com/tv42/zbase32/zbase32.go | 222 - vendor/github.com/urfave/negroni/LICENSE | 21 - vendor/github.com/urfave/negroni/doc.go | 25 - vendor/github.com/urfave/negroni/logger.go | 80 - vendor/github.com/urfave/negroni/negroni.go | 141 - vendor/github.com/urfave/negroni/recovery.go | 65 - .../urfave/negroni/response_writer.go | 113 - vendor/github.com/urfave/negroni/static.go | 88 - .../grpc/health/grpc_health_v1/health.pb.go | 227 - 432 files changed, 182 insertions(+), 259514 deletions(-) delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/LICENSE delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/client.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/cluster.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/debug.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/delete.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/error.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/get.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/metadata_marshaller.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/post.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/put.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/requests.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/response.go delete mode 100644 vendor/github.com/ArthurHlt/go-eureka-client/eureka/version.go delete mode 100644 vendor/github.com/ArthurHlt/gominlog/LICENSE delete mode 100644 vendor/github.com/ArthurHlt/gominlog/gominlog.go delete mode 100644 vendor/github.com/BurntSushi/ty/COPYING delete mode 100644 vendor/github.com/BurntSushi/ty/doc.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/chan.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/doc.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/func.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/list.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/map.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/rand.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/set.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/sort.go delete mode 100644 vendor/github.com/BurntSushi/ty/fun/util.go delete mode 100644 vendor/github.com/BurntSushi/ty/type-check.go delete mode 100644 vendor/github.com/BurntSushi/ty/tyvars.go delete mode 100644 vendor/github.com/abronan/valkeyrie/store/boltdb/boltdb.go delete mode 100644 vendor/github.com/abronan/valkeyrie/store/consul/consul.go delete mode 100644 vendor/github.com/abronan/valkeyrie/store/etcd/v3/etcd.go delete mode 100644 vendor/github.com/abronan/valkeyrie/store/zookeeper/zookeeper.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ec2/api.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ec2/service.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ecs/api.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ecs/doc.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ecs/service.go delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go delete mode 100644 vendor/github.com/coreos/bbolt/LICENSE delete mode 100644 vendor/github.com/coreos/bbolt/bolt_386.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_amd64.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_arm.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_arm64.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_linux.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_mips64x.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_mipsx.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_openbsd.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_ppc.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_ppc64.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_ppc64le.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_s390x.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_unix.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_unix_solaris.go delete mode 100644 vendor/github.com/coreos/bbolt/bolt_windows.go delete mode 100644 vendor/github.com/coreos/bbolt/boltsync_unix.go delete mode 100644 vendor/github.com/coreos/bbolt/bucket.go delete mode 100644 vendor/github.com/coreos/bbolt/cursor.go delete mode 100644 vendor/github.com/coreos/bbolt/db.go delete mode 100644 vendor/github.com/coreos/bbolt/doc.go delete mode 100644 vendor/github.com/coreos/bbolt/errors.go delete mode 100644 vendor/github.com/coreos/bbolt/freelist.go delete mode 100644 vendor/github.com/coreos/bbolt/node.go delete mode 100644 vendor/github.com/coreos/bbolt/page.go delete mode 100644 vendor/github.com/coreos/bbolt/tx.go delete mode 100644 vendor/github.com/coreos/etcd/LICENSE delete mode 100644 vendor/github.com/coreos/etcd/NOTICE delete mode 100644 vendor/github.com/coreos/etcd/auth/authpb/auth.pb.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/auth.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/client.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/cluster.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/compact_op.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/compare.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/concurrency/doc.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/concurrency/election.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/concurrency/key.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/concurrency/mutex.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/concurrency/session.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/concurrency/stm.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/config.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/doc.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/health_balancer.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/kv.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/lease.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/logger.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/maintenance.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/op.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/options.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/ready_wait.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/retry.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/sort.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/txn.go delete mode 100644 vendor/github.com/coreos/etcd/clientv3/watch.go delete mode 100644 vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/doc.go delete mode 100644 vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/error.go delete mode 100644 vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/md.go delete mode 100644 vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go delete mode 100644 vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go delete mode 100644 vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go delete mode 100644 vendor/github.com/coreos/etcd/mvcc/mvccpb/kv.pb.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/doc.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/id.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/set.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/slice.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/urls.go delete mode 100644 vendor/github.com/coreos/etcd/pkg/types/urlsmap.go delete mode 100644 vendor/github.com/docker/leadership/LICENSE delete mode 100644 vendor/github.com/docker/leadership/candidate.go delete mode 100644 vendor/github.com/docker/leadership/follower.go delete mode 100644 vendor/github.com/fatih/color/LICENSE.md delete mode 100644 vendor/github.com/fatih/color/color.go delete mode 100644 vendor/github.com/fatih/color/doc.go create mode 100644 vendor/github.com/go-acme/lego/providers/dns/dode/client.go create mode 100644 vendor/github.com/go-acme/lego/providers/dns/dode/dode.go delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/doc.go delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/gogoproto/helper.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go delete mode 100644 vendor/github.com/hashicorp/consul/LICENSE delete mode 100644 vendor/github.com/hashicorp/consul/api/acl.go delete mode 100644 vendor/github.com/hashicorp/consul/api/agent.go delete mode 100644 vendor/github.com/hashicorp/consul/api/api.go delete mode 100644 vendor/github.com/hashicorp/consul/api/catalog.go delete mode 100644 vendor/github.com/hashicorp/consul/api/coordinate.go delete mode 100644 vendor/github.com/hashicorp/consul/api/event.go delete mode 100644 vendor/github.com/hashicorp/consul/api/health.go delete mode 100644 vendor/github.com/hashicorp/consul/api/kv.go delete mode 100644 vendor/github.com/hashicorp/consul/api/lock.go delete mode 100644 vendor/github.com/hashicorp/consul/api/operator.go delete mode 100644 vendor/github.com/hashicorp/consul/api/operator_area.go delete mode 100644 vendor/github.com/hashicorp/consul/api/operator_autopilot.go delete mode 100644 vendor/github.com/hashicorp/consul/api/operator_keyring.go delete mode 100644 vendor/github.com/hashicorp/consul/api/operator_raft.go delete mode 100644 vendor/github.com/hashicorp/consul/api/operator_segment.go delete mode 100644 vendor/github.com/hashicorp/consul/api/prepared_query.go delete mode 100644 vendor/github.com/hashicorp/consul/api/raw.go delete mode 100644 vendor/github.com/hashicorp/consul/api/semaphore.go delete mode 100644 vendor/github.com/hashicorp/consul/api/session.go delete mode 100644 vendor/github.com/hashicorp/consul/api/snapshot.go delete mode 100644 vendor/github.com/hashicorp/consul/api/status.go delete mode 100644 vendor/github.com/hashicorp/consul/website/LICENSE.md delete mode 100644 vendor/github.com/hashicorp/go-cleanhttp/LICENSE delete mode 100644 vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go delete mode 100644 vendor/github.com/hashicorp/go-cleanhttp/doc.go delete mode 100644 vendor/github.com/hashicorp/go-rootcerts/LICENSE delete mode 100644 vendor/github.com/hashicorp/go-rootcerts/doc.go delete mode 100644 vendor/github.com/hashicorp/go-rootcerts/rootcerts.go delete mode 100644 vendor/github.com/hashicorp/go-rootcerts/rootcerts_base.go delete mode 100644 vendor/github.com/hashicorp/go-rootcerts/rootcerts_darwin.go delete mode 100644 vendor/github.com/hashicorp/serf/LICENSE delete mode 100644 vendor/github.com/hashicorp/serf/coordinate/client.go delete mode 100644 vendor/github.com/hashicorp/serf/coordinate/config.go delete mode 100644 vendor/github.com/hashicorp/serf/coordinate/coordinate.go delete mode 100644 vendor/github.com/hashicorp/serf/coordinate/phantom.go delete mode 100644 vendor/github.com/hashicorp/serf/ops-misc/debian/copyright delete mode 100644 vendor/github.com/hashicorp/serf/website/LICENSE.md delete mode 100644 vendor/github.com/hashicorp/serf/website/source/LICENSE delete mode 100644 vendor/github.com/mattn/go-colorable/LICENSE delete mode 100644 vendor/github.com/mattn/go-colorable/colorable_others.go delete mode 100644 vendor/github.com/mattn/go-colorable/colorable_windows.go delete mode 100644 vendor/github.com/mattn/go-colorable/noncolorable.go delete mode 100644 vendor/github.com/mattn/go-isatty/LICENSE delete mode 100644 vendor/github.com/mattn/go-isatty/doc.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_appengine.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_bsd.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_linux.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_others.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_solaris.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_windows.go delete mode 100644 vendor/github.com/mesos/mesos-go/LICENSE delete mode 100644 vendor/github.com/mesos/mesos-go/NOTICE delete mode 100644 vendor/github.com/mesos/mesos-go/detector/doc.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/factory.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/interface.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/standalone.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/zoo/client2.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/zoo/detect.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/zoo/doc.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/zoo/mocked_conn.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/zoo/plugin.go delete mode 100644 vendor/github.com/mesos/mesos-go/detector/zoo/types.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/authentication.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/authorizer.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/internal.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/log.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/mesos.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/messages.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/registry.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosproto/state.pb.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosutil/constants.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosutil/mesosprotoutil.go delete mode 100644 vendor/github.com/mesos/mesos-go/mesosutil/node.go delete mode 100644 vendor/github.com/mesos/mesos-go/upid/doc.go delete mode 100644 vendor/github.com/mesos/mesos-go/upid/upid.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/LICENSE delete mode 100644 vendor/github.com/mesosphere/mesos-dns/detect/masters.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/errorutil/errorutil.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/logging/logging.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/models/models.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/records/chains.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/records/config.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/records/generator.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/records/labels/labels.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/records/state/state.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/records/validation.go delete mode 100644 vendor/github.com/mesosphere/mesos-dns/util/util.go delete mode 100644 vendor/github.com/rancher/go-rancher-metadata/metadata/change.go delete mode 100644 vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go delete mode 100644 vendor/github.com/rancher/go-rancher-metadata/metadata/types.go delete mode 100644 vendor/github.com/rancher/go-rancher-metadata/metadata/utils.go delete mode 100644 vendor/github.com/rancher/go-rancher/LICENSE delete mode 100644 vendor/github.com/rancher/go-rancher/v2/client.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/common.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_account.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_agent.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_api_key.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_backup.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_binding.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_certificate.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_client.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_config_item.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_credential.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_default_network.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_host.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_host_access.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_host_template.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_identity.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_image.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_label.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_log_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_machine.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_mount.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_password.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_port.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_project.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_project_member.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_project_template.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_publish.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_register.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_registry.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_secret.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_event.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_link.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_log.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_setting.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_stack.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_subnet.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_task.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_volume.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/schemas.go delete mode 100644 vendor/github.com/rancher/go-rancher/v2/types.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/LICENSE delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/conn.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/constants.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/dnshostprovider.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/flw.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/lock.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/server_help.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/server_java.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/structs.go delete mode 100644 vendor/github.com/samuel/go-zookeeper/zk/util.go delete mode 100644 vendor/github.com/tv42/zbase32/LICENSE delete mode 100644 vendor/github.com/tv42/zbase32/flag.go delete mode 100644 vendor/github.com/tv42/zbase32/fuzz.go delete mode 100644 vendor/github.com/tv42/zbase32/zbase32.go delete mode 100644 vendor/github.com/urfave/negroni/LICENSE delete mode 100644 vendor/github.com/urfave/negroni/doc.go delete mode 100644 vendor/github.com/urfave/negroni/logger.go delete mode 100644 vendor/github.com/urfave/negroni/negroni.go delete mode 100644 vendor/github.com/urfave/negroni/recovery.go delete mode 100644 vendor/github.com/urfave/negroni/response_writer.go delete mode 100644 vendor/github.com/urfave/negroni/static.go delete mode 100644 vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go diff --git a/Gopkg.lock b/Gopkg.lock index cb815ea31..c5017a407 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -9,22 +9,6 @@ revision = "056a55f54a6cc77b440b31a56a5e7c3982d32811" version = "v0.22.0" -[[projects]] - branch = "master" - digest = "1:24afd6a7be85997c981693ddcc5f7b37fd3ed5cb119901e14737b9635b944cfb" - name = "github.com/ArthurHlt/go-eureka-client" - packages = ["eureka"] - pruneopts = "NUT" - revision = "9d0a49cbd39aa3634ae1977e9f519a262b10adaf" - -[[projects]] - branch = "master" - digest = "1:922aa650254d0678003e182aeb75f6b094a0bfc40a87d198859d511cdafcfa8a" - name = "github.com/ArthurHlt/gominlog" - packages = ["."] - pruneopts = "NUT" - revision = "72eebf980f467d3ab3a8b4ddf660f664911ce519" - [[projects]] digest = "1:59f6c2fd10ad014d2907eaa48a19070d5e7af35624328a4fbbf93b7b1c4a19e8" name = "github.com/Azure/azure-sdk-for-go" @@ -70,17 +54,6 @@ pruneopts = "NUT" revision = "a368813c5e648fee92e5f6c30e3944ff9d5e8895" -[[projects]] - branch = "master" - digest = "1:28e560d27a06cbebacd86531439aafa31c6da990607ca5a085d0005af325697f" - name = "github.com/BurntSushi/ty" - packages = [ - ".", - "fun", - ] - pruneopts = "NUT" - revision = "6add9cd6ad42d389d6ead1dde60b4ad71e46fd74" - [[projects]] digest = "1:ab7fee312bbdc8070d0325d841de8704cc78bf032b076200f1458659b74b8ed6" name = "github.com/JamesClonk/vultr" @@ -161,15 +134,11 @@ [[projects]] branch = "master" - digest = "1:d4ad87edcd6f6b6cfd1bfe8da6dd090e00901601c9270aa2928842402a361475" + digest = "1:28be1959f81e9a6dec3058768a4c4535cf73fcd6e171d21688ad0a7fdf49d43a" name = "github.com/abronan/valkeyrie" packages = [ ".", "store", - "store/boltdb", - "store/consul", - "store/etcd/v3", - "store/zookeeper", ] pruneopts = "NUT" revision = "063d875e3c5fd734fa2aa12fac83829f62acfc70" @@ -231,7 +200,7 @@ revision = "48572f11356f1843b694f21a290d4f1006bc5e47" [[projects]] - digest = "1:bfb036834a43e76abd318f0db39b0bbec6f7865680c1e443475c0297250a89ed" + digest = "1:9991a3fc14d9de52a55cdb5a5f1f237140684eab050251ecfaaafa239a8ab5c9" name = "github.com/aws/aws-sdk-go" packages = [ "aws", @@ -254,7 +223,6 @@ "internal/sdkrand", "internal/shareddefaults", "private/protocol", - "private/protocol/ec2query", "private/protocol/json/jsonutil", "private/protocol/jsonrpc", "private/protocol/query", @@ -262,11 +230,6 @@ "private/protocol/rest", "private/protocol/restxml", "private/protocol/xml/xmlutil", - "service/dynamodb", - "service/dynamodb/dynamodbattribute", - "service/dynamodb/dynamodbiface", - "service/ec2", - "service/ecs", "service/lightsail", "service/route53", "service/sts", @@ -350,29 +313,6 @@ revision = "7a9987c3a6d46be84e141a5c3191347ec10af17d" version = "v3.1.2" -[[projects]] - digest = "1:4e9c9d51ef5c98f2a71d6fa56a22f0bb8a4463656f9591ba24ebff2c21bcbd1f" - name = "github.com/coreos/bbolt" - packages = ["."] - pruneopts = "NUT" - revision = "32c383e75ce054674c53b5a07e55de85332aee14" - -[[projects]] - digest = "1:f07fcc19d52f5d9f559573c6b625142bc4b018fd275029c020d06d2bad6f6c8c" - name = "github.com/coreos/etcd" - packages = [ - "auth/authpb", - "clientv3", - "clientv3/concurrency", - "etcdserver/api/v3rpc/rpctypes", - "etcdserver/etcdserverpb", - "mvcc/mvccpb", - "pkg/types", - ] - pruneopts = "NUT" - revision = "70c8726202dd91e482fb4029fd14af1d4ed1d5af" - version = "v3.3.5" - [[projects]] digest = "1:fa91847d50d3f656fc2d2d608b9749b97d77528e8988ad8001f957640545e91e" name = "github.com/coreos/go-systemd" @@ -543,15 +483,6 @@ pruneopts = "NUT" revision = "9e638d38cf6977a37a8ea0078f3ee75a7cdb2dd1" -[[projects]] - branch = "master" - digest = "1:2de676f0b5c5d051ae4343503760069de753c995a3cb3b01544a4924c65a93aa" - name = "github.com/docker/leadership" - packages = ["."] - pruneopts = "NUT" - revision = "a2e096d9fe0af5b4c37dd37aea719bc9c2e5eec6" - source = "github.com/containous/leadership" - [[projects]] branch = "master" digest = "1:9b26bdc6b9952f728f61f510a48875c38974591c69b0afa77dcfe466c6162e9e" @@ -635,13 +566,6 @@ revision = "0a91ac8209d6a805f259ff881d0c2654221d0346" version = "v0.14.3" -[[projects]] - digest = "1:b0d5e98ac0f0a509eb320f542e748582d637aae09e74538212e9712d1e71064b" - name = "github.com/fatih/color" - packages = ["."] - pruneopts = "NUT" - revision = "62e9147c64a1ed519147b62a56a14e83e2be02c1" - [[projects]] digest = "1:aa3ed0a71c4e66e4ae6486bf97a3f4cab28edc78df2e50c5ad01dc7d91604b88" name = "github.com/fatih/structs" @@ -673,8 +597,7 @@ revision = "73d445a93680fa1a78ae23a5839bad48f32ba1ee" [[projects]] - branch = "master" - digest = "1:7dcfb91047873eb70b3a20ed5c400c4d05d9c1e73c9dac0e71ec0d44589d208a" + digest = "1:a04af13190b67ff69cf8fcd79ee133a24c4a7a900cacbc296261dd43f3fbde5c" name = "github.com/go-acme/lego" packages = [ "acme", @@ -712,6 +635,7 @@ "providers/dns/dnsmadeeasy", "providers/dns/dnsmadeeasy/internal", "providers/dns/dnspod", + "providers/dns/dode", "providers/dns/dreamhost", "providers/dns/duckdns", "providers/dns/dyn", @@ -758,7 +682,8 @@ "registration", ] pruneopts = "NUT" - revision = "0c87df143e630a1c50b4c36c8fbdda6cd993ebba" + revision = "aaecc1ca7254190b71c5f01f57ee3bb6701bc937" + version = "v2.4.0" [[projects]] branch = "fork-containous" @@ -821,12 +746,10 @@ version = "v1.5.4" [[projects]] - digest = "1:b518b9be1fc76244e246afe09113e3dd6246073b444787d30883877b82a0b90d" + digest = "1:6689652ec1f6e30455551da19c707f2bfac75e4df5c7bbe3f0ad7b49b9aa2cfc" name = "github.com/gogo/protobuf" packages = [ - "gogoproto", "proto", - "protoc-gen-gogo/descriptor", "sortkeys", ] pruneopts = "NUT" @@ -971,29 +894,6 @@ pruneopts = "NUT" revision = "2bcd89a1743fd4b373f7370ce8ddc14dfbd18229" -[[projects]] - digest = "1:c3f14b698c0f5c5729896489f4b526f519d1d2522e697d63f532901d0e183dff" - name = "github.com/hashicorp/consul" - packages = ["api"] - pruneopts = "NUT" - revision = "9a494b5fb9c86180a5702e29c485df1507a47198" - version = "v1.0.6" - -[[projects]] - digest = "1:7b699584752575e81e3f4e8b00cfb3e5d6fa5419d5d212ef925e02c798847464" - name = "github.com/hashicorp/go-cleanhttp" - packages = ["."] - pruneopts = "NUT" - revision = "3573b8b52aa7b37b9358d966a898feb387f62437" - -[[projects]] - branch = "master" - digest = "1:cdb5ce76cd7af19e3d2d5ba9b6458a2ee804f0d376711215dd3df5f51100d423" - name = "github.com/hashicorp/go-rootcerts" - packages = ["."] - pruneopts = "NUT" - revision = "6bb64b370b90e7ef1fa532be9e591a81c3493e00" - [[projects]] digest = "1:f7b3db9cb74d13f6a7cf84b3801e68585745eacaf7d40cc10ecc4734c30503d3" name = "github.com/hashicorp/go-version" @@ -1012,13 +912,6 @@ pruneopts = "NUT" revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3" -[[projects]] - digest = "1:c6552ffc71f7586a9ea624c6b2bdab87a47d9bd52889e3baf5fbf200425a85e2" - name = "github.com/hashicorp/serf" - packages = ["coordinate"] - pruneopts = "NUT" - revision = "19f2c401e122352c047a84d6584dd51e2fb8fcc4" - [[projects]] digest = "1:45e66b20393507035c6a7d15bef5ffe8faf5b083621c1284d9824cc052776de5" name = "github.com/huandu/xstrings" @@ -1192,20 +1085,6 @@ pruneopts = "NUT" revision = "c1c17f74874f2a5ea48bfb06b5459d4ef2689749" -[[projects]] - digest = "1:4953945f4fdc12cb7aa0263710534fb64b35a85e4047570fdf1cb03284055f0d" - name = "github.com/mattn/go-colorable" - packages = ["."] - pruneopts = "NUT" - revision = "5411d3eea5978e6cdc258b30de592b60df6aba96" - -[[projects]] - digest = "1:89e4861dccb76fd84b7de2d88791cc8d23e125805397db27195b4dd83c459713" - name = "github.com/mattn/go-isatty" - packages = ["."] - pruneopts = "NUT" - revision = "57fdcb988a5c543893cc61bce354a6e24ab70022" - [[projects]] branch = "master" digest = "1:5985ef4caf91ece5d54817c11ea25f182697534f8ae6521eadcd628c142ac4b6" @@ -1214,37 +1093,6 @@ pruneopts = "NUT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" -[[projects]] - digest = "1:337c4007f8ecd8092927c3f9d3c7e391a9e7222aa579dd07a6008379d92d61f6" - name = "github.com/mesos/mesos-go" - packages = [ - "detector", - "detector/zoo", - "mesosproto", - "mesosutil", - "upid", - ] - pruneopts = "NUT" - revision = "068d5470506e3780189fe607af40892814197c5e" - -[[projects]] - branch = "master" - digest = "1:940a93ac88a908ef0908939181ab048c4172ba7babd32d896ac8b1ef5c1f9036" - name = "github.com/mesosphere/mesos-dns" - packages = [ - "detect", - "errorutil", - "logging", - "models", - "records", - "records/labels", - "records/state", - "util", - ] - pruneopts = "NUT" - revision = "b47dc4c19f215e98da687b15b4c64e70f629bea5" - source = "https://github.com/containous/mesos-dns.git" - [[projects]] digest = "1:b83995756f9b1a24c518d40052d80f524f0a9024ee0479d8a8e91ec2548074d1" name = "github.com/miekg/dns" @@ -1540,22 +1388,6 @@ pruneopts = "NUT" revision = "a1dba9ce8baed984a2495b658c82687f8157b98f" -[[projects]] - digest = "1:f140e414b284a500b812b26bda8b9a5110aa110f0473ec97e79f3245000c730a" - name = "github.com/rancher/go-rancher" - packages = ["v2"] - pruneopts = "NUT" - revision = "52e2f489534007ae843065468c5a1920d542afa4" - -[[projects]] - branch = "containous-fork" - digest = "1:4e63da6276e18c5e12eadef1ec3cabd437698bef5e60ffdce7a75b492cd1c14e" - name = "github.com/rancher/go-rancher-metadata" - packages = ["metadata"] - pruneopts = "NUT" - revision = "e937e8308985dfd3bc157cc8a284454f0cbf4fef" - source = "github.com/containous/go-rancher-metadata" - [[projects]] digest = "1:0d095d4b1220902aec6896e23808fbcdfa5192dab96d5a31a443a8c47eabc326" name = "github.com/rcrowley/go-metrics" @@ -1584,13 +1416,6 @@ pruneopts = "NUT" revision = "306ea89b6ef19334614f7b0fc5aa19595022bb8c" -[[projects]] - digest = "1:142520cf3c9bb85449dd0000f820b8c604531587ee654793c54909be7dabadac" - name = "github.com/samuel/go-zookeeper" - packages = ["zk"] - pruneopts = "NUT" - revision = "1d7be4effb13d2d908342d349d71a284a7542693" - [[projects]] digest = "1:6bc0652ea6e39e22ccd522458b8bdd8665bf23bdc5a20eec90056e4dc7e273ca" name = "github.com/satori/go.uuid" @@ -1681,13 +1506,6 @@ pruneopts = "NUT" revision = "1dc93a7db3567a5ccf865106afac88278ba940cf" -[[projects]] - digest = "1:9b2996458a2f7d1f3e0ebf08152acfe8c1106f3fe855d08121c5ee7d801a063f" - name = "github.com/tv42/zbase32" - packages = ["."] - pruneopts = "NUT" - revision = "03389da7e0bf9844767f82690f4d68fc097a1306" - [[projects]] digest = "1:7d3a890e525da3b7014d26dd1d4a0e4d31a479995007cd11989ad31db132e66c" name = "github.com/uber/jaeger-client-go" @@ -1738,13 +1556,6 @@ pruneopts = "NUT" revision = "a1cf62cc2159fff407728f118c41aece76c397fa" -[[projects]] - digest = "1:e84e99d5f369afaa9a5c41f55b57fa03047ecd3bac2a65861607882693ceea81" - name = "github.com/urfave/negroni" - packages = ["."] - pruneopts = "NUT" - revision = "490e6a555d47ca891a89a150d0c1ef3922dfffe9" - [[projects]] digest = "1:a68c3f55d44d225da4f22ffbed2d8572d267cb19aaa1d60537769034ac66bc01" name = "github.com/vdemeester/shakers" @@ -1956,7 +1767,7 @@ revision = "09f6ed296fc66555a25fe4ce95173148778dfa85" [[projects]] - digest = "1:a893d24a604ae6f45f2d6e00ae9e817476e110e2dd5455152b35bb720ca2f626" + digest = "1:a840929a3a2d91282dc853cbd5f586069c14ae373247fb7d4cb4fa02b285326e" name = "google.golang.org/grpc" packages = [ ".", @@ -1971,7 +1782,6 @@ "encoding/proto", "grpclb/grpc_lb_v1/messages", "grpclog", - "health/grpc_health_v1", "internal", "keepalive", "metadata", @@ -2348,29 +2158,12 @@ analyzer-name = "dep" analyzer-version = 1 input-imports = [ - "github.com/ArthurHlt/go-eureka-client/eureka", "github.com/BurntSushi/toml", - "github.com/BurntSushi/ty/fun", "github.com/Masterminds/sprig", "github.com/NYTimes/gziphandler", "github.com/abbot/go-http-auth", - "github.com/abronan/valkeyrie", "github.com/abronan/valkeyrie/store", - "github.com/abronan/valkeyrie/store/boltdb", - "github.com/abronan/valkeyrie/store/consul", - "github.com/abronan/valkeyrie/store/etcd/v3", - "github.com/abronan/valkeyrie/store/zookeeper", "github.com/armon/go-proxyproto", - "github.com/aws/aws-sdk-go/aws", - "github.com/aws/aws-sdk-go/aws/credentials", - "github.com/aws/aws-sdk-go/aws/defaults", - "github.com/aws/aws-sdk-go/aws/ec2metadata", - "github.com/aws/aws-sdk-go/aws/session", - "github.com/aws/aws-sdk-go/service/dynamodb", - "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute", - "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface", - "github.com/aws/aws-sdk-go/service/ec2", - "github.com/aws/aws-sdk-go/service/ecs", "github.com/cenkalti/backoff", "github.com/containous/alice", "github.com/containous/flaeg", @@ -2390,7 +2183,6 @@ "github.com/docker/docker/pkg/namesgenerator", "github.com/docker/go-connections/nat", "github.com/docker/go-connections/sockets", - "github.com/docker/leadership", "github.com/eapache/channels", "github.com/elazarl/go-bindata-assetfs", "github.com/gambol99/go-marathon", @@ -2414,25 +2206,15 @@ "github.com/golang/protobuf/proto", "github.com/google/go-github/github", "github.com/gorilla/websocket", - "github.com/hashicorp/consul/api", "github.com/hashicorp/go-version", "github.com/influxdata/influxdb/client/v2", "github.com/instana/go-sensor", "github.com/libkermit/compose/check", "github.com/libkermit/docker", "github.com/libkermit/docker-check", - "github.com/mesos/mesos-go/detector", - "github.com/mesos/mesos-go/detector/zoo", - "github.com/mesos/mesos-go/upid", - "github.com/mesosphere/mesos-dns/detect", - "github.com/mesosphere/mesos-dns/logging", - "github.com/mesosphere/mesos-dns/records", - "github.com/mesosphere/mesos-dns/records/state", - "github.com/mesosphere/mesos-dns/util", "github.com/miekg/dns", "github.com/mitchellh/copystructure", "github.com/mitchellh/hashstructure", - "github.com/mitchellh/mapstructure", "github.com/mvdan/xurls", "github.com/ogier/pflag", "github.com/opentracing/opentracing-go", @@ -2444,8 +2226,6 @@ "github.com/prometheus/client_golang/prometheus", "github.com/prometheus/client_golang/prometheus/promhttp", "github.com/prometheus/client_model/go", - "github.com/rancher/go-rancher-metadata/metadata", - "github.com/rancher/go-rancher/v2", "github.com/ryanuber/go-glob", "github.com/satori/go.uuid", "github.com/sirupsen/logrus", @@ -2460,7 +2240,6 @@ "github.com/uber/jaeger-lib/metrics", "github.com/unrolled/render", "github.com/unrolled/secure", - "github.com/urfave/negroni", "github.com/vdemeester/shakers", "github.com/vulcand/oxy/buffer", "github.com/vulcand/oxy/cbreaker", diff --git a/Gopkg.toml b/Gopkg.toml index c58cf1099..066224842 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -190,9 +190,9 @@ required = [ name = "github.com/vulcand/oxy" [[constraint]] - branch = "master" +# branch = "master" name = "github.com/go-acme/lego" -# version = "2.4.0" + version = "2.4.0" [[constraint]] name = "google.golang.org/grpc" diff --git a/docs/content/https-tls/acme.md b/docs/content/https-tls/acme.md index fed176cab..cb6236bb7 100644 --- a/docs/content/https-tls/acme.md +++ b/docs/content/https-tls/acme.md @@ -130,6 +130,7 @@ For example, `CF_API_EMAIL_FILE=/run/secrets/traefik_cf-api-email` could be used | [DNSimple](https://dnsimple.com) | `dnsimple` | `DNSIMPLE_OAUTH_TOKEN`, `DNSIMPLE_BASE_URL` | YES | | [DNS Made Easy](https://dnsmadeeasy.com) | `dnsmadeeasy` | `DNSMADEEASY_API_KEY`, `DNSMADEEASY_API_SECRET`, `DNSMADEEASY_SANDBOX` | Not tested yet | | [DNSPod](https://www.dnspod.com/) | `dnspod` | `DNSPOD_API_KEY` | Not tested yet | +| [Domain Offensive (do.de)](https://www.do.de/) | `dode` | `DODE_TOKEN` | YES | | [DreamHost](https://www.dreamhost.com/) | `dreamhost` | `DREAMHOST_API_KEY` | YES | | [Duck DNS](https://www.duckdns.org/) | `duckdns` | `DUCKDNS_TOKEN` | YES | | [Dyn](https://dyn.com) | `dyn` | `DYN_CUSTOMER_NAME`, `DYN_USER_NAME`, `DYN_PASSWORD` | Not tested yet | diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/LICENSE b/vendor/github.com/ArthurHlt/go-eureka-client/LICENSE deleted file mode 100644 index 7305f8fd0..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Arthur Halet - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/client.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/client.go deleted file mode 100644 index f8cde1fca..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/client.go +++ /dev/null @@ -1,357 +0,0 @@ -package eureka - -import ( - "crypto/tls" - "crypto/x509" - "encoding/json" - "errors" - "io" - "io/ioutil" - "net" - "net/http" - "net/url" - "os" - "path" - "time" - "strings" -) - -const ( - defaultBufferSize = 10 - UP = "UP" - DOWN = "DOWN" - STARTING = "STARTING" -) - -type Config struct { - CertFile string `json:"certFile"` - KeyFile string `json:"keyFile"` - CaCertFile []string `json:"caCertFiles"` - DialTimeout time.Duration `json:"timeout"` - Consistency string `json:"consistency"` -} - -type Client struct { - Config Config `json:"config"` - Cluster *Cluster `json:"cluster"` - httpClient *http.Client - persistence io.Writer - cURLch chan string - // CheckRetry can be used to control the policy for failed requests - // and modify the cluster if needed. - // The client calls it before sending requests again, and - // stops retrying if CheckRetry returns some error. The cases that - // this function needs to handle include no response and unexpected - // http status code of response. - // If CheckRetry is nil, client will call the default one - // `DefaultCheckRetry`. - // Argument cluster is the eureka.Cluster object that these requests have been made on. - // Argument numReqs is the number of http.Requests that have been made so far. - // Argument lastResp is the http.Responses from the last request. - // Argument err is the reason of the failure. - CheckRetry func(cluster *Cluster, numReqs int, - lastResp http.Response, err error) error -} - -// NewClient create a basic client that is configured to be used -// with the given machine list. -func NewClient(machines []string) *Client { - config := Config{ - // default timeout is one second - DialTimeout: time.Second, - } - - client := &Client{ - Cluster: NewCluster(machines), - Config: config, - } - - client.initHTTPClient() - return client -} - -// NewTLSClient create a basic client with TLS configuration -func NewTLSClient(machines []string, cert string, key string, caCerts []string) (*Client, error) { - // overwrite the default machine to use https - if len(machines) == 0 { - machines = []string{"https://127.0.0.1:4001"} - } - - config := Config{ - // default timeout is one second - DialTimeout: time.Second, - CertFile: cert, - KeyFile: key, - CaCertFile: make([]string, 0), - } - - client := &Client{ - Cluster: NewCluster(machines), - Config: config, - } - - err := client.initHTTPSClient(cert, key) - if err != nil { - return nil, err - } - - for _, caCert := range caCerts { - if err := client.AddRootCA(caCert); err != nil { - return nil, err - } - } - return client, nil -} - -// NewClientFromFile creates a client from a given file path. -// The given file is expected to use the JSON format. -func NewClientFromFile(fpath string) (*Client, error) { - fi, err := os.Open(fpath) - if err != nil { - return nil, err - } - - defer func() { - if err := fi.Close(); err != nil { - panic(err) - } - }() - - return NewClientFromReader(fi) -} - -// NewClientFromReader creates a Client configured from a given reader. -// The configuration is expected to use the JSON format. -func NewClientFromReader(reader io.Reader) (*Client, error) { - c := new(Client) - - b, err := ioutil.ReadAll(reader) - if err != nil { - return nil, err - } - - err = json.Unmarshal(b, c) - if err != nil { - return nil, err - } - if c.Config.CertFile == "" { - c.initHTTPClient() - } else { - err = c.initHTTPSClient(c.Config.CertFile, c.Config.KeyFile) - } - - if err != nil { - return nil, err - } - - for _, caCert := range c.Config.CaCertFile { - if err := c.AddRootCA(caCert); err != nil { - return nil, err - } - } - - return c, nil -} - -// Override the Client's HTTP Transport object -func (c *Client) SetTransport(tr *http.Transport) { - c.httpClient.Transport = tr -} - -// initHTTPClient initializes a HTTP client for eureka client -func (c *Client) initHTTPClient() { - tr := &http.Transport{ - Dial: c.dial, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - }, - } - c.httpClient = &http.Client{Transport: tr} -} - -// initHTTPClient initializes a HTTPS client for eureka client -func (c *Client) initHTTPSClient(cert, key string) error { - if cert == "" || key == "" { - return errors.New("Require both cert and key path") - } - - tlsCert, err := tls.LoadX509KeyPair(cert, key) - if err != nil { - return err - } - - tlsConfig := &tls.Config{ - Certificates: []tls.Certificate{tlsCert}, - InsecureSkipVerify: true, - } - - tr := &http.Transport{ - TLSClientConfig: tlsConfig, - Dial: c.dial, - } - - c.httpClient = &http.Client{Transport: tr} - return nil -} - -// Sets the DialTimeout value -func (c *Client) SetDialTimeout(d time.Duration) { - c.Config.DialTimeout = d -} - -// AddRootCA adds a root CA cert for the eureka client -func (c *Client) AddRootCA(caCert string) error { - if c.httpClient == nil { - return errors.New("Client has not been initialized yet!") - } - - certBytes, err := ioutil.ReadFile(caCert) - if err != nil { - return err - } - - tr, ok := c.httpClient.Transport.(*http.Transport) - - if !ok { - panic("AddRootCA(): Transport type assert should not fail") - } - - if tr.TLSClientConfig.RootCAs == nil { - caCertPool := x509.NewCertPool() - ok = caCertPool.AppendCertsFromPEM(certBytes) - if ok { - tr.TLSClientConfig.RootCAs = caCertPool - } - tr.TLSClientConfig.InsecureSkipVerify = false - } else { - ok = tr.TLSClientConfig.RootCAs.AppendCertsFromPEM(certBytes) - } - - if !ok { - err = errors.New("Unable to load caCert") - } - - c.Config.CaCertFile = append(c.Config.CaCertFile, caCert) - return err -} - -// SetCluster updates cluster information using the given machine list. -func (c *Client) SetCluster(machines []string) bool { - success := c.internalSyncCluster(machines) - return success -} - -func (c *Client) GetCluster() []string { - return c.Cluster.Machines -} - -// SyncCluster updates the cluster information using the internal machine list. -func (c *Client) SyncCluster() bool { - return c.internalSyncCluster(c.Cluster.Machines) -} - -// internalSyncCluster syncs cluster information using the given machine list. -func (c *Client) internalSyncCluster(machines []string) bool { - for _, machine := range machines { - httpPath := c.createHttpPath(machine, "machines") - resp, err := c.httpClient.Get(httpPath) - if err != nil { - // try another machine in the cluster - continue - } else { - b, err := ioutil.ReadAll(resp.Body) - resp.Body.Close() - if err != nil { - // try another machine in the cluster - continue - } - - // update Machines List - c.Cluster.updateFromStr(string(b)) - - // update leader - // the first one in the machine list is the leader - c.Cluster.switchLeader(0) - - logger.Debug("sync.machines " + strings.Join(c.Cluster.Machines, ", ")) - return true - } - } - return false -} - -// createHttpPath creates a complete HTTP URL. -// serverName should contain both the host name and a port number, if any. -func (c *Client) createHttpPath(serverName string, _path string) string { - u, err := url.Parse(serverName) - if err != nil { - panic(err) - } - - u.Path = path.Join(u.Path, _path) - - if u.Scheme == "" { - u.Scheme = "http" - } - return u.String() -} - -// dial attempts to open a TCP connection to the provided address, explicitly -// enabling keep-alives with a one-second interval. -func (c *Client) dial(network, addr string) (net.Conn, error) { - conn, err := net.DialTimeout(network, addr, c.Config.DialTimeout) - if err != nil { - return nil, err - } - - tcpConn, ok := conn.(*net.TCPConn) - if !ok { - return nil, errors.New("Failed type-assertion of net.Conn as *net.TCPConn") - } - - // Keep TCP alive to check whether or not the remote machine is down - if err = tcpConn.SetKeepAlive(true); err != nil { - return nil, err - } - - if err = tcpConn.SetKeepAlivePeriod(time.Second); err != nil { - return nil, err - } - - return tcpConn, nil -} - -// MarshalJSON implements the Marshaller interface -// as defined by the standard JSON package. -func (c *Client) MarshalJSON() ([]byte, error) { - b, err := json.Marshal(struct { - Config Config `json:"config"` - Cluster *Cluster `json:"cluster"` - }{ - Config: c.Config, - Cluster: c.Cluster, - }) - - if err != nil { - return nil, err - } - - return b, nil -} - -// UnmarshalJSON implements the Unmarshaller interface -// as defined by the standard JSON package. -func (c *Client) UnmarshalJSON(b []byte) error { - temp := struct { - Config Config `json:"config"` - Cluster *Cluster `json:"cluster"` - }{} - err := json.Unmarshal(b, &temp) - if err != nil { - return err - } - - c.Cluster = temp.Cluster - c.Config = temp.Config - return nil -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/cluster.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/cluster.go deleted file mode 100644 index 87248d4ca..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/cluster.go +++ /dev/null @@ -1,51 +0,0 @@ -package eureka - -import ( - "net/url" - "strings" -) - -type Cluster struct { - Leader string `json:"leader"` - Machines []string `json:"machines"` -} - -func NewCluster(machines []string) *Cluster { - // if an empty slice was sent in then just assume HTTP 4001 on localhost - if len(machines) == 0 { - machines = []string{"http://127.0.0.1:4001"} - } - - // default leader and machines - return &Cluster{ - Leader: machines[0], - Machines: machines, - } -} - -// switchLeader switch the current leader to machines[num] -func (cl *Cluster) switchLeader(num int) { - logger.Debug("switch.leader[from %v to %v]", - cl.Leader, cl.Machines[num]) - - cl.Leader = cl.Machines[num] -} - -func (cl *Cluster) updateFromStr(machines string) { - cl.Machines = strings.Split(machines, ", ") -} - -func (cl *Cluster) updateLeader(leader string) { - logger.Debug("update.leader[%s,%s]", cl.Leader, leader) - cl.Leader = leader -} - -func (cl *Cluster) updateLeaderFromURL(u *url.URL) { - var leader string - if u.Scheme == "" { - leader = "http://" + u.Host - } else { - leader = u.Scheme + "://" + u.Host - } - cl.updateLeader(leader) -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/debug.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/debug.go deleted file mode 100644 index a82b5a8a5..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/debug.go +++ /dev/null @@ -1,21 +0,0 @@ -package eureka - -import ( - "github.com/ArthurHlt/gominlog" - "log" -) - -var logger *gominlog.MinLog - -func GetLogger() *log.Logger { - return logger.GetLogger() -} - -func SetLogger(loggerLog *log.Logger) { - logger.SetLogger(loggerLog) -} - -func init() { - // Default logger uses the go default log. - logger = gominlog.NewClassicMinLogWithPackageName("go-eureka-client") -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/delete.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/delete.go deleted file mode 100644 index 4682e80bb..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/delete.go +++ /dev/null @@ -1,10 +0,0 @@ -package eureka - -import "strings" - -func (c *Client) UnregisterInstance(appId, instanceId string) error { - values := []string{"apps", appId, instanceId} - path := strings.Join(values, "/") - _, err := c.Delete(path) - return err -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/error.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/error.go deleted file mode 100644 index 99c5c7914..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/error.go +++ /dev/null @@ -1,48 +0,0 @@ -package eureka - -import ( - "encoding/json" - "fmt" -) - -const ( - ErrCodeEurekaNotReachable = 501 -) - -var ( - errorMap = map[int]string{ - ErrCodeEurekaNotReachable: "All the given peers are not reachable", - } -) - -type EurekaError struct { - ErrorCode int `json:"errorCode"` - Message string `json:"message"` - Cause string `json:"cause,omitempty"` - Index uint64 `json:"index"` -} - -func (e EurekaError) Error() string { - return fmt.Sprintf("%v: %v (%v) [%v]", e.ErrorCode, e.Message, e.Cause, e.Index) -} - -func newError(errorCode int, cause string, index uint64) *EurekaError { - return &EurekaError{ - ErrorCode: errorCode, - Message: errorMap[errorCode], - Cause: cause, - Index: index, - } -} - -func handleError(b []byte) error { - eurekaErr := new(EurekaError) - - err := json.Unmarshal(b, eurekaErr) - if err != nil { - logger.Warning("cannot unmarshal eureka error: %v", err) - return err - } - - return eurekaErr -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/get.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/get.go deleted file mode 100644 index a27deb9e5..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/get.go +++ /dev/null @@ -1,64 +0,0 @@ -package eureka - -import ( - "encoding/xml" - "strings" -) - -func (c *Client) GetApplications() (*Applications, error) { - response, err := c.Get("apps") - if err != nil { - return nil, err - } - var applications *Applications = new(Applications) - err = xml.Unmarshal(response.Body, applications) - return applications, err -} - -func (c *Client) GetApplication(appId string) (*Application, error) { - values := []string{"apps", appId} - path := strings.Join(values, "/") - response, err := c.Get(path) - if err != nil { - return nil, err - } - var application *Application = new(Application) - err = xml.Unmarshal(response.Body, application) - return application, err -} - -func (c *Client) GetInstance(appId, instanceId string) (*InstanceInfo, error) { - values := []string{"apps", appId, instanceId} - path := strings.Join(values, "/") - response, err := c.Get(path) - if err != nil { - return nil, err - } - var instance *InstanceInfo = new(InstanceInfo) - err = xml.Unmarshal(response.Body, instance) - return instance, err -} - -func (c *Client) GetVIP(vipId string) (*Applications, error) { - values := []string{"vips", vipId} - path := strings.Join(values, "/") - response, err := c.Get(path) - if err != nil { - return nil, err - } - var applications *Applications = new(Applications) - err = xml.Unmarshal(response.Body, applications) - return applications, err -} - -func (c *Client) GetSVIP(svipId string) (*Applications, error) { - values := []string{"svips", svipId} - path := strings.Join(values, "/") - response, err := c.Get(path) - if err != nil { - return nil, err - } - var applications *Applications = new(Applications) - err = xml.Unmarshal(response.Body, applications) - return applications, err -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/metadata_marshaller.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/metadata_marshaller.go deleted file mode 100644 index 09485ecad..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/metadata_marshaller.go +++ /dev/null @@ -1,95 +0,0 @@ -package eureka - -import ( - "encoding/xml" - "encoding/json" - "regexp" -) - -type MetaData struct { - Map map[string]string - Class string -} - - -type Vraw struct { - Content []byte `xml:",innerxml"` - Class string `xml:"class,attr" json:"@class"` -} - -func (s *MetaData) MarshalXML(e *xml.Encoder, start xml.StartElement) error { - var attributes []xml.Attr = make([]xml.Attr, 0) - if s.Class != "" { - attributes = append(attributes, xml.Attr{ - Name: xml.Name{ - Local: "class", - }, - Value: s.Class, - }) - } - start.Attr = attributes - tokens := []xml.Token{start} - - for key, value := range s.Map { - t := xml.StartElement{Name: xml.Name{"", key}} - tokens = append(tokens, t, xml.CharData(value), xml.EndElement{t.Name}) - } - - tokens = append(tokens, xml.EndElement{ - Name: start.Name, - }) - - - for _, t := range tokens { - err := e.EncodeToken(t) - if err != nil { - return err - } - } - - // flush to ensure tokens are written - err := e.Flush() - if err != nil { - return err - } - - return nil -} - -func (s *MetaData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - s.Map = make(map[string]string) - vraw := &Vraw{} - d.DecodeElement(vraw, &start) - dataInString := string(vraw.Content) - regex, err := regexp.Compile("\\s*<([^<>]+)>([^<>]+)]+>\\s*") - if err != nil { - return err - } - subMatches := regex.FindAllStringSubmatch(dataInString, -1) - for _, subMatch := range subMatches { - s.Map[subMatch[1]] = subMatch[2] - } - s.Class = vraw.Class - return nil -} - -func (s *MetaData) MarshalJSON() ([]byte, error) { - mapIt := make(map[string]string) - for key, value := range s.Map { - mapIt[key] = value - } - if s.Class != "" { - mapIt["@class"] = s.Class - } - return json.Marshal(mapIt) -} -func (s *MetaData) UnmarshalJSON(data []byte) error { - dataUnmarshal := make(map[string]string) - err := json.Unmarshal(data, dataUnmarshal) - s.Map = dataUnmarshal - if val, ok := s.Map["@class"]; ok { - s.Class = val - delete(s.Map, "@class") - } - return err -} \ No newline at end of file diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/post.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/post.go deleted file mode 100644 index 48dd7385b..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/post.go +++ /dev/null @@ -1,21 +0,0 @@ -package eureka - -import ( - "encoding/json" - "strings" -) - -func (c *Client) RegisterInstance(appId string, instanceInfo *InstanceInfo) error { - values := []string{"apps", appId} - path := strings.Join(values, "/") - instance := &Instance{ - Instance: instanceInfo, - } - body, err := json.Marshal(instance) - if err != nil { - return err - } - - _, err = c.Post(path, body) - return err -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/put.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/put.go deleted file mode 100644 index 0d75ecb9e..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/put.go +++ /dev/null @@ -1,10 +0,0 @@ -package eureka - -import "strings" - -func (c *Client) SendHeartbeat(appId, instanceId string) error { - values := []string{"apps", appId, instanceId} - path := strings.Join(values, "/") - _, err := c.Put(path, nil) - return err -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/requests.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/requests.go deleted file mode 100644 index 467b65ff8..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/requests.go +++ /dev/null @@ -1,439 +0,0 @@ -package eureka - -import ( - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "math/rand" - "net/http" - "net/url" - "sync" - "time" - "strconv" -) - -// Errors introduced by handling requests -var ( - ErrRequestCancelled = errors.New("sending request is cancelled") -) - -type RawRequest struct { - method string - relativePath string - body []byte - cancel <-chan bool -} -type Applications struct { - VersionsDelta int `xml:"versions__delta"` - AppsHashcode string `xml:"apps__hashcode"` - Applications []Application `xml:"application,omitempty"` -} -type Application struct { - Name string `xml:"name"` - Instances []InstanceInfo `xml:"instance"` -} -type Instance struct { - Instance *InstanceInfo `xml:"instance" json:"instance"` -} -type Port struct { - Port int `xml:",chardata" json:"$"` - Enabled bool `xml:"enabled,attr" json:"@enabled"` -} -type InstanceInfo struct { - HostName string `xml:"hostName" json:"hostName"` - HomePageUrl string `xml:"homePageUrl,omitempty" json:"homePageUrl,omitempty"` - StatusPageUrl string `xml:"statusPageUrl" json:"statusPageUrl"` - HealthCheckUrl string `xml:"healthCheckUrl,omitempty" json:"healthCheckUrl,omitempty"` - App string `xml:"app" json:"app"` - IpAddr string `xml:"ipAddr" json:"ipAddr"` - VipAddress string `xml:"vipAddress" json:"vipAddress"` - secureVipAddress string `xml:"secureVipAddress,omitempty" json:"secureVipAddress,omitempty"` - Status string `xml:"status" json:"status"` - Port *Port `xml:"port,omitempty" json:"port,omitempty"` - SecurePort *Port `xml:"securePort,omitempty" json:"securePort,omitempty"` - DataCenterInfo *DataCenterInfo `xml:"dataCenterInfo" json:"dataCenterInfo"` - LeaseInfo *LeaseInfo `xml:"leaseInfo,omitempty" json:"leaseInfo,omitempty"` - Metadata *MetaData `xml:"metadata,omitempty" json:"metadata,omitempty"` - IsCoordinatingDiscoveryServer bool `xml:"isCoordinatingDiscoveryServer,omitempty" json:"isCoordinatingDiscoveryServer,omitempty"` - LastUpdatedTimestamp int `xml:"lastUpdatedTimestamp,omitempty" json:"lastUpdatedTimestamp,omitempty"` - LastDirtyTimestamp int `xml:"lastDirtyTimestamp,omitempty" json:"lastDirtyTimestamp,omitempty"` - ActionType string `xml:"actionType,omitempty" json:"actionType,omitempty"` - Overriddenstatus string `xml:"overriddenstatus,omitempty" json:"overriddenstatus,omitempty"` - CountryId int `xml:"countryId,omitempty" json:"countryId,omitempty"` - -} -type DataCenterInfo struct { - Name string `xml:"name" json:"name"` - Class string `xml:"class,attr" json:"@class"` - Metadata *DataCenterMetadata `xml:"metadata,omitempty" json:"metadata,omitempty"` -} - -type DataCenterMetadata struct { - AmiLaunchIndex string `xml:"ami-launch-index,omitempty" json:"ami-launch-index,omitempty"` - LocalHostname string `xml:"local-hostname,omitempty" json:"local-hostname,omitempty"` - AvailabilityZone string `xml:"availability-zone,omitempty" json:"availability-zone,omitempty"` - InstanceId string `xml:"instance-id,omitempty" json:"instance-id,omitempty"` - PublicIpv4 string `xml:"public-ipv4,omitempty" json:"public-ipv4,omitempty"` - PublicHostname string `xml:"public-hostname,omitempty" json:"public-hostname,omitempty"` - AmiManifestPath string `xml:"ami-manifest-path,omitempty" json:"ami-manifest-path,omitempty"` - LocalIpv4 string `xml:"local-ipv4,omitempty" json:"local-ipv4,omitempty"` - Hostname string `xml:"hostname,omitempty" json:"hostname,omitempty"` - AmiId string `xml:"ami-id,omitempty" json:"ami-id,omitempty"` - InstanceType string `xml:"instance-type,omitempty" json:"instance-type,omitempty"` -} - -type LeaseInfo struct { - EvictionDurationInSecs uint `xml:"evictionDurationInSecs,omitempty" json:"evictionDurationInSecs,omitempty"` - RenewalIntervalInSecs int `xml:"renewalIntervalInSecs,omitempty" json:"renewalIntervalInSecs,omitempty"` - DurationInSecs int `xml:"durationInSecs,omitempty" json:"durationInSecs,omitempty"` - RegistrationTimestamp int `xml:"registrationTimestamp,omitempty" json:"registrationTimestamp,omitempty"` - LastRenewalTimestamp int `xml:"lastRenewalTimestamp,omitempty" json:"lastRenewalTimestamp,omitempty"` - EvictionTimestamp int `xml:"evictionTimestamp,omitempty" json:"evictionTimestamp,omitempty"` - ServiceUpTimestamp int `xml:"serviceUpTimestamp,omitempty" json:"serviceUpTimestamp,omitempty"` -} - -func NewRawRequest(method, relativePath string, body []byte, cancel <-chan bool) *RawRequest { - return &RawRequest{ - method: method, - relativePath: relativePath, - body: body, - cancel: cancel, - } -} - -func NewInstanceInfo(hostName, app, ip string, port int, ttl uint, isSsl bool) *InstanceInfo { - dataCenterInfo := &DataCenterInfo{ - Name: "MyOwn", - Class: "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo", - Metadata: nil, - } - leaseInfo := &LeaseInfo{ - EvictionDurationInSecs: ttl, - } - instanceInfo := &InstanceInfo{ - HostName: hostName, - App: app, - IpAddr: ip, - Status: UP, - DataCenterInfo: dataCenterInfo, - LeaseInfo: leaseInfo, - Metadata: nil, - } - stringPort := "" - if (port != 80 && port != 443) { - stringPort = ":" + strconv.Itoa(port) - } - var protocol string = "http" - if (isSsl) { - protocol = "https" - instanceInfo.secureVipAddress = protocol + "://" + hostName + stringPort - instanceInfo.SecurePort = &Port{ - Port: port, - Enabled: true, - } - }else { - instanceInfo.VipAddress = protocol + "://" + hostName + stringPort - instanceInfo.Port = &Port{ - Port: port, - Enabled: true, - } - } - instanceInfo.StatusPageUrl = protocol + "://" + hostName + stringPort + "/info" - return instanceInfo -} - -// getCancelable issues a cancelable GET request -func (c *Client) getCancelable(endpoint string, -cancel <-chan bool) (*RawResponse, error) { - logger.Debug("get %s [%s]", endpoint, c.Cluster.Leader) - p := endpoint - - req := NewRawRequest("GET", p, nil, cancel) - resp, err := c.SendRequest(req) - - if err != nil { - return nil, err - } - - return resp, nil -} - -// get issues a GET request -func (c *Client) Get(endpoint string) (*RawResponse, error) { - return c.getCancelable(endpoint, nil) -} - -// put issues a PUT request -func (c *Client) Put(endpoint string, body []byte) (*RawResponse, error) { - - logger.Debug("put %s, %s, [%s]", endpoint, body, c.Cluster.Leader) - p := endpoint - - req := NewRawRequest("PUT", p, body, nil) - resp, err := c.SendRequest(req) - - if err != nil { - return nil, err - } - - return resp, nil -} - -// post issues a POST request -func (c *Client) Post(endpoint string, body []byte) (*RawResponse, error) { - logger.Debug("post %s, %s, [%s]", endpoint, body, c.Cluster.Leader) - p := endpoint - - req := NewRawRequest("POST", p, body, nil) - resp, err := c.SendRequest(req) - - if err != nil { - return nil, err - } - - return resp, nil -} - -// delete issues a DELETE request -func (c *Client) Delete(endpoint string) (*RawResponse, error) { - logger.Debug("delete %s [%s]", endpoint, c.Cluster.Leader) - p := endpoint - - req := NewRawRequest("DELETE", p, nil, nil) - resp, err := c.SendRequest(req) - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *Client) SendRequest(rr *RawRequest) (*RawResponse, error) { - - var req *http.Request - var resp *http.Response - var httpPath string - var err error - var respBody []byte - - var numReqs = 1 - - checkRetry := c.CheckRetry - if checkRetry == nil { - checkRetry = DefaultCheckRetry - } - - cancelled := make(chan bool, 1) - reqLock := new(sync.Mutex) - - if rr.cancel != nil { - cancelRoutine := make(chan bool) - defer close(cancelRoutine) - - go func() { - select { - case <-rr.cancel: - cancelled <- true - logger.Debug("send.request is cancelled") - case <-cancelRoutine: - return - } - - // Repeat canceling request until this thread is stopped - // because we have no idea about whether it succeeds. - for { - reqLock.Lock() - c.httpClient.Transport.(*http.Transport).CancelRequest(req) - reqLock.Unlock() - - select { - case <-time.After(100 * time.Millisecond): - case <-cancelRoutine: - return - } - } - }() - } - - // If we connect to a follower and consistency is required, retry until - // we connect to a leader - sleep := 25 * time.Millisecond - maxSleep := time.Second - - for attempt := 0;; attempt++ { - if attempt > 0 { - select { - case <-cancelled: - return nil, ErrRequestCancelled - case <-time.After(sleep): - sleep = sleep * 2 - if sleep > maxSleep { - sleep = maxSleep - } - } - } - - logger.Debug("Connecting to eureka: attempt %d for %s", attempt + 1, rr.relativePath) - - httpPath = c.getHttpPath(false, rr.relativePath) - - logger.Debug("send.request.to %s | method %s", httpPath, rr.method) - - req, err := func() (*http.Request, error) { - reqLock.Lock() - defer reqLock.Unlock() - - if req, err = http.NewRequest(rr.method, httpPath, bytes.NewReader(rr.body)); err != nil { - return nil, err - } - - req.Header.Set("Content-Type", - "application/json") - return req, nil - }() - - if err != nil { - return nil, err - } - - resp, err = c.httpClient.Do(req) - defer func() { - if resp != nil { - resp.Body.Close() - } - }() - - // If the request was cancelled, return ErrRequestCancelled directly - select { - case <-cancelled: - return nil, ErrRequestCancelled - default: - } - - numReqs++ - - // network error, change a machine! - if err != nil { - logger.Error("network error: %v", err.Error()) - lastResp := http.Response{} - if checkErr := checkRetry(c.Cluster, numReqs, lastResp, err); checkErr != nil { - return nil, checkErr - } - - c.Cluster.switchLeader(attempt % len(c.Cluster.Machines)) - continue - } - - // if there is no error, it should receive response - logger.Debug("recv.response.from "+httpPath) - - if validHttpStatusCode[resp.StatusCode] { - // try to read byte code and break the loop - respBody, err = ioutil.ReadAll(resp.Body) - if err == nil { - logger.Debug("recv.success "+ httpPath) - break - } - // ReadAll error may be caused due to cancel request - select { - case <-cancelled: - return nil, ErrRequestCancelled - default: - } - - if err == io.ErrUnexpectedEOF { - // underlying connection was closed prematurely, probably by timeout - // TODO: empty body or unexpectedEOF can cause http.Transport to get hosed; - // this allows the client to detect that and take evasive action. Need - // to revisit once code.google.com/p/go/issues/detail?id=8648 gets fixed. - respBody = []byte{} - break - } - } - - // if resp is TemporaryRedirect, set the new leader and retry - if resp.StatusCode == http.StatusTemporaryRedirect { - u, err := resp.Location() - - if err != nil { - logger.Warning("%v", err) - } else { - // Update cluster leader based on redirect location - // because it should point to the leader address - c.Cluster.updateLeaderFromURL(u) - logger.Debug("recv.response.relocate "+ u.String()) - } - resp.Body.Close() - continue - } - - if checkErr := checkRetry(c.Cluster, numReqs, *resp, - errors.New("Unexpected HTTP status code")); checkErr != nil { - return nil, checkErr - } - resp.Body.Close() - } - - r := &RawResponse{ - StatusCode: resp.StatusCode, - Body: respBody, - Header: resp.Header, - } - - return r, nil -} - -// DefaultCheckRetry defines the retrying behaviour for bad HTTP requests -// If we have retried 2 * machine number, stop retrying. -// If status code is InternalServerError, sleep for 200ms. -func DefaultCheckRetry(cluster *Cluster, numReqs int, lastResp http.Response, -err error) error { - - if numReqs >= 2 * len(cluster.Machines) { - return newError(ErrCodeEurekaNotReachable, - "Tried to connect to each peer twice and failed", 0) - } - - code := lastResp.StatusCode - if code == http.StatusInternalServerError { - time.Sleep(time.Millisecond * 200) - - } - - logger.Warning("bad response status code %d", code) - return nil -} - -func (c *Client) getHttpPath(random bool, s ...string) string { - var machine string - if random { - machine = c.Cluster.Machines[rand.Intn(len(c.Cluster.Machines))] - } else { - machine = c.Cluster.Leader - } - - fullPath := machine - for _, seg := range s { - fullPath += "/" + seg - } - - return fullPath -} - -// buildValues builds a url.Values map according to the given value and ttl -func buildValues(value string, ttl uint64) url.Values { - v := url.Values{} - - if value != "" { - v.Set("value", value) - } - - if ttl > 0 { - v.Set("ttl", fmt.Sprintf("%v", ttl)) - } - - return v -} diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/response.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/response.go deleted file mode 100644 index 4bc37a63b..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/response.go +++ /dev/null @@ -1,21 +0,0 @@ -package eureka - -import "net/http" - -type RawResponse struct { - StatusCode int - Body []byte - Header http.Header -} - -var ( - validHttpStatusCode = map[int]bool{ - http.StatusNoContent: true, - http.StatusCreated: true, - http.StatusOK: true, - http.StatusBadRequest: true, - http.StatusNotFound: true, - http.StatusPreconditionFailed: true, - http.StatusForbidden: true, - } -) diff --git a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/version.go b/vendor/github.com/ArthurHlt/go-eureka-client/eureka/version.go deleted file mode 100644 index d8ca2b4e2..000000000 --- a/vendor/github.com/ArthurHlt/go-eureka-client/eureka/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package eureka - -const version = "v2" diff --git a/vendor/github.com/ArthurHlt/gominlog/LICENSE b/vendor/github.com/ArthurHlt/gominlog/LICENSE deleted file mode 100644 index 8c349ed2f..000000000 --- a/vendor/github.com/ArthurHlt/gominlog/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Arthur Halet - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -The Software should rather be used for Good, not Evil. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/ArthurHlt/gominlog/gominlog.go b/vendor/github.com/ArthurHlt/gominlog/gominlog.go deleted file mode 100644 index b4d39067e..000000000 --- a/vendor/github.com/ArthurHlt/gominlog/gominlog.go +++ /dev/null @@ -1,190 +0,0 @@ -package gominlog - -import ( - "log" - "os" - "fmt" - "runtime" - "github.com/fatih/color" - "regexp" - "strings" - "io" -) - -type Level int - -const ( - Loff = Level(^uint(0) >> 1) - Lsevere = Level(1000) - Lerror = Level(900) - Lwarning = Level(800) - Linfo = Level(700) - Ldebug = Level(600) - Lall = Level(-Loff - 1) -) - -type MinLog struct { - log *log.Logger - level Level - packageName string - isColorized bool -} - -func NewClassicMinLog() *MinLog { - minLog := &MinLog{} - logWriter := os.Stdout - flags := log.Lshortfile | log.Ldate | log.Ltime - minLog.log = log.New(logWriter, "", flags) - minLog.isColorized = true - minLog.packageName = "" - minLog.level = Lall - return minLog -} -func NewClassicMinLogWithPackageName(packageName string) *MinLog { - minLog := NewClassicMinLog() - minLog.SetPackageName(packageName) - return minLog -} -func NewMinLog(appName string, level Level, withColor bool, flag int) *MinLog { - minLog := &MinLog{} - logWriter := os.Stdout - minLog.log = log.New(logWriter, "", flag) - minLog.isColorized = withColor - minLog.packageName = appName - minLog.level = level - return minLog -} -func NewMinLogWithWriter(appName string, level Level, withColor bool, flag int, logWriter io.Writer) *MinLog { - minLog := &MinLog{} - minLog.log = log.New(logWriter, "", flag) - minLog.isColorized = withColor - minLog.packageName = appName - minLog.level = level - return minLog -} -func NewMinLogWithLogger(packageName string, level Level, withColor bool, logger *log.Logger) *MinLog { - minLog := &MinLog{} - minLog.log = logger - minLog.isColorized = withColor - minLog.packageName = packageName - minLog.level = level - return minLog -} -func (this *MinLog) GetLevel() Level { - return Level(this.level) -} - -func (this *MinLog) SetWriter(writer io.Writer) { - this.log.SetOutput(writer) -} - -func (this *MinLog) SetLevel(level Level) { - this.level = level -} -func (this *MinLog) SetPackageName(newPackageName string) { - this.packageName = newPackageName -} -func (this *MinLog) GetPackageName() string { - return this.packageName -} -func (this *MinLog) SetLogger(l *log.Logger) { - this.log = l -} -func (this *MinLog) WithColor(isColorized bool) { - this.isColorized = isColorized -} -func (this *MinLog) IsColorized() bool { - return this.isColorized -} -func (this *MinLog) GetLogger() *log.Logger { - - return this.log -} - -func (this *MinLog) logMessage(typeLog string, colorFg color.Attribute, colorBg color.Attribute, args ...interface{}) { - var text string - msg := "" - flags := this.log.Flags() - if (log.Lshortfile | flags) == flags { - msg += this.trace() - this.log.SetFlags(flags - log.Lshortfile) - } - text, ok := args[0].(string); - if !ok { - panic("Firt argument should be a string") - } - if len(args) > 1 { - newArgs := args[1:] - msg += typeLog + ": " + fmt.Sprintf(text, newArgs...) - } else { - msg += typeLog + ": " + text - } - this.writeMsgInLogger(msg, colorFg, colorBg) - this.log.SetFlags(flags) -} -func (this *MinLog) writeMsgInLogger(msg string, colorFg color.Attribute, colorBg color.Attribute) { - if this.isColorized && int(colorBg) == 0 { - msg = color.New(colorFg).Sprint(msg) - } else if this.isColorized { - msg = color.New(colorFg, colorBg).Sprint(msg) - } - this.log.Print(msg) -} -func (this *MinLog) Error(args ...interface{}) { - if this.level > Lerror { - return - } - this.logMessage("ERROR", color.FgRed, 0, args...) -} - -func (this *MinLog) Severe(args ...interface{}) { - if this.level > Lsevere { - return - } - this.logMessage("SEVERE", color.FgRed, color.BgYellow, args...) -} - -func (this *MinLog) Debug(args ...interface{}) { - if this.level > Ldebug { - return - } - this.logMessage("DEBUG", color.FgBlue, 0, args...) -} - -func (this *MinLog) Info(args ...interface{}) { - if this.level > Linfo { - return - } - this.logMessage("INFO", color.FgCyan, 0, args...) -} - -func (this *MinLog) Warning(args ...interface{}) { - if this.level > Lwarning { - return - } - this.logMessage("WARNING", color.FgYellow, 0, args...) -} -func (this *MinLog) trace() string { - var shortFile string - pc := make([]uintptr, 10) - runtime.Callers(2, pc) - f := runtime.FuncForPC(pc[2]) - file, line := f.FileLine(pc[2]) - if this.packageName == "" { - execFileSplit := strings.Split(os.Args[0], "/") - this.packageName = execFileSplit[len(execFileSplit) - 1] - } - regex, err := regexp.Compile(regexp.QuoteMeta(this.packageName) + "/(.*)") - if err != nil { - panic(err) - } - subMatch := regex.FindStringSubmatch(file) - if len(subMatch) < 2 { - fileSplit := strings.Split(file, "/") - shortFile = fileSplit[len(fileSplit) - 1] - } else { - shortFile = subMatch[1] - } - - return fmt.Sprintf("/%s/%s:%d ", this.packageName, shortFile, line) -} \ No newline at end of file diff --git a/vendor/github.com/BurntSushi/ty/COPYING b/vendor/github.com/BurntSushi/ty/COPYING deleted file mode 100644 index 5c93f4565..000000000 --- a/vendor/github.com/BurntSushi/ty/COPYING +++ /dev/null @@ -1,13 +0,0 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2004 Sam Hocevar - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/vendor/github.com/BurntSushi/ty/doc.go b/vendor/github.com/BurntSushi/ty/doc.go deleted file mode 100644 index 78405f7e8..000000000 --- a/vendor/github.com/BurntSushi/ty/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Package ty provides utilities for writing type parametric functions with run -time type safety. - -This package contains two sub-packages `fun` and `data` which define some -potentially useful functions and abstractions using the type checker in -this package. - -Requirements - -Go tip (or 1.1 when it's released) is required. This package will not work -with Go 1.0.x or earlier. - -The very foundation of this package only recently became possible with the -addition of 3 new functions in the standard library `reflect` package: -SliceOf, MapOf and ChanOf. In particular, it provides the ability to -dynamically construct types at run time from component types. - -Further extensions to this package can be made if similar functions are added -for structs and functions(?). -*/ -package ty diff --git a/vendor/github.com/BurntSushi/ty/fun/chan.go b/vendor/github.com/BurntSushi/ty/fun/chan.go deleted file mode 100644 index 45db9f492..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/chan.go +++ /dev/null @@ -1,84 +0,0 @@ -package fun - -import ( - "reflect" - - "github.com/BurntSushi/ty" -) - -// AsyncChan has a parametric type: -// -// func AsyncChan(chan A) (send chan<- A, recv <-chan A) -// -// AsyncChan provides a channel abstraction without a fixed size buffer. -// The input should be a pointer to a channel that has a type without a -// direction, e.g., `new(chan int)`. Two new channels are returned: `send` and -// `recv`. The caller must send data on the `send` channel and receive data on -// the `recv` channel. -// -// Implementation is inspired by Kyle Lemons' work: -// https://github.com/kylelemons/iq/blob/master/iq_slice.go -func AsyncChan(baseChan interface{}) (send, recv interface{}) { - chk := ty.Check( - new(func(*chan ty.A) (chan ty.A, chan ty.A)), - baseChan) - - // We don't care about the baseChan---it is only used to construct - // the return types. - tsend, trecv := chk.Returns[0], chk.Returns[1] - - buf := make([]reflect.Value, 0, 10) - rsend := reflect.MakeChan(tsend, 0) - rrecv := reflect.MakeChan(trecv, 0) - - go func() { - defer rrecv.Close() - - BUFLOOP: - for { - if len(buf) == 0 { - rv, ok := rsend.Recv() - if !ok { - break BUFLOOP - } - buf = append(buf, rv) - } - - cases := []reflect.SelectCase{ - // case v, ok := <-send - { - Dir: reflect.SelectRecv, - Chan: rsend, - }, - // case recv <- buf[0] - { - Dir: reflect.SelectSend, - Chan: rrecv, - Send: buf[0], - }, - } - choice, rval, rok := reflect.Select(cases) - switch choice { - case 0: - // case v, ok := <-send - if !rok { - break BUFLOOP - } - buf = append(buf, rval) - case 1: - // case recv <- buf[0] - buf = buf[1:] - default: - panic("bug") - } - } - for _, rv := range buf { - rrecv.Send(rv) - } - }() - - // Create the directional channel types. - tsDir := reflect.ChanOf(reflect.SendDir, tsend.Elem()) - trDir := reflect.ChanOf(reflect.RecvDir, trecv.Elem()) - return rsend.Convert(tsDir).Interface(), rrecv.Convert(trDir).Interface() -} diff --git a/vendor/github.com/BurntSushi/ty/fun/doc.go b/vendor/github.com/BurntSushi/ty/fun/doc.go deleted file mode 100644 index 50e10a9ec..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/doc.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Package fun provides type parametric utility functions for lists, sets, -channels and maps. - -The central contribution of this package is a set of functions that operate -on values without depending on their types while maintaining type safety at -run time using the `reflect` package. - -There are two primary concerns when deciding whether to use this package -or not: the loss of compile time type safety and performance. In particular, -with regard to performance, most functions here are much slower than their -built-in counter parts. However, there are a couple where the overhead of -reflection is relatively insignificant: AsyncChan and ParMap. - -In terms of code structure and organization, the price is mostly paid inside -of the package due to the annoyances of operating with `reflect`. The caller -usually only has one obligation other than to provide values consistent with -the type of the function: type assert the result to the desired type. - -When the caller provides values that are inconsistent with the parametric type -of the function, the function will panic with a `TypeError`. (Either because -the types cannot be unified or because they cannot be constructed due to -limitations of the `reflect` package. See the `github.com/BurntSushi/ty` -package for more details.) - -Requirements - -Go tip (or 1.1 when it's released) is required. This package will not work -with Go 1.0.x or earlier. - -The very foundation of this package only recently became possible with the -addition of 3 new functions in the standard library `reflect` package: -SliceOf, MapOf and ChanOf. In particular, it provides the ability to -dynamically construct types at run time from component types. - -Further extensions to this package can be made if similar functions are added -for structs and functions(?). - -Examples - -Squaring each integer in a slice: - - square := func(x int) int { return x * x } - nums := []int{1, 2, 3, 4, 5} - squares := Map(square, nums).([]int) - -Reversing any slice: - - slice := []string{"a", "b", "c"} - reversed := Reverse(slice).([]string) - -Sorting any slice: - - // Sort a slice of structs with first class functions. - type Album struct { - Title string - Year int - } - albums := []Album{ - {"Born to Run", 1975}, - {"WIESS", 1973}, - {"Darkness", 1978}, - {"Greetings", 1973}, - } - - less := func(a, b Album) bool { return a.Year < b.Year }, - sorted := QuickSort(less, albums).([]Album) - -Parallel map: - - // Compute the prime factorization concurrently - // for every integer in [1000, 10000]. - primeFactors := func(n int) []int { // compute prime factors } - factors := ParMap(primeFactors, Range(1000, 10001)).([]int) - -Asynchronous channel without a fixed size buffer: - - s, r := AsyncChan(new(chan int)) - send, recv := s.(chan<- int), r.(<-chan int) - - // Send as much as you want. - for i := 0; i < 100; i++ { - s <- i - } - close(s) - for i := range recv { - // do something with `i` - } - -Shuffle any slice in place: - - jumbleMe := []string{"The", "quick", "brown", "fox"} - Shuffle(jumbleMe) - -Function memoization: - - // Memoizing a recursive function like `fibonacci`. - // Write it like normal: - var fib func(n int64) int64 - fib = func(n int64) int64 { - switch n { - case 0: - return 0 - case 1: - return 1 - } - return fib(n - 1) + fib(n - 2) - } - - // And wrap it with `Memo`. - fib = Memo(fib).(func(int64) int64) - - // Will keep your CPU busy for a long time - // without memoization. - fmt.Println(fib(80)) - -*/ -package fun diff --git a/vendor/github.com/BurntSushi/ty/fun/func.go b/vendor/github.com/BurntSushi/ty/fun/func.go deleted file mode 100644 index d3b387677..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/func.go +++ /dev/null @@ -1,35 +0,0 @@ -package fun - -import ( - "reflect" - - "github.com/BurntSushi/ty" -) - -// Memo has a parametric type: -// -// func Memo(f func(A) B) func(A) B -// -// Memo memoizes any function of a single argument that returns a single value. -// The type `A` must be a Go type for which the comparison operators `==` and -// `!=` are fully defined (this rules out functions, maps and slices). -func Memo(f interface{}) interface{} { - chk := ty.Check( - new(func(func(ty.A) ty.B)), - f) - vf := chk.Args[0] - - saved := make(map[interface{}]reflect.Value) - memo := func(in []reflect.Value) []reflect.Value { - val := in[0].Interface() - ret, ok := saved[val] - if ok { - return []reflect.Value{ret} - } - - ret = call1(vf, in[0]) - saved[val] = ret - return []reflect.Value{ret} - } - return reflect.MakeFunc(vf.Type(), memo).Interface() -} diff --git a/vendor/github.com/BurntSushi/ty/fun/list.go b/vendor/github.com/BurntSushi/ty/fun/list.go deleted file mode 100644 index 416811c3e..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/list.go +++ /dev/null @@ -1,303 +0,0 @@ -package fun - -import ( - "reflect" - "runtime" - "sync" - - "github.com/BurntSushi/ty" -) - -// All has a parametric type: -// -// func All(p func(A) bool, xs []A) bool -// -// All returns `true` if and only if every element in `xs` satisfies `p`. -func All(f, xs interface{}) bool { - chk := ty.Check( - new(func(func(ty.A) bool, []ty.A) bool), - f, xs) - vf, vxs := chk.Args[0], chk.Args[1] - - xsLen := vxs.Len() - for i := 0; i < xsLen; i++ { - if !call1(vf, vxs.Index(i)).Interface().(bool) { - return false - } - } - return true -} - -// Exists has a parametric type: -// -// func Exists(p func(A) bool, xs []A) bool -// -// Exists returns `true` if and only if an element in `xs` satisfies `p`. -func Exists(f, xs interface{}) bool { - chk := ty.Check( - new(func(func(ty.A) bool, []ty.A) bool), - f, xs) - vf, vxs := chk.Args[0], chk.Args[1] - - xsLen := vxs.Len() - for i := 0; i < xsLen; i++ { - if call1(vf, vxs.Index(i)).Interface().(bool) { - return true - } - } - return false -} - -// In has a parametric type: -// -// func In(needle A, haystack []A) bool -// -// In returns `true` if and only if `v` can be found in `xs`. The equality test -// used is Go's standard `==` equality and NOT deep equality. -// -// Note that this requires that `A` be a type that can be meaningfully compared. -func In(needle, haystack interface{}) bool { - chk := ty.Check( - new(func(ty.A, []ty.A) bool), - needle, haystack) - vhaystack := chk.Args[1] - - length := vhaystack.Len() - for i := 0; i < length; i++ { - if vhaystack.Index(i).Interface() == needle { - return true - } - } - return false -} - -// Map has a parametric type: -// -// func Map(f func(A) B, xs []A) []B -// -// Map returns the list corresponding to the return value of applying -// `f` to each element in `xs`. -func Map(f, xs interface{}) interface{} { - chk := ty.Check( - new(func(func(ty.A) ty.B, []ty.A) []ty.B), - f, xs) - vf, vxs, tys := chk.Args[0], chk.Args[1], chk.Returns[0] - - xsLen := vxs.Len() - vys := reflect.MakeSlice(tys, xsLen, xsLen) - for i := 0; i < xsLen; i++ { - vy := call1(vf, vxs.Index(i)) - vys.Index(i).Set(vy) - } - return vys.Interface() -} - -// Filter has a parametric type: -// -// func Filter(p func(A) bool, xs []A) []A -// -// Filter returns a new list only containing the elements of `xs` that satisfy -// the predicate `p`. -func Filter(p, xs interface{}) interface{} { - chk := ty.Check( - new(func(func(ty.A) bool, []ty.A) []ty.A), - p, xs) - vp, vxs, tys := chk.Args[0], chk.Args[1], chk.Returns[0] - - xsLen := vxs.Len() - vys := reflect.MakeSlice(tys, 0, xsLen) - for i := 0; i < xsLen; i++ { - vx := vxs.Index(i) - if call1(vp, vx).Bool() { - vys = reflect.Append(vys, vx) - } - } - return vys.Interface() -} - -// Foldl has a parametric type: -// -// func Foldl(f func(A, B) B, init B, xs []A) B -// -// Foldl reduces a list of A to a single element B using a left fold with -// an initial value `init`. -func Foldl(f, init, xs interface{}) interface{} { - chk := ty.Check( - new(func(func(ty.A, ty.B) ty.B, ty.B, []ty.A) ty.B), - f, init, xs) - vf, vinit, vxs, tb := chk.Args[0], chk.Args[1], chk.Args[2], chk.Returns[0] - - xsLen := vxs.Len() - vb := zeroValue(tb) - vb.Set(vinit) - if xsLen == 0 { - return vb.Interface() - } - - vb.Set(call1(vf, vxs.Index(0), vb)) - for i := 1; i < xsLen; i++ { - vb.Set(call1(vf, vxs.Index(i), vb)) - } - return vb.Interface() -} - -// Foldr has a parametric type: -// -// func Foldr(f func(A, B) B, init B, xs []A) B -// -// Foldr reduces a list of A to a single element B using a right fold with -// an initial value `init`. -func Foldr(f, init, xs interface{}) interface{} { - chk := ty.Check( - new(func(func(ty.A, ty.B) ty.B, ty.B, []ty.A) ty.B), - f, init, xs) - vf, vinit, vxs, tb := chk.Args[0], chk.Args[1], chk.Args[2], chk.Returns[0] - - xsLen := vxs.Len() - vb := zeroValue(tb) - vb.Set(vinit) - if xsLen == 0 { - return vb.Interface() - } - - vb.Set(call1(vf, vxs.Index(xsLen-1), vb)) - for i := xsLen - 2; i >= 0; i-- { - vb.Set(call1(vf, vxs.Index(i), vb)) - } - return vb.Interface() -} - -// Concat has a parametric type: -// -// func Concat(xs [][]A) []A -// -// Concat returns a new flattened list by appending all elements of `xs`. -func Concat(xs interface{}) interface{} { - chk := ty.Check( - new(func([][]ty.A) []ty.A), - xs) - vxs, tflat := chk.Args[0], chk.Returns[0] - - xsLen := vxs.Len() - vflat := reflect.MakeSlice(tflat, 0, xsLen*3) - for i := 0; i < xsLen; i++ { - vflat = reflect.AppendSlice(vflat, vxs.Index(i)) - } - return vflat.Interface() -} - -// Reverse has a parametric type: -// -// func Reverse(xs []A) []A -// -// Reverse returns a new slice that is the reverse of `xs`. -func Reverse(xs interface{}) interface{} { - chk := ty.Check( - new(func([]ty.A) []ty.A), - xs) - vxs, tys := chk.Args[0], chk.Returns[0] - - xsLen := vxs.Len() - vys := reflect.MakeSlice(tys, xsLen, xsLen) - for i := 0; i < xsLen; i++ { - vys.Index(i).Set(vxs.Index(xsLen - 1 - i)) - } - return vys.Interface() -} - -// Copy has a parametric type: -// -// func Copy(xs []A) []A -// -// Copy returns a copy of `xs` using Go's `copy` operation. -func Copy(xs interface{}) interface{} { - chk := ty.Check( - new(func([]ty.A) []ty.A), - xs) - vxs, tys := chk.Args[0], chk.Returns[0] - - xsLen := vxs.Len() - vys := reflect.MakeSlice(tys, xsLen, xsLen) - reflect.Copy(vys, vxs) - return vys.Interface() -} - -// ParMap has a parametric type: -// -// func ParMap(f func(A) B, xs []A) []B -// -// ParMap is just like Map, except it applies `f` to each element in `xs` -// concurrently using N worker goroutines (where N is the number of CPUs -// available reported by the Go runtime). If you want to control the number -// of goroutines spawned, use `ParMapN`. -// -// It is important that `f` not be a trivial operation, otherwise the overhead -// of executing it concurrently will result in worse performance than using -// a `Map`. -func ParMap(f, xs interface{}) interface{} { - n := runtime.NumCPU() - if n < 1 { - n = 1 - } - return ParMapN(f, xs, n) -} - -// ParMapN has a parametric type: -// -// func ParMapN(f func(A) B, xs []A, n int) []B -// -// ParMapN is just like Map, except it applies `f` to each element in `xs` -// concurrently using `n` worker goroutines. -// -// It is important that `f` not be a trivial operation, otherwise the overhead -// of executing it concurrently will result in worse performance than using -// a `Map`. -func ParMapN(f, xs interface{}, n int) interface{} { - chk := ty.Check( - new(func(func(ty.A) ty.B, []ty.A) []ty.B), - f, xs) - vf, vxs, tys := chk.Args[0], chk.Args[1], chk.Returns[0] - - xsLen := vxs.Len() - ys := reflect.MakeSlice(tys, xsLen, xsLen) - - if n < 1 { - n = 1 - } - work := make(chan int, n) - wg := new(sync.WaitGroup) - for i := 0; i < n; i++ { - wg.Add(1) - go func() { - for j := range work { - // Good golly miss molly. Is `reflect.Value.Index` - // safe to access/set from multiple goroutines? - // XXX: If not, we'll need an extra wave of allocation to - // use real slices of `reflect.Value`. - ys.Index(j).Set(call1(vf, vxs.Index(j))) - } - wg.Done() - }() - } - for i := 0; i < xsLen; i++ { - work <- i - } - close(work) - wg.Wait() - return ys.Interface() -} - -// Range generates a list of integers corresponding to every integer in -// the half-open interval [x, y). -// -// Range will panic if `end < start`. -func Range(start, end int) []int { - if end < start { - panic("range must have end greater than or equal to start") - } - r := make([]int, end-start) - for i := start; i < end; i++ { - r[i-start] = i - } - return r -} diff --git a/vendor/github.com/BurntSushi/ty/fun/map.go b/vendor/github.com/BurntSushi/ty/fun/map.go deleted file mode 100644 index d2ff97f7f..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/map.go +++ /dev/null @@ -1,46 +0,0 @@ -package fun - -import ( - "reflect" - - "github.com/BurntSushi/ty" -) - -// Keys has a parametric type: -// -// func Keys(m map[A]B) []A -// -// Keys returns a list of the keys of `m` in an unspecified order. -func Keys(m interface{}) interface{} { - chk := ty.Check( - new(func(map[ty.A]ty.B) []ty.A), - m) - vm, tkeys := chk.Args[0], chk.Returns[0] - - vkeys := reflect.MakeSlice(tkeys, vm.Len(), vm.Len()) - for i, vkey := range vm.MapKeys() { - vkeys.Index(i).Set(vkey) - } - return vkeys.Interface() -} - -// Values has a parametric type: -// -// func Values(m map[A]B) []B -// -// Values returns a list of the values of `m` in an unspecified order. -func Values(m interface{}) interface{} { - chk := ty.Check( - new(func(map[ty.A]ty.B) []ty.B), - m) - vm, tvals := chk.Args[0], chk.Returns[0] - - vvals := reflect.MakeSlice(tvals, vm.Len(), vm.Len()) - for i, vkey := range vm.MapKeys() { - vvals.Index(i).Set(vm.MapIndex(vkey)) - } - return vvals.Interface() -} - -// func MapMerge(m1, m2 interface{}) interface{} { -// } diff --git a/vendor/github.com/BurntSushi/ty/fun/rand.go b/vendor/github.com/BurntSushi/ty/fun/rand.go deleted file mode 100644 index 2b0e34ae8..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/rand.go +++ /dev/null @@ -1,94 +0,0 @@ -package fun - -import ( - "math/rand" - "reflect" - "time" - - "github.com/BurntSushi/ty" -) - -var randNumGen *rand.Rand - -func init() { - randNumGen = rand.New(rand.NewSource(time.Now().UnixNano())) -} - -// ShuffleGen has a parametric type: -// -// func ShuffleGen(xs []A, rng *rand.Rand) -// -// ShuffleGen shuffles `xs` in place using the given random number -// generator `rng`. -func ShuffleGen(xs interface{}, rng *rand.Rand) { - chk := ty.Check( - new(func([]ty.A, *rand.Rand)), - xs, rng) - vxs := chk.Args[0] - - // Implements the Fisher-Yates shuffle: http://goo.gl/Hb9vg - xsLen := vxs.Len() - swapper := swapperOf(vxs.Type().Elem()) - for i := xsLen - 1; i >= 1; i-- { - j := rng.Intn(i + 1) - swapper.swap(vxs.Index(i), vxs.Index(j)) - } -} - -// Shuffle has a parametric type: -// -// func Shuffle(xs []A) -// -// Shuffle shuffles `xs` in place using a default random number -// generator seeded once at program initialization. -func Shuffle(xs interface{}) { - ShuffleGen(xs, randNumGen) -} - -// Sample has a parametric type: -// -// func Sample(population []A, n int) []A -// -// Sample returns a random sample of size `n` from a list -// `population` using a default random number generator seeded once at -// program initialization. -// All elements in `population` have an equal chance of being selected. -// If `n` is greater than the size of `population`, then `n` is set to -// the size of the population. -func Sample(population interface{}, n int) interface{} { - return SampleGen(population, n, randNumGen) -} - -// SampleGen has a parametric type: -// -// func SampleGen(population []A, n int, rng *rand.Rand) []A -// -// SampleGen returns a random sample of size `n` from a list -// `population` using a given random number generator `rng`. -// All elements in `population` have an equal chance of being selected. -// If `n` is greater than the size of `population`, then `n` is set to -// the size of the population. -func SampleGen(population interface{}, n int, rng *rand.Rand) interface{} { - chk := ty.Check( - new(func([]ty.A, int, *rand.Rand) []ty.A), - population, n, rng) - rpop, tsamp := chk.Args[0], chk.Returns[0] - - popLen := rpop.Len() - if n == 0 { - return reflect.MakeSlice(tsamp, 0, 0).Interface() - } - if n > popLen { - n = popLen - } - - // TODO(burntsushi): Implement an algorithm that doesn't depend on - // the size of the population. - - rsamp := reflect.MakeSlice(tsamp, n, n) - choices := rng.Perm(popLen) - for i := 0; i < n; i++ { - rsamp.Index(i).Set(rpop.Index(choices[i])) - } - return rsamp.Interface() -} diff --git a/vendor/github.com/BurntSushi/ty/fun/set.go b/vendor/github.com/BurntSushi/ty/fun/set.go deleted file mode 100644 index 4aa4f4d76..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/set.go +++ /dev/null @@ -1,99 +0,0 @@ -package fun - -import ( - "reflect" - - "github.com/BurntSushi/ty" -) - -// Set has a parametric type: -// -// func Set(xs []A) map[A]bool -// -// Set creates a set from a list. -func Set(xs interface{}) interface{} { - chk := ty.Check( - new(func([]ty.A) map[ty.A]bool), - xs) - vxs, tset := chk.Args[0], chk.Returns[0] - - vtrue := reflect.ValueOf(true) - vset := reflect.MakeMap(tset) - xsLen := vxs.Len() - for i := 0; i < xsLen; i++ { - vset.SetMapIndex(vxs.Index(i), vtrue) - } - return vset.Interface() -} - -// Union has a parametric type: -// -// func Union(a map[A]bool, b map[A]bool) map[A]bool -// -// Union returns the union of two sets, where a set is represented as a -// `map[A]bool`. The sets `a` and `b` are not modified. -func Union(a, b interface{}) interface{} { - chk := ty.Check( - new(func(map[ty.A]bool, map[ty.A]bool) map[ty.A]bool), - a, b) - va, vb, tc := chk.Args[0], chk.Args[1], chk.Returns[0] - - vtrue := reflect.ValueOf(true) - vc := reflect.MakeMap(tc) - for _, vkey := range va.MapKeys() { - vc.SetMapIndex(vkey, vtrue) - } - for _, vkey := range vb.MapKeys() { - vc.SetMapIndex(vkey, vtrue) - } - return vc.Interface() -} - -// Intersection has a parametric type: -// -// func Intersection(a map[A]bool, b map[A]bool) map[A]bool -// -// Intersection returns the intersection of two sets, where a set is -// represented as a `map[A]bool`. The sets `a` and `b` are not modified. -func Intersection(a, b interface{}) interface{} { - chk := ty.Check( - new(func(map[ty.A]bool, map[ty.A]bool) map[ty.A]bool), - a, b) - va, vb, tc := chk.Args[0], chk.Args[1], chk.Returns[0] - - vtrue := reflect.ValueOf(true) - vc := reflect.MakeMap(tc) - for _, vkey := range va.MapKeys() { - if vb.MapIndex(vkey).IsValid() { - vc.SetMapIndex(vkey, vtrue) - } - } - for _, vkey := range vb.MapKeys() { - if va.MapIndex(vkey).IsValid() { - vc.SetMapIndex(vkey, vtrue) - } - } - return vc.Interface() -} - -// Difference has a parametric type: -// -// func Difference(a map[A]bool, b map[A]bool) map[A]bool -// -// Difference returns a set with all elements in `a` that are not in `b`. -// The sets `a` and `b` are not modified. -func Difference(a, b interface{}) interface{} { - chk := ty.Check( - new(func(map[ty.A]bool, map[ty.A]bool) map[ty.A]bool), - a, b) - va, vb, tc := chk.Args[0], chk.Args[1], chk.Returns[0] - - vtrue := reflect.ValueOf(true) - vc := reflect.MakeMap(tc) - for _, vkey := range va.MapKeys() { - if !vb.MapIndex(vkey).IsValid() { - vc.SetMapIndex(vkey, vtrue) - } - } - return vc.Interface() -} diff --git a/vendor/github.com/BurntSushi/ty/fun/sort.go b/vendor/github.com/BurntSushi/ty/fun/sort.go deleted file mode 100644 index b109147aa..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/sort.go +++ /dev/null @@ -1,98 +0,0 @@ -package fun - -import ( - "reflect" - "sort" - - "github.com/BurntSushi/ty" -) - -// QuickSort has a parametric type: -// -// func QuickSort(less func(x1 A, x2 A) bool, []A) []A -// -// QuickSort applies the "quicksort" algorithm to return a new sorted list -// of `xs`, where `xs` is not modified. -// -// `less` should be a function that returns true if and only if `x1` is less -// than `x2`. -func QuickSort(less, xs interface{}) interface{} { - chk := ty.Check( - new(func(func(ty.A, ty.A) bool, []ty.A) []ty.A), - less, xs) - vless, vxs, tys := chk.Args[0], chk.Args[1], chk.Returns[0] - - var qsort func(left, right int) - var partition func(left, right, pivot int) int - xsind := Range(0, vxs.Len()) - - qsort = func(left, right int) { - if left >= right { - return - } - pivot := (left + right) / 2 - pivot = partition(left, right, pivot) - - qsort(left, pivot-1) - qsort(pivot+1, right) - } - partition = func(left, right, pivot int) int { - vpivot := xsind[pivot] - xsind[pivot], xsind[right] = xsind[right], xsind[pivot] - - ind := left - for i := left; i < right; i++ { - if call1(vless, vxs.Index(xsind[i]), vxs.Index(vpivot)).Bool() { - xsind[i], xsind[ind] = xsind[ind], xsind[i] - ind++ - } - } - xsind[ind], xsind[right] = xsind[right], xsind[ind] - return ind - } - - // Sort `xsind` in place. - qsort(0, len(xsind)-1) - - vys := reflect.MakeSlice(tys, len(xsind), len(xsind)) - for i, xsIndex := range xsind { - vys.Index(i).Set(vxs.Index(xsIndex)) - } - return vys.Interface() -} - -// Sort has a parametric type: -// -// func Sort(less func(x1 A, x2 A) bool, []A) -// -// Sort uses the standard library `sort` package to sort `xs` in place. -// -// `less` should be a function that returns true if and only if `x1` is less -// than `x2`. -func Sort(less, xs interface{}) { - chk := ty.Check( - new(func(func(ty.A, ty.A) bool, []ty.A)), - less, xs) - - vless, vxs := chk.Args[0], chk.Args[1] - sort.Sort(&sortable{vless, vxs, swapperOf(vxs.Type().Elem())}) -} - -type sortable struct { - less reflect.Value - xs reflect.Value - swapper swapper -} - -func (s *sortable) Less(i, j int) bool { - ith, jth := s.xs.Index(i), s.xs.Index(j) - return call1(s.less, ith, jth).Bool() -} - -func (s *sortable) Swap(i, j int) { - s.swapper.swap(s.xs.Index(i), s.xs.Index(j)) -} - -func (s *sortable) Len() int { - return s.xs.Len() -} diff --git a/vendor/github.com/BurntSushi/ty/fun/util.go b/vendor/github.com/BurntSushi/ty/fun/util.go deleted file mode 100644 index a50895886..000000000 --- a/vendor/github.com/BurntSushi/ty/fun/util.go +++ /dev/null @@ -1,37 +0,0 @@ -package fun - -import ( - "reflect" -) - -func zeroValue(typ reflect.Type) reflect.Value { - return reflect.New(typ).Elem() -} - -type swapper reflect.Value - -func swapperOf(typ reflect.Type) swapper { - return swapper(zeroValue(typ)) -} - -func (s swapper) swap(a, b reflect.Value) { - vs := reflect.Value(s) - vs.Set(a) - a.Set(b) - b.Set(vs) -} - -func call(f reflect.Value, args ...reflect.Value) { - f.Call(args) -} - -func call1(f reflect.Value, args ...reflect.Value) reflect.Value { - return f.Call(args)[0] -} - -func call2(f reflect.Value, args ...reflect.Value) ( - reflect.Value, reflect.Value) { - - ret := f.Call(args) - return ret[0], ret[1] -} diff --git a/vendor/github.com/BurntSushi/ty/type-check.go b/vendor/github.com/BurntSushi/ty/type-check.go deleted file mode 100644 index 9741daefd..000000000 --- a/vendor/github.com/BurntSushi/ty/type-check.go +++ /dev/null @@ -1,338 +0,0 @@ -package ty - -import ( - "fmt" - "reflect" - "strings" -) - -// TypeError corresponds to any error reported by the `Check` function. -// Since `Check` panics, if you want to run `Check` safely, it is -// appropriate to recover and use a type switch to discover a `TypeError` -// value. -type TypeError string - -func (te TypeError) Error() string { - return string(te) -} - -func pe(format string, v ...interface{}) TypeError { - return TypeError(fmt.Sprintf(format, v...)) -} - -func ppe(format string, v ...interface{}) { - panic(pe(format, v...)) -} - -// Typed corresponds to the information returned by `Check`. -type Typed struct { - // In correspondence with the `as` parameter to `Check`. - Args []reflect.Value - - // In correspondence with the return types of `f` in `Check`. - Returns []reflect.Type - - // The type environment generated via unification in `Check`. - // (Its usefulness in the public API is questionable.) - TypeEnv map[string]reflect.Type -} - -// Check accepts a function `f`, which may have a parametric type, along with a -// number of arguments in correspondence with the arguments to `f`, -// and returns inferred Go type information. This type information includes -// a list of `reflect.Value` in correspondence with `as`, a list of -// `reflect.Type` in correspondence with the return types of `f` and a type -// environment mapping type variables to `reflect.Type`. -// -// The power of `Check` comes from the following invariant: if `Check` returns, -// then the types of the arguments corresponding to `as` are consistent -// with the parametric type of `f`, *and* the parametric return types of `f` -// were made into valid Go types that are not parametric. Otherwise, there is -// a bug in `Check`. -// -// More concretely, consider a simple parametric function `Map`, which -// transforms a list of elements by applying a function to each element in -// order to generate a new list. Such a function constructed only for integers -// might have a type like -// -// func Map(func(int) int, []int) []int -// -// But the parametric type of `Map` could be given with -// -// func Map(func(A) B, []A) []B -// -// which in English reads, "Given a function from any type `A` to any type `B` -// and a slice of `A`, `Map` returns a slice of `B`." -// -// To write a parametric function like `Map`, one can pass a pointer -// to a nil function of the desired parametric type to get the reflection -// information: -// -// func Map(f, xs interface{}) interface{} { -// // Given the parametric type and the arguments, Check will -// // return all the reflection information you need to write `Map`. -// uni := ty.Check( -// new(func(func(ty.A) ty.B, []ty.A) []ty.B), -// f, xs) -// -// // `vf` and `vxs` are `reflect.Value`s of `f` and `xs`. -// vf, vxs := uni.Args[0], uni.Args[1] -// -// // `tys` is a `reflect.Type` of `[]ty.B` where `ty.B` is replaced -// // with the return type of the given function `f`. -// tys := uni.Returns[0] -// -// // Given the promise of `Check`, we now know that `vf` has -// // type `func(ty.A) ty.B` and `vxs` has type `[]ty.A`. -// xsLen := vxs.Len() -// -// // Constructs a new slice which will have type `[]ty.B`. -// vys := reflect.MakeSlice(tys, xsLen, xsLen) -// -// // Actually perform the `Map` operation, but in the world of -// // reflection. -// for i := 0; i < xsLen; i++ { -// vy := vf.Call([]reflect.Value{vxs.Index(i)})[0] -// vys.Index(i).Set(vy) -// } -// -// // The `reflect.Value.Interface` method is how we exit the world of -// // reflection. The onus is now on the caller to type assert it to -// // the appropriate type. -// return vys.Interface() -// } -// -// Working in the reflection world is certainly more inconvenient than writing -// regular Go code, but the information and invariants held by `Check` provide -// a more convenient experience than how one normally works with reflection. -// (Notice that there is no error-prone type switching or boiler plate to -// construct new types, since `Check` guarantees the types are consistent -// with the inputs for us.) -// -// And while writing such functions is still not so convenient, -// invoking them is simple: -// -// square := func(x int) int { return x * x } -// squared := Map(square, []int{1, 2, 3, 4, 5}).([]int) -// -// Restrictions -// -// There are a few restrictions imposed on the parametric return types of -// `f`: type variables may only be found in types that can be composed by the -// `reflect` package. This *only* includes channels, maps, pointers and slices. -// If a type variable is found in an array, function or struct, `Check` will -// panic. -// -// Also, type variables inside of structs are ignored in the types of the -// arguments `as`. This restriction may be lifted in the future. -// -// To be clear: type variables *may* appear in arrays or functions in the types -// of the arguments `as`. -func Check(f interface{}, as ...interface{}) *Typed { - rf := reflect.ValueOf(f) - tf := rf.Type() - - if tf.Kind() == reflect.Ptr { - rf = reflect.Indirect(rf) - tf = rf.Type() - } - if tf.Kind() != reflect.Func { - ppe("The type of `f` must be a function, but it is a '%s'.", tf.Kind()) - } - if tf.NumIn() != len(as) { - ppe("`f` expects %d arguments, but only %d were given.", - tf.NumIn(), len(as)) - } - - // Populate the argument value list. - args := make([]reflect.Value, len(as)) - for i := 0; i < len(as); i++ { - args[i] = reflect.ValueOf(as[i]) - } - - // Populate our type variable environment through unification. - tyenv := make(tyenv) - for i := 0; i < len(args); i++ { - tp := typePair{tyenv, tf.In(i), args[i].Type()} - - // Mutates the type variable environment. - if err := tp.unify(tp.param, tp.input); err != nil { - argTypes := make([]string, len(args)) - for i := range args { - argTypes[i] = args[i].Type().String() - } - ppe("\nError type checking\n\t%s\nwith argument types\n\t(%s)\n%s", - tf, strings.Join(argTypes, ", "), err) - } - } - - // Now substitute those types into the return types of `f`. - retTypes := make([]reflect.Type, tf.NumOut()) - for i := 0; i < tf.NumOut(); i++ { - retTypes[i] = (&returnType{tyenv, tf.Out(i)}).tysubst(tf.Out(i)) - } - return &Typed{args, retTypes, map[string]reflect.Type(tyenv)} -} - -// tyenv maps type variable names to their inferred Go type. -type tyenv map[string]reflect.Type - -// typePair represents a pair of types to be unified. They act as a way to -// report sensible error messages from within the unification algorithm. -// -// It also includes a type environment, which is mutated during unification. -type typePair struct { - tyenv tyenv - param reflect.Type - input reflect.Type -} - -func (tp typePair) error(format string, v ...interface{}) error { - return pe("Type error when unifying type '%s' and '%s': %s", - tp.param, tp.input, fmt.Sprintf(format, v...)) -} - -// unify attempts to satisfy a pair of types, where the `param` type is the -// expected type of a function argument and the `input` type is the known -// type of a function argument. The `param` type may be parametric (that is, -// it may contain a type that is convertible to TypeVariable) but the -// `input` type may *not* be parametric. -// -// Any failure to unify the two types results in a panic. -// -// The end result of unification is a type environment: a set of substitutions -// from type variable to a Go type. -func (tp typePair) unify(param, input reflect.Type) error { - if tyname := tyvarName(input); len(tyname) > 0 { - return tp.error("Type variables are not allowed in the types of " + - "arguments.") - } - if tyname := tyvarName(param); len(tyname) > 0 { - if cur, ok := tp.tyenv[tyname]; ok && cur != input { - return tp.error("Type variable %s expected type '%s' but got '%s'.", - tyname, cur, input) - } else if !ok { - tp.tyenv[tyname] = input - } - return nil - } - if param.Kind() != input.Kind() { - return tp.error("Cannot unify different kinds of types '%s' and '%s'.", - param, input) - } - - switch param.Kind() { - case reflect.Array: - return tp.unify(param.Elem(), input.Elem()) - case reflect.Chan: - if param.ChanDir() != input.ChanDir() { - return tp.error("Cannot unify '%s' with '%s' "+ - "(channel directions are different: '%s' != '%s').", - param, input, param.ChanDir(), input.ChanDir()) - } - return tp.unify(param.Elem(), input.Elem()) - case reflect.Func: - if param.NumIn() != input.NumIn() || param.NumOut() != input.NumOut() { - return tp.error("Cannot unify '%s' with '%s'.", param, input) - } - for i := 0; i < param.NumIn(); i++ { - if err := tp.unify(param.In(i), input.In(i)); err != nil { - return err - } - } - for i := 0; i < param.NumOut(); i++ { - if err := tp.unify(param.Out(i), input.Out(i)); err != nil { - return err - } - } - case reflect.Map: - if err := tp.unify(param.Key(), input.Key()); err != nil { - return err - } - return tp.unify(param.Elem(), input.Elem()) - case reflect.Ptr: - return tp.unify(param.Elem(), input.Elem()) - case reflect.Slice: - return tp.unify(param.Elem(), input.Elem()) - } - - // The only other container types are Interface and Struct. - // I am unsure about what to do with interfaces. Mind is fuzzy. - // Structs? I don't think it really makes much sense to use type - // variables inside of them. - return nil -} - -// returnType corresponds to the type of a single return value of a function, -// in which the type may be parametric. It also contains a type environment -// constructed from unification. -type returnType struct { - tyenv tyenv - typ reflect.Type -} - -func (rt returnType) panic(format string, v ...interface{}) { - ppe("Error substituting in return type '%s': %s", - rt.typ, fmt.Sprintf(format, v...)) -} - -// tysubst attempts to substitute all type variables within a single return -// type with their corresponding Go type from the type environment. -// -// tysubst will panic if a type variable is unbound, or if it encounters a -// type that cannot be dynamically created. Such types include arrays, -// functions and structs. (A limitation of the `reflect` package.) -func (rt returnType) tysubst(typ reflect.Type) reflect.Type { - if tyname := tyvarName(typ); len(tyname) > 0 { - if thetype, ok := rt.tyenv[tyname]; !ok { - rt.panic("Unbound type variable %s.", tyname) - } else { - return thetype - } - } - - switch typ.Kind() { - case reflect.Array: - rt.panic("Cannot dynamically create Array types.") - case reflect.Chan: - return reflect.ChanOf(typ.ChanDir(), rt.tysubst(typ.Elem())) - case reflect.Func: - rt.panic("Cannot dynamically create Function types.") - case reflect.Interface: - // rt.panic("TODO") - // Not sure if this is right. - return typ - case reflect.Map: - return reflect.MapOf(rt.tysubst(typ.Key()), rt.tysubst(typ.Elem())) - case reflect.Ptr: - return reflect.PtrTo(rt.tysubst(typ.Elem())) - case reflect.Slice: - return reflect.SliceOf(rt.tysubst(typ.Elem())) - case reflect.Struct: - rt.panic("Cannot dynamically create Struct types.") - case reflect.UnsafePointer: - rt.panic("Cannot dynamically create unsafe.Pointer types.") - } - - // We've covered all the composite types, so we're only left with - // base types. - return typ -} - -func tyvarName(t reflect.Type) string { - if !t.ConvertibleTo(tyvarUnderlyingType) { - return "" - } - return t.Name() -} - -// AssertType panics with a `TypeError` if `v` does not have type `t`. -// Otherwise, it returns the `reflect.Value` of `v`. -func AssertType(v interface{}, t reflect.Type) reflect.Value { - rv := reflect.ValueOf(v) - tv := rv.Type() - if tv != t { - ppe("Value '%v' has type '%s' but expected '%s'.", v, tv, t) - } - return rv -} diff --git a/vendor/github.com/BurntSushi/ty/tyvars.go b/vendor/github.com/BurntSushi/ty/tyvars.go deleted file mode 100644 index 73b19e8cc..000000000 --- a/vendor/github.com/BurntSushi/ty/tyvars.go +++ /dev/null @@ -1,28 +0,0 @@ -package ty - -import ( - "reflect" -) - -// TypeVariable is the underlying type of every type variable used in -// parametric types. It should not be used directly. Instead, use -// -// type myOwnTypeVariable TypeVariable -// -// to create your own type variable. For your convenience, this package -// defines some type variables for you. (e.g., `A`, `B`, `C`, ...) -type TypeVariable struct { - noImitation struct{} -} - -// tyvarUnderlyingType is used to discover types that are type variables. -// Namely, any type variable must be convertible to `TypeVariable`. -var tyvarUnderlyingType = reflect.TypeOf(TypeVariable{}) - -type A TypeVariable -type B TypeVariable -type C TypeVariable -type D TypeVariable -type E TypeVariable -type F TypeVariable -type G TypeVariable diff --git a/vendor/github.com/abronan/valkeyrie/store/boltdb/boltdb.go b/vendor/github.com/abronan/valkeyrie/store/boltdb/boltdb.go deleted file mode 100644 index 5c553c3be..000000000 --- a/vendor/github.com/abronan/valkeyrie/store/boltdb/boltdb.go +++ /dev/null @@ -1,476 +0,0 @@ -package boltdb - -import ( - "bytes" - "encoding/binary" - "errors" - "os" - "path/filepath" - "sync" - "sync/atomic" - "time" - - "github.com/abronan/valkeyrie" - "github.com/abronan/valkeyrie/store" - "github.com/coreos/bbolt" -) - -var ( - // ErrMultipleEndpointsUnsupported is thrown when multiple endpoints specified for - // BoltDB. Endpoint has to be a local file path - ErrMultipleEndpointsUnsupported = errors.New("boltdb supports one endpoint and should be a file path") - // ErrBoltBucketOptionMissing is thrown when boltBcuket config option is missing - ErrBoltBucketOptionMissing = errors.New("boltBucket config option missing") -) - -const ( - filePerm os.FileMode = 0644 -) - -//BoltDB type implements the Store interface -type BoltDB struct { - client *bolt.DB - boltBucket []byte - dbIndex uint64 - path string - timeout time.Duration - // By default valkeyrie opens and closes the bolt DB connection for every - // get/put operation. This allows multiple apps to use a Bolt DB at the - // same time. - // PersistConnection flag provides an option to override ths behavior. - // ie: open the connection in New and use it till Close is called. - PersistConnection bool - sync.Mutex -} - -const ( - metadatalen = 8 - transientTimeout = time.Duration(10) * time.Second -) - -// Register registers boltdb to valkeyrie -func Register() { - valkeyrie.AddStore(store.BOLTDB, New) -} - -// New opens a new BoltDB connection to the specified path and bucket -func New(endpoints []string, options *store.Config) (store.Store, error) { - var ( - db *bolt.DB - err error - boltOptions *bolt.Options - timeout = transientTimeout - ) - - if len(endpoints) > 1 { - return nil, ErrMultipleEndpointsUnsupported - } - - if (options == nil) || (len(options.Bucket) == 0) { - return nil, ErrBoltBucketOptionMissing - } - - dir, _ := filepath.Split(endpoints[0]) - if err = os.MkdirAll(dir, 0750); err != nil { - return nil, err - } - - if options.PersistConnection { - boltOptions = &bolt.Options{Timeout: options.ConnectionTimeout} - db, err = bolt.Open(endpoints[0], filePerm, boltOptions) - if err != nil { - return nil, err - } - } - - if options.ConnectionTimeout != 0 { - timeout = options.ConnectionTimeout - } - - b := &BoltDB{ - client: db, - path: endpoints[0], - boltBucket: []byte(options.Bucket), - timeout: timeout, - PersistConnection: options.PersistConnection, - } - - return b, nil -} - -func (b *BoltDB) reset() { - b.path = "" - b.boltBucket = []byte{} -} - -func (b *BoltDB) getDBhandle() (*bolt.DB, error) { - var ( - db *bolt.DB - err error - ) - if !b.PersistConnection { - boltOptions := &bolt.Options{Timeout: b.timeout} - if db, err = bolt.Open(b.path, filePerm, boltOptions); err != nil { - return nil, err - } - b.client = db - } - - return b.client, nil -} - -func (b *BoltDB) releaseDBhandle() { - if !b.PersistConnection { - b.client.Close() - } -} - -// Get the value at "key". BoltDB doesn't provide an inbuilt last modified index with every kv pair. Its implemented by -// by a atomic counter maintained by the valkeyrie and appened to the value passed by the client. -func (b *BoltDB) Get(key string, opts *store.ReadOptions) (*store.KVPair, error) { - var ( - val []byte - db *bolt.DB - err error - ) - b.Lock() - defer b.Unlock() - - if db, err = b.getDBhandle(); err != nil { - return nil, err - } - defer b.releaseDBhandle() - - err = db.View(func(tx *bolt.Tx) error { - bucket := tx.Bucket(b.boltBucket) - if bucket == nil { - return store.ErrKeyNotFound - } - - v := bucket.Get([]byte(key)) - val = make([]byte, len(v)) - copy(val, v) - - return nil - }) - - if len(val) == 0 { - return nil, store.ErrKeyNotFound - } - if err != nil { - return nil, err - } - - dbIndex := binary.LittleEndian.Uint64(val[:metadatalen]) - val = val[metadatalen:] - - return &store.KVPair{Key: key, Value: val, LastIndex: (dbIndex)}, nil -} - -//Put the key, value pair. index number metadata is prepended to the value -func (b *BoltDB) Put(key string, value []byte, opts *store.WriteOptions) error { - var ( - dbIndex uint64 - db *bolt.DB - err error - ) - b.Lock() - defer b.Unlock() - - dbval := make([]byte, metadatalen) - - if db, err = b.getDBhandle(); err != nil { - return err - } - defer b.releaseDBhandle() - - err = db.Update(func(tx *bolt.Tx) error { - bucket, err := tx.CreateBucketIfNotExists(b.boltBucket) - if err != nil { - return err - } - - dbIndex = atomic.AddUint64(&b.dbIndex, 1) - binary.LittleEndian.PutUint64(dbval, dbIndex) - dbval = append(dbval, value...) - - err = bucket.Put([]byte(key), dbval) - if err != nil { - return err - } - return nil - }) - return err -} - -//Delete the value for the given key. -func (b *BoltDB) Delete(key string) error { - var ( - db *bolt.DB - err error - ) - b.Lock() - defer b.Unlock() - - if db, err = b.getDBhandle(); err != nil { - return err - } - defer b.releaseDBhandle() - - err = db.Update(func(tx *bolt.Tx) error { - bucket := tx.Bucket(b.boltBucket) - if bucket == nil { - return store.ErrKeyNotFound - } - err := bucket.Delete([]byte(key)) - return err - }) - return err -} - -// Exists checks if the key exists inside the store -func (b *BoltDB) Exists(key string, opts *store.ReadOptions) (bool, error) { - var ( - val []byte - db *bolt.DB - err error - ) - b.Lock() - defer b.Unlock() - - if db, err = b.getDBhandle(); err != nil { - return false, err - } - defer b.releaseDBhandle() - - err = db.View(func(tx *bolt.Tx) error { - bucket := tx.Bucket(b.boltBucket) - if bucket == nil { - return store.ErrKeyNotFound - } - - val = bucket.Get([]byte(key)) - - return nil - }) - - if len(val) == 0 { - return false, err - } - return true, err -} - -// List returns the range of keys starting with the passed in prefix -func (b *BoltDB) List(keyPrefix string, opts *store.ReadOptions) ([]*store.KVPair, error) { - var ( - db *bolt.DB - err error - ) - b.Lock() - defer b.Unlock() - - kv := []*store.KVPair{} - - if db, err = b.getDBhandle(); err != nil { - return nil, err - } - defer b.releaseDBhandle() - hasResult := false - err = db.View(func(tx *bolt.Tx) error { - bucket := tx.Bucket(b.boltBucket) - if bucket == nil { - return store.ErrKeyNotFound - } - - cursor := bucket.Cursor() - prefix := []byte(keyPrefix) - - for key, v := cursor.Seek(prefix); bytes.HasPrefix(key, prefix); key, v = cursor.Next() { - hasResult = true - dbIndex := binary.LittleEndian.Uint64(v[:metadatalen]) - v = v[metadatalen:] - val := make([]byte, len(v)) - copy(val, v) - - if string(key) != keyPrefix { - kv = append(kv, &store.KVPair{ - Key: string(key), - Value: val, - LastIndex: dbIndex, - }) - } - } - return nil - }) - if !hasResult { - return nil, store.ErrKeyNotFound - } - return kv, err -} - -// AtomicDelete deletes a value at "key" if the key -// has not been modified in the meantime, throws an -// error if this is the case -func (b *BoltDB) AtomicDelete(key string, previous *store.KVPair) (bool, error) { - var ( - val []byte - db *bolt.DB - err error - ) - b.Lock() - defer b.Unlock() - - if previous == nil { - return false, store.ErrPreviousNotSpecified - } - if db, err = b.getDBhandle(); err != nil { - return false, err - } - defer b.releaseDBhandle() - - err = db.Update(func(tx *bolt.Tx) error { - bucket := tx.Bucket(b.boltBucket) - if bucket == nil { - return store.ErrKeyNotFound - } - - val = bucket.Get([]byte(key)) - if val == nil { - return store.ErrKeyNotFound - } - dbIndex := binary.LittleEndian.Uint64(val[:metadatalen]) - if dbIndex != previous.LastIndex { - return store.ErrKeyModified - } - err := bucket.Delete([]byte(key)) - return err - }) - if err != nil { - return false, err - } - return true, err -} - -// AtomicPut puts a value at "key" if the key has not been -// modified since the last Put, throws an error if this is the case -func (b *BoltDB) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error) { - var ( - val []byte - dbIndex uint64 - db *bolt.DB - err error - ) - b.Lock() - defer b.Unlock() - - dbval := make([]byte, metadatalen) - - if db, err = b.getDBhandle(); err != nil { - return false, nil, err - } - defer b.releaseDBhandle() - - err = db.Update(func(tx *bolt.Tx) error { - var err error - bucket := tx.Bucket(b.boltBucket) - if bucket == nil { - if previous != nil { - return store.ErrKeyNotFound - } - bucket, err = tx.CreateBucket(b.boltBucket) - if err != nil { - return err - } - } - // AtomicPut is equivalent to Put if previous is nil and the Ky - // doesn't exist in the DB. - val = bucket.Get([]byte(key)) - if previous == nil && len(val) != 0 { - return store.ErrKeyExists - } - if previous != nil { - if len(val) == 0 { - return store.ErrKeyNotFound - } - dbIndex = binary.LittleEndian.Uint64(val[:metadatalen]) - if dbIndex != previous.LastIndex { - return store.ErrKeyModified - } - } - dbIndex = atomic.AddUint64(&b.dbIndex, 1) - binary.LittleEndian.PutUint64(dbval, b.dbIndex) - dbval = append(dbval, value...) - return (bucket.Put([]byte(key), dbval)) - }) - if err != nil { - return false, nil, err - } - - updated := &store.KVPair{ - Key: key, - Value: value, - LastIndex: dbIndex, - } - - return true, updated, nil -} - -// Close the db connection to the BoltDB -func (b *BoltDB) Close() { - b.Lock() - defer b.Unlock() - - if !b.PersistConnection { - b.reset() - } else { - b.client.Close() - } - return -} - -// DeleteTree deletes a range of keys with a given prefix -func (b *BoltDB) DeleteTree(keyPrefix string) error { - var ( - db *bolt.DB - err error - ) - b.Lock() - defer b.Unlock() - - if db, err = b.getDBhandle(); err != nil { - return err - } - defer b.releaseDBhandle() - - err = db.Update(func(tx *bolt.Tx) error { - bucket := tx.Bucket(b.boltBucket) - if bucket == nil { - return store.ErrKeyNotFound - } - - cursor := bucket.Cursor() - prefix := []byte(keyPrefix) - - for key, _ := cursor.Seek(prefix); bytes.HasPrefix(key, prefix); key, _ = cursor.Next() { - _ = bucket.Delete([]byte(key)) - } - return nil - }) - - return err -} - -// NewLock has to implemented at the library level since its not supported by BoltDB -func (b *BoltDB) NewLock(key string, options *store.LockOptions) (store.Locker, error) { - return nil, store.ErrCallNotSupported -} - -// Watch has to implemented at the library level since its not supported by BoltDB -func (b *BoltDB) Watch(key string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan *store.KVPair, error) { - return nil, store.ErrCallNotSupported -} - -// WatchTree has to implemented at the library level since its not supported by BoltDB -func (b *BoltDB) WatchTree(directory string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan []*store.KVPair, error) { - return nil, store.ErrCallNotSupported -} diff --git a/vendor/github.com/abronan/valkeyrie/store/consul/consul.go b/vendor/github.com/abronan/valkeyrie/store/consul/consul.go deleted file mode 100644 index aeb176409..000000000 --- a/vendor/github.com/abronan/valkeyrie/store/consul/consul.go +++ /dev/null @@ -1,575 +0,0 @@ -package consul - -import ( - "crypto/tls" - "errors" - "net/http" - "strings" - "sync" - "time" - - "github.com/abronan/valkeyrie" - "github.com/abronan/valkeyrie/store" - api "github.com/hashicorp/consul/api" -) - -const ( - // DefaultWatchWaitTime is how long we block for at a - // time to check if the watched key has changed. This - // affects the minimum time it takes to cancel a watch. - DefaultWatchWaitTime = 15 * time.Second - - // RenewSessionRetryMax is the number of time we should try - // to renew the session before giving up and throwing an error - RenewSessionRetryMax = 5 - - // MaxSessionDestroyAttempts is the maximum times we will try - // to explicitly destroy the session attached to a lock after - // the connectivity to the store has been lost - MaxSessionDestroyAttempts = 5 - - // defaultLockTTL is the default ttl for the consul lock - defaultLockTTL = 20 * time.Second -) - -var ( - // ErrMultipleEndpointsUnsupported is thrown when there are - // multiple endpoints specified for Consul - ErrMultipleEndpointsUnsupported = errors.New("consul does not support multiple endpoints") - - // ErrSessionRenew is thrown when the session can't be - // renewed because the Consul version does not support sessions - ErrSessionRenew = errors.New("cannot set or renew session for ttl, unable to operate on sessions") -) - -// Consul is the receiver type for the -// Store interface -type Consul struct { - sync.Mutex - config *api.Config - client *api.Client -} - -type consulLock struct { - lock *api.Lock - renewCh chan struct{} -} - -// Register registers consul to valkeyrie -func Register() { - valkeyrie.AddStore(store.CONSUL, New) -} - -// New creates a new Consul client given a list -// of endpoints and optional tls config -func New(endpoints []string, options *store.Config) (store.Store, error) { - if len(endpoints) > 1 { - return nil, ErrMultipleEndpointsUnsupported - } - - s := &Consul{} - - // Create Consul client - config := api.DefaultConfig() - s.config = config - config.HttpClient = http.DefaultClient - config.Address = endpoints[0] - - // Set options - if options != nil { - if options.TLS != nil { - s.setTLS(options.TLS) - } - if options.ConnectionTimeout != 0 { - s.setTimeout(options.ConnectionTimeout) - } - } - - // Creates a new client - client, err := api.NewClient(config) - if err != nil { - return nil, err - } - s.client = client - - return s, nil -} - -// SetTLS sets Consul TLS options -func (s *Consul) setTLS(tls *tls.Config) { - s.config.HttpClient.Transport = &http.Transport{ - TLSClientConfig: tls, - } - s.config.Scheme = "https" -} - -// SetTimeout sets the timeout for connecting to Consul -func (s *Consul) setTimeout(time time.Duration) { - s.config.WaitTime = time -} - -// Normalize the key for usage in Consul -func (s *Consul) normalize(key string) string { - key = store.Normalize(key) - return strings.TrimPrefix(key, "/") -} - -func (s *Consul) renewSession(pair *api.KVPair, ttl time.Duration) error { - // Check if there is any previous session with an active TTL - session, err := s.getActiveSession(pair.Key) - if err != nil { - return err - } - - if session == "" { - entry := &api.SessionEntry{ - Behavior: api.SessionBehaviorDelete, // Delete the key when the session expires - TTL: (ttl / 2).String(), // Consul multiplies the TTL by 2x - LockDelay: 1 * time.Millisecond, // Virtually disable lock delay - } - - // Create the key session - session, _, err = s.client.Session().Create(entry, nil) - if err != nil { - return err - } - - lockOpts := &api.LockOptions{ - Key: pair.Key, - Session: session, - } - - // Lock and ignore if lock is held - // It's just a placeholder for the - // ephemeral behavior - lock, _ := s.client.LockOpts(lockOpts) - if lock != nil { - lock.Lock(nil) - } - } - - _, _, err = s.client.Session().Renew(session, nil) - return err -} - -// getActiveSession checks if the key already has -// a session attached -func (s *Consul) getActiveSession(key string) (string, error) { - pair, _, err := s.client.KV().Get(key, nil) - if err != nil { - return "", err - } - if pair != nil && pair.Session != "" { - return pair.Session, nil - } - return "", nil -} - -// Get the value at "key", returns the last modified index -// to use in conjunction to CAS calls -func (s *Consul) Get(key string, opts *store.ReadOptions) (*store.KVPair, error) { - options := &api.QueryOptions{ - AllowStale: false, - RequireConsistent: true, - } - - // Get options - if opts != nil { - options.RequireConsistent = opts.Consistent - } - - pair, meta, err := s.client.KV().Get(s.normalize(key), options) - if err != nil { - return nil, err - } - - // If pair is nil then the key does not exist - if pair == nil { - return nil, store.ErrKeyNotFound - } - - return &store.KVPair{Key: pair.Key, Value: pair.Value, LastIndex: meta.LastIndex}, nil -} - -// Put a value at "key" -func (s *Consul) Put(key string, value []byte, opts *store.WriteOptions) error { - key = s.normalize(key) - - p := &api.KVPair{ - Key: key, - Value: value, - Flags: api.LockFlagValue, - } - - if opts != nil && opts.TTL > 0 { - // Create or renew a session holding a TTL. Operations on sessions - // are not deterministic: creating or renewing a session can fail - for retry := 1; retry <= RenewSessionRetryMax; retry++ { - err := s.renewSession(p, opts.TTL) - if err == nil { - break - } - if retry == RenewSessionRetryMax { - return ErrSessionRenew - } - } - } - - _, err := s.client.KV().Put(p, nil) - return err -} - -// Delete a value at "key" -func (s *Consul) Delete(key string) error { - if _, err := s.Get(key, nil); err != nil { - return err - } - _, err := s.client.KV().Delete(s.normalize(key), nil) - return err -} - -// Exists checks that the key exists inside the store -func (s *Consul) Exists(key string, opts *store.ReadOptions) (bool, error) { - _, err := s.Get(key, opts) - if err != nil { - if err == store.ErrKeyNotFound { - return false, nil - } - return false, err - } - return true, nil -} - -// List child nodes of a given directory -func (s *Consul) List(directory string, opts *store.ReadOptions) ([]*store.KVPair, error) { - options := &api.QueryOptions{ - AllowStale: false, - RequireConsistent: true, - } - - if opts != nil { - if !opts.Consistent { - options.AllowStale = true - options.RequireConsistent = false - } - } - - pairs, _, err := s.client.KV().List(s.normalize(directory), options) - if err != nil { - return nil, err - } - if len(pairs) == 0 { - return nil, store.ErrKeyNotFound - } - - kv := []*store.KVPair{} - - for _, pair := range pairs { - if pair.Key == directory { - continue - } - kv = append(kv, &store.KVPair{ - Key: pair.Key, - Value: pair.Value, - LastIndex: pair.ModifyIndex, - }) - } - - return kv, nil -} - -// DeleteTree deletes a range of keys under a given directory -func (s *Consul) DeleteTree(directory string) error { - if _, err := s.List(directory, nil); err != nil { - return err - } - _, err := s.client.KV().DeleteTree(s.normalize(directory), nil) - return err -} - -// Watch for changes on a "key" -// It returns a channel that will receive changes or pass -// on errors. Upon creation, the current value will first -// be sent to the channel. Providing a non-nil stopCh can -// be used to stop watching. -func (s *Consul) Watch(key string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan *store.KVPair, error) { - kv := s.client.KV() - watchCh := make(chan *store.KVPair) - - go func() { - defer close(watchCh) - - // Use a wait time in order to check if we should quit - // from time to time. - opts := &api.QueryOptions{WaitTime: DefaultWatchWaitTime} - - for { - // Check if we should quit - select { - case <-stopCh: - return - default: - } - - // Get the key - pair, meta, err := kv.Get(key, opts) - if err != nil { - return - } - - // If LastIndex didn't change then it means `Get` returned - // because of the WaitTime and the key didn't changed. - if opts.WaitIndex == meta.LastIndex { - continue - } - opts.WaitIndex = meta.LastIndex - - // Return the value to the channel - if pair != nil { - watchCh <- &store.KVPair{ - Key: pair.Key, - Value: pair.Value, - LastIndex: pair.ModifyIndex, - } - } - } - }() - - return watchCh, nil -} - -// WatchTree watches for changes on a "directory" -// It returns a channel that will receive changes or pass -// on errors. Upon creating a watch, the current childs values -// will be sent to the channel .Providing a non-nil stopCh can -// be used to stop watching. -func (s *Consul) WatchTree(directory string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan []*store.KVPair, error) { - kv := s.client.KV() - watchCh := make(chan []*store.KVPair) - - go func() { - defer close(watchCh) - - // Use a wait time in order to check if we should quit - // from time to time. - opts := &api.QueryOptions{WaitTime: DefaultWatchWaitTime} - for { - // Check if we should quit - select { - case <-stopCh: - return - default: - } - - // Get all the childrens - pairs, meta, err := kv.List(directory, opts) - if err != nil { - return - } - - // If LastIndex didn't change then it means `Get` returned - // because of the WaitTime and the child keys didn't change. - if opts.WaitIndex == meta.LastIndex { - continue - } - opts.WaitIndex = meta.LastIndex - - // Return children KV pairs to the channel - kvpairs := []*store.KVPair{} - for _, pair := range pairs { - if pair.Key == directory { - continue - } - kvpairs = append(kvpairs, &store.KVPair{ - Key: pair.Key, - Value: pair.Value, - LastIndex: pair.ModifyIndex, - }) - } - watchCh <- kvpairs - } - }() - - return watchCh, nil -} - -// NewLock returns a handle to a lock struct which can -// be used to provide mutual exclusion on a key -func (s *Consul) NewLock(key string, options *store.LockOptions) (store.Locker, error) { - lockOpts := &api.LockOptions{ - Key: s.normalize(key), - } - - lock := &consulLock{} - - ttl := defaultLockTTL - - if options != nil { - // Set optional TTL on Lock - if options.TTL != 0 { - ttl = options.TTL - } - // Set optional value on Lock - if options.Value != nil { - lockOpts.Value = options.Value - } - } - - entry := &api.SessionEntry{ - Behavior: api.SessionBehaviorRelease, // Release the lock when the session expires - TTL: (ttl / 2).String(), // Consul multiplies the TTL by 2x - LockDelay: 1 * time.Millisecond, // Virtually disable lock delay - } - - // Create the key session - session, _, err := s.client.Session().Create(entry, nil) - if err != nil { - return nil, err - } - - // Place the session and renew chan on lock - lockOpts.Session = session - lock.renewCh = options.RenewLock - - l, err := s.client.LockOpts(lockOpts) - if err != nil { - return nil, err - } - - // Renew the session ttl lock periodically - s.renewLockSession(entry.TTL, session, options.RenewLock) - - lock.lock = l - return lock, nil -} - -// renewLockSession is used to renew a session Lock, it takes -// a stopRenew chan which is used to explicitly stop the session -// renew process. The renew routine never stops until a signal is -// sent to this channel. If deleting the session fails because the -// connection to the store is lost, it keeps trying to delete the -// session periodically until it can contact the store, this ensures -// that the lock is not maintained indefinitely which ensures liveness -// over safety for the lock when the store becomes unavailable. -func (s *Consul) renewLockSession(initialTTL string, id string, stopRenew chan struct{}) { - sessionDestroyAttempts := 0 - ttl, err := time.ParseDuration(initialTTL) - if err != nil { - return - } - go func() { - for { - select { - case <-time.After(ttl / 2): - entry, _, err := s.client.Session().Renew(id, nil) - if err != nil { - // If an error occurs, continue until the - // session gets destroyed explicitly or - // the session ttl times out - continue - } - if entry == nil { - return - } - - // Handle the server updating the TTL - ttl, _ = time.ParseDuration(entry.TTL) - - case <-stopRenew: - // Attempt a session destroy - _, err := s.client.Session().Destroy(id, nil) - if err == nil { - return - } - - // We cannot destroy the session because the store - // is unavailable, wait for the session renew period. - // Give up after 'MaxSessionDestroyAttempts'. - sessionDestroyAttempts++ - - if sessionDestroyAttempts >= MaxSessionDestroyAttempts { - return - } - - time.Sleep(ttl / 2) - } - } - }() -} - -// Lock attempts to acquire the lock and blocks while -// doing so. It returns a channel that is closed if our -// lock is lost or if an error occurs -func (l *consulLock) Lock(stopChan chan struct{}) (<-chan struct{}, error) { - return l.lock.Lock(stopChan) -} - -// Unlock the "key". Calling unlock while -// not holding the lock will throw an error -func (l *consulLock) Unlock() error { - if l.renewCh != nil { - close(l.renewCh) - } - return l.lock.Unlock() -} - -// AtomicPut put a value at "key" if the key has not been -// modified in the meantime, throws an error if this is the case -func (s *Consul) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error) { - - p := &api.KVPair{Key: s.normalize(key), Value: value, Flags: api.LockFlagValue} - - if previous == nil { - // Consul interprets ModifyIndex = 0 as new key. - p.ModifyIndex = 0 - } else { - p.ModifyIndex = previous.LastIndex - } - - ok, _, err := s.client.KV().CAS(p, nil) - if err != nil { - return false, nil, err - } - if !ok { - if previous == nil { - return false, nil, store.ErrKeyExists - } - return false, nil, store.ErrKeyModified - } - - pair, err := s.Get(key, nil) - if err != nil { - return false, nil, err - } - - return true, pair, nil -} - -// AtomicDelete deletes a value at "key" if the key has not -// been modified in the meantime, throws an error if this is the case -func (s *Consul) AtomicDelete(key string, previous *store.KVPair) (bool, error) { - if previous == nil { - return false, store.ErrPreviousNotSpecified - } - - p := &api.KVPair{Key: s.normalize(key), ModifyIndex: previous.LastIndex, Flags: api.LockFlagValue} - - // Extra Get operation to check on the key - _, err := s.Get(key, nil) - if err != nil && err == store.ErrKeyNotFound { - return false, err - } - - if work, _, err := s.client.KV().DeleteCAS(p, nil); err != nil { - return false, err - } else if !work { - return false, store.ErrKeyModified - } - - return true, nil -} - -// Close closes the client connection -func (s *Consul) Close() { - return -} diff --git a/vendor/github.com/abronan/valkeyrie/store/etcd/v3/etcd.go b/vendor/github.com/abronan/valkeyrie/store/etcd/v3/etcd.go deleted file mode 100644 index 7f54cc9fd..000000000 --- a/vendor/github.com/abronan/valkeyrie/store/etcd/v3/etcd.go +++ /dev/null @@ -1,534 +0,0 @@ -package etcdv3 - -import ( - "context" - "crypto/tls" - "strings" - "sync" - "time" - - "github.com/abronan/valkeyrie" - "github.com/abronan/valkeyrie/store" - etcd "github.com/coreos/etcd/clientv3" - "github.com/coreos/etcd/clientv3/concurrency" -) - -const ( - defaultLockTTL = 20 * time.Second - etcdDefaultTimeout = 5 * time.Second - lockSuffix = "___lock" -) - -// EtcdV3 is the receiver type for the -// Store interface -type EtcdV3 struct { - client *etcd.Client -} - -type etcdLock struct { - lock sync.Mutex - store *EtcdV3 - - mutex *concurrency.Mutex - session *concurrency.Session - - mutexKey string // mutexKey is the key to write appended with a "_lock" suffix - writeKey string // writeKey is the actual key to update protected by the mutexKey - value string - ttl time.Duration -} - -// Register registers etcd to valkeyrie -func Register() { - valkeyrie.AddStore(store.ETCDV3, New) -} - -// New creates a new Etcd client given a list -// of endpoints and an optional tls config -func New(addrs []string, options *store.Config) (store.Store, error) { - s := &EtcdV3{} - - var ( - entries []string - err error - ) - - entries = store.CreateEndpoints(addrs, "http") - cfg := &etcd.Config{ - Endpoints: entries, - } - - // Set options - if options != nil { - if options.TLS != nil { - setTLS(cfg, options.TLS, addrs) - } - if options.ConnectionTimeout != 0 { - setTimeout(cfg, options.ConnectionTimeout) - } - if options.Username != "" { - setCredentials(cfg, options.Username, options.Password) - } - if options.SyncPeriod != 0 { - cfg.AutoSyncInterval = options.SyncPeriod - } - } - - s.client, err = etcd.New(*cfg) - if err != nil { - return nil, err - } - - return s, nil -} - -// setTLS sets the tls configuration given a tls.Config scheme -func setTLS(cfg *etcd.Config, tls *tls.Config, addrs []string) { - entries := store.CreateEndpoints(addrs, "https") - cfg.Endpoints = entries - cfg.TLS = tls -} - -// setTimeout sets the timeout used for connecting to the store -func setTimeout(cfg *etcd.Config, time time.Duration) { - cfg.DialTimeout = time -} - -// setCredentials sets the username/password credentials for connecting to Etcd -func setCredentials(cfg *etcd.Config, username, password string) { - cfg.Username = username - cfg.Password = password -} - -// Normalize the key for usage in Etcd -func (s *EtcdV3) normalize(key string) string { - key = store.Normalize(key) - return strings.TrimPrefix(key, "/") -} - -// Get the value at "key", returns the last modified -// index to use in conjunction to Atomic calls -func (s *EtcdV3) Get(key string, opts *store.ReadOptions) (pair *store.KVPair, err error) { - ctx, cancel := context.WithTimeout(context.Background(), etcdDefaultTimeout) - - var result *etcd.GetResponse - - if opts != nil && !opts.Consistent { - result, err = s.client.KV.Get(ctx, s.normalize(key), etcd.WithSerializable()) - } else { - result, err = s.client.KV.Get(ctx, s.normalize(key)) - } - - cancel() - - if err != nil { - return nil, err - } - - if result.Count == 0 { - return nil, store.ErrKeyNotFound - } - - kvs := []*store.KVPair{} - - for _, pair := range result.Kvs { - kvs = append(kvs, &store.KVPair{ - Key: string(pair.Key), - Value: []byte(pair.Value), - LastIndex: uint64(pair.ModRevision), - }) - } - - return kvs[0], nil -} - -// Put a value at "key" -func (s *EtcdV3) Put(key string, value []byte, opts *store.WriteOptions) (err error) { - ctx, cancel := context.WithTimeout(context.Background(), etcdDefaultTimeout) - pr := s.client.Txn(ctx) - - if opts != nil && opts.TTL > 0 { - lease := etcd.NewLease(s.client) - resp, err := lease.Grant(context.Background(), int64(opts.TTL/time.Second)) - if err != nil { - cancel() - return err - } - pr.Then(etcd.OpPut(key, string(value), etcd.WithLease(resp.ID))) - } else { - pr.Then(etcd.OpPut(key, string(value))) - } - - _, err = pr.Commit() - cancel() - if err != nil { - return err - } - - return nil -} - -// Delete a value at "key" -func (s *EtcdV3) Delete(key string) error { - resp, err := s.client.KV.Delete(context.Background(), s.normalize(key)) - if resp.Deleted == 0 { - return store.ErrKeyNotFound - } - return err -} - -// Exists checks if the key exists inside the store -func (s *EtcdV3) Exists(key string, opts *store.ReadOptions) (bool, error) { - _, err := s.Get(key, opts) - if err != nil { - if err == store.ErrKeyNotFound { - return false, nil - } - return false, err - } - return true, nil -} - -// Watch for changes on a "key" -// It returns a channel that will receive changes or pass -// on errors. Upon creation, the current value will first -// be sent to the channel. Providing a non-nil stopCh can -// be used to stop watching. -func (s *EtcdV3) Watch(key string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan *store.KVPair, error) { - wc := etcd.NewWatcher(s.client) - - // respCh is sending back events to the caller - respCh := make(chan *store.KVPair) - - // Get the current value - pair, err := s.Get(key, opts) - if err != nil { - return nil, err - } - - go func() { - defer wc.Close() - defer close(respCh) - - // Push the current value through the channel. - respCh <- pair - - watchCh := wc.Watch(context.Background(), s.normalize(key)) - - for resp := range watchCh { - // Check if the watch was stopped by the caller - select { - case <-stopCh: - return - default: - } - - for _, ev := range resp.Events { - respCh <- &store.KVPair{ - Key: key, - Value: []byte(ev.Kv.Value), - LastIndex: uint64(ev.Kv.ModRevision), - } - } - } - }() - - return respCh, nil -} - -// WatchTree watches for changes on a "directory" -// It returns a channel that will receive changes or pass -// on errors. Upon creating a watch, the current childs values -// will be sent to the channel. Providing a non-nil stopCh can -// be used to stop watching. -func (s *EtcdV3) WatchTree(directory string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan []*store.KVPair, error) { - wc := etcd.NewWatcher(s.client) - - // respCh is sending back events to the caller - respCh := make(chan []*store.KVPair) - - // Get the current value - rev, pairs, err := s.list(directory, opts) - if err != nil { - return nil, err - } - - go func() { - defer wc.Close() - defer close(respCh) - - // Push the current value through the channel. - respCh <- pairs - - rev++ - watchCh := wc.Watch(context.Background(), s.normalize(directory), etcd.WithPrefix(), etcd.WithRev(rev)) - - for resp := range watchCh { - // Check if the watch was stopped by the caller - select { - case <-stopCh: - return - default: - } - - list := make([]*store.KVPair, len(resp.Events)) - - for i, ev := range resp.Events { - list[i] = &store.KVPair{ - Key: string(ev.Kv.Key), - Value: []byte(ev.Kv.Value), - LastIndex: uint64(ev.Kv.ModRevision), - } - } - - respCh <- list - } - }() - - return respCh, nil -} - -// AtomicPut puts a value at "key" if the key has not been -// modified in the meantime, throws an error if this is the case -func (s *EtcdV3) AtomicPut(key string, value []byte, previous *store.KVPair, opts *store.WriteOptions) (bool, *store.KVPair, error) { - var cmp etcd.Cmp - var testIndex bool - - if previous != nil { - // We compare on the last modified index - testIndex = true - cmp = etcd.Compare(etcd.ModRevision(key), "=", int64(previous.LastIndex)) - } else { - // Previous key is not given, thus we want the key not to exist - testIndex = false - cmp = etcd.Compare(etcd.CreateRevision(key), "=", 0) - } - - ctx, cancel := context.WithTimeout(context.Background(), etcdDefaultTimeout) - pr := s.client.Txn(ctx).If(cmp) - - // We set the TTL if given - if opts != nil && opts.TTL > 0 { - lease := etcd.NewLease(s.client) - resp, err := lease.Grant(context.Background(), int64(opts.TTL/time.Second)) - if err != nil { - cancel() - return false, nil, err - } - pr.Then(etcd.OpPut(key, string(value), etcd.WithLease(resp.ID))) - } else { - pr.Then(etcd.OpPut(key, string(value))) - } - - txn, err := pr.Commit() - cancel() - if err != nil { - return false, nil, err - } - - if !txn.Succeeded { - if testIndex { - return false, nil, store.ErrKeyModified - } - return false, nil, store.ErrKeyExists - } - - updated := &store.KVPair{ - Key: key, - Value: value, - LastIndex: uint64(txn.Header.Revision), - } - - return true, updated, nil -} - -// AtomicDelete deletes a value at "key" if the key -// has not been modified in the meantime, throws an -// error if this is the case -func (s *EtcdV3) AtomicDelete(key string, previous *store.KVPair) (bool, error) { - if previous == nil { - return false, store.ErrPreviousNotSpecified - } - - // We compare on the last modified index - cmp := etcd.Compare(etcd.ModRevision(key), "=", int64(previous.LastIndex)) - - ctx, cancel := context.WithTimeout(context.Background(), etcdDefaultTimeout) - txn, err := s.client.Txn(ctx). - If(cmp). - Then(etcd.OpDelete(key)). - Commit() - cancel() - - if err != nil { - return false, err - } - - if len(txn.Responses) == 0 { - return false, store.ErrKeyNotFound - } - - if !txn.Succeeded { - return false, store.ErrKeyModified - } - - return true, nil -} - -// List child nodes of a given directory -func (s *EtcdV3) List(directory string, opts *store.ReadOptions) ([]*store.KVPair, error) { - _, kv, err := s.list(directory, opts) - return kv, err -} - -// DeleteTree deletes a range of keys under a given directory -func (s *EtcdV3) DeleteTree(directory string) error { - ctx, cancel := context.WithTimeout(context.Background(), etcdDefaultTimeout) - resp, err := s.client.KV.Delete(ctx, s.normalize(directory), etcd.WithPrefix()) - cancel() - if resp.Deleted == 0 { - return store.ErrKeyNotFound - } - return err -} - -// NewLock returns a handle to a lock struct which can -// be used to provide mutual exclusion on a key -func (s *EtcdV3) NewLock(key string, options *store.LockOptions) (lock store.Locker, err error) { - var value string - ttl := defaultLockTTL - renewCh := make(chan struct{}) - - // Apply options on Lock - if options != nil { - if options.Value != nil { - value = string(options.Value) - } - if options.TTL != 0 { - ttl = options.TTL - } - if options.RenewLock != nil { - renewCh = options.RenewLock - } - } - - // Create Session for Mutex - session, err := concurrency.NewSession(s.client, concurrency.WithTTL(int(ttl/time.Second))) - if err != nil { - return nil, err - } - - go func() { - <-renewCh - session.Close() - return - }() - - // A Mutex is a simple key that can only be held by a single process. - // An etcd mutex behaves like a Zookeeper lock: a side key is created with - // a suffix (such as "_lock") and represents the mutex. Thus we have a pair - // composed of the key to protect with a lock: "/key", and a side key that - // acts as the lock: "/key_lock" - mutexKey := s.normalize(key + lockSuffix) - writeKey := s.normalize(key) - - // Create lock object - lock = &etcdLock{ - store: s, - mutex: concurrency.NewMutex(session, mutexKey), - session: session, - mutexKey: mutexKey, - writeKey: writeKey, - value: value, - ttl: ttl, - } - - return lock, nil -} - -// Lock attempts to acquire the lock and blocks while -// doing so. It returns a channel that is closed if our -// lock is lost or if an error occurs -func (l *etcdLock) Lock(stopChan chan struct{}) (<-chan struct{}, error) { - l.lock.Lock() - defer l.lock.Unlock() - - ctx, cancel := context.WithCancel(context.Background()) - go func() { - <-stopChan - cancel() - }() - err := l.mutex.Lock(ctx) - if err != nil { - if err == context.Canceled { - return nil, nil - } - return nil, err - } - - err = l.store.Put(l.writeKey, []byte(l.value), nil) - if err != nil { - return nil, err - } - - return l.session.Done(), nil -} - -// Unlock the "key". Calling unlock while -// not holding the lock will throw an error -func (l *etcdLock) Unlock() error { - l.lock.Lock() - defer l.lock.Unlock() - - return l.mutex.Unlock(context.Background()) -} - -// Close closes the client connection -func (s *EtcdV3) Close() { - s.client.Close() -} - -// list child nodes of a given directory and return revision number -func (s *EtcdV3) list(directory string, opts *store.ReadOptions) (int64, []*store.KVPair, error) { - ctx, cancel := context.WithTimeout(context.Background(), etcdDefaultTimeout) - - var resp *etcd.GetResponse - var err error - - if opts != nil && !opts.Consistent { - resp, err = s.client.KV.Get(ctx, s.normalize(directory), etcd.WithSerializable(), etcd.WithPrefix(), etcd.WithSort(etcd.SortByKey, etcd.SortDescend)) - } else { - resp, err = s.client.KV.Get(ctx, s.normalize(directory), etcd.WithPrefix(), etcd.WithSort(etcd.SortByKey, etcd.SortDescend)) - } - - cancel() - - if err != nil { - return 0, nil, err - } - - if resp.Count == 0 { - return 0, nil, store.ErrKeyNotFound - } - - kv := []*store.KVPair{} - - for _, n := range resp.Kvs { - if string(n.Key) == directory { - continue - } - - // Filter out etcd mutex side keys with `___lock` suffix - if strings.Contains(string(n.Key), lockSuffix) { - continue - } - - kv = append(kv, &store.KVPair{ - Key: string(n.Key), - Value: []byte(n.Value), - LastIndex: uint64(n.ModRevision), - }) - } - - return resp.Header.Revision, kv, nil -} diff --git a/vendor/github.com/abronan/valkeyrie/store/zookeeper/zookeeper.go b/vendor/github.com/abronan/valkeyrie/store/zookeeper/zookeeper.go deleted file mode 100644 index 40f2834ba..000000000 --- a/vendor/github.com/abronan/valkeyrie/store/zookeeper/zookeeper.go +++ /dev/null @@ -1,593 +0,0 @@ -package zookeeper - -import ( - "strings" - "time" - - "github.com/abronan/valkeyrie" - "github.com/abronan/valkeyrie/store" - zk "github.com/samuel/go-zookeeper/zk" -) - -const ( - // SOH control character - SOH = "\x01" - - defaultTimeout = 10 * time.Second - - syncRetryLimit = 5 -) - -// Zookeeper is the receiver type for -// the Store interface -type Zookeeper struct { - timeout time.Duration - client *zk.Conn -} - -type zookeeperLock struct { - client *zk.Conn - lock *zk.Lock - key string - value []byte -} - -// Register registers zookeeper to valkeyrie -func Register() { - valkeyrie.AddStore(store.ZK, New) -} - -// New creates a new Zookeeper client given a -// list of endpoints and an optional tls config -func New(endpoints []string, options *store.Config) (store.Store, error) { - s := &Zookeeper{} - s.timeout = defaultTimeout - - // Set options - if options != nil { - if options.ConnectionTimeout != 0 { - s.setTimeout(options.ConnectionTimeout) - } - } - - // Connect to Zookeeper - conn, _, err := zk.Connect(endpoints, s.timeout) - if err != nil { - return nil, err - } - s.client = conn - - return s, nil -} - -// setTimeout sets the timeout for connecting to Zookeeper -func (s *Zookeeper) setTimeout(time time.Duration) { - s.timeout = time -} - -// Get the value at "key", returns the last modified index -// to use in conjunction to Atomic calls -func (s *Zookeeper) Get(key string, opts *store.ReadOptions) (pair *store.KVPair, err error) { - - resp, meta, err := s.get(key) - if err != nil { - return nil, err - } - - pair = &store.KVPair{ - Key: key, - Value: resp, - LastIndex: uint64(meta.Version), - } - - return pair, nil -} - -// createFullPath creates the entire path for a directory -// that does not exist and sets the value of the last -// znode to data -func (s *Zookeeper) createFullPath(path []string, data []byte, ephemeral bool) error { - for i := 1; i <= len(path); i++ { - newpath := "/" + strings.Join(path[:i], "/") - - if i == len(path) { - flag := 0 - if ephemeral { - flag = zk.FlagEphemeral - } - _, err := s.client.Create(newpath, data, int32(flag), zk.WorldACL(zk.PermAll)) - return err - } - - _, err := s.client.Create(newpath, []byte{}, 0, zk.WorldACL(zk.PermAll)) - if err != nil { - // Skip if node already exists - if err != zk.ErrNodeExists { - return err - } - } - } - return nil -} - -// Put a value at "key" -func (s *Zookeeper) Put(key string, value []byte, opts *store.WriteOptions) error { - fkey := s.normalize(key) - - exists, err := s.Exists(key, nil) - if err != nil { - return err - } - - if !exists { - if opts != nil && opts.TTL > 0 { - s.createFullPath(store.SplitKey(strings.TrimSuffix(key, "/")), value, true) - } else { - s.createFullPath(store.SplitKey(strings.TrimSuffix(key, "/")), value, false) - } - } else { - _, err = s.client.Set(fkey, value, -1) - } - - return err -} - -// Delete a value at "key" -func (s *Zookeeper) Delete(key string) error { - err := s.client.Delete(s.normalize(key), -1) - if err == zk.ErrNoNode { - return store.ErrKeyNotFound - } - return err -} - -// Exists checks if the key exists inside the store -func (s *Zookeeper) Exists(key string, opts *store.ReadOptions) (bool, error) { - exists, _, err := s.client.Exists(s.normalize(key)) - if err != nil { - return false, err - } - return exists, nil -} - -// Watch for changes on a "key" -// It returns a channel that will receive changes or pass -// on errors. Upon creation, the current value will first -// be sent to the channel. Providing a non-nil stopCh can -// be used to stop watching. -func (s *Zookeeper) Watch(key string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan *store.KVPair, error) { - // Catch zk notifications and fire changes into the channel. - watchCh := make(chan *store.KVPair) - go func() { - defer close(watchCh) - - var fireEvt = true - for { - resp, meta, eventCh, err := s.getW(key) - if err != nil { - return - } - if fireEvt { - watchCh <- &store.KVPair{ - Key: key, - Value: resp, - LastIndex: uint64(meta.Version), - } - } - select { - case e := <-eventCh: - // Only fire an event if the data in the node changed. - // Simply reset the watch if this is any other event - // (e.g. a session event). - fireEvt = e.Type == zk.EventNodeDataChanged - case <-stopCh: - // There is no way to stop GetW so just quit - return - } - } - }() - - return watchCh, nil -} - -// WatchTree watches for changes on a "directory" -// It returns a channel that will receive changes or pass -// on errors. Upon creating a watch, the current childs values -// will be sent to the channel .Providing a non-nil stopCh can -// be used to stop watching. -func (s *Zookeeper) WatchTree(directory string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan []*store.KVPair, error) { - // Catch zk notifications and fire changes into the channel. - watchCh := make(chan []*store.KVPair) - go func() { - defer close(watchCh) - - var fireEvt = true - for { - WATCH: - keys, _, eventCh, err := s.client.ChildrenW(s.normalize(directory)) - if err != nil { - return - } - if fireEvt { - kvs, err := s.getListWithPath(directory, keys, opts) - if err != nil { - // Failed to get values for one or more of the keys, - // the list may be out of date so try again. - goto WATCH - } - watchCh <- kvs - } - select { - case e := <-eventCh: - // Only fire an event if the children have changed. - // Simply reset the watch if this is any other event - // (e.g. a session event). - fireEvt = e.Type == zk.EventNodeChildrenChanged - case <-stopCh: - // There is no way to stop ChildrenW so just quit - return - } - } - }() - - return watchCh, nil -} - -// listChildren lists the direct children of a directory -func (s *Zookeeper) listChildren(directory string) ([]string, error) { - children, _, err := s.client.Children(s.normalize(directory)) - if err != nil { - if err == zk.ErrNoNode { - return nil, store.ErrKeyNotFound - } - return nil, err - } - return children, nil -} - -// listChildrenRecursive lists the children of a directory as well as -// all the descending childs from sub-folders in a recursive fashion. -func (s *Zookeeper) listChildrenRecursive(list *[]string, directory string) error { - children, err := s.listChildren(directory) - if err != nil { - return err - } - - // We reached a leaf. - if len(children) == 0 { - return nil - } - - for _, c := range children { - c = strings.TrimSuffix(directory, "/") + "/" + c - err := s.listChildrenRecursive(list, c) - if err != nil && err != zk.ErrNoChildrenForEphemerals { - return err - } - *list = append(*list, c) - } - - return nil -} - -// List child nodes of a given directory -func (s *Zookeeper) List(directory string, opts *store.ReadOptions) ([]*store.KVPair, error) { - children := make([]string, 0) - err := s.listChildrenRecursive(&children, directory) - if err != nil { - return nil, err - } - - kvs, err := s.getList(children, opts) - if err != nil { - // If node is not found: List is out of date, retry - if err == store.ErrKeyNotFound { - return s.List(directory, opts) - } - return nil, err - } - - return kvs, nil -} - -// DeleteTree deletes a range of keys under a given directory -func (s *Zookeeper) DeleteTree(directory string) error { - children, err := s.listChildren(directory) - if err != nil { - return err - } - - var reqs []interface{} - - for _, c := range children { - reqs = append(reqs, &zk.DeleteRequest{ - Path: s.normalize(directory + "/" + c), - Version: -1, - }) - } - - _, err = s.client.Multi(reqs...) - return err -} - -// AtomicPut put a value at "key" if the key has not been -// modified in the meantime, throws an error if this is the case -func (s *Zookeeper) AtomicPut(key string, value []byte, previous *store.KVPair, _ *store.WriteOptions) (bool, *store.KVPair, error) { - var lastIndex uint64 - - if previous != nil { - meta, err := s.client.Set(s.normalize(key), value, int32(previous.LastIndex)) - if err != nil { - // Compare Failed - if err == zk.ErrBadVersion { - return false, nil, store.ErrKeyModified - } - return false, nil, err - } - lastIndex = uint64(meta.Version) - } else { - // Interpret previous == nil as create operation. - _, err := s.client.Create(s.normalize(key), value, 0, zk.WorldACL(zk.PermAll)) - if err != nil { - // Directory does not exist - if err == zk.ErrNoNode { - - // Create the directory - parts := store.SplitKey(strings.TrimSuffix(key, "/")) - parts = parts[:len(parts)-1] - if err = s.createFullPath(parts, []byte{}, false); err != nil { - // Failed to create the directory. - return false, nil, err - } - - // Create the node - if _, err := s.client.Create(s.normalize(key), value, 0, zk.WorldACL(zk.PermAll)); err != nil { - // Node exist error (when previous nil) - if err == zk.ErrNodeExists { - return false, nil, store.ErrKeyExists - } - return false, nil, err - } - - } else { - // Node Exists error (when previous nil) - if err == zk.ErrNodeExists { - return false, nil, store.ErrKeyExists - } - - // Unhandled error - return false, nil, err - } - } - lastIndex = 0 // Newly created nodes have version 0. - } - - pair := &store.KVPair{ - Key: key, - Value: value, - LastIndex: lastIndex, - } - - return true, pair, nil -} - -// AtomicDelete deletes a value at "key" if the key -// has not been modified in the meantime, throws an -// error if this is the case -func (s *Zookeeper) AtomicDelete(key string, previous *store.KVPair) (bool, error) { - if previous == nil { - return false, store.ErrPreviousNotSpecified - } - - err := s.client.Delete(s.normalize(key), int32(previous.LastIndex)) - if err != nil { - // Key not found - if err == zk.ErrNoNode { - return false, store.ErrKeyNotFound - } - // Compare failed - if err == zk.ErrBadVersion { - return false, store.ErrKeyModified - } - // General store error - return false, err - } - return true, nil -} - -// NewLock returns a handle to a lock struct which can -// be used to provide mutual exclusion on a key -func (s *Zookeeper) NewLock(key string, options *store.LockOptions) (lock store.Locker, err error) { - value := []byte("") - - // Apply options - if options != nil { - if options.Value != nil { - value = options.Value - } - } - - lock = &zookeeperLock{ - client: s.client, - key: s.normalize(key), - value: value, - lock: zk.NewLock(s.client, s.normalize(key), zk.WorldACL(zk.PermAll)), - } - - return lock, err -} - -// Lock attempts to acquire the lock and blocks while -// doing so. It returns a channel that is closed if our -// lock is lost or if an error occurs -func (l *zookeeperLock) Lock(stopChan chan struct{}) (<-chan struct{}, error) { - err := l.lock.Lock() - - lostCh := make(chan struct{}) - if err == nil { - // We hold the lock, we can set our value - _, err = l.client.Set(l.key, l.value, -1) - if err == nil { - go l.monitorLock(stopChan, lostCh) - } - } - - return lostCh, err -} - -// Unlock the "key". Calling unlock while -// not holding the lock will throw an error -func (l *zookeeperLock) Unlock() error { - return l.lock.Unlock() -} - -// Close closes the client connection -func (s *Zookeeper) Close() { - s.client.Close() -} - -// Normalize the key for usage in Zookeeper -func (s *Zookeeper) normalize(key string) string { - key = store.Normalize(key) - return strings.TrimSuffix(key, "/") -} - -func (l *zookeeperLock) monitorLock(stopCh <-chan struct{}, lostCh chan struct{}) { - defer close(lostCh) - - for { - _, _, eventCh, err := l.client.GetW(l.key) - if err != nil { - // We failed to set watch, relinquish the lock - return - } - select { - case e := <-eventCh: - if e.Type == zk.EventNotWatching || - (e.Type == zk.EventSession && e.State == zk.StateExpired) { - // Either the session has been closed and our watch has been - // invalidated or the session has expired. - return - } else if e.Type == zk.EventNodeDataChanged { - // Somemone else has written to the lock node and believes - // that they have the lock. - return - } - case <-stopCh: - // The caller has requested that we relinquish our lock - return - } - } -} - -func (s *Zookeeper) get(key string) ([]byte, *zk.Stat, error) { - var resp []byte - var meta *zk.Stat - var err error - - // To guard against older versions of valkeyrie - // creating and writing to znodes non-atomically, - // We try to resync few times if we read SOH or - // an empty string - for i := 0; i <= syncRetryLimit; i++ { - resp, meta, err = s.client.Get(s.normalize(key)) - - if err != nil { - if err == zk.ErrNoNode { - return nil, nil, store.ErrKeyNotFound - } - return nil, nil, err - } - - if string(resp) != SOH && string(resp) != "" { - return resp, meta, nil - } - - if i < syncRetryLimit { - if _, err = s.client.Sync(s.normalize(key)); err != nil { - return nil, nil, err - } - } - } - return resp, meta, nil -} - -func (s *Zookeeper) getW(key string) ([]byte, *zk.Stat, <-chan zk.Event, error) { - var resp []byte - var meta *zk.Stat - var ech <-chan zk.Event - var err error - - // To guard against older versions of valkeyrie - // creating and writing to znodes non-atomically, - // We try to resync few times if we read SOH or - // an empty string - for i := 0; i <= syncRetryLimit; i++ { - resp, meta, ech, err = s.client.GetW(s.normalize(key)) - - if err != nil { - if err == zk.ErrNoNode { - return nil, nil, nil, store.ErrKeyNotFound - } - return nil, nil, nil, err - } - - if string(resp) != SOH && string(resp) != "" { - return resp, meta, ech, nil - } - - if i < syncRetryLimit { - if _, err = s.client.Sync(s.normalize(key)); err != nil { - return nil, nil, nil, err - } - } - } - return resp, meta, ech, nil -} - -// getListWithPath gets the key/value pairs for a list of keys under -// a given path. -// -// This is generally used when we get a list of child keys which -// are stripped out of their path (for example when using ChildrenW). -func (s *Zookeeper) getListWithPath(path string, keys []string, opts *store.ReadOptions) ([]*store.KVPair, error) { - kvs := []*store.KVPair{} - - for _, key := range keys { - pair, err := s.Get(strings.TrimSuffix(path, "/")+s.normalize(key), opts) - if err != nil { - return nil, err - } - - kvs = append(kvs, &store.KVPair{ - Key: key, - Value: pair.Value, - LastIndex: pair.LastIndex, - }) - } - - return kvs, nil -} - -// getList returns key/value pairs from a list of keys. -// -// This is generally used when we have a full list of keys with -// their full path included. -func (s *Zookeeper) getList(keys []string, opts *store.ReadOptions) ([]*store.KVPair, error) { - kvs := []*store.KVPair{} - - for _, key := range keys { - pair, err := s.Get(strings.TrimSuffix(key, "/"), nil) - if err != nil { - return nil, err - } - - kvs = append(kvs, &store.KVPair{ - Key: key, - Value: pair.Value, - LastIndex: pair.LastIndex, - }) - } - - return kvs, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go deleted file mode 100644 index 3104e6ce4..000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go +++ /dev/null @@ -1,35 +0,0 @@ -// Package ec2query provides serialization of AWS EC2 requests and responses. -package ec2query - -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/ec2.json build_test.go - -import ( - "net/url" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" -) - -// BuildHandler is a named request handler for building ec2query protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.ec2query.Build", Fn: Build} - -// Build builds a request for the EC2 protocol. -func Build(r *request.Request) { - body := url.Values{ - "Action": {r.Operation.Name}, - "Version": {r.ClientInfo.APIVersion}, - } - if err := queryutil.Parse(body, r.Params, true); err != nil { - r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err) - } - - if !r.IsPresigned() { - r.HTTPRequest.Method = "POST" - r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") - r.SetBufferBody([]byte(body.Encode())) - } else { // This is a pre-signed request - r.HTTPRequest.Method = "GET" - r.HTTPRequest.URL.RawQuery = body.Encode() - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go deleted file mode 100644 index 095e97ccf..000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go +++ /dev/null @@ -1,63 +0,0 @@ -package ec2query - -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/ec2.json unmarshal_test.go - -import ( - "encoding/xml" - "io" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" -) - -// UnmarshalHandler is a named request handler for unmarshaling ec2query protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.ec2query.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling ec2query protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.ec2query.UnmarshalMeta", Fn: UnmarshalMeta} - -// UnmarshalErrorHandler is a named request handler for unmarshaling ec2query protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.ec2query.UnmarshalError", Fn: UnmarshalError} - -// Unmarshal unmarshals a response body for the EC2 protocol. -func Unmarshal(r *request.Request) { - defer r.HTTPResponse.Body.Close() - if r.DataFilled() { - decoder := xml.NewDecoder(r.HTTPResponse.Body) - err := xmlutil.UnmarshalXML(r.Data, decoder, "") - if err != nil { - r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err) - return - } - } -} - -// UnmarshalMeta unmarshals response headers for the EC2 protocol. -func UnmarshalMeta(r *request.Request) { - // TODO implement unmarshaling of request IDs -} - -type xmlErrorResponse struct { - XMLName xml.Name `xml:"Response"` - Code string `xml:"Errors>Error>Code"` - Message string `xml:"Errors>Error>Message"` - RequestID string `xml:"RequestID"` -} - -// UnmarshalError unmarshals a response error for the EC2 protocol. -func UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - resp := &xmlErrorResponse{} - err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) - if err != nil && err != io.EOF { - r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err) - } else { - r.Error = awserr.NewRequestFailure( - awserr.New(resp.Code, resp.Message, nil), - r.HTTPResponse.StatusCode, - resp.RequestID, - ) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go deleted file mode 100644 index bf9d7a4e1..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go +++ /dev/null @@ -1,12998 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package dynamodb - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opBatchGetItem = "BatchGetItem" - -// BatchGetItemRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetItem operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See BatchGetItem for more information on using the BatchGetItem -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the BatchGetItemRequest method. -// req, resp := client.BatchGetItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItem -func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.Request, output *BatchGetItemOutput) { - op := &request.Operation{ - Name: opBatchGetItem, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"RequestItems"}, - OutputTokens: []string{"UnprocessedKeys"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &BatchGetItemInput{} - } - - output = &BatchGetItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetItem API operation for Amazon DynamoDB. -// -// The BatchGetItem operation returns the attributes of one or more items from -// one or more tables. You identify requested items by primary key. -// -// A single operation can retrieve up to 16 MB of data, which can contain as -// many as 100 items. BatchGetItem will return a partial result if the response -// size limit is exceeded, the table's provisioned throughput is exceeded, or -// an internal processing failure occurs. If a partial result is returned, the -// operation returns a value for UnprocessedKeys. You can use this value to -// retry the operation starting with the next item to get. -// -// If you request more than 100 items BatchGetItem will return a ValidationException -// with the message "Too many items requested for the BatchGetItem call". -// -// For example, if you ask to retrieve 100 items, but each individual item is -// 300 KB in size, the system returns 52 items (so as not to exceed the 16 MB -// limit). It also returns an appropriate UnprocessedKeys value so you can get -// the next page of results. If desired, your application can include its own -// logic to assemble the pages of results into one data set. -// -// If none of the items can be processed due to insufficient provisioned throughput -// on all of the tables in the request, then BatchGetItem will return a ProvisionedThroughputExceededException. -// If at least one of the items is successfully processed, then BatchGetItem -// completes successfully, while returning the keys of the unread items in UnprocessedKeys. -// -// If DynamoDB returns any unprocessed items, you should retry the batch operation -// on those items. However, we strongly recommend that you use an exponential -// backoff algorithm. If you retry the batch operation immediately, the underlying -// read or write requests can still fail due to throttling on the individual -// tables. If you delay the batch operation using exponential backoff, the individual -// requests in the batch are much more likely to succeed. -// -// For more information, see Batch Operations and Error Handling (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations) -// in the Amazon DynamoDB Developer Guide. -// -// By default, BatchGetItem performs eventually consistent reads on every table -// in the request. If you want strongly consistent reads instead, you can set -// ConsistentRead to true for any or all tables. -// -// In order to minimize response latency, BatchGetItem retrieves items in parallel. -// -// When designing your application, keep in mind that DynamoDB does not return -// items in any particular order. To help parse the response by item, include -// the primary key values for the items in your request in the ProjectionExpression -// parameter. -// -// If a requested item does not exist, it is not returned in the result. Requests -// for nonexistent items consume the minimum read capacity units according to -// the type of read. For more information, see Capacity Units Calculations (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations) -// in the Amazon DynamoDB Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation BatchGetItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItem -func (c *DynamoDB) BatchGetItem(input *BatchGetItemInput) (*BatchGetItemOutput, error) { - req, out := c.BatchGetItemRequest(input) - return out, req.Send() -} - -// BatchGetItemWithContext is the same as BatchGetItem with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetItem for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) BatchGetItemWithContext(ctx aws.Context, input *BatchGetItemInput, opts ...request.Option) (*BatchGetItemOutput, error) { - req, out := c.BatchGetItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// BatchGetItemPages iterates over the pages of a BatchGetItem operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See BatchGetItem method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a BatchGetItem operation. -// pageNum := 0 -// err := client.BatchGetItemPages(params, -// func(page *BatchGetItemOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) BatchGetItemPages(input *BatchGetItemInput, fn func(*BatchGetItemOutput, bool) bool) error { - return c.BatchGetItemPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// BatchGetItemPagesWithContext same as BatchGetItemPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) BatchGetItemPagesWithContext(ctx aws.Context, input *BatchGetItemInput, fn func(*BatchGetItemOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *BatchGetItemInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.BatchGetItemRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*BatchGetItemOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opBatchWriteItem = "BatchWriteItem" - -// BatchWriteItemRequest generates a "aws/request.Request" representing the -// client's request for the BatchWriteItem operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See BatchWriteItem for more information on using the BatchWriteItem -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the BatchWriteItemRequest method. -// req, resp := client.BatchWriteItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItem -func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *request.Request, output *BatchWriteItemOutput) { - op := &request.Operation{ - Name: opBatchWriteItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchWriteItemInput{} - } - - output = &BatchWriteItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchWriteItem API operation for Amazon DynamoDB. -// -// The BatchWriteItem operation puts or deletes multiple items in one or more -// tables. A single call to BatchWriteItem can write up to 16 MB of data, which -// can comprise as many as 25 put or delete requests. Individual items to be -// written can be as large as 400 KB. -// -// BatchWriteItem cannot update items. To update items, use the UpdateItem action. -// -// The individual PutItem and DeleteItem operations specified in BatchWriteItem -// are atomic; however BatchWriteItem as a whole is not. If any requested operations -// fail because the table's provisioned throughput is exceeded or an internal -// processing failure occurs, the failed operations are returned in the UnprocessedItems -// response parameter. You can investigate and optionally resend the requests. -// Typically, you would call BatchWriteItem in a loop. Each iteration would -// check for unprocessed items and submit a new BatchWriteItem request with -// those unprocessed items until all items have been processed. -// -// Note that if none of the items can be processed due to insufficient provisioned -// throughput on all of the tables in the request, then BatchWriteItem will -// return a ProvisionedThroughputExceededException. -// -// If DynamoDB returns any unprocessed items, you should retry the batch operation -// on those items. However, we strongly recommend that you use an exponential -// backoff algorithm. If you retry the batch operation immediately, the underlying -// read or write requests can still fail due to throttling on the individual -// tables. If you delay the batch operation using exponential backoff, the individual -// requests in the batch are much more likely to succeed. -// -// For more information, see Batch Operations and Error Handling (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations) -// in the Amazon DynamoDB Developer Guide. -// -// With BatchWriteItem, you can efficiently write or delete large amounts of -// data, such as from Amazon Elastic MapReduce (EMR), or copy data from another -// database into DynamoDB. In order to improve performance with these large-scale -// operations, BatchWriteItem does not behave in the same way as individual -// PutItem and DeleteItem calls would. For example, you cannot specify conditions -// on individual put and delete requests, and BatchWriteItem does not return -// deleted items in the response. -// -// If you use a programming language that supports concurrency, you can use -// threads to write items in parallel. Your application must include the necessary -// logic to manage the threads. With languages that don't support threading, -// you must update or delete the specified items one at a time. In both situations, -// BatchWriteItem performs the specified put and delete operations in parallel, -// giving you the power of the thread pool approach without having to introduce -// complexity into your application. -// -// Parallel processing reduces latency, but each specified put and delete request -// consumes the same number of write capacity units whether it is processed -// in parallel or not. Delete operations on nonexistent items consume one write -// capacity unit. -// -// If one or more of the following is true, DynamoDB rejects the entire batch -// write operation: -// -// * One or more tables specified in the BatchWriteItem request does not -// exist. -// -// * Primary key attributes specified on an item in the request do not match -// those in the corresponding table's primary key schema. -// -// * You try to perform multiple operations on the same item in the same -// BatchWriteItem request. For example, you cannot put and delete the same -// item in the same BatchWriteItem request. -// -// * Your request contains at least two items with identical hash and range -// keys (which essentially is two put operations). -// -// * There are more than 25 requests in the batch. -// -// * Any individual item in a batch exceeds 400 KB. -// -// * The total request size exceeds 16 MB. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation BatchWriteItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeItemCollectionSizeLimitExceededException "ItemCollectionSizeLimitExceededException" -// An item collection is too large. This exception is only returned for tables -// that have one or more local secondary indexes. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItem -func (c *DynamoDB) BatchWriteItem(input *BatchWriteItemInput) (*BatchWriteItemOutput, error) { - req, out := c.BatchWriteItemRequest(input) - return out, req.Send() -} - -// BatchWriteItemWithContext is the same as BatchWriteItem with the addition of -// the ability to pass a context and additional request options. -// -// See BatchWriteItem for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) BatchWriteItemWithContext(ctx aws.Context, input *BatchWriteItemInput, opts ...request.Option) (*BatchWriteItemOutput, error) { - req, out := c.BatchWriteItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateBackup = "CreateBackup" - -// CreateBackupRequest generates a "aws/request.Request" representing the -// client's request for the CreateBackup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateBackup for more information on using the CreateBackup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateBackupRequest method. -// req, resp := client.CreateBackupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateBackup -func (c *DynamoDB) CreateBackupRequest(input *CreateBackupInput) (req *request.Request, output *CreateBackupOutput) { - op := &request.Operation{ - Name: opCreateBackup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateBackupInput{} - } - - output = &CreateBackupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateBackup API operation for Amazon DynamoDB. -// -// Creates a backup for an existing table. -// -// Each time you create an On-Demand Backup, the entire table data is backed -// up. There is no limit to the number of on-demand backups that can be taken. -// -// When you create an On-Demand Backup, a time marker of the request is cataloged, -// and the backup is created asynchronously, by applying all changes until the -// time of the request to the last full table snapshot. Backup requests are -// processed instantaneously and become available for restore within minutes. -// -// You can call CreateBackup at a maximum rate of 50 times per second. -// -// All backups in DynamoDB work without consuming any provisioned throughput -// on the table. -// -// If you submit a backup request on 2018-12-14 at 14:25:00, the backup is guaranteed -// to contain all data committed to the table up to 14:24:00, and data committed -// after 14:26:00 will not be. The backup may or may not contain data modifications -// made between 14:24:00 and 14:26:00. On-Demand Backup does not support causal -// consistency. -// -// Along with data, the following are also included on the backups: -// -// * Global secondary indexes (GSIs) -// -// * Local secondary indexes (LSIs) -// -// * Streams -// -// * Provisioned read and write capacity -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation CreateBackup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTableNotFoundException "TableNotFoundException" -// A source table with the name TableName does not currently exist within the -// subscriber's account. -// -// * ErrCodeTableInUseException "TableInUseException" -// A target table with the specified name is either being created or deleted. -// -// * ErrCodeContinuousBackupsUnavailableException "ContinuousBackupsUnavailableException" -// Backups have not yet been enabled for this table. -// -// * ErrCodeBackupInUseException "BackupInUseException" -// There is another ongoing conflicting backup control plane operation on the -// table. The backups is either being created, deleted or restored to a table. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateBackup -func (c *DynamoDB) CreateBackup(input *CreateBackupInput) (*CreateBackupOutput, error) { - req, out := c.CreateBackupRequest(input) - return out, req.Send() -} - -// CreateBackupWithContext is the same as CreateBackup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateBackup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) CreateBackupWithContext(ctx aws.Context, input *CreateBackupInput, opts ...request.Option) (*CreateBackupOutput, error) { - req, out := c.CreateBackupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateGlobalTable = "CreateGlobalTable" - -// CreateGlobalTableRequest generates a "aws/request.Request" representing the -// client's request for the CreateGlobalTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateGlobalTable for more information on using the CreateGlobalTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateGlobalTableRequest method. -// req, resp := client.CreateGlobalTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateGlobalTable -func (c *DynamoDB) CreateGlobalTableRequest(input *CreateGlobalTableInput) (req *request.Request, output *CreateGlobalTableOutput) { - op := &request.Operation{ - Name: opCreateGlobalTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateGlobalTableInput{} - } - - output = &CreateGlobalTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateGlobalTable API operation for Amazon DynamoDB. -// -// Creates a global table from an existing table. A global table creates a replication -// relationship between two or more DynamoDB tables with the same table name -// in the provided regions. -// -// Tables can only be added as the replicas of a global table group under the -// following conditions: -// -// * The tables must have the same name. -// -// * The tables must contain no items. -// -// * The tables must have the same hash key and sort key (if present). -// -// * The tables must have DynamoDB Streams enabled (NEW_AND_OLD_IMAGES). -// -// -// * The tables must have same provisioned and maximum write capacity units. -// -// -// If global secondary indexes are specified, then the following conditions -// must also be met: -// -// * The global secondary indexes must have the same name. -// -// * The global secondary indexes must have the same hash key and sort key -// (if present). -// -// * The global secondary indexes must have the same provisioned and maximum -// write capacity units. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation CreateGlobalTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeGlobalTableAlreadyExistsException "GlobalTableAlreadyExistsException" -// The specified global table already exists. -// -// * ErrCodeTableNotFoundException "TableNotFoundException" -// A source table with the name TableName does not currently exist within the -// subscriber's account. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateGlobalTable -func (c *DynamoDB) CreateGlobalTable(input *CreateGlobalTableInput) (*CreateGlobalTableOutput, error) { - req, out := c.CreateGlobalTableRequest(input) - return out, req.Send() -} - -// CreateGlobalTableWithContext is the same as CreateGlobalTable with the addition of -// the ability to pass a context and additional request options. -// -// See CreateGlobalTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) CreateGlobalTableWithContext(ctx aws.Context, input *CreateGlobalTableInput, opts ...request.Option) (*CreateGlobalTableOutput, error) { - req, out := c.CreateGlobalTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTable = "CreateTable" - -// CreateTableRequest generates a "aws/request.Request" representing the -// client's request for the CreateTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateTable for more information on using the CreateTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateTableRequest method. -// req, resp := client.CreateTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTable -func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) (req *request.Request, output *CreateTableOutput) { - op := &request.Operation{ - Name: opCreateTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTableInput{} - } - - output = &CreateTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTable API operation for Amazon DynamoDB. -// -// The CreateTable operation adds a new table to your account. In an AWS account, -// table names must be unique within each region. That is, you can have two -// tables with same name if you create the tables in different regions. -// -// CreateTable is an asynchronous operation. Upon receiving a CreateTable request, -// DynamoDB immediately returns a response with a TableStatus of CREATING. After -// the table is created, DynamoDB sets the TableStatus to ACTIVE. You can perform -// read and write operations only on an ACTIVE table. -// -// You can optionally define secondary indexes on the new table, as part of -// the CreateTable operation. If you want to create multiple tables with secondary -// indexes on them, you must create the tables sequentially. Only one table -// with secondary indexes can be in the CREATING state at any given time. -// -// You can use the DescribeTable action to check the table status. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation CreateTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTable -func (c *DynamoDB) CreateTable(input *CreateTableInput) (*CreateTableOutput, error) { - req, out := c.CreateTableRequest(input) - return out, req.Send() -} - -// CreateTableWithContext is the same as CreateTable with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) CreateTableWithContext(ctx aws.Context, input *CreateTableInput, opts ...request.Option) (*CreateTableOutput, error) { - req, out := c.CreateTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBackup = "DeleteBackup" - -// DeleteBackupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBackup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBackup for more information on using the DeleteBackup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteBackupRequest method. -// req, resp := client.DeleteBackupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteBackup -func (c *DynamoDB) DeleteBackupRequest(input *DeleteBackupInput) (req *request.Request, output *DeleteBackupOutput) { - op := &request.Operation{ - Name: opDeleteBackup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteBackupInput{} - } - - output = &DeleteBackupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteBackup API operation for Amazon DynamoDB. -// -// Deletes an existing backup of a table. -// -// You can call DeleteBackup at a maximum rate of 10 times per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DeleteBackup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBackupNotFoundException "BackupNotFoundException" -// Backup not found for the given BackupARN. -// -// * ErrCodeBackupInUseException "BackupInUseException" -// There is another ongoing conflicting backup control plane operation on the -// table. The backups is either being created, deleted or restored to a table. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteBackup -func (c *DynamoDB) DeleteBackup(input *DeleteBackupInput) (*DeleteBackupOutput, error) { - req, out := c.DeleteBackupRequest(input) - return out, req.Send() -} - -// DeleteBackupWithContext is the same as DeleteBackup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBackup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DeleteBackupWithContext(ctx aws.Context, input *DeleteBackupInput, opts ...request.Option) (*DeleteBackupOutput, error) { - req, out := c.DeleteBackupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteItem = "DeleteItem" - -// DeleteItemRequest generates a "aws/request.Request" representing the -// client's request for the DeleteItem operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteItem for more information on using the DeleteItem -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteItemRequest method. -// req, resp := client.DeleteItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteItem -func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Request, output *DeleteItemOutput) { - op := &request.Operation{ - Name: opDeleteItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteItemInput{} - } - - output = &DeleteItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteItem API operation for Amazon DynamoDB. -// -// Deletes a single item in a table by primary key. You can perform a conditional -// delete operation that deletes the item if it exists, or if it has an expected -// attribute value. -// -// In addition to deleting an item, you can also return the item's attribute -// values in the same operation, using the ReturnValues parameter. -// -// Unless you specify conditions, the DeleteItem is an idempotent operation; -// running it multiple times on the same item or attribute does not result in -// an error response. -// -// Conditional deletes are useful for deleting items only if specific conditions -// are met. If those conditions are met, DynamoDB performs the delete. Otherwise, -// the item is not deleted. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DeleteItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" -// A condition specified in the operation could not be evaluated. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeItemCollectionSizeLimitExceededException "ItemCollectionSizeLimitExceededException" -// An item collection is too large. This exception is only returned for tables -// that have one or more local secondary indexes. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteItem -func (c *DynamoDB) DeleteItem(input *DeleteItemInput) (*DeleteItemOutput, error) { - req, out := c.DeleteItemRequest(input) - return out, req.Send() -} - -// DeleteItemWithContext is the same as DeleteItem with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteItem for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DeleteItemWithContext(ctx aws.Context, input *DeleteItemInput, opts ...request.Option) (*DeleteItemOutput, error) { - req, out := c.DeleteItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTable = "DeleteTable" - -// DeleteTableRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteTable for more information on using the DeleteTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteTableRequest method. -// req, resp := client.DeleteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteTable -func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) (req *request.Request, output *DeleteTableOutput) { - op := &request.Operation{ - Name: opDeleteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTableInput{} - } - - output = &DeleteTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTable API operation for Amazon DynamoDB. -// -// The DeleteTable operation deletes a table and all of its items. After a DeleteTable -// request, the specified table is in the DELETING state until DynamoDB completes -// the deletion. If the table is in the ACTIVE state, you can delete it. If -// a table is in CREATING or UPDATING states, then DynamoDB returns a ResourceInUseException. -// If the specified table does not exist, DynamoDB returns a ResourceNotFoundException. -// If table is already in the DELETING state, no error is returned. -// -// DynamoDB might continue to accept data read and write operations, such as -// GetItem and PutItem, on a table in the DELETING state until the table deletion -// is complete. -// -// When you delete a table, any indexes on that table are also deleted. -// -// If you have DynamoDB Streams enabled on the table, then the corresponding -// stream on that table goes into the DISABLED state, and the stream is automatically -// deleted after 24 hours. -// -// Use the DescribeTable action to check the status of the table. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DeleteTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteTable -func (c *DynamoDB) DeleteTable(input *DeleteTableInput) (*DeleteTableOutput, error) { - req, out := c.DeleteTableRequest(input) - return out, req.Send() -} - -// DeleteTableWithContext is the same as DeleteTable with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DeleteTableWithContext(ctx aws.Context, input *DeleteTableInput, opts ...request.Option) (*DeleteTableOutput, error) { - req, out := c.DeleteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeBackup = "DescribeBackup" - -// DescribeBackupRequest generates a "aws/request.Request" representing the -// client's request for the DescribeBackup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeBackup for more information on using the DescribeBackup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeBackupRequest method. -// req, resp := client.DescribeBackupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeBackup -func (c *DynamoDB) DescribeBackupRequest(input *DescribeBackupInput) (req *request.Request, output *DescribeBackupOutput) { - op := &request.Operation{ - Name: opDescribeBackup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeBackupInput{} - } - - output = &DescribeBackupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeBackup API operation for Amazon DynamoDB. -// -// Describes an existing backup of a table. -// -// You can call DescribeBackup at a maximum rate of 10 times per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DescribeBackup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBackupNotFoundException "BackupNotFoundException" -// Backup not found for the given BackupARN. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeBackup -func (c *DynamoDB) DescribeBackup(input *DescribeBackupInput) (*DescribeBackupOutput, error) { - req, out := c.DescribeBackupRequest(input) - return out, req.Send() -} - -// DescribeBackupWithContext is the same as DescribeBackup with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeBackup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DescribeBackupWithContext(ctx aws.Context, input *DescribeBackupInput, opts ...request.Option) (*DescribeBackupOutput, error) { - req, out := c.DescribeBackupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeContinuousBackups = "DescribeContinuousBackups" - -// DescribeContinuousBackupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeContinuousBackups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeContinuousBackups for more information on using the DescribeContinuousBackups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeContinuousBackupsRequest method. -// req, resp := client.DescribeContinuousBackupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeContinuousBackups -func (c *DynamoDB) DescribeContinuousBackupsRequest(input *DescribeContinuousBackupsInput) (req *request.Request, output *DescribeContinuousBackupsOutput) { - op := &request.Operation{ - Name: opDescribeContinuousBackups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeContinuousBackupsInput{} - } - - output = &DescribeContinuousBackupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeContinuousBackups API operation for Amazon DynamoDB. -// -// Checks the status of continuous backups and point in time recovery on the -// specified table. Continuous backups are ENABLED on all tables at table creation. -// If point in time recovery is enabled, PointInTimeRecoveryStatus will be set -// to ENABLED. -// -// Once continuous backups and point in time recovery are enabled, you can restore -// to any point in time within EarliestRestorableDateTime and LatestRestorableDateTime. -// -// LatestRestorableDateTime is typically 5 minutes before the current time. -// You can restore your table to any point in time during the last 35 days. -// -// You can call DescribeContinuousBackups at a maximum rate of 10 times per -// second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DescribeContinuousBackups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTableNotFoundException "TableNotFoundException" -// A source table with the name TableName does not currently exist within the -// subscriber's account. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeContinuousBackups -func (c *DynamoDB) DescribeContinuousBackups(input *DescribeContinuousBackupsInput) (*DescribeContinuousBackupsOutput, error) { - req, out := c.DescribeContinuousBackupsRequest(input) - return out, req.Send() -} - -// DescribeContinuousBackupsWithContext is the same as DescribeContinuousBackups with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeContinuousBackups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DescribeContinuousBackupsWithContext(ctx aws.Context, input *DescribeContinuousBackupsInput, opts ...request.Option) (*DescribeContinuousBackupsOutput, error) { - req, out := c.DescribeContinuousBackupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeGlobalTable = "DescribeGlobalTable" - -// DescribeGlobalTableRequest generates a "aws/request.Request" representing the -// client's request for the DescribeGlobalTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeGlobalTable for more information on using the DescribeGlobalTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeGlobalTableRequest method. -// req, resp := client.DescribeGlobalTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeGlobalTable -func (c *DynamoDB) DescribeGlobalTableRequest(input *DescribeGlobalTableInput) (req *request.Request, output *DescribeGlobalTableOutput) { - op := &request.Operation{ - Name: opDescribeGlobalTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeGlobalTableInput{} - } - - output = &DescribeGlobalTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeGlobalTable API operation for Amazon DynamoDB. -// -// Returns information about the specified global table. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DescribeGlobalTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeGlobalTableNotFoundException "GlobalTableNotFoundException" -// The specified global table does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeGlobalTable -func (c *DynamoDB) DescribeGlobalTable(input *DescribeGlobalTableInput) (*DescribeGlobalTableOutput, error) { - req, out := c.DescribeGlobalTableRequest(input) - return out, req.Send() -} - -// DescribeGlobalTableWithContext is the same as DescribeGlobalTable with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeGlobalTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DescribeGlobalTableWithContext(ctx aws.Context, input *DescribeGlobalTableInput, opts ...request.Option) (*DescribeGlobalTableOutput, error) { - req, out := c.DescribeGlobalTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeGlobalTableSettings = "DescribeGlobalTableSettings" - -// DescribeGlobalTableSettingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeGlobalTableSettings operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeGlobalTableSettings for more information on using the DescribeGlobalTableSettings -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeGlobalTableSettingsRequest method. -// req, resp := client.DescribeGlobalTableSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeGlobalTableSettings -func (c *DynamoDB) DescribeGlobalTableSettingsRequest(input *DescribeGlobalTableSettingsInput) (req *request.Request, output *DescribeGlobalTableSettingsOutput) { - op := &request.Operation{ - Name: opDescribeGlobalTableSettings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeGlobalTableSettingsInput{} - } - - output = &DescribeGlobalTableSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeGlobalTableSettings API operation for Amazon DynamoDB. -// -// Describes region specific settings for a global table. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DescribeGlobalTableSettings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeGlobalTableNotFoundException "GlobalTableNotFoundException" -// The specified global table does not exist. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeGlobalTableSettings -func (c *DynamoDB) DescribeGlobalTableSettings(input *DescribeGlobalTableSettingsInput) (*DescribeGlobalTableSettingsOutput, error) { - req, out := c.DescribeGlobalTableSettingsRequest(input) - return out, req.Send() -} - -// DescribeGlobalTableSettingsWithContext is the same as DescribeGlobalTableSettings with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeGlobalTableSettings for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DescribeGlobalTableSettingsWithContext(ctx aws.Context, input *DescribeGlobalTableSettingsInput, opts ...request.Option) (*DescribeGlobalTableSettingsOutput, error) { - req, out := c.DescribeGlobalTableSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeLimits = "DescribeLimits" - -// DescribeLimitsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLimits operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeLimits for more information on using the DescribeLimits -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeLimitsRequest method. -// req, resp := client.DescribeLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeLimits -func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) (req *request.Request, output *DescribeLimitsOutput) { - op := &request.Operation{ - Name: opDescribeLimits, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLimitsInput{} - } - - output = &DescribeLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLimits API operation for Amazon DynamoDB. -// -// Returns the current provisioned-capacity limits for your AWS account in a -// region, both for the region as a whole and for any one DynamoDB table that -// you create there. -// -// When you establish an AWS account, the account has initial limits on the -// maximum read capacity units and write capacity units that you can provision -// across all of your DynamoDB tables in a given region. Also, there are per-table -// limits that apply when you create a table there. For more information, see -// Limits (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) -// page in the Amazon DynamoDB Developer Guide. -// -// Although you can increase these limits by filing a case at AWS Support Center -// (https://console.aws.amazon.com/support/home#/), obtaining the increase is -// not instantaneous. The DescribeLimits action lets you write code to compare -// the capacity you are currently using to those limits imposed by your account -// so that you have enough time to apply for an increase before you hit a limit. -// -// For example, you could use one of the AWS SDKs to do the following: -// -// Call DescribeLimits for a particular region to obtain your current account -// limits on provisioned capacity there. -// -// Create a variable to hold the aggregate read capacity units provisioned for -// all your tables in that region, and one to hold the aggregate write capacity -// units. Zero them both. -// -// Call ListTables to obtain a list of all your DynamoDB tables. -// -// For each table name listed by ListTables, do the following: -// -// Call DescribeTable with the table name. -// -// Use the data returned by DescribeTable to add the read capacity units and -// write capacity units provisioned for the table itself to your variables. -// -// If the table has one or more global secondary indexes (GSIs), loop over these -// GSIs and add their provisioned capacity values to your variables as well. -// -// Report the account limits for that region returned by DescribeLimits, along -// with the total current provisioned capacity levels you have calculated. -// -// This will let you see whether you are getting close to your account-level -// limits. -// -// The per-table limits apply only when you are creating a new table. They restrict -// the sum of the provisioned capacity of the new table itself and all its global -// secondary indexes. -// -// For existing tables and their GSIs, DynamoDB will not let you increase provisioned -// capacity extremely rapidly, but the only upper limit that applies is that -// the aggregate provisioned capacity over all your tables and GSIs cannot exceed -// either of the per-account limits. -// -// DescribeLimits should only be called periodically. You can expect throttling -// errors if you call it more than once in a minute. -// -// The DescribeLimits Request element has no content. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DescribeLimits for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeLimits -func (c *DynamoDB) DescribeLimits(input *DescribeLimitsInput) (*DescribeLimitsOutput, error) { - req, out := c.DescribeLimitsRequest(input) - return out, req.Send() -} - -// DescribeLimitsWithContext is the same as DescribeLimits with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLimits for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DescribeLimitsWithContext(ctx aws.Context, input *DescribeLimitsInput, opts ...request.Option) (*DescribeLimitsOutput, error) { - req, out := c.DescribeLimitsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTable = "DescribeTable" - -// DescribeTableRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeTable for more information on using the DescribeTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeTableRequest method. -// req, resp := client.DescribeTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTable -func (c *DynamoDB) DescribeTableRequest(input *DescribeTableInput) (req *request.Request, output *DescribeTableOutput) { - op := &request.Operation{ - Name: opDescribeTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTableInput{} - } - - output = &DescribeTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTable API operation for Amazon DynamoDB. -// -// Returns information about the table, including the current status of the -// table, when it was created, the primary key schema, and any indexes on the -// table. -// -// If you issue a DescribeTable request immediately after a CreateTable request, -// DynamoDB might return a ResourceNotFoundException. This is because DescribeTable -// uses an eventually consistent query, and the metadata for your table might -// not be available at that moment. Wait for a few seconds, and then try the -// DescribeTable request again. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DescribeTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTable -func (c *DynamoDB) DescribeTable(input *DescribeTableInput) (*DescribeTableOutput, error) { - req, out := c.DescribeTableRequest(input) - return out, req.Send() -} - -// DescribeTableWithContext is the same as DescribeTable with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DescribeTableWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.Option) (*DescribeTableOutput, error) { - req, out := c.DescribeTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTimeToLive = "DescribeTimeToLive" - -// DescribeTimeToLiveRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTimeToLive operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeTimeToLive for more information on using the DescribeTimeToLive -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeTimeToLiveRequest method. -// req, resp := client.DescribeTimeToLiveRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLive -func (c *DynamoDB) DescribeTimeToLiveRequest(input *DescribeTimeToLiveInput) (req *request.Request, output *DescribeTimeToLiveOutput) { - op := &request.Operation{ - Name: opDescribeTimeToLive, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTimeToLiveInput{} - } - - output = &DescribeTimeToLiveOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTimeToLive API operation for Amazon DynamoDB. -// -// Gives a description of the Time to Live (TTL) status on the specified table. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation DescribeTimeToLive for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLive -func (c *DynamoDB) DescribeTimeToLive(input *DescribeTimeToLiveInput) (*DescribeTimeToLiveOutput, error) { - req, out := c.DescribeTimeToLiveRequest(input) - return out, req.Send() -} - -// DescribeTimeToLiveWithContext is the same as DescribeTimeToLive with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTimeToLive for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) DescribeTimeToLiveWithContext(ctx aws.Context, input *DescribeTimeToLiveInput, opts ...request.Option) (*DescribeTimeToLiveOutput, error) { - req, out := c.DescribeTimeToLiveRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetItem = "GetItem" - -// GetItemRequest generates a "aws/request.Request" representing the -// client's request for the GetItem operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetItem for more information on using the GetItem -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetItemRequest method. -// req, resp := client.GetItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GetItem -func (c *DynamoDB) GetItemRequest(input *GetItemInput) (req *request.Request, output *GetItemOutput) { - op := &request.Operation{ - Name: opGetItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetItemInput{} - } - - output = &GetItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetItem API operation for Amazon DynamoDB. -// -// The GetItem operation returns a set of attributes for the item with the given -// primary key. If there is no matching item, GetItem does not return any data -// and there will be no Item element in the response. -// -// GetItem provides an eventually consistent read by default. If your application -// requires a strongly consistent read, set ConsistentRead to true. Although -// a strongly consistent read might take more time than an eventually consistent -// read, it always returns the last updated value. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation GetItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GetItem -func (c *DynamoDB) GetItem(input *GetItemInput) (*GetItemOutput, error) { - req, out := c.GetItemRequest(input) - return out, req.Send() -} - -// GetItemWithContext is the same as GetItem with the addition of -// the ability to pass a context and additional request options. -// -// See GetItem for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) GetItemWithContext(ctx aws.Context, input *GetItemInput, opts ...request.Option) (*GetItemOutput, error) { - req, out := c.GetItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBackups = "ListBackups" - -// ListBackupsRequest generates a "aws/request.Request" representing the -// client's request for the ListBackups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListBackups for more information on using the ListBackups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListBackupsRequest method. -// req, resp := client.ListBackupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListBackups -func (c *DynamoDB) ListBackupsRequest(input *ListBackupsInput) (req *request.Request, output *ListBackupsOutput) { - op := &request.Operation{ - Name: opListBackups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListBackupsInput{} - } - - output = &ListBackupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBackups API operation for Amazon DynamoDB. -// -// List backups associated with an AWS account. To list backups for a given -// table, specify TableName. ListBackups returns a paginated list of results -// with at most 1MB worth of items in a page. You can also specify a limit for -// the maximum number of entries to be returned in a page. -// -// In the request, start time is inclusive but end time is exclusive. Note that -// these limits are for the time at which the original backup was requested. -// -// You can call ListBackups a maximum of 5 times per second. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation ListBackups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListBackups -func (c *DynamoDB) ListBackups(input *ListBackupsInput) (*ListBackupsOutput, error) { - req, out := c.ListBackupsRequest(input) - return out, req.Send() -} - -// ListBackupsWithContext is the same as ListBackups with the addition of -// the ability to pass a context and additional request options. -// -// See ListBackups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ListBackupsWithContext(ctx aws.Context, input *ListBackupsInput, opts ...request.Option) (*ListBackupsOutput, error) { - req, out := c.ListBackupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListGlobalTables = "ListGlobalTables" - -// ListGlobalTablesRequest generates a "aws/request.Request" representing the -// client's request for the ListGlobalTables operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListGlobalTables for more information on using the ListGlobalTables -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListGlobalTablesRequest method. -// req, resp := client.ListGlobalTablesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListGlobalTables -func (c *DynamoDB) ListGlobalTablesRequest(input *ListGlobalTablesInput) (req *request.Request, output *ListGlobalTablesOutput) { - op := &request.Operation{ - Name: opListGlobalTables, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListGlobalTablesInput{} - } - - output = &ListGlobalTablesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListGlobalTables API operation for Amazon DynamoDB. -// -// Lists all global tables that have a replica in the specified region. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation ListGlobalTables for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListGlobalTables -func (c *DynamoDB) ListGlobalTables(input *ListGlobalTablesInput) (*ListGlobalTablesOutput, error) { - req, out := c.ListGlobalTablesRequest(input) - return out, req.Send() -} - -// ListGlobalTablesWithContext is the same as ListGlobalTables with the addition of -// the ability to pass a context and additional request options. -// -// See ListGlobalTables for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ListGlobalTablesWithContext(ctx aws.Context, input *ListGlobalTablesInput, opts ...request.Option) (*ListGlobalTablesOutput, error) { - req, out := c.ListGlobalTablesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTables = "ListTables" - -// ListTablesRequest generates a "aws/request.Request" representing the -// client's request for the ListTables operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTables for more information on using the ListTables -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListTablesRequest method. -// req, resp := client.ListTablesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTables -func (c *DynamoDB) ListTablesRequest(input *ListTablesInput) (req *request.Request, output *ListTablesOutput) { - op := &request.Operation{ - Name: opListTables, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"ExclusiveStartTableName"}, - OutputTokens: []string{"LastEvaluatedTableName"}, - LimitToken: "Limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTablesInput{} - } - - output = &ListTablesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTables API operation for Amazon DynamoDB. -// -// Returns an array of table names associated with the current account and endpoint. -// The output from ListTables is paginated, with each page returning a maximum -// of 100 table names. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation ListTables for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTables -func (c *DynamoDB) ListTables(input *ListTablesInput) (*ListTablesOutput, error) { - req, out := c.ListTablesRequest(input) - return out, req.Send() -} - -// ListTablesWithContext is the same as ListTables with the addition of -// the ability to pass a context and additional request options. -// -// See ListTables for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ListTablesWithContext(ctx aws.Context, input *ListTablesInput, opts ...request.Option) (*ListTablesOutput, error) { - req, out := c.ListTablesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTablesPages iterates over the pages of a ListTables operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTables method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTables operation. -// pageNum := 0 -// err := client.ListTablesPages(params, -// func(page *ListTablesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) ListTablesPages(input *ListTablesInput, fn func(*ListTablesOutput, bool) bool) error { - return c.ListTablesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTablesPagesWithContext same as ListTablesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ListTablesPagesWithContext(ctx aws.Context, input *ListTablesInput, fn func(*ListTablesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTablesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTablesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTablesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTagsOfResource = "ListTagsOfResource" - -// ListTagsOfResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsOfResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTagsOfResource for more information on using the ListTagsOfResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListTagsOfResourceRequest method. -// req, resp := client.ListTagsOfResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTagsOfResource -func (c *DynamoDB) ListTagsOfResourceRequest(input *ListTagsOfResourceInput) (req *request.Request, output *ListTagsOfResourceOutput) { - op := &request.Operation{ - Name: opListTagsOfResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsOfResourceInput{} - } - - output = &ListTagsOfResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsOfResource API operation for Amazon DynamoDB. -// -// List all tags on an Amazon DynamoDB resource. You can call ListTagsOfResource -// up to 10 times per second, per account. -// -// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) -// in the Amazon DynamoDB Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation ListTagsOfResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTagsOfResource -func (c *DynamoDB) ListTagsOfResource(input *ListTagsOfResourceInput) (*ListTagsOfResourceOutput, error) { - req, out := c.ListTagsOfResourceRequest(input) - return out, req.Send() -} - -// ListTagsOfResourceWithContext is the same as ListTagsOfResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsOfResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ListTagsOfResourceWithContext(ctx aws.Context, input *ListTagsOfResourceInput, opts ...request.Option) (*ListTagsOfResourceOutput, error) { - req, out := c.ListTagsOfResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutItem = "PutItem" - -// PutItemRequest generates a "aws/request.Request" representing the -// client's request for the PutItem operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutItem for more information on using the PutItem -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the PutItemRequest method. -// req, resp := client.PutItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItem -func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, output *PutItemOutput) { - op := &request.Operation{ - Name: opPutItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutItemInput{} - } - - output = &PutItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutItem API operation for Amazon DynamoDB. -// -// Creates a new item, or replaces an old item with a new item. If an item that -// has the same primary key as the new item already exists in the specified -// table, the new item completely replaces the existing item. You can perform -// a conditional put operation (add a new item if one with the specified primary -// key doesn't exist), or replace an existing item if it has certain attribute -// values. You can return the item's attribute values in the same operation, -// using the ReturnValues parameter. -// -// This topic provides general information about the PutItem API. -// -// For information on how to call the PutItem API using the AWS SDK in specific -// languages, see the following: -// -// PutItem in the AWS Command Line Interface (http://docs.aws.amazon.com/goto/aws-cli/dynamodb-2012-08-10/PutItem) -// -// PutItem in the AWS SDK for .NET (http://docs.aws.amazon.com/goto/DotNetSDKV3/dynamodb-2012-08-10/PutItem) -// -// PutItem in the AWS SDK for C++ (http://docs.aws.amazon.com/goto/SdkForCpp/dynamodb-2012-08-10/PutItem) -// -// PutItem in the AWS SDK for Go (http://docs.aws.amazon.com/goto/SdkForGoV1/dynamodb-2012-08-10/PutItem) -// -// PutItem in the AWS SDK for Java (http://docs.aws.amazon.com/goto/SdkForJava/dynamodb-2012-08-10/PutItem) -// -// PutItem in the AWS SDK for JavaScript (http://docs.aws.amazon.com/goto/AWSJavaScriptSDK/dynamodb-2012-08-10/PutItem) -// -// PutItem in the AWS SDK for PHP V3 (http://docs.aws.amazon.com/goto/SdkForPHPV3/dynamodb-2012-08-10/PutItem) -// -// PutItem in the AWS SDK for Python (http://docs.aws.amazon.com/goto/boto3/dynamodb-2012-08-10/PutItem) -// -// PutItem in the AWS SDK for Ruby V2 (http://docs.aws.amazon.com/goto/SdkForRubyV2/dynamodb-2012-08-10/PutItem) -// -// When you add an item, the primary key attribute(s) are the only required -// attributes. Attribute values cannot be null. String and Binary type attributes -// must have lengths greater than zero. Set type attributes cannot be empty. -// Requests with empty values will be rejected with a ValidationException exception. -// -// To prevent a new item from replacing an existing item, use a conditional -// expression that contains the attribute_not_exists function with the name -// of the attribute being used as the partition key for the table. Since every -// record must contain that attribute, the attribute_not_exists function will -// only succeed if no matching item exists. -// -// For more information about PutItem, see Working with Items (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html) -// in the Amazon DynamoDB Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation PutItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" -// A condition specified in the operation could not be evaluated. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeItemCollectionSizeLimitExceededException "ItemCollectionSizeLimitExceededException" -// An item collection is too large. This exception is only returned for tables -// that have one or more local secondary indexes. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItem -func (c *DynamoDB) PutItem(input *PutItemInput) (*PutItemOutput, error) { - req, out := c.PutItemRequest(input) - return out, req.Send() -} - -// PutItemWithContext is the same as PutItem with the addition of -// the ability to pass a context and additional request options. -// -// See PutItem for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) PutItemWithContext(ctx aws.Context, input *PutItemInput, opts ...request.Option) (*PutItemOutput, error) { - req, out := c.PutItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opQuery = "Query" - -// QueryRequest generates a "aws/request.Request" representing the -// client's request for the Query operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See Query for more information on using the Query -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the QueryRequest method. -// req, resp := client.QueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Query -func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output *QueryOutput) { - op := &request.Operation{ - Name: opQuery, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"ExclusiveStartKey"}, - OutputTokens: []string{"LastEvaluatedKey"}, - LimitToken: "Limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &QueryInput{} - } - - output = &QueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// Query API operation for Amazon DynamoDB. -// -// The Query operation finds items based on primary key values. You can query -// any table or secondary index that has a composite primary key (a partition -// key and a sort key). -// -// Use the KeyConditionExpression parameter to provide a specific value for -// the partition key. The Query operation will return all of the items from -// the table or index with that partition key value. You can optionally narrow -// the scope of the Query operation by specifying a sort key value and a comparison -// operator in KeyConditionExpression. To further refine the Query results, -// you can optionally provide a FilterExpression. A FilterExpression determines -// which items within the results should be returned to you. All of the other -// results are discarded. -// -// A Query operation always returns a result set. If no matching items are found, -// the result set will be empty. Queries that do not return results consume -// the minimum number of read capacity units for that type of read operation. -// -// DynamoDB calculates the number of read capacity units consumed based on item -// size, not on the amount of data that is returned to an application. The number -// of capacity units consumed will be the same whether you request all of the -// attributes (the default behavior) or just some of them (using a projection -// expression). The number will also be the same whether or not you use a FilterExpression. -// -// Query results are always sorted by the sort key value. If the data type of -// the sort key is Number, the results are returned in numeric order; otherwise, -// the results are returned in order of UTF-8 bytes. By default, the sort order -// is ascending. To reverse the order, set the ScanIndexForward parameter to -// false. -// -// A single Query operation will read up to the maximum number of items set -// (if using the Limit parameter) or a maximum of 1 MB of data and then apply -// any filtering to the results using FilterExpression. If LastEvaluatedKey -// is present in the response, you will need to paginate the result set. For -// more information, see Paginating the Results (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.Pagination) -// in the Amazon DynamoDB Developer Guide. -// -// FilterExpression is applied after a Query finishes, but before the results -// are returned. A FilterExpression cannot contain partition key or sort key -// attributes. You need to specify those attributes in the KeyConditionExpression. -// -// A Query operation can return an empty result set and a LastEvaluatedKey if -// all the items read for the page of results are filtered out. -// -// You can query a table, a local secondary index, or a global secondary index. -// For a query on a table or on a local secondary index, you can set the ConsistentRead -// parameter to true and obtain a strongly consistent result. Global secondary -// indexes support eventually consistent reads only, so do not specify ConsistentRead -// when querying a global secondary index. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation Query for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Query -func (c *DynamoDB) Query(input *QueryInput) (*QueryOutput, error) { - req, out := c.QueryRequest(input) - return out, req.Send() -} - -// QueryWithContext is the same as Query with the addition of -// the ability to pass a context and additional request options. -// -// See Query for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) QueryWithContext(ctx aws.Context, input *QueryInput, opts ...request.Option) (*QueryOutput, error) { - req, out := c.QueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// QueryPages iterates over the pages of a Query operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Query method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a Query operation. -// pageNum := 0 -// err := client.QueryPages(params, -// func(page *QueryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) QueryPages(input *QueryInput, fn func(*QueryOutput, bool) bool) error { - return c.QueryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// QueryPagesWithContext same as QueryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) QueryPagesWithContext(ctx aws.Context, input *QueryInput, fn func(*QueryOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *QueryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.QueryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*QueryOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opRestoreTableFromBackup = "RestoreTableFromBackup" - -// RestoreTableFromBackupRequest generates a "aws/request.Request" representing the -// client's request for the RestoreTableFromBackup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RestoreTableFromBackup for more information on using the RestoreTableFromBackup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RestoreTableFromBackupRequest method. -// req, resp := client.RestoreTableFromBackupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/RestoreTableFromBackup -func (c *DynamoDB) RestoreTableFromBackupRequest(input *RestoreTableFromBackupInput) (req *request.Request, output *RestoreTableFromBackupOutput) { - op := &request.Operation{ - Name: opRestoreTableFromBackup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreTableFromBackupInput{} - } - - output = &RestoreTableFromBackupOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreTableFromBackup API operation for Amazon DynamoDB. -// -// Creates a new table from an existing backup. Any number of users can execute -// up to 4 concurrent restores (any type of restore) in a given account. -// -// You can call RestoreTableFromBackup at a maximum rate of 10 times per second. -// -// You must manually set up the following on the restored table: -// -// * Auto scaling policies -// -// * IAM policies -// -// * Cloudwatch metrics and alarms -// -// * Tags -// -// * Stream settings -// -// * Time to Live (TTL) settings -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation RestoreTableFromBackup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTableAlreadyExistsException "TableAlreadyExistsException" -// A target table with the specified name already exists. -// -// * ErrCodeTableInUseException "TableInUseException" -// A target table with the specified name is either being created or deleted. -// -// * ErrCodeBackupNotFoundException "BackupNotFoundException" -// Backup not found for the given BackupARN. -// -// * ErrCodeBackupInUseException "BackupInUseException" -// There is another ongoing conflicting backup control plane operation on the -// table. The backups is either being created, deleted or restored to a table. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/RestoreTableFromBackup -func (c *DynamoDB) RestoreTableFromBackup(input *RestoreTableFromBackupInput) (*RestoreTableFromBackupOutput, error) { - req, out := c.RestoreTableFromBackupRequest(input) - return out, req.Send() -} - -// RestoreTableFromBackupWithContext is the same as RestoreTableFromBackup with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreTableFromBackup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) RestoreTableFromBackupWithContext(ctx aws.Context, input *RestoreTableFromBackupInput, opts ...request.Option) (*RestoreTableFromBackupOutput, error) { - req, out := c.RestoreTableFromBackupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreTableToPointInTime = "RestoreTableToPointInTime" - -// RestoreTableToPointInTimeRequest generates a "aws/request.Request" representing the -// client's request for the RestoreTableToPointInTime operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RestoreTableToPointInTime for more information on using the RestoreTableToPointInTime -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RestoreTableToPointInTimeRequest method. -// req, resp := client.RestoreTableToPointInTimeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/RestoreTableToPointInTime -func (c *DynamoDB) RestoreTableToPointInTimeRequest(input *RestoreTableToPointInTimeInput) (req *request.Request, output *RestoreTableToPointInTimeOutput) { - op := &request.Operation{ - Name: opRestoreTableToPointInTime, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreTableToPointInTimeInput{} - } - - output = &RestoreTableToPointInTimeOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreTableToPointInTime API operation for Amazon DynamoDB. -// -// Restores the specified table to the specified point in time within EarliestRestorableDateTime -// and LatestRestorableDateTime. You can restore your table to any point in -// time during the last 35 days. Any number of users can execute up to 4 concurrent -// restores (any type of restore) in a given account. -// -// When you restore using point in time recovery, DynamoDB restores your table -// data to the state based on the selected date and time (day:hour:minute:second) -// to a new table. -// -// Along with data, the following are also included on the new restored table -// using point in time recovery: -// -// * Global secondary indexes (GSIs) -// -// * Local secondary indexes (LSIs) -// -// * Provisioned read and write capacity -// -// * Encryption settings -// -// All these settings come from the current settings of the source table at -// the time of restore. -// -// You must manually set up the following on the restored table: -// -// * Auto scaling policies -// -// * IAM policies -// -// * Cloudwatch metrics and alarms -// -// * Tags -// -// * Stream settings -// -// * Time to Live (TTL) settings -// -// * Point in time recovery settings -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation RestoreTableToPointInTime for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTableAlreadyExistsException "TableAlreadyExistsException" -// A target table with the specified name already exists. -// -// * ErrCodeTableNotFoundException "TableNotFoundException" -// A source table with the name TableName does not currently exist within the -// subscriber's account. -// -// * ErrCodeTableInUseException "TableInUseException" -// A target table with the specified name is either being created or deleted. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInvalidRestoreTimeException "InvalidRestoreTimeException" -// An invalid restore time was specified. RestoreDateTime must be between EarliestRestorableDateTime -// and LatestRestorableDateTime. -// -// * ErrCodePointInTimeRecoveryUnavailableException "PointInTimeRecoveryUnavailableException" -// Point in time recovery has not yet been enabled for this source table. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/RestoreTableToPointInTime -func (c *DynamoDB) RestoreTableToPointInTime(input *RestoreTableToPointInTimeInput) (*RestoreTableToPointInTimeOutput, error) { - req, out := c.RestoreTableToPointInTimeRequest(input) - return out, req.Send() -} - -// RestoreTableToPointInTimeWithContext is the same as RestoreTableToPointInTime with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreTableToPointInTime for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) RestoreTableToPointInTimeWithContext(ctx aws.Context, input *RestoreTableToPointInTimeInput, opts ...request.Option) (*RestoreTableToPointInTimeOutput, error) { - req, out := c.RestoreTableToPointInTimeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opScan = "Scan" - -// ScanRequest generates a "aws/request.Request" representing the -// client's request for the Scan operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See Scan for more information on using the Scan -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ScanRequest method. -// req, resp := client.ScanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Scan -func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output *ScanOutput) { - op := &request.Operation{ - Name: opScan, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"ExclusiveStartKey"}, - OutputTokens: []string{"LastEvaluatedKey"}, - LimitToken: "Limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ScanInput{} - } - - output = &ScanOutput{} - req = c.newRequest(op, input, output) - return -} - -// Scan API operation for Amazon DynamoDB. -// -// The Scan operation returns one or more items and item attributes by accessing -// every item in a table or a secondary index. To have DynamoDB return fewer -// items, you can provide a FilterExpression operation. -// -// If the total number of scanned items exceeds the maximum data set size limit -// of 1 MB, the scan stops and results are returned to the user as a LastEvaluatedKey -// value to continue the scan in a subsequent operation. The results also include -// the number of items exceeding the limit. A scan can result in no table data -// meeting the filter criteria. -// -// A single Scan operation will read up to the maximum number of items set (if -// using the Limit parameter) or a maximum of 1 MB of data and then apply any -// filtering to the results using FilterExpression. If LastEvaluatedKey is present -// in the response, you will need to paginate the result set. For more information, -// see Paginating the Results (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Pagination) -// in the Amazon DynamoDB Developer Guide. -// -// Scan operations proceed sequentially; however, for faster performance on -// a large table or secondary index, applications can request a parallel Scan -// operation by providing the Segment and TotalSegments parameters. For more -// information, see Parallel Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.ParallelScan) -// in the Amazon DynamoDB Developer Guide. -// -// Scan uses eventually consistent reads when accessing the data in a table; -// therefore, the result set might not include the changes to data in the table -// immediately before the operation began. If you need a consistent copy of -// the data, as of the time that the Scan begins, you can set the ConsistentRead -// parameter to true. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation Scan for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Scan -func (c *DynamoDB) Scan(input *ScanInput) (*ScanOutput, error) { - req, out := c.ScanRequest(input) - return out, req.Send() -} - -// ScanWithContext is the same as Scan with the addition of -// the ability to pass a context and additional request options. -// -// See Scan for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ScanWithContext(ctx aws.Context, input *ScanInput, opts ...request.Option) (*ScanOutput, error) { - req, out := c.ScanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ScanPages iterates over the pages of a Scan operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Scan method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a Scan operation. -// pageNum := 0 -// err := client.ScanPages(params, -// func(page *ScanOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) ScanPages(input *ScanInput, fn func(*ScanOutput, bool) bool) error { - return c.ScanPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ScanPagesWithContext same as ScanPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) ScanPagesWithContext(ctx aws.Context, input *ScanInput, fn func(*ScanOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ScanInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ScanRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ScanOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See TagResource for more information on using the TagResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TagResource -func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon DynamoDB. -// -// Associate a set of tags with an Amazon DynamoDB resource. You can then activate -// these user-defined tags so that they appear on the Billing and Cost Management -// console for cost allocation tracking. You can call TagResource up to 5 times -// per second, per account. -// -// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) -// in the Amazon DynamoDB Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation TagResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TagResource -func (c *DynamoDB) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UntagResource for more information on using the UntagResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UntagResource -func (c *DynamoDB) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon DynamoDB. -// -// Removes the association of tags from an Amazon DynamoDB resource. You can -// call UntagResource up to 5 times per second, per account. -// -// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) -// in the Amazon DynamoDB Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation UntagResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UntagResource -func (c *DynamoDB) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateContinuousBackups = "UpdateContinuousBackups" - -// UpdateContinuousBackupsRequest generates a "aws/request.Request" representing the -// client's request for the UpdateContinuousBackups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateContinuousBackups for more information on using the UpdateContinuousBackups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateContinuousBackupsRequest method. -// req, resp := client.UpdateContinuousBackupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateContinuousBackups -func (c *DynamoDB) UpdateContinuousBackupsRequest(input *UpdateContinuousBackupsInput) (req *request.Request, output *UpdateContinuousBackupsOutput) { - op := &request.Operation{ - Name: opUpdateContinuousBackups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateContinuousBackupsInput{} - } - - output = &UpdateContinuousBackupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateContinuousBackups API operation for Amazon DynamoDB. -// -// UpdateContinuousBackups enables or disables point in time recovery for the -// specified table. A successful UpdateContinuousBackups call returns the current -// ContinuousBackupsDescription. Continuous backups are ENABLED on all tables -// at table creation. If point in time recovery is enabled, PointInTimeRecoveryStatus -// will be set to ENABLED. -// -// Once continuous backups and point in time recovery are enabled, you can restore -// to any point in time within EarliestRestorableDateTime and LatestRestorableDateTime. -// -// LatestRestorableDateTime is typically 5 minutes before the current time. -// You can restore your table to any point in time during the last 35 days.. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation UpdateContinuousBackups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTableNotFoundException "TableNotFoundException" -// A source table with the name TableName does not currently exist within the -// subscriber's account. -// -// * ErrCodeContinuousBackupsUnavailableException "ContinuousBackupsUnavailableException" -// Backups have not yet been enabled for this table. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateContinuousBackups -func (c *DynamoDB) UpdateContinuousBackups(input *UpdateContinuousBackupsInput) (*UpdateContinuousBackupsOutput, error) { - req, out := c.UpdateContinuousBackupsRequest(input) - return out, req.Send() -} - -// UpdateContinuousBackupsWithContext is the same as UpdateContinuousBackups with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateContinuousBackups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) UpdateContinuousBackupsWithContext(ctx aws.Context, input *UpdateContinuousBackupsInput, opts ...request.Option) (*UpdateContinuousBackupsOutput, error) { - req, out := c.UpdateContinuousBackupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateGlobalTable = "UpdateGlobalTable" - -// UpdateGlobalTableRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGlobalTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateGlobalTable for more information on using the UpdateGlobalTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateGlobalTableRequest method. -// req, resp := client.UpdateGlobalTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateGlobalTable -func (c *DynamoDB) UpdateGlobalTableRequest(input *UpdateGlobalTableInput) (req *request.Request, output *UpdateGlobalTableOutput) { - op := &request.Operation{ - Name: opUpdateGlobalTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateGlobalTableInput{} - } - - output = &UpdateGlobalTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateGlobalTable API operation for Amazon DynamoDB. -// -// Adds or removes replicas in the specified global table. The global table -// must already exist to be able to use this operation. Any replica to be added -// must be empty, must have the same name as the global table, must have the -// same key schema, and must have DynamoDB Streams enabled and must have same -// provisioned and maximum write capacity units. -// -// Although you can use UpdateGlobalTable to add replicas and remove replicas -// in a single request, for simplicity we recommend that you issue separate -// requests for adding or removing replicas. -// -// If global secondary indexes are specified, then the following conditions -// must also be met: -// -// * The global secondary indexes must have the same name. -// -// * The global secondary indexes must have the same hash key and sort key -// (if present). -// -// * The global secondary indexes must have the same provisioned and maximum -// write capacity units. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation UpdateGlobalTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeGlobalTableNotFoundException "GlobalTableNotFoundException" -// The specified global table does not exist. -// -// * ErrCodeReplicaAlreadyExistsException "ReplicaAlreadyExistsException" -// The specified replica is already part of the global table. -// -// * ErrCodeReplicaNotFoundException "ReplicaNotFoundException" -// The specified replica is no longer part of the global table. -// -// * ErrCodeTableNotFoundException "TableNotFoundException" -// A source table with the name TableName does not currently exist within the -// subscriber's account. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateGlobalTable -func (c *DynamoDB) UpdateGlobalTable(input *UpdateGlobalTableInput) (*UpdateGlobalTableOutput, error) { - req, out := c.UpdateGlobalTableRequest(input) - return out, req.Send() -} - -// UpdateGlobalTableWithContext is the same as UpdateGlobalTable with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateGlobalTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) UpdateGlobalTableWithContext(ctx aws.Context, input *UpdateGlobalTableInput, opts ...request.Option) (*UpdateGlobalTableOutput, error) { - req, out := c.UpdateGlobalTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateGlobalTableSettings = "UpdateGlobalTableSettings" - -// UpdateGlobalTableSettingsRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGlobalTableSettings operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateGlobalTableSettings for more information on using the UpdateGlobalTableSettings -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateGlobalTableSettingsRequest method. -// req, resp := client.UpdateGlobalTableSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateGlobalTableSettings -func (c *DynamoDB) UpdateGlobalTableSettingsRequest(input *UpdateGlobalTableSettingsInput) (req *request.Request, output *UpdateGlobalTableSettingsOutput) { - op := &request.Operation{ - Name: opUpdateGlobalTableSettings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateGlobalTableSettingsInput{} - } - - output = &UpdateGlobalTableSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateGlobalTableSettings API operation for Amazon DynamoDB. -// -// Updates settings for a global table. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation UpdateGlobalTableSettings for usage and error information. -// -// Returned Error Codes: -// * ErrCodeGlobalTableNotFoundException "GlobalTableNotFoundException" -// The specified global table does not exist. -// -// * ErrCodeReplicaNotFoundException "ReplicaNotFoundException" -// The specified replica is no longer part of the global table. -// -// * ErrCodeIndexNotFoundException "IndexNotFoundException" -// The operation tried to access a nonexistent index. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateGlobalTableSettings -func (c *DynamoDB) UpdateGlobalTableSettings(input *UpdateGlobalTableSettingsInput) (*UpdateGlobalTableSettingsOutput, error) { - req, out := c.UpdateGlobalTableSettingsRequest(input) - return out, req.Send() -} - -// UpdateGlobalTableSettingsWithContext is the same as UpdateGlobalTableSettings with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateGlobalTableSettings for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) UpdateGlobalTableSettingsWithContext(ctx aws.Context, input *UpdateGlobalTableSettingsInput, opts ...request.Option) (*UpdateGlobalTableSettingsOutput, error) { - req, out := c.UpdateGlobalTableSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateItem = "UpdateItem" - -// UpdateItemRequest generates a "aws/request.Request" representing the -// client's request for the UpdateItem operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateItem for more information on using the UpdateItem -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateItemRequest method. -// req, resp := client.UpdateItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateItem -func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Request, output *UpdateItemOutput) { - op := &request.Operation{ - Name: opUpdateItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateItemInput{} - } - - output = &UpdateItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateItem API operation for Amazon DynamoDB. -// -// Edits an existing item's attributes, or adds a new item to the table if it -// does not already exist. You can put, delete, or add attribute values. You -// can also perform a conditional update on an existing item (insert a new attribute -// name-value pair if it doesn't exist, or replace an existing name-value pair -// if it has certain expected attribute values). -// -// You can also return the item's attribute values in the same UpdateItem operation -// using the ReturnValues parameter. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation UpdateItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" -// A condition specified in the operation could not be evaluated. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeItemCollectionSizeLimitExceededException "ItemCollectionSizeLimitExceededException" -// An item collection is too large. This exception is only returned for tables -// that have one or more local secondary indexes. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateItem -func (c *DynamoDB) UpdateItem(input *UpdateItemInput) (*UpdateItemOutput, error) { - req, out := c.UpdateItemRequest(input) - return out, req.Send() -} - -// UpdateItemWithContext is the same as UpdateItem with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateItem for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) UpdateItemWithContext(ctx aws.Context, input *UpdateItemInput, opts ...request.Option) (*UpdateItemOutput, error) { - req, out := c.UpdateItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTable = "UpdateTable" - -// UpdateTableRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateTable for more information on using the UpdateTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateTableRequest method. -// req, resp := client.UpdateTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTable -func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Request, output *UpdateTableOutput) { - op := &request.Operation{ - Name: opUpdateTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateTableInput{} - } - - output = &UpdateTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTable API operation for Amazon DynamoDB. -// -// Modifies the provisioned throughput settings, global secondary indexes, or -// DynamoDB Streams settings for a given table. -// -// You can only perform one of the following operations at once: -// -// * Modify the provisioned throughput settings of the table. -// -// * Enable or disable Streams on the table. -// -// * Remove a global secondary index from the table. -// -// * Create a new global secondary index on the table. Once the index begins -// backfilling, you can use UpdateTable to perform other operations. -// -// UpdateTable is an asynchronous operation; while it is executing, the table -// status changes from ACTIVE to UPDATING. While it is UPDATING, you cannot -// issue another UpdateTable request. When the table returns to the ACTIVE state, -// the UpdateTable operation is complete. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation UpdateTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTable -func (c *DynamoDB) UpdateTable(input *UpdateTableInput) (*UpdateTableOutput, error) { - req, out := c.UpdateTableRequest(input) - return out, req.Send() -} - -// UpdateTableWithContext is the same as UpdateTable with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) UpdateTableWithContext(ctx aws.Context, input *UpdateTableInput, opts ...request.Option) (*UpdateTableOutput, error) { - req, out := c.UpdateTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTimeToLive = "UpdateTimeToLive" - -// UpdateTimeToLiveRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTimeToLive operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateTimeToLive for more information on using the UpdateTimeToLive -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateTimeToLiveRequest method. -// req, resp := client.UpdateTimeToLiveRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLive -func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *request.Request, output *UpdateTimeToLiveOutput) { - op := &request.Operation{ - Name: opUpdateTimeToLive, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateTimeToLiveInput{} - } - - output = &UpdateTimeToLiveOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTimeToLive API operation for Amazon DynamoDB. -// -// The UpdateTimeToLive method will enable or disable TTL for the specified -// table. A successful UpdateTimeToLive call returns the current TimeToLiveSpecification; -// it may take up to one hour for the change to fully process. Any additional -// UpdateTimeToLive calls for the same table during this one hour duration result -// in a ValidationException. -// -// TTL compares the current time in epoch time format to the time stored in -// the TTL attribute of an item. If the epoch time value stored in the attribute -// is less than the current time, the item is marked as expired and subsequently -// deleted. -// -// The epoch time format is the number of seconds elapsed since 12:00:00 AM -// January 1st, 1970 UTC. -// -// DynamoDB deletes expired items on a best-effort basis to ensure availability -// of throughput for other data operations. -// -// DynamoDB typically deletes expired items within two days of expiration. The -// exact duration within which an item gets deleted after expiration is specific -// to the nature of the workload. Items that have expired and not been deleted -// will still show up in reads, queries, and scans. -// -// As items are deleted, they are removed from any Local Secondary Index and -// Global Secondary Index immediately in the same eventually consistent way -// as a standard delete operation. -// -// For more information, see Time To Live (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html) -// in the Amazon DynamoDB Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon DynamoDB's -// API operation UpdateTimeToLive for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Up to 50 CreateBackup operations are allowed per second, per account. There -// is no limit to the number of daily on-demand backups that can be taken. -// -// Up to 10 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, -// and RestoreTableToPointInTime. -// -// For tables with secondary indexes, only one of those tables can be in the -// CREATING state at any point in time. Do not attempt to create more than one -// such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLive -func (c *DynamoDB) UpdateTimeToLive(input *UpdateTimeToLiveInput) (*UpdateTimeToLiveOutput, error) { - req, out := c.UpdateTimeToLiveRequest(input) - return out, req.Send() -} - -// UpdateTimeToLiveWithContext is the same as UpdateTimeToLive with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTimeToLive for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) UpdateTimeToLiveWithContext(ctx aws.Context, input *UpdateTimeToLiveInput, opts ...request.Option) (*UpdateTimeToLiveOutput, error) { - req, out := c.UpdateTimeToLiveRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Represents an attribute for describing the key schema for the table and indexes. -type AttributeDefinition struct { - _ struct{} `type:"structure"` - - // A name for the attribute. - // - // AttributeName is a required field - AttributeName *string `min:"1" type:"string" required:"true"` - - // The data type for the attribute, where: - // - // * S - the attribute is of type String - // - // * N - the attribute is of type Number - // - // * B - the attribute is of type Binary - // - // AttributeType is a required field - AttributeType *string `type:"string" required:"true" enum:"ScalarAttributeType"` -} - -// String returns the string representation -func (s AttributeDefinition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttributeDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttributeDefinition"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.AttributeName != nil && len(*s.AttributeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1)) - } - if s.AttributeType == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *AttributeDefinition) SetAttributeName(v string) *AttributeDefinition { - s.AttributeName = &v - return s -} - -// SetAttributeType sets the AttributeType field's value. -func (s *AttributeDefinition) SetAttributeType(v string) *AttributeDefinition { - s.AttributeType = &v - return s -} - -// Represents the data for an attribute. -// -// Each attribute value is described as a name-value pair. The name is the data -// type, and the value is the data itself. -// -// For more information, see Data Types (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) -// in the Amazon DynamoDB Developer Guide. -type AttributeValue struct { - _ struct{} `type:"structure"` - - // An attribute of type Binary. For example: - // - // "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk" - // - // B is automatically base64 encoded/decoded by the SDK. - B []byte `type:"blob"` - - // An attribute of type Boolean. For example: - // - // "BOOL": true - BOOL *bool `type:"boolean"` - - // An attribute of type Binary Set. For example: - // - // "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="] - BS [][]byte `type:"list"` - - // An attribute of type List. For example: - // - // "L": ["Cookies", "Coffee", 3.14159] - L []*AttributeValue `type:"list"` - - // An attribute of type Map. For example: - // - // "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}} - M map[string]*AttributeValue `type:"map"` - - // An attribute of type Number. For example: - // - // "N": "123.45" - // - // Numbers are sent across the network to DynamoDB as strings, to maximize compatibility - // across languages and libraries. However, DynamoDB treats them as number type - // attributes for mathematical operations. - N *string `type:"string"` - - // An attribute of type Number Set. For example: - // - // "NS": ["42.2", "-19", "7.5", "3.14"] - // - // Numbers are sent across the network to DynamoDB as strings, to maximize compatibility - // across languages and libraries. However, DynamoDB treats them as number type - // attributes for mathematical operations. - NS []*string `type:"list"` - - // An attribute of type Null. For example: - // - // "NULL": true - NULL *bool `type:"boolean"` - - // An attribute of type String. For example: - // - // "S": "Hello" - S *string `type:"string"` - - // An attribute of type String Set. For example: - // - // "SS": ["Giraffe", "Hippo" ,"Zebra"] - SS []*string `type:"list"` -} - -// String returns the string representation -func (s AttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeValue) GoString() string { - return s.String() -} - -// SetB sets the B field's value. -func (s *AttributeValue) SetB(v []byte) *AttributeValue { - s.B = v - return s -} - -// SetBOOL sets the BOOL field's value. -func (s *AttributeValue) SetBOOL(v bool) *AttributeValue { - s.BOOL = &v - return s -} - -// SetBS sets the BS field's value. -func (s *AttributeValue) SetBS(v [][]byte) *AttributeValue { - s.BS = v - return s -} - -// SetL sets the L field's value. -func (s *AttributeValue) SetL(v []*AttributeValue) *AttributeValue { - s.L = v - return s -} - -// SetM sets the M field's value. -func (s *AttributeValue) SetM(v map[string]*AttributeValue) *AttributeValue { - s.M = v - return s -} - -// SetN sets the N field's value. -func (s *AttributeValue) SetN(v string) *AttributeValue { - s.N = &v - return s -} - -// SetNS sets the NS field's value. -func (s *AttributeValue) SetNS(v []*string) *AttributeValue { - s.NS = v - return s -} - -// SetNULL sets the NULL field's value. -func (s *AttributeValue) SetNULL(v bool) *AttributeValue { - s.NULL = &v - return s -} - -// SetS sets the S field's value. -func (s *AttributeValue) SetS(v string) *AttributeValue { - s.S = &v - return s -} - -// SetSS sets the SS field's value. -func (s *AttributeValue) SetSS(v []*string) *AttributeValue { - s.SS = v - return s -} - -// For the UpdateItem operation, represents the attributes to be modified, the -// action to perform on each, and the new value for each. -// -// You cannot use UpdateItem to update any primary key attributes. Instead, -// you will need to delete the item, and then use PutItem to create a new item -// with new attributes. -// -// Attribute values cannot be null; string and binary type attributes must have -// lengths greater than zero; and set type attributes must not be empty. Requests -// with empty values will be rejected with a ValidationException exception. -type AttributeValueUpdate struct { - _ struct{} `type:"structure"` - - // Specifies how to perform the update. Valid values are PUT (default), DELETE, - // and ADD. The behavior depends on whether the specified primary key already - // exists in the table. - // - // If an item with the specified Key is found in the table: - // - // * PUT - Adds the specified attribute to the item. If the attribute already - // exists, it is replaced by the new value. - // - // * DELETE - If no value is specified, the attribute and its value are removed - // from the item. The data type of the specified value must match the existing - // value's data type. - // - // If a set of values is specified, then those values are subtracted from the - // old set. For example, if the attribute value was the set [a,b,c] and the - // DELETE action specified [a,c], then the final attribute value would be - // [b]. Specifying an empty set is an error. - // - // * ADD - If the attribute does not already exist, then the attribute and - // its values are added to the item. If the attribute does exist, then the - // behavior of ADD depends on the data type of the attribute: - // - // If the existing attribute is a number, and if Value is also a number, then - // the Value is mathematically added to the existing attribute. If Value - // is a negative number, then it is subtracted from the existing attribute. - // - // If you use ADD to increment or decrement a number value for an item that - // doesn't exist before the update, DynamoDB uses 0 as the initial value. - // - // In addition, if you use ADD to update an existing item, and intend to increment - // or decrement an attribute value which does not yet exist, DynamoDB uses - // 0 as the initial value. For example, suppose that the item you want to - // update does not yet have an attribute named itemcount, but you decide - // to ADD the number 3 to this attribute anyway, even though it currently - // does not exist. DynamoDB will create the itemcount attribute, set its - // initial value to 0, and finally add 3 to it. The result will be a new - // itemcount attribute in the item, with a value of 3. - // - // If the existing data type is a set, and if the Value is also a set, then - // the Value is added to the existing set. (This is a set operation, not - // mathematical addition.) For example, if the attribute value was the set - // [1,2], and the ADD action specified [3], then the final attribute value - // would be [1,2,3]. An error occurs if an Add action is specified for a - // set attribute and the attribute type specified does not match the existing - // set type. - // - // Both sets must have the same primitive data type. For example, if the existing - // data type is a set of strings, the Value must also be a set of strings. - // The same holds true for number sets and binary sets. - // - // This action is only valid for an existing attribute whose data type is number - // or is a set. Do not use ADD for any other data types. - // - // If no item with the specified Key is found: - // - // * PUT - DynamoDB creates a new item with the specified primary key, and - // then adds the attribute. - // - // * DELETE - Nothing happens; there is no attribute to delete. - // - // * ADD - DynamoDB creates an item with the supplied primary key and number - // (or set of numbers) for the attribute value. The only data types allowed - // are number and number set; no other data types can be specified. - Action *string `type:"string" enum:"AttributeAction"` - - // Represents the data for an attribute. - // - // Each attribute value is described as a name-value pair. The name is the data - // type, and the value is the data itself. - // - // For more information, see Data Types (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) - // in the Amazon DynamoDB Developer Guide. - Value *AttributeValue `type:"structure"` -} - -// String returns the string representation -func (s AttributeValueUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeValueUpdate) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *AttributeValueUpdate) SetAction(v string) *AttributeValueUpdate { - s.Action = &v - return s -} - -// SetValue sets the Value field's value. -func (s *AttributeValueUpdate) SetValue(v *AttributeValue) *AttributeValueUpdate { - s.Value = v - return s -} - -// Contains the description of the backup created for the table. -type BackupDescription struct { - _ struct{} `type:"structure"` - - // Contains the details of the backup created for the table. - BackupDetails *BackupDetails `type:"structure"` - - // Contains the details of the table when the backup was created. - SourceTableDetails *SourceTableDetails `type:"structure"` - - // Contains the details of the features enabled on the table when the backup - // was created. For example, LSIs, GSIs, streams, TTL. - SourceTableFeatureDetails *SourceTableFeatureDetails `type:"structure"` -} - -// String returns the string representation -func (s BackupDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BackupDescription) GoString() string { - return s.String() -} - -// SetBackupDetails sets the BackupDetails field's value. -func (s *BackupDescription) SetBackupDetails(v *BackupDetails) *BackupDescription { - s.BackupDetails = v - return s -} - -// SetSourceTableDetails sets the SourceTableDetails field's value. -func (s *BackupDescription) SetSourceTableDetails(v *SourceTableDetails) *BackupDescription { - s.SourceTableDetails = v - return s -} - -// SetSourceTableFeatureDetails sets the SourceTableFeatureDetails field's value. -func (s *BackupDescription) SetSourceTableFeatureDetails(v *SourceTableFeatureDetails) *BackupDescription { - s.SourceTableFeatureDetails = v - return s -} - -// Contains the details of the backup created for the table. -type BackupDetails struct { - _ struct{} `type:"structure"` - - // ARN associated with the backup. - // - // BackupArn is a required field - BackupArn *string `min:"37" type:"string" required:"true"` - - // Time at which the backup was created. This is the request time of the backup. - // - // BackupCreationDateTime is a required field - BackupCreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // Name of the requested backup. - // - // BackupName is a required field - BackupName *string `min:"3" type:"string" required:"true"` - - // Size of the backup in bytes. - BackupSizeBytes *int64 `type:"long"` - - // Backup can be in one of the following states: CREATING, ACTIVE, DELETED. - // - // BackupStatus is a required field - BackupStatus *string `type:"string" required:"true" enum:"BackupStatus"` -} - -// String returns the string representation -func (s BackupDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BackupDetails) GoString() string { - return s.String() -} - -// SetBackupArn sets the BackupArn field's value. -func (s *BackupDetails) SetBackupArn(v string) *BackupDetails { - s.BackupArn = &v - return s -} - -// SetBackupCreationDateTime sets the BackupCreationDateTime field's value. -func (s *BackupDetails) SetBackupCreationDateTime(v time.Time) *BackupDetails { - s.BackupCreationDateTime = &v - return s -} - -// SetBackupName sets the BackupName field's value. -func (s *BackupDetails) SetBackupName(v string) *BackupDetails { - s.BackupName = &v - return s -} - -// SetBackupSizeBytes sets the BackupSizeBytes field's value. -func (s *BackupDetails) SetBackupSizeBytes(v int64) *BackupDetails { - s.BackupSizeBytes = &v - return s -} - -// SetBackupStatus sets the BackupStatus field's value. -func (s *BackupDetails) SetBackupStatus(v string) *BackupDetails { - s.BackupStatus = &v - return s -} - -// Contains details for the backup. -type BackupSummary struct { - _ struct{} `type:"structure"` - - // ARN associated with the backup. - BackupArn *string `min:"37" type:"string"` - - // Time at which the backup was created. - BackupCreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Name of the specified backup. - BackupName *string `min:"3" type:"string"` - - // Size of the backup in bytes. - BackupSizeBytes *int64 `type:"long"` - - // Backup can be in one of the following states: CREATING, ACTIVE, DELETED. - BackupStatus *string `type:"string" enum:"BackupStatus"` - - // ARN associated with the table. - TableArn *string `type:"string"` - - // Unique identifier for the table. - TableId *string `type:"string"` - - // Name of the table. - TableName *string `min:"3" type:"string"` -} - -// String returns the string representation -func (s BackupSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BackupSummary) GoString() string { - return s.String() -} - -// SetBackupArn sets the BackupArn field's value. -func (s *BackupSummary) SetBackupArn(v string) *BackupSummary { - s.BackupArn = &v - return s -} - -// SetBackupCreationDateTime sets the BackupCreationDateTime field's value. -func (s *BackupSummary) SetBackupCreationDateTime(v time.Time) *BackupSummary { - s.BackupCreationDateTime = &v - return s -} - -// SetBackupName sets the BackupName field's value. -func (s *BackupSummary) SetBackupName(v string) *BackupSummary { - s.BackupName = &v - return s -} - -// SetBackupSizeBytes sets the BackupSizeBytes field's value. -func (s *BackupSummary) SetBackupSizeBytes(v int64) *BackupSummary { - s.BackupSizeBytes = &v - return s -} - -// SetBackupStatus sets the BackupStatus field's value. -func (s *BackupSummary) SetBackupStatus(v string) *BackupSummary { - s.BackupStatus = &v - return s -} - -// SetTableArn sets the TableArn field's value. -func (s *BackupSummary) SetTableArn(v string) *BackupSummary { - s.TableArn = &v - return s -} - -// SetTableId sets the TableId field's value. -func (s *BackupSummary) SetTableId(v string) *BackupSummary { - s.TableId = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *BackupSummary) SetTableName(v string) *BackupSummary { - s.TableName = &v - return s -} - -// Represents the input of a BatchGetItem operation. -type BatchGetItemInput struct { - _ struct{} `type:"structure"` - - // A map of one or more table names and, for each table, a map that describes - // one or more items to retrieve from that table. Each table name can be used - // only once per BatchGetItem request. - // - // Each element in the map of items to retrieve consists of the following: - // - // * ConsistentRead - If true, a strongly consistent read is used; if false - // (the default), an eventually consistent read is used. - // - // * ExpressionAttributeNames - One or more substitution tokens for attribute - // names in the ProjectionExpression parameter. The following are some use - // cases for using ExpressionAttributeNames: - // - // To access an attribute whose name conflicts with a DynamoDB reserved word. - // - // To create a placeholder for repeating occurrences of an attribute name in - // an expression. - // - // To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could - // specify the following for ExpressionAttributeNames: - // - // {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - // - // * Keys - An array of primary key attribute values that define specific - // items in the table. For each primary key, you must provide all of the - // key attributes. For example, with a simple primary key, you only need - // to provide the partition key value. For a composite key, you must provide - // both the partition key value and the sort key value. - // - // * ProjectionExpression - A string that identifies one or more attributes - // to retrieve from the table. These attributes can include scalars, sets, - // or elements of a JSON document. The attributes in the expression must - // be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear - // in the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - // - // * AttributesToGet - This is a legacy parameter. Use ProjectionExpression - // instead. For more information, see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - // - // RequestItems is a required field - RequestItems map[string]*KeysAndAttributes `min:"1" type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` -} - -// String returns the string representation -func (s BatchGetItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetItemInput"} - if s.RequestItems == nil { - invalidParams.Add(request.NewErrParamRequired("RequestItems")) - } - if s.RequestItems != nil && len(s.RequestItems) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestItems", 1)) - } - if s.RequestItems != nil { - for i, v := range s.RequestItems { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RequestItems", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRequestItems sets the RequestItems field's value. -func (s *BatchGetItemInput) SetRequestItems(v map[string]*KeysAndAttributes) *BatchGetItemInput { - s.RequestItems = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *BatchGetItemInput) SetReturnConsumedCapacity(v string) *BatchGetItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// Represents the output of a BatchGetItem operation. -type BatchGetItemOutput struct { - _ struct{} `type:"structure"` - - // The read capacity units consumed by the entire BatchGetItem operation. - // - // Each element consists of: - // - // * TableName - The table that consumed the provisioned throughput. - // - // * CapacityUnits - The total number of capacity units consumed. - ConsumedCapacity []*ConsumedCapacity `type:"list"` - - // A map of table name to a list of items. Each object in Responses consists - // of a table name, along with a map of attribute data consisting of the data - // type and attribute value. - Responses map[string][]map[string]*AttributeValue `type:"map"` - - // A map of tables and their respective keys that were not processed with the - // current response. The UnprocessedKeys value is in the same form as RequestItems, - // so the value can be provided directly to a subsequent BatchGetItem operation. - // For more information, see RequestItems in the Request Parameters section. - // - // Each element consists of: - // - // * Keys - An array of primary key attribute values that define specific - // items in the table. - // - // * ProjectionExpression - One or more attributes to be retrieved from the - // table or index. By default, all attributes are returned. If a requested - // attribute is not found, it does not appear in the result. - // - // * ConsistentRead - The consistency of a read operation. If set to true, - // then a strongly consistent read is used; otherwise, an eventually consistent - // read is used. - // - // If there are no unprocessed keys remaining, the response contains an empty - // UnprocessedKeys map. - UnprocessedKeys map[string]*KeysAndAttributes `min:"1" type:"map"` -} - -// String returns the string representation -func (s BatchGetItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetItemOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *BatchGetItemOutput) SetConsumedCapacity(v []*ConsumedCapacity) *BatchGetItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetResponses sets the Responses field's value. -func (s *BatchGetItemOutput) SetResponses(v map[string][]map[string]*AttributeValue) *BatchGetItemOutput { - s.Responses = v - return s -} - -// SetUnprocessedKeys sets the UnprocessedKeys field's value. -func (s *BatchGetItemOutput) SetUnprocessedKeys(v map[string]*KeysAndAttributes) *BatchGetItemOutput { - s.UnprocessedKeys = v - return s -} - -// Represents the input of a BatchWriteItem operation. -type BatchWriteItemInput struct { - _ struct{} `type:"structure"` - - // A map of one or more table names and, for each table, a list of operations - // to be performed (DeleteRequest or PutRequest). Each element in the map consists - // of the following: - // - // * DeleteRequest - Perform a DeleteItem operation on the specified item. - // The item to be deleted is identified by a Key subelement: - // - // Key - A map of primary key attribute values that uniquely identify the item. - // Each entry in this map consists of an attribute name and an attribute - // value. For each primary key, you must provide all of the key attributes. - // For example, with a simple primary key, you only need to provide a value - // for the partition key. For a composite primary key, you must provide values - // for both the partition key and the sort key. - // - // * PutRequest - Perform a PutItem operation on the specified item. The - // item to be put is identified by an Item subelement: - // - // Item - A map of attributes and their values. Each entry in this map consists - // of an attribute name and an attribute value. Attribute values must not - // be null; string and binary type attributes must have lengths greater than - // zero; and set type attributes must not be empty. Requests that contain - // empty values will be rejected with a ValidationException exception. - // - // If you specify any attributes that are part of an index key, then the data - // types for those attributes must match those of the schema in the table's - // attribute definition. - // - // RequestItems is a required field - RequestItems map[string][]*WriteRequest `min:"1" type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Determines whether item collection metrics are returned. If set to SIZE, - // the response includes statistics about item collections, if any, that were - // modified during the operation are returned in the response. If set to NONE - // (the default), no statistics are returned. - ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"` -} - -// String returns the string representation -func (s BatchWriteItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchWriteItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchWriteItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchWriteItemInput"} - if s.RequestItems == nil { - invalidParams.Add(request.NewErrParamRequired("RequestItems")) - } - if s.RequestItems != nil && len(s.RequestItems) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRequestItems sets the RequestItems field's value. -func (s *BatchWriteItemInput) SetRequestItems(v map[string][]*WriteRequest) *BatchWriteItemInput { - s.RequestItems = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *BatchWriteItemInput) SetReturnConsumedCapacity(v string) *BatchWriteItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *BatchWriteItemInput) SetReturnItemCollectionMetrics(v string) *BatchWriteItemInput { - s.ReturnItemCollectionMetrics = &v - return s -} - -// Represents the output of a BatchWriteItem operation. -type BatchWriteItemOutput struct { - _ struct{} `type:"structure"` - - // The capacity units consumed by the entire BatchWriteItem operation. - // - // Each element consists of: - // - // * TableName - The table that consumed the provisioned throughput. - // - // * CapacityUnits - The total number of capacity units consumed. - ConsumedCapacity []*ConsumedCapacity `type:"list"` - - // A list of tables that were processed by BatchWriteItem and, for each table, - // information about any item collections that were affected by individual DeleteItem - // or PutItem operations. - // - // Each entry consists of the following subelements: - // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item. - // - // * SizeEstimateRangeGB - An estimate of item collection size, expressed - // in GB. This is a two-element array containing a lower bound and an upper - // bound for the estimate. The estimate includes the size of all the items - // in the table, plus the size of all attributes projected into all of the - // local secondary indexes on the table. Use this estimate to measure whether - // a local secondary index is approaching its size limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - ItemCollectionMetrics map[string][]*ItemCollectionMetrics `type:"map"` - - // A map of tables and requests against those tables that were not processed. - // The UnprocessedItems value is in the same form as RequestItems, so you can - // provide this value directly to a subsequent BatchGetItem operation. For more - // information, see RequestItems in the Request Parameters section. - // - // Each UnprocessedItems entry consists of a table name and, for that table, - // a list of operations to perform (DeleteRequest or PutRequest). - // - // * DeleteRequest - Perform a DeleteItem operation on the specified item. - // The item to be deleted is identified by a Key subelement: - // - // Key - A map of primary key attribute values that uniquely identify the item. - // Each entry in this map consists of an attribute name and an attribute - // value. - // - // * PutRequest - Perform a PutItem operation on the specified item. The - // item to be put is identified by an Item subelement: - // - // Item - A map of attributes and their values. Each entry in this map consists - // of an attribute name and an attribute value. Attribute values must not - // be null; string and binary type attributes must have lengths greater than - // zero; and set type attributes must not be empty. Requests that contain - // empty values will be rejected with a ValidationException exception. - // - // If you specify any attributes that are part of an index key, then the data - // types for those attributes must match those of the schema in the table's - // attribute definition. - // - // If there are no unprocessed items remaining, the response contains an empty - // UnprocessedItems map. - UnprocessedItems map[string][]*WriteRequest `min:"1" type:"map"` -} - -// String returns the string representation -func (s BatchWriteItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchWriteItemOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *BatchWriteItemOutput) SetConsumedCapacity(v []*ConsumedCapacity) *BatchWriteItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *BatchWriteItemOutput) SetItemCollectionMetrics(v map[string][]*ItemCollectionMetrics) *BatchWriteItemOutput { - s.ItemCollectionMetrics = v - return s -} - -// SetUnprocessedItems sets the UnprocessedItems field's value. -func (s *BatchWriteItemOutput) SetUnprocessedItems(v map[string][]*WriteRequest) *BatchWriteItemOutput { - s.UnprocessedItems = v - return s -} - -// Represents the amount of provisioned throughput capacity consumed on a table -// or an index. -type Capacity struct { - _ struct{} `type:"structure"` - - // The total number of capacity units consumed on a table or an index. - CapacityUnits *float64 `type:"double"` -} - -// String returns the string representation -func (s Capacity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Capacity) GoString() string { - return s.String() -} - -// SetCapacityUnits sets the CapacityUnits field's value. -func (s *Capacity) SetCapacityUnits(v float64) *Capacity { - s.CapacityUnits = &v - return s -} - -// Represents the selection criteria for a Query or Scan operation: -// -// * For a Query operation, Condition is used for specifying the KeyConditions -// to use when querying a table or an index. For KeyConditions, only the -// following comparison operators are supported: -// -// EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN -// -// Condition is also used in a QueryFilter, which evaluates the query results -// and returns only the desired values. -// -// * For a Scan operation, Condition is used in a ScanFilter, which evaluates -// the scan results and returns only the desired values. -type Condition struct { - _ struct{} `type:"structure"` - - // One or more values to evaluate against the supplied attribute. The number - // of values in the list depends on the ComparisonOperator being used. - // - // For type Number, value comparisons are numeric. - // - // String value comparisons for greater than, equals, or less than are based - // on ASCII character code values. For example, a is greater than A, and a is - // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters - // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). - // - // For Binary, DynamoDB treats each byte of the binary data as unsigned when - // it compares binary values. - AttributeValueList []*AttributeValue `type:"list"` - - // A comparator for evaluating attributes. For example, equals, greater than, - // less than, etc. - // - // The following comparison operators are available: - // - // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | - // BEGINS_WITH | IN | BETWEEN - // - // The following are descriptions of each comparison operator. - // - // * EQ : Equal. EQ is supported for all data types, including lists and - // maps. - // - // AttributeValueList can contain only one AttributeValue element of type String, - // Number, Binary, String Set, Number Set, or Binary Set. If an item contains - // an AttributeValue element of a different type than the one provided in - // the request, the value does not match. For example, {"S":"6"} does not - // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. - // - // * NE : Not equal. NE is supported for all data types, including lists - // and maps. - // - // * AttributeValueList can contain only one AttributeValue of type String, - // Number, Binary, String Set, Number Set, or Binary Set. If an item contains - // an AttributeValue of a different type than the one provided in the request, - // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. - // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. - // - // * LE : Less than or equal. - // - // AttributeValueList can contain only one AttributeValue element of type String, - // Number, or Binary (not a set type). If an item contains an AttributeValue - // element of a different type than the one provided in the request, the value - // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} - // does not compare to {"NS":["6", "2", "1"]}. - // - // LT: Less than. - // - // AttributeValueListcan contain only one AttributeValueof type String, Number, or Binary (not a set type). If an item contains an - // AttributeValueelement of a different type than the one provided in the request, the value - // does not match. For example, {"S":"6"}does not equal {"N":"6"}. Also, {"N":"6"}does not compare to {"NS":["6", "2", "1"]} - // - // ComparisonOperator is a required field - ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` -} - -// String returns the string representation -func (s Condition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Condition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Condition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Condition"} - if s.ComparisonOperator == nil { - invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeValueList sets the AttributeValueList field's value. -func (s *Condition) SetAttributeValueList(v []*AttributeValue) *Condition { - s.AttributeValueList = v - return s -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *Condition) SetComparisonOperator(v string) *Condition { - s.ComparisonOperator = &v - return s -} - -// The capacity units consumed by an operation. The data returned includes the -// total provisioned throughput consumed, along with statistics for the table -// and any indexes involved in the operation. ConsumedCapacity is only returned -// if the request asked for it. For more information, see Provisioned Throughput -// (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) -// in the Amazon DynamoDB Developer Guide. -type ConsumedCapacity struct { - _ struct{} `type:"structure"` - - // The total number of capacity units consumed by the operation. - CapacityUnits *float64 `type:"double"` - - // The amount of throughput consumed on each global index affected by the operation. - GlobalSecondaryIndexes map[string]*Capacity `type:"map"` - - // The amount of throughput consumed on each local index affected by the operation. - LocalSecondaryIndexes map[string]*Capacity `type:"map"` - - // The amount of throughput consumed on the table affected by the operation. - Table *Capacity `type:"structure"` - - // The name of the table that was affected by the operation. - TableName *string `min:"3" type:"string"` -} - -// String returns the string representation -func (s ConsumedCapacity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConsumedCapacity) GoString() string { - return s.String() -} - -// SetCapacityUnits sets the CapacityUnits field's value. -func (s *ConsumedCapacity) SetCapacityUnits(v float64) *ConsumedCapacity { - s.CapacityUnits = &v - return s -} - -// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. -func (s *ConsumedCapacity) SetGlobalSecondaryIndexes(v map[string]*Capacity) *ConsumedCapacity { - s.GlobalSecondaryIndexes = v - return s -} - -// SetLocalSecondaryIndexes sets the LocalSecondaryIndexes field's value. -func (s *ConsumedCapacity) SetLocalSecondaryIndexes(v map[string]*Capacity) *ConsumedCapacity { - s.LocalSecondaryIndexes = v - return s -} - -// SetTable sets the Table field's value. -func (s *ConsumedCapacity) SetTable(v *Capacity) *ConsumedCapacity { - s.Table = v - return s -} - -// SetTableName sets the TableName field's value. -func (s *ConsumedCapacity) SetTableName(v string) *ConsumedCapacity { - s.TableName = &v - return s -} - -// Represents the continuous backups and point in time recovery settings on -// the table. -type ContinuousBackupsDescription struct { - _ struct{} `type:"structure"` - - // ContinuousBackupsStatus can be one of the following states : ENABLED, DISABLED - // - // ContinuousBackupsStatus is a required field - ContinuousBackupsStatus *string `type:"string" required:"true" enum:"ContinuousBackupsStatus"` - - // The description of the point in time recovery settings applied to the table. - PointInTimeRecoveryDescription *PointInTimeRecoveryDescription `type:"structure"` -} - -// String returns the string representation -func (s ContinuousBackupsDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContinuousBackupsDescription) GoString() string { - return s.String() -} - -// SetContinuousBackupsStatus sets the ContinuousBackupsStatus field's value. -func (s *ContinuousBackupsDescription) SetContinuousBackupsStatus(v string) *ContinuousBackupsDescription { - s.ContinuousBackupsStatus = &v - return s -} - -// SetPointInTimeRecoveryDescription sets the PointInTimeRecoveryDescription field's value. -func (s *ContinuousBackupsDescription) SetPointInTimeRecoveryDescription(v *PointInTimeRecoveryDescription) *ContinuousBackupsDescription { - s.PointInTimeRecoveryDescription = v - return s -} - -type CreateBackupInput struct { - _ struct{} `type:"structure"` - - // Specified name for the backup. - // - // BackupName is a required field - BackupName *string `min:"3" type:"string" required:"true"` - - // The name of the table. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateBackupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateBackupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateBackupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateBackupInput"} - if s.BackupName == nil { - invalidParams.Add(request.NewErrParamRequired("BackupName")) - } - if s.BackupName != nil && len(*s.BackupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BackupName", 3)) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupName sets the BackupName field's value. -func (s *CreateBackupInput) SetBackupName(v string) *CreateBackupInput { - s.BackupName = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *CreateBackupInput) SetTableName(v string) *CreateBackupInput { - s.TableName = &v - return s -} - -type CreateBackupOutput struct { - _ struct{} `type:"structure"` - - // Contains the details of the backup created for the table. - BackupDetails *BackupDetails `type:"structure"` -} - -// String returns the string representation -func (s CreateBackupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateBackupOutput) GoString() string { - return s.String() -} - -// SetBackupDetails sets the BackupDetails field's value. -func (s *CreateBackupOutput) SetBackupDetails(v *BackupDetails) *CreateBackupOutput { - s.BackupDetails = v - return s -} - -// Represents a new global secondary index to be added to an existing table. -type CreateGlobalSecondaryIndexAction struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index to be created. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The key schema for the global secondary index. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // Represents attributes that are copied (projected) from the table into an - // index. These are in addition to the primary key attributes and index key - // attributes, which are automatically projected. - // - // Projection is a required field - Projection *Projection `type:"structure" required:"true"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateGlobalSecondaryIndexAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGlobalSecondaryIndexAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGlobalSecondaryIndexAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGlobalSecondaryIndexAction"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.KeySchema == nil { - invalidParams.Add(request.NewErrParamRequired("KeySchema")) - } - if s.KeySchema != nil && len(s.KeySchema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1)) - } - if s.Projection == nil { - invalidParams.Add(request.NewErrParamRequired("Projection")) - } - if s.ProvisionedThroughput == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput")) - } - if s.KeySchema != nil { - for i, v := range s.KeySchema { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Projection != nil { - if err := s.Projection.Validate(); err != nil { - invalidParams.AddNested("Projection", err.(request.ErrInvalidParams)) - } - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *CreateGlobalSecondaryIndexAction) SetIndexName(v string) *CreateGlobalSecondaryIndexAction { - s.IndexName = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *CreateGlobalSecondaryIndexAction) SetKeySchema(v []*KeySchemaElement) *CreateGlobalSecondaryIndexAction { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *CreateGlobalSecondaryIndexAction) SetProjection(v *Projection) *CreateGlobalSecondaryIndexAction { - s.Projection = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *CreateGlobalSecondaryIndexAction) SetProvisionedThroughput(v *ProvisionedThroughput) *CreateGlobalSecondaryIndexAction { - s.ProvisionedThroughput = v - return s -} - -type CreateGlobalTableInput struct { - _ struct{} `type:"structure"` - - // The global table name. - // - // GlobalTableName is a required field - GlobalTableName *string `min:"3" type:"string" required:"true"` - - // The regions where the global table needs to be created. - // - // ReplicationGroup is a required field - ReplicationGroup []*Replica `type:"list" required:"true"` -} - -// String returns the string representation -func (s CreateGlobalTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGlobalTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGlobalTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGlobalTableInput"} - if s.GlobalTableName == nil { - invalidParams.Add(request.NewErrParamRequired("GlobalTableName")) - } - if s.GlobalTableName != nil && len(*s.GlobalTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("GlobalTableName", 3)) - } - if s.ReplicationGroup == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationGroup")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *CreateGlobalTableInput) SetGlobalTableName(v string) *CreateGlobalTableInput { - s.GlobalTableName = &v - return s -} - -// SetReplicationGroup sets the ReplicationGroup field's value. -func (s *CreateGlobalTableInput) SetReplicationGroup(v []*Replica) *CreateGlobalTableInput { - s.ReplicationGroup = v - return s -} - -type CreateGlobalTableOutput struct { - _ struct{} `type:"structure"` - - // Contains the details of the global table. - GlobalTableDescription *GlobalTableDescription `type:"structure"` -} - -// String returns the string representation -func (s CreateGlobalTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGlobalTableOutput) GoString() string { - return s.String() -} - -// SetGlobalTableDescription sets the GlobalTableDescription field's value. -func (s *CreateGlobalTableOutput) SetGlobalTableDescription(v *GlobalTableDescription) *CreateGlobalTableOutput { - s.GlobalTableDescription = v - return s -} - -// Represents a replica to be added. -type CreateReplicaAction struct { - _ struct{} `type:"structure"` - - // The region of the replica to be added. - // - // RegionName is a required field - RegionName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateReplicaAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReplicaAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReplicaAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReplicaAction"} - if s.RegionName == nil { - invalidParams.Add(request.NewErrParamRequired("RegionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegionName sets the RegionName field's value. -func (s *CreateReplicaAction) SetRegionName(v string) *CreateReplicaAction { - s.RegionName = &v - return s -} - -// Represents the input of a CreateTable operation. -type CreateTableInput struct { - _ struct{} `type:"structure"` - - // An array of attributes that describe the key schema for the table and indexes. - // - // AttributeDefinitions is a required field - AttributeDefinitions []*AttributeDefinition `type:"list" required:"true"` - - // One or more global secondary indexes (the maximum is five) to be created - // on the table. Each global secondary index in the array includes the following: - // - // * IndexName - The name of the global secondary index. Must be unique only - // for this table. - // - // * KeySchema - Specifies the key schema for the global secondary index. - // - // * Projection - Specifies attributes that are copied (projected) from the - // table into the index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. Each attribute - // specification is composed of: - // - // * ProjectionType - One of the following: - // - // KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // INCLUDE - Only the specified table attributes are projected into the index. - // The list of projected attributes are in NonKeyAttributes. - // - // ALL - All of the table attributes are projected into the index. - // - // NonKeyAttributes - A list of one or more non-key attribute names that are - // projected into the secondary index. The total count of attributes provided - // in NonKeyAttributes, summed across all of the secondary indexes, must - // not exceed 20. If you project the same attribute into two different indexes, - // this counts as two distinct attributes when determining the total. - // - // * ProvisionedThroughput - The provisioned throughput settings for the - // global secondary index, consisting of read and write capacity units. - GlobalSecondaryIndexes []*GlobalSecondaryIndex `type:"list"` - - // Specifies the attributes that make up the primary key for a table or an index. - // The attributes in KeySchema must also be defined in the AttributeDefinitions - // array. For more information, see Data Model (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html) - // in the Amazon DynamoDB Developer Guide. - // - // Each KeySchemaElement in the array is composed of: - // - // * AttributeName - The name of this key attribute. - // - // * KeyType - The role that the key attribute will assume: - // - // HASH - partition key - // - // RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // For a simple primary key (partition key), you must provide exactly one element - // with a KeyType of HASH. - // - // For a composite primary key (partition key and sort key), you must provide - // exactly two elements, in this order: The first element must have a KeyType - // of HASH, and the second element must have a KeyType of RANGE. - // - // For more information, see Specifying the Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key) - // in the Amazon DynamoDB Developer Guide. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // One or more local secondary indexes (the maximum is five) to be created on - // the table. Each index is scoped to a given partition key value. There is - // a 10 GB size limit per partition key value; otherwise, the size of a local - // secondary index is unconstrained. - // - // Each local secondary index in the array includes the following: - // - // * IndexName - The name of the local secondary index. Must be unique only - // for this table. - // - // * KeySchema - Specifies the key schema for the local secondary index. - // The key schema must begin with the same partition key as the table. - // - // * Projection - Specifies attributes that are copied (projected) from the - // table into the index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. Each attribute - // specification is composed of: - // - // * ProjectionType - One of the following: - // - // KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // INCLUDE - Only the specified table attributes are projected into the index. - // The list of projected attributes are in NonKeyAttributes. - // - // ALL - All of the table attributes are projected into the index. - // - // NonKeyAttributes - A list of one or more non-key attribute names that are - // projected into the secondary index. The total count of attributes provided - // in NonKeyAttributes, summed across all of the secondary indexes, must - // not exceed 20. If you project the same attribute into two different indexes, - // this counts as two distinct attributes when determining the total. - LocalSecondaryIndexes []*LocalSecondaryIndex `type:"list"` - - // Represents the provisioned throughput settings for a specified table or index. - // The settings can be modified using the UpdateTable operation. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` - - // Represents the settings used to enable server-side encryption. - SSESpecification *SSESpecification `type:"structure"` - - // The settings for DynamoDB Streams on the table. These settings consist of: - // - // * StreamEnabled - Indicates whether Streams is to be enabled (true) or - // disabled (false). - // - // * StreamViewType - When an item in the table is modified, StreamViewType - // determines what information is written to the table's stream. Valid values - // for StreamViewType are: - // - // KEYS_ONLY - Only the key attributes of the modified item are written to the - // stream. - // - // NEW_IMAGE - The entire item, as it appears after it was modified, is written - // to the stream. - // - // OLD_IMAGE - The entire item, as it appeared before it was modified, is written - // to the stream. - // - // NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are - // written to the stream. - StreamSpecification *StreamSpecification `type:"structure"` - - // The name of the table to create. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTableInput"} - if s.AttributeDefinitions == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeDefinitions")) - } - if s.KeySchema == nil { - invalidParams.Add(request.NewErrParamRequired("KeySchema")) - } - if s.KeySchema != nil && len(s.KeySchema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1)) - } - if s.ProvisionedThroughput == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.AttributeDefinitions != nil { - for i, v := range s.AttributeDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AttributeDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.GlobalSecondaryIndexes != nil { - for i, v := range s.GlobalSecondaryIndexes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.KeySchema != nil { - for i, v := range s.KeySchema { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams)) - } - } - } - if s.LocalSecondaryIndexes != nil { - for i, v := range s.LocalSecondaryIndexes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LocalSecondaryIndexes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - if s.SSESpecification != nil { - if err := s.SSESpecification.Validate(); err != nil { - invalidParams.AddNested("SSESpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeDefinitions sets the AttributeDefinitions field's value. -func (s *CreateTableInput) SetAttributeDefinitions(v []*AttributeDefinition) *CreateTableInput { - s.AttributeDefinitions = v - return s -} - -// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. -func (s *CreateTableInput) SetGlobalSecondaryIndexes(v []*GlobalSecondaryIndex) *CreateTableInput { - s.GlobalSecondaryIndexes = v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *CreateTableInput) SetKeySchema(v []*KeySchemaElement) *CreateTableInput { - s.KeySchema = v - return s -} - -// SetLocalSecondaryIndexes sets the LocalSecondaryIndexes field's value. -func (s *CreateTableInput) SetLocalSecondaryIndexes(v []*LocalSecondaryIndex) *CreateTableInput { - s.LocalSecondaryIndexes = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *CreateTableInput) SetProvisionedThroughput(v *ProvisionedThroughput) *CreateTableInput { - s.ProvisionedThroughput = v - return s -} - -// SetSSESpecification sets the SSESpecification field's value. -func (s *CreateTableInput) SetSSESpecification(v *SSESpecification) *CreateTableInput { - s.SSESpecification = v - return s -} - -// SetStreamSpecification sets the StreamSpecification field's value. -func (s *CreateTableInput) SetStreamSpecification(v *StreamSpecification) *CreateTableInput { - s.StreamSpecification = v - return s -} - -// SetTableName sets the TableName field's value. -func (s *CreateTableInput) SetTableName(v string) *CreateTableInput { - s.TableName = &v - return s -} - -// Represents the output of a CreateTable operation. -type CreateTableOutput struct { - _ struct{} `type:"structure"` - - // Represents the properties of the table. - TableDescription *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s CreateTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTableOutput) GoString() string { - return s.String() -} - -// SetTableDescription sets the TableDescription field's value. -func (s *CreateTableOutput) SetTableDescription(v *TableDescription) *CreateTableOutput { - s.TableDescription = v - return s -} - -type DeleteBackupInput struct { - _ struct{} `type:"structure"` - - // The ARN associated with the backup. - // - // BackupArn is a required field - BackupArn *string `min:"37" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBackupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBackupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBackupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBackupInput"} - if s.BackupArn == nil { - invalidParams.Add(request.NewErrParamRequired("BackupArn")) - } - if s.BackupArn != nil && len(*s.BackupArn) < 37 { - invalidParams.Add(request.NewErrParamMinLen("BackupArn", 37)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupArn sets the BackupArn field's value. -func (s *DeleteBackupInput) SetBackupArn(v string) *DeleteBackupInput { - s.BackupArn = &v - return s -} - -type DeleteBackupOutput struct { - _ struct{} `type:"structure"` - - // Contains the description of the backup created for the table. - BackupDescription *BackupDescription `type:"structure"` -} - -// String returns the string representation -func (s DeleteBackupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBackupOutput) GoString() string { - return s.String() -} - -// SetBackupDescription sets the BackupDescription field's value. -func (s *DeleteBackupOutput) SetBackupDescription(v *BackupDescription) *DeleteBackupOutput { - s.BackupDescription = v - return s -} - -// Represents a global secondary index to be deleted from an existing table. -type DeleteGlobalSecondaryIndexAction struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index to be deleted. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteGlobalSecondaryIndexAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGlobalSecondaryIndexAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGlobalSecondaryIndexAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGlobalSecondaryIndexAction"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *DeleteGlobalSecondaryIndexAction) SetIndexName(v string) *DeleteGlobalSecondaryIndexAction { - s.IndexName = &v - return s -} - -// Represents the input of a DeleteItem operation. -type DeleteItemInput struct { - _ struct{} `type:"structure"` - - // A condition that must be satisfied in order for a conditional DeleteItem - // to succeed. - // - // An expression can contain any of the following: - // - // * Functions: attribute_exists | attribute_not_exists | attribute_type - // | contains | begins_with | size - // - // These function names are case-sensitive. - // - // * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN - // - // * Logical operators: AND | OR | NOT - // - // For more information on condition expressions, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ConditionExpression *string `type:"string"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - // in the Amazon DynamoDB Developer Guide. - Expected map[string]*ExpectedAttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A map of attribute names to AttributeValue objects, representing the primary - // key of the item to delete. - // - // For the primary key, you must provide all of the attributes. For example, - // with a simple primary key, you only need to provide a value for the partition - // key. For a composite primary key, you must provide values for both the partition - // key and the sort key. - // - // Key is a required field - Key map[string]*AttributeValue `type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Determines whether item collection metrics are returned. If set to SIZE, - // the response includes statistics about item collections, if any, that were - // modified during the operation are returned in the response. If set to NONE - // (the default), no statistics are returned. - ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"` - - // Use ReturnValues if you want to get the item attributes as they appeared - // before they were deleted. For DeleteItem, the valid values are: - // - // * NONE - If ReturnValues is not specified, or if its value is NONE, then - // nothing is returned. (This setting is the default for ReturnValues.) - // - // * ALL_OLD - The content of the old item is returned. - // - // The ReturnValues parameter is used by several DynamoDB operations; however, - // DeleteItem does not recognize any values other than NONE or ALL_OLD. - ReturnValues *string `type:"string" enum:"ReturnValue"` - - // The name of the table from which to delete the item. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteItemInput"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConditionExpression sets the ConditionExpression field's value. -func (s *DeleteItemInput) SetConditionExpression(v string) *DeleteItemInput { - s.ConditionExpression = &v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *DeleteItemInput) SetConditionalOperator(v string) *DeleteItemInput { - s.ConditionalOperator = &v - return s -} - -// SetExpected sets the Expected field's value. -func (s *DeleteItemInput) SetExpected(v map[string]*ExpectedAttributeValue) *DeleteItemInput { - s.Expected = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *DeleteItemInput) SetExpressionAttributeNames(v map[string]*string) *DeleteItemInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *DeleteItemInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *DeleteItemInput { - s.ExpressionAttributeValues = v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteItemInput) SetKey(v map[string]*AttributeValue) *DeleteItemInput { - s.Key = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *DeleteItemInput) SetReturnConsumedCapacity(v string) *DeleteItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *DeleteItemInput) SetReturnItemCollectionMetrics(v string) *DeleteItemInput { - s.ReturnItemCollectionMetrics = &v - return s -} - -// SetReturnValues sets the ReturnValues field's value. -func (s *DeleteItemInput) SetReturnValues(v string) *DeleteItemInput { - s.ReturnValues = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *DeleteItemInput) SetTableName(v string) *DeleteItemInput { - s.TableName = &v - return s -} - -// Represents the output of a DeleteItem operation. -type DeleteItemOutput struct { - _ struct{} `type:"structure"` - - // A map of attribute names to AttributeValue objects, representing the item - // as it appeared before the DeleteItem operation. This map appears in the response - // only if ReturnValues was specified as ALL_OLD in the request. - Attributes map[string]*AttributeValue `type:"map"` - - // The capacity units consumed by the DeleteItem operation. The data returned - // includes the total provisioned throughput consumed, along with statistics - // for the table and any indexes involved in the operation. ConsumedCapacity - // is only returned if the ReturnConsumedCapacity parameter was specified. For - // more information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // Information about item collections, if any, that were affected by the DeleteItem - // operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics - // parameter was specified. If the table does not have any local secondary indexes, - // this information is not returned in the response. - // - // Each ItemCollectionMetrics element consists of: - // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item itself. - // - // * SizeEstimateRangeGB - An estimate of item collection size, in gigabytes. - // This value is a two-element array containing a lower bound and an upper - // bound for the estimate. The estimate includes the size of all the items - // in the table, plus the size of all attributes projected into all of the - // local secondary indexes on that table. Use this estimate to measure whether - // a local secondary index is approaching its size limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"` -} - -// String returns the string representation -func (s DeleteItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteItemOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *DeleteItemOutput) SetAttributes(v map[string]*AttributeValue) *DeleteItemOutput { - s.Attributes = v - return s -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *DeleteItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *DeleteItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *DeleteItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *DeleteItemOutput { - s.ItemCollectionMetrics = v - return s -} - -// Represents a replica to be removed. -type DeleteReplicaAction struct { - _ struct{} `type:"structure"` - - // The region of the replica to be removed. - // - // RegionName is a required field - RegionName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteReplicaAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReplicaAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReplicaAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReplicaAction"} - if s.RegionName == nil { - invalidParams.Add(request.NewErrParamRequired("RegionName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegionName sets the RegionName field's value. -func (s *DeleteReplicaAction) SetRegionName(v string) *DeleteReplicaAction { - s.RegionName = &v - return s -} - -// Represents a request to perform a DeleteItem operation on an item. -type DeleteRequest struct { - _ struct{} `type:"structure"` - - // A map of attribute name to attribute values, representing the primary key - // of the item to delete. All of the table's primary key attributes must be - // specified, and their data types must match those of the table's key schema. - // - // Key is a required field - Key map[string]*AttributeValue `type:"map" required:"true"` -} - -// String returns the string representation -func (s DeleteRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRequest) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *DeleteRequest) SetKey(v map[string]*AttributeValue) *DeleteRequest { - s.Key = v - return s -} - -// Represents the input of a DeleteTable operation. -type DeleteTableInput struct { - _ struct{} `type:"structure"` - - // The name of the table to delete. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTableInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *DeleteTableInput) SetTableName(v string) *DeleteTableInput { - s.TableName = &v - return s -} - -// Represents the output of a DeleteTable operation. -type DeleteTableOutput struct { - _ struct{} `type:"structure"` - - // Represents the properties of a table. - TableDescription *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s DeleteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTableOutput) GoString() string { - return s.String() -} - -// SetTableDescription sets the TableDescription field's value. -func (s *DeleteTableOutput) SetTableDescription(v *TableDescription) *DeleteTableOutput { - s.TableDescription = v - return s -} - -type DescribeBackupInput struct { - _ struct{} `type:"structure"` - - // The ARN associated with the backup. - // - // BackupArn is a required field - BackupArn *string `min:"37" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeBackupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeBackupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeBackupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeBackupInput"} - if s.BackupArn == nil { - invalidParams.Add(request.NewErrParamRequired("BackupArn")) - } - if s.BackupArn != nil && len(*s.BackupArn) < 37 { - invalidParams.Add(request.NewErrParamMinLen("BackupArn", 37)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupArn sets the BackupArn field's value. -func (s *DescribeBackupInput) SetBackupArn(v string) *DescribeBackupInput { - s.BackupArn = &v - return s -} - -type DescribeBackupOutput struct { - _ struct{} `type:"structure"` - - // Contains the description of the backup created for the table. - BackupDescription *BackupDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeBackupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeBackupOutput) GoString() string { - return s.String() -} - -// SetBackupDescription sets the BackupDescription field's value. -func (s *DescribeBackupOutput) SetBackupDescription(v *BackupDescription) *DescribeBackupOutput { - s.BackupDescription = v - return s -} - -type DescribeContinuousBackupsInput struct { - _ struct{} `type:"structure"` - - // Name of the table for which the customer wants to check the continuous backups - // and point in time recovery settings. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeContinuousBackupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeContinuousBackupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeContinuousBackupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeContinuousBackupsInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *DescribeContinuousBackupsInput) SetTableName(v string) *DescribeContinuousBackupsInput { - s.TableName = &v - return s -} - -type DescribeContinuousBackupsOutput struct { - _ struct{} `type:"structure"` - - // ContinuousBackupsDescription can be one of the following : ENABLED, DISABLED. - ContinuousBackupsDescription *ContinuousBackupsDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeContinuousBackupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeContinuousBackupsOutput) GoString() string { - return s.String() -} - -// SetContinuousBackupsDescription sets the ContinuousBackupsDescription field's value. -func (s *DescribeContinuousBackupsOutput) SetContinuousBackupsDescription(v *ContinuousBackupsDescription) *DescribeContinuousBackupsOutput { - s.ContinuousBackupsDescription = v - return s -} - -type DescribeGlobalTableInput struct { - _ struct{} `type:"structure"` - - // The name of the global table. - // - // GlobalTableName is a required field - GlobalTableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeGlobalTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeGlobalTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeGlobalTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeGlobalTableInput"} - if s.GlobalTableName == nil { - invalidParams.Add(request.NewErrParamRequired("GlobalTableName")) - } - if s.GlobalTableName != nil && len(*s.GlobalTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("GlobalTableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *DescribeGlobalTableInput) SetGlobalTableName(v string) *DescribeGlobalTableInput { - s.GlobalTableName = &v - return s -} - -type DescribeGlobalTableOutput struct { - _ struct{} `type:"structure"` - - // Contains the details of the global table. - GlobalTableDescription *GlobalTableDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeGlobalTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeGlobalTableOutput) GoString() string { - return s.String() -} - -// SetGlobalTableDescription sets the GlobalTableDescription field's value. -func (s *DescribeGlobalTableOutput) SetGlobalTableDescription(v *GlobalTableDescription) *DescribeGlobalTableOutput { - s.GlobalTableDescription = v - return s -} - -type DescribeGlobalTableSettingsInput struct { - _ struct{} `type:"structure"` - - // The name of the global table to describe. - // - // GlobalTableName is a required field - GlobalTableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeGlobalTableSettingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeGlobalTableSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeGlobalTableSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeGlobalTableSettingsInput"} - if s.GlobalTableName == nil { - invalidParams.Add(request.NewErrParamRequired("GlobalTableName")) - } - if s.GlobalTableName != nil && len(*s.GlobalTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("GlobalTableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *DescribeGlobalTableSettingsInput) SetGlobalTableName(v string) *DescribeGlobalTableSettingsInput { - s.GlobalTableName = &v - return s -} - -type DescribeGlobalTableSettingsOutput struct { - _ struct{} `type:"structure"` - - // The name of the global table. - GlobalTableName *string `min:"3" type:"string"` - - // The region specific settings for the global table. - ReplicaSettings []*ReplicaSettingsDescription `type:"list"` -} - -// String returns the string representation -func (s DescribeGlobalTableSettingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeGlobalTableSettingsOutput) GoString() string { - return s.String() -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *DescribeGlobalTableSettingsOutput) SetGlobalTableName(v string) *DescribeGlobalTableSettingsOutput { - s.GlobalTableName = &v - return s -} - -// SetReplicaSettings sets the ReplicaSettings field's value. -func (s *DescribeGlobalTableSettingsOutput) SetReplicaSettings(v []*ReplicaSettingsDescription) *DescribeGlobalTableSettingsOutput { - s.ReplicaSettings = v - return s -} - -// Represents the input of a DescribeLimits operation. Has no content. -type DescribeLimitsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeLimitsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLimitsInput) GoString() string { - return s.String() -} - -// Represents the output of a DescribeLimits operation. -type DescribeLimitsOutput struct { - _ struct{} `type:"structure"` - - // The maximum total read capacity units that your account allows you to provision - // across all of your tables in this region. - AccountMaxReadCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum total write capacity units that your account allows you to provision - // across all of your tables in this region. - AccountMaxWriteCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum read capacity units that your account allows you to provision - // for a new table that you are creating in this region, including the read - // capacity units provisioned for its global secondary indexes (GSIs). - TableMaxReadCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum write capacity units that your account allows you to provision - // for a new table that you are creating in this region, including the write - // capacity units provisioned for its global secondary indexes (GSIs). - TableMaxWriteCapacityUnits *int64 `min:"1" type:"long"` -} - -// String returns the string representation -func (s DescribeLimitsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLimitsOutput) GoString() string { - return s.String() -} - -// SetAccountMaxReadCapacityUnits sets the AccountMaxReadCapacityUnits field's value. -func (s *DescribeLimitsOutput) SetAccountMaxReadCapacityUnits(v int64) *DescribeLimitsOutput { - s.AccountMaxReadCapacityUnits = &v - return s -} - -// SetAccountMaxWriteCapacityUnits sets the AccountMaxWriteCapacityUnits field's value. -func (s *DescribeLimitsOutput) SetAccountMaxWriteCapacityUnits(v int64) *DescribeLimitsOutput { - s.AccountMaxWriteCapacityUnits = &v - return s -} - -// SetTableMaxReadCapacityUnits sets the TableMaxReadCapacityUnits field's value. -func (s *DescribeLimitsOutput) SetTableMaxReadCapacityUnits(v int64) *DescribeLimitsOutput { - s.TableMaxReadCapacityUnits = &v - return s -} - -// SetTableMaxWriteCapacityUnits sets the TableMaxWriteCapacityUnits field's value. -func (s *DescribeLimitsOutput) SetTableMaxWriteCapacityUnits(v int64) *DescribeLimitsOutput { - s.TableMaxWriteCapacityUnits = &v - return s -} - -// Represents the input of a DescribeTable operation. -type DescribeTableInput struct { - _ struct{} `type:"structure"` - - // The name of the table to describe. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTableInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *DescribeTableInput) SetTableName(v string) *DescribeTableInput { - s.TableName = &v - return s -} - -// Represents the output of a DescribeTable operation. -type DescribeTableOutput struct { - _ struct{} `type:"structure"` - - // The properties of the table. - Table *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTableOutput) GoString() string { - return s.String() -} - -// SetTable sets the Table field's value. -func (s *DescribeTableOutput) SetTable(v *TableDescription) *DescribeTableOutput { - s.Table = v - return s -} - -type DescribeTimeToLiveInput struct { - _ struct{} `type:"structure"` - - // The name of the table to be described. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeTimeToLiveInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTimeToLiveInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTimeToLiveInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTimeToLiveInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *DescribeTimeToLiveInput) SetTableName(v string) *DescribeTimeToLiveInput { - s.TableName = &v - return s -} - -type DescribeTimeToLiveOutput struct { - _ struct{} `type:"structure"` - - // The description of the Time to Live (TTL) status on the specified table. - TimeToLiveDescription *TimeToLiveDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeTimeToLiveOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTimeToLiveOutput) GoString() string { - return s.String() -} - -// SetTimeToLiveDescription sets the TimeToLiveDescription field's value. -func (s *DescribeTimeToLiveOutput) SetTimeToLiveDescription(v *TimeToLiveDescription) *DescribeTimeToLiveOutput { - s.TimeToLiveDescription = v - return s -} - -// Represents a condition to be compared with an attribute value. This condition -// can be used with DeleteItem, PutItem or UpdateItem operations; if the comparison -// evaluates to true, the operation succeeds; if not, the operation fails. You -// can use ExpectedAttributeValue in one of two different ways: -// -// * Use AttributeValueList to specify one or more values to compare against -// an attribute. Use ComparisonOperator to specify how you want to perform -// the comparison. If the comparison evaluates to true, then the conditional -// operation succeeds. -// -// * Use Value to specify a value that DynamoDB will compare against an attribute. -// If the values match, then ExpectedAttributeValue evaluates to true and -// the conditional operation succeeds. Optionally, you can also set Exists -// to false, indicating that you do not expect to find the attribute value -// in the table. In this case, the conditional operation succeeds only if -// the comparison evaluates to false. -// -// Value and Exists are incompatible with AttributeValueList and ComparisonOperator. -// Note that if you use both sets of parameters at once, DynamoDB will return -// a ValidationException exception. -type ExpectedAttributeValue struct { - _ struct{} `type:"structure"` - - // One or more values to evaluate against the supplied attribute. The number - // of values in the list depends on the ComparisonOperator being used. - // - // For type Number, value comparisons are numeric. - // - // String value comparisons for greater than, equals, or less than are based - // on ASCII character code values. For example, a is greater than A, and a is - // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters - // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). - // - // For Binary, DynamoDB treats each byte of the binary data as unsigned when - // it compares binary values. - // - // For information on specifying data types in JSON, see JSON Data Format (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html) - // in the Amazon DynamoDB Developer Guide. - AttributeValueList []*AttributeValue `type:"list"` - - // A comparator for evaluating attributes in the AttributeValueList. For example, - // equals, greater than, less than, etc. - // - // The following comparison operators are available: - // - // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | - // BEGINS_WITH | IN | BETWEEN - // - // The following are descriptions of each comparison operator. - // - // * EQ : Equal. EQ is supported for all data types, including lists and - // maps. - // - // AttributeValueList can contain only one AttributeValue element of type String, - // Number, Binary, String Set, Number Set, or Binary Set. If an item contains - // an AttributeValue element of a different type than the one provided in - // the request, the value does not match. For example, {"S":"6"} does not - // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. - // - // * NE : Not equal. NE is supported for all data types, including lists - // and maps. - // - // * AttributeValueList can contain only one AttributeValue of type String, - // Number, Binary, String Set, Number Set, or Binary Set. If an item contains - // an AttributeValue of a different type than the one provided in the request, - // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. - // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. - // - // * LE : Less than or equal. - // - // AttributeValueList can contain only one AttributeValue element of type String, - // Number, or Binary (not a set type). If an item contains an AttributeValue - // element of a different type than the one provided in the request, the value - // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} - // does not compare to {"NS":["6", "2", "1"]}. - // - // LT: Less than. - // - // AttributeValueListcan contain only one AttributeValueof type String, Number, or Binary (not a set type). If an item contains an - // AttributeValueelement of a different type than the one provided in the request, the value - // does not match. For example, {"S":"6"}does not equal {"N":"6"}. Also, {"N":"6"}does not compare to {"NS":["6", "2", "1"]} - ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` - - // Causes DynamoDB to evaluate the value before attempting a conditional operation: - // - // * If Exists is true, DynamoDB will check to see if that attribute value - // already exists in the table. If it is found, then the operation succeeds. - // If it is not found, the operation fails with a ConditionalCheckFailedException. - // - // * If Exists is false, DynamoDB assumes that the attribute value does not - // exist in the table. If in fact the value does not exist, then the assumption - // is valid and the operation succeeds. If the value is found, despite the - // assumption that it does not exist, the operation fails with a ConditionalCheckFailedException. - // - // The default setting for Exists is true. If you supply a Value all by itself, - // DynamoDB assumes the attribute exists: You don't have to set Exists to true, - // because it is implied. - // - // DynamoDB returns a ValidationException if: - // - // * Exists is true but there is no Value to check. (You expect a value to - // exist, but don't specify what that value is.) - // - // * Exists is false but you also provide a Value. (You cannot expect an - // attribute to have a value, while also expecting it not to exist.) - Exists *bool `type:"boolean"` - - // Represents the data for the expected attribute. - // - // Each attribute value is described as a name-value pair. The name is the data - // type, and the value is the data itself. - // - // For more information, see Data Types (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) - // in the Amazon DynamoDB Developer Guide. - Value *AttributeValue `type:"structure"` -} - -// String returns the string representation -func (s ExpectedAttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExpectedAttributeValue) GoString() string { - return s.String() -} - -// SetAttributeValueList sets the AttributeValueList field's value. -func (s *ExpectedAttributeValue) SetAttributeValueList(v []*AttributeValue) *ExpectedAttributeValue { - s.AttributeValueList = v - return s -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *ExpectedAttributeValue) SetComparisonOperator(v string) *ExpectedAttributeValue { - s.ComparisonOperator = &v - return s -} - -// SetExists sets the Exists field's value. -func (s *ExpectedAttributeValue) SetExists(v bool) *ExpectedAttributeValue { - s.Exists = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ExpectedAttributeValue) SetValue(v *AttributeValue) *ExpectedAttributeValue { - s.Value = v - return s -} - -// Represents the input of a GetItem operation. -type GetItemInput struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` - - // Determines the read consistency model: If set to true, then the operation - // uses strongly consistent reads; otherwise, the operation uses eventually - // consistent reads. - ConsistentRead *bool `type:"boolean"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // A map of attribute names to AttributeValue objects, representing the primary - // key of the item to retrieve. - // - // For the primary key, you must provide all of the attributes. For example, - // with a simple primary key, you only need to provide a value for the partition - // key. For a composite primary key, you must provide values for both the partition - // key and the sort key. - // - // Key is a required field - Key map[string]*AttributeValue `type:"map" required:"true"` - - // A string that identifies one or more attributes to retrieve from the table. - // These attributes can include scalars, sets, or elements of a JSON document. - // The attributes in the expression must be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear in - // the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // The name of the table containing the requested item. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetItemInput"} - if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *GetItemInput) SetAttributesToGet(v []*string) *GetItemInput { - s.AttributesToGet = v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *GetItemInput) SetConsistentRead(v bool) *GetItemInput { - s.ConsistentRead = &v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *GetItemInput) SetExpressionAttributeNames(v map[string]*string) *GetItemInput { - s.ExpressionAttributeNames = v - return s -} - -// SetKey sets the Key field's value. -func (s *GetItemInput) SetKey(v map[string]*AttributeValue) *GetItemInput { - s.Key = v - return s -} - -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *GetItemInput) SetProjectionExpression(v string) *GetItemInput { - s.ProjectionExpression = &v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *GetItemInput) SetReturnConsumedCapacity(v string) *GetItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *GetItemInput) SetTableName(v string) *GetItemInput { - s.TableName = &v - return s -} - -// Represents the output of a GetItem operation. -type GetItemOutput struct { - _ struct{} `type:"structure"` - - // The capacity units consumed by the GetItem operation. The data returned includes - // the total provisioned throughput consumed, along with statistics for the - // table and any indexes involved in the operation. ConsumedCapacity is only - // returned if the ReturnConsumedCapacity parameter was specified. For more - // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // A map of attribute names to AttributeValue objects, as specified by ProjectionExpression. - Item map[string]*AttributeValue `type:"map"` -} - -// String returns the string representation -func (s GetItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetItemOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *GetItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *GetItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItem sets the Item field's value. -func (s *GetItemOutput) SetItem(v map[string]*AttributeValue) *GetItemOutput { - s.Item = v - return s -} - -// Represents the properties of a global secondary index. -type GlobalSecondaryIndex struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index. The name must be unique among all - // other indexes on this table. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The complete key schema for a global secondary index, which consists of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // Represents attributes that are copied (projected) from the table into the - // global secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - // - // Projection is a required field - Projection *Projection `type:"structure" required:"true"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GlobalSecondaryIndex) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalSecondaryIndex) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlobalSecondaryIndex) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndex"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.KeySchema == nil { - invalidParams.Add(request.NewErrParamRequired("KeySchema")) - } - if s.KeySchema != nil && len(s.KeySchema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1)) - } - if s.Projection == nil { - invalidParams.Add(request.NewErrParamRequired("Projection")) - } - if s.ProvisionedThroughput == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput")) - } - if s.KeySchema != nil { - for i, v := range s.KeySchema { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Projection != nil { - if err := s.Projection.Validate(); err != nil { - invalidParams.AddNested("Projection", err.(request.ErrInvalidParams)) - } - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *GlobalSecondaryIndex) SetIndexName(v string) *GlobalSecondaryIndex { - s.IndexName = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *GlobalSecondaryIndex) SetKeySchema(v []*KeySchemaElement) *GlobalSecondaryIndex { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *GlobalSecondaryIndex) SetProjection(v *Projection) *GlobalSecondaryIndex { - s.Projection = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *GlobalSecondaryIndex) SetProvisionedThroughput(v *ProvisionedThroughput) *GlobalSecondaryIndex { - s.ProvisionedThroughput = v - return s -} - -// Represents the properties of a global secondary index. -type GlobalSecondaryIndexDescription struct { - _ struct{} `type:"structure"` - - // Indicates whether the index is currently backfilling. Backfilling is the - // process of reading items from the table and determining whether they can - // be added to the index. (Not all items will qualify: For example, a partition - // key cannot have any duplicate values.) If an item can be added to the index, - // DynamoDB will do so. After all items have been processed, the backfilling - // operation is complete and Backfilling is false. - // - // For indexes that were created during a CreateTable operation, the Backfilling - // attribute does not appear in the DescribeTable output. - Backfilling *bool `type:"boolean"` - - // The Amazon Resource Name (ARN) that uniquely identifies the index. - IndexArn *string `type:"string"` - - // The name of the global secondary index. - IndexName *string `min:"3" type:"string"` - - // The total size of the specified index, in bytes. DynamoDB updates this value - // approximately every six hours. Recent changes might not be reflected in this - // value. - IndexSizeBytes *int64 `type:"long"` - - // The current state of the global secondary index: - // - // * CREATING - The index is being created. - // - // * UPDATING - The index is being updated. - // - // * DELETING - The index is being deleted. - // - // * ACTIVE - The index is ready for use. - IndexStatus *string `type:"string" enum:"IndexStatus"` - - // The number of items in the specified index. DynamoDB updates this value approximately - // every six hours. Recent changes might not be reflected in this value. - ItemCount *int64 `type:"long"` - - // The complete key schema for a global secondary index, which consists of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - KeySchema []*KeySchemaElement `min:"1" type:"list"` - - // Represents attributes that are copied (projected) from the table into the - // global secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - Projection *Projection `type:"structure"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - ProvisionedThroughput *ProvisionedThroughputDescription `type:"structure"` -} - -// String returns the string representation -func (s GlobalSecondaryIndexDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalSecondaryIndexDescription) GoString() string { - return s.String() -} - -// SetBackfilling sets the Backfilling field's value. -func (s *GlobalSecondaryIndexDescription) SetBackfilling(v bool) *GlobalSecondaryIndexDescription { - s.Backfilling = &v - return s -} - -// SetIndexArn sets the IndexArn field's value. -func (s *GlobalSecondaryIndexDescription) SetIndexArn(v string) *GlobalSecondaryIndexDescription { - s.IndexArn = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *GlobalSecondaryIndexDescription) SetIndexName(v string) *GlobalSecondaryIndexDescription { - s.IndexName = &v - return s -} - -// SetIndexSizeBytes sets the IndexSizeBytes field's value. -func (s *GlobalSecondaryIndexDescription) SetIndexSizeBytes(v int64) *GlobalSecondaryIndexDescription { - s.IndexSizeBytes = &v - return s -} - -// SetIndexStatus sets the IndexStatus field's value. -func (s *GlobalSecondaryIndexDescription) SetIndexStatus(v string) *GlobalSecondaryIndexDescription { - s.IndexStatus = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *GlobalSecondaryIndexDescription) SetItemCount(v int64) *GlobalSecondaryIndexDescription { - s.ItemCount = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *GlobalSecondaryIndexDescription) SetKeySchema(v []*KeySchemaElement) *GlobalSecondaryIndexDescription { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *GlobalSecondaryIndexDescription) SetProjection(v *Projection) *GlobalSecondaryIndexDescription { - s.Projection = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *GlobalSecondaryIndexDescription) SetProvisionedThroughput(v *ProvisionedThroughputDescription) *GlobalSecondaryIndexDescription { - s.ProvisionedThroughput = v - return s -} - -// Represents the properties of a global secondary index for the table when -// the backup was created. -type GlobalSecondaryIndexInfo struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index. - IndexName *string `min:"3" type:"string"` - - // The complete key schema for a global secondary index, which consists of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - KeySchema []*KeySchemaElement `min:"1" type:"list"` - - // Represents attributes that are copied (projected) from the table into the - // global secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - Projection *Projection `type:"structure"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - ProvisionedThroughput *ProvisionedThroughput `type:"structure"` -} - -// String returns the string representation -func (s GlobalSecondaryIndexInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalSecondaryIndexInfo) GoString() string { - return s.String() -} - -// SetIndexName sets the IndexName field's value. -func (s *GlobalSecondaryIndexInfo) SetIndexName(v string) *GlobalSecondaryIndexInfo { - s.IndexName = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *GlobalSecondaryIndexInfo) SetKeySchema(v []*KeySchemaElement) *GlobalSecondaryIndexInfo { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *GlobalSecondaryIndexInfo) SetProjection(v *Projection) *GlobalSecondaryIndexInfo { - s.Projection = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *GlobalSecondaryIndexInfo) SetProvisionedThroughput(v *ProvisionedThroughput) *GlobalSecondaryIndexInfo { - s.ProvisionedThroughput = v - return s -} - -// Represents one of the following: -// -// * A new global secondary index to be added to an existing table. -// -// * New provisioned throughput parameters for an existing global secondary -// index. -// -// * An existing global secondary index to be removed from an existing table. -type GlobalSecondaryIndexUpdate struct { - _ struct{} `type:"structure"` - - // The parameters required for creating a global secondary index on an existing - // table: - // - // * IndexName - // - // * KeySchema - // - // * AttributeDefinitions - // - // * Projection - // - // * ProvisionedThroughput - Create *CreateGlobalSecondaryIndexAction `type:"structure"` - - // The name of an existing global secondary index to be removed. - Delete *DeleteGlobalSecondaryIndexAction `type:"structure"` - - // The name of an existing global secondary index, along with new provisioned - // throughput settings to be applied to that index. - Update *UpdateGlobalSecondaryIndexAction `type:"structure"` -} - -// String returns the string representation -func (s GlobalSecondaryIndexUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalSecondaryIndexUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlobalSecondaryIndexUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndexUpdate"} - if s.Create != nil { - if err := s.Create.Validate(); err != nil { - invalidParams.AddNested("Create", err.(request.ErrInvalidParams)) - } - } - if s.Delete != nil { - if err := s.Delete.Validate(); err != nil { - invalidParams.AddNested("Delete", err.(request.ErrInvalidParams)) - } - } - if s.Update != nil { - if err := s.Update.Validate(); err != nil { - invalidParams.AddNested("Update", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreate sets the Create field's value. -func (s *GlobalSecondaryIndexUpdate) SetCreate(v *CreateGlobalSecondaryIndexAction) *GlobalSecondaryIndexUpdate { - s.Create = v - return s -} - -// SetDelete sets the Delete field's value. -func (s *GlobalSecondaryIndexUpdate) SetDelete(v *DeleteGlobalSecondaryIndexAction) *GlobalSecondaryIndexUpdate { - s.Delete = v - return s -} - -// SetUpdate sets the Update field's value. -func (s *GlobalSecondaryIndexUpdate) SetUpdate(v *UpdateGlobalSecondaryIndexAction) *GlobalSecondaryIndexUpdate { - s.Update = v - return s -} - -// Represents the properties of a global table. -type GlobalTable struct { - _ struct{} `type:"structure"` - - // The global table name. - GlobalTableName *string `min:"3" type:"string"` - - // The regions where the global table has replicas. - ReplicationGroup []*Replica `type:"list"` -} - -// String returns the string representation -func (s GlobalTable) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalTable) GoString() string { - return s.String() -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *GlobalTable) SetGlobalTableName(v string) *GlobalTable { - s.GlobalTableName = &v - return s -} - -// SetReplicationGroup sets the ReplicationGroup field's value. -func (s *GlobalTable) SetReplicationGroup(v []*Replica) *GlobalTable { - s.ReplicationGroup = v - return s -} - -// Contains details about the global table. -type GlobalTableDescription struct { - _ struct{} `type:"structure"` - - // The creation time of the global table. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The unique identifier of the global table. - GlobalTableArn *string `type:"string"` - - // The global table name. - GlobalTableName *string `min:"3" type:"string"` - - // The current state of the global table: - // - // * CREATING - The global table is being created. - // - // * UPDATING - The global table is being updated. - // - // * DELETING - The global table is being deleted. - // - // * ACTIVE - The global table is ready for use. - GlobalTableStatus *string `type:"string" enum:"GlobalTableStatus"` - - // The regions where the global table has replicas. - ReplicationGroup []*ReplicaDescription `type:"list"` -} - -// String returns the string representation -func (s GlobalTableDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalTableDescription) GoString() string { - return s.String() -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *GlobalTableDescription) SetCreationDateTime(v time.Time) *GlobalTableDescription { - s.CreationDateTime = &v - return s -} - -// SetGlobalTableArn sets the GlobalTableArn field's value. -func (s *GlobalTableDescription) SetGlobalTableArn(v string) *GlobalTableDescription { - s.GlobalTableArn = &v - return s -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *GlobalTableDescription) SetGlobalTableName(v string) *GlobalTableDescription { - s.GlobalTableName = &v - return s -} - -// SetGlobalTableStatus sets the GlobalTableStatus field's value. -func (s *GlobalTableDescription) SetGlobalTableStatus(v string) *GlobalTableDescription { - s.GlobalTableStatus = &v - return s -} - -// SetReplicationGroup sets the ReplicationGroup field's value. -func (s *GlobalTableDescription) SetReplicationGroup(v []*ReplicaDescription) *GlobalTableDescription { - s.ReplicationGroup = v - return s -} - -// Represents the settings of a global secondary index for a global table that -// will be modified. -type GlobalTableGlobalSecondaryIndexSettingsUpdate struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index. The name must be unique among all - // other indexes on this table. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. - ProvisionedWriteCapacityUnits *int64 `min:"1" type:"long"` -} - -// String returns the string representation -func (s GlobalTableGlobalSecondaryIndexSettingsUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalTableGlobalSecondaryIndexSettingsUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlobalTableGlobalSecondaryIndexSettingsUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlobalTableGlobalSecondaryIndexSettingsUpdate"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.ProvisionedWriteCapacityUnits != nil && *s.ProvisionedWriteCapacityUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("ProvisionedWriteCapacityUnits", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *GlobalTableGlobalSecondaryIndexSettingsUpdate) SetIndexName(v string) *GlobalTableGlobalSecondaryIndexSettingsUpdate { - s.IndexName = &v - return s -} - -// SetProvisionedWriteCapacityUnits sets the ProvisionedWriteCapacityUnits field's value. -func (s *GlobalTableGlobalSecondaryIndexSettingsUpdate) SetProvisionedWriteCapacityUnits(v int64) *GlobalTableGlobalSecondaryIndexSettingsUpdate { - s.ProvisionedWriteCapacityUnits = &v - return s -} - -// Information about item collections, if any, that were affected by the operation. -// ItemCollectionMetrics is only returned if the request asked for it. If the -// table does not have any local secondary indexes, this information is not -// returned in the response. -type ItemCollectionMetrics struct { - _ struct{} `type:"structure"` - - // The partition key value of the item collection. This value is the same as - // the partition key value of the item. - ItemCollectionKey map[string]*AttributeValue `type:"map"` - - // An estimate of item collection size, in gigabytes. This value is a two-element - // array containing a lower bound and an upper bound for the estimate. The estimate - // includes the size of all the items in the table, plus the size of all attributes - // projected into all of the local secondary indexes on that table. Use this - // estimate to measure whether a local secondary index is approaching its size - // limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - SizeEstimateRangeGB []*float64 `type:"list"` -} - -// String returns the string representation -func (s ItemCollectionMetrics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ItemCollectionMetrics) GoString() string { - return s.String() -} - -// SetItemCollectionKey sets the ItemCollectionKey field's value. -func (s *ItemCollectionMetrics) SetItemCollectionKey(v map[string]*AttributeValue) *ItemCollectionMetrics { - s.ItemCollectionKey = v - return s -} - -// SetSizeEstimateRangeGB sets the SizeEstimateRangeGB field's value. -func (s *ItemCollectionMetrics) SetSizeEstimateRangeGB(v []*float64) *ItemCollectionMetrics { - s.SizeEstimateRangeGB = v - return s -} - -// Represents a single element of a key schema. A key schema specifies the attributes -// that make up the primary key of a table, or the key attributes of an index. -// -// A KeySchemaElement represents exactly one attribute of the primary key. For -// example, a simple primary key would be represented by one KeySchemaElement -// (for the partition key). A composite primary key would require one KeySchemaElement -// for the partition key, and another KeySchemaElement for the sort key. -// -// A KeySchemaElement must be a scalar, top-level attribute (not a nested attribute). -// The data type must be one of String, Number, or Binary. The attribute cannot -// be nested within a List or a Map. -type KeySchemaElement struct { - _ struct{} `type:"structure"` - - // The name of a key attribute. - // - // AttributeName is a required field - AttributeName *string `min:"1" type:"string" required:"true"` - - // The role that this key attribute will assume: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // KeyType is a required field - KeyType *string `type:"string" required:"true" enum:"KeyType"` -} - -// String returns the string representation -func (s KeySchemaElement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeySchemaElement) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KeySchemaElement) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KeySchemaElement"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.AttributeName != nil && len(*s.AttributeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1)) - } - if s.KeyType == nil { - invalidParams.Add(request.NewErrParamRequired("KeyType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *KeySchemaElement) SetAttributeName(v string) *KeySchemaElement { - s.AttributeName = &v - return s -} - -// SetKeyType sets the KeyType field's value. -func (s *KeySchemaElement) SetKeyType(v string) *KeySchemaElement { - s.KeyType = &v - return s -} - -// Represents a set of primary keys and, for each key, the attributes to retrieve -// from the table. -// -// For each primary key, you must provide all of the key attributes. For example, -// with a simple primary key, you only need to provide the partition key. For -// a composite primary key, you must provide both the partition key and the -// sort key. -type KeysAndAttributes struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see Legacy Conditional Parameters (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` - - // The consistency of a read operation. If set to true, then a strongly consistent - // read is used; otherwise, an eventually consistent read is used. - ConsistentRead *bool `type:"boolean"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // The primary key attribute values that define the items and the attributes - // associated with the items. - // - // Keys is a required field - Keys []map[string]*AttributeValue `min:"1" type:"list" required:"true"` - - // A string that identifies one or more attributes to retrieve from the table. - // These attributes can include scalars, sets, or elements of a JSON document. - // The attributes in the ProjectionExpression must be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear in - // the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` -} - -// String returns the string representation -func (s KeysAndAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeysAndAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KeysAndAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KeysAndAttributes"} - if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1)) - } - if s.Keys == nil { - invalidParams.Add(request.NewErrParamRequired("Keys")) - } - if s.Keys != nil && len(s.Keys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Keys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *KeysAndAttributes) SetAttributesToGet(v []*string) *KeysAndAttributes { - s.AttributesToGet = v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *KeysAndAttributes) SetConsistentRead(v bool) *KeysAndAttributes { - s.ConsistentRead = &v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *KeysAndAttributes) SetExpressionAttributeNames(v map[string]*string) *KeysAndAttributes { - s.ExpressionAttributeNames = v - return s -} - -// SetKeys sets the Keys field's value. -func (s *KeysAndAttributes) SetKeys(v []map[string]*AttributeValue) *KeysAndAttributes { - s.Keys = v - return s -} - -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *KeysAndAttributes) SetProjectionExpression(v string) *KeysAndAttributes { - s.ProjectionExpression = &v - return s -} - -type ListBackupsInput struct { - _ struct{} `type:"structure"` - - // LastEvaluatedBackupARN returned by the previous ListBackups call. - ExclusiveStartBackupArn *string `min:"37" type:"string"` - - // Maximum number of backups to return at once. - Limit *int64 `min:"1" type:"integer"` - - // The backups from the table specified by TableName are listed. - TableName *string `min:"3" type:"string"` - - // Only backups created after this time are listed. TimeRangeLowerBound is inclusive. - TimeRangeLowerBound *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Only backups created before this time are listed. TimeRangeUpperBound is - // exclusive. - TimeRangeUpperBound *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s ListBackupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBackupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBackupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBackupsInput"} - if s.ExclusiveStartBackupArn != nil && len(*s.ExclusiveStartBackupArn) < 37 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartBackupArn", 37)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExclusiveStartBackupArn sets the ExclusiveStartBackupArn field's value. -func (s *ListBackupsInput) SetExclusiveStartBackupArn(v string) *ListBackupsInput { - s.ExclusiveStartBackupArn = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListBackupsInput) SetLimit(v int64) *ListBackupsInput { - s.Limit = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *ListBackupsInput) SetTableName(v string) *ListBackupsInput { - s.TableName = &v - return s -} - -// SetTimeRangeLowerBound sets the TimeRangeLowerBound field's value. -func (s *ListBackupsInput) SetTimeRangeLowerBound(v time.Time) *ListBackupsInput { - s.TimeRangeLowerBound = &v - return s -} - -// SetTimeRangeUpperBound sets the TimeRangeUpperBound field's value. -func (s *ListBackupsInput) SetTimeRangeUpperBound(v time.Time) *ListBackupsInput { - s.TimeRangeUpperBound = &v - return s -} - -type ListBackupsOutput struct { - _ struct{} `type:"structure"` - - // List of BackupSummary objects. - BackupSummaries []*BackupSummary `type:"list"` - - // Last evaluated BackupARN. - LastEvaluatedBackupArn *string `min:"37" type:"string"` -} - -// String returns the string representation -func (s ListBackupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBackupsOutput) GoString() string { - return s.String() -} - -// SetBackupSummaries sets the BackupSummaries field's value. -func (s *ListBackupsOutput) SetBackupSummaries(v []*BackupSummary) *ListBackupsOutput { - s.BackupSummaries = v - return s -} - -// SetLastEvaluatedBackupArn sets the LastEvaluatedBackupArn field's value. -func (s *ListBackupsOutput) SetLastEvaluatedBackupArn(v string) *ListBackupsOutput { - s.LastEvaluatedBackupArn = &v - return s -} - -type ListGlobalTablesInput struct { - _ struct{} `type:"structure"` - - // The first global table name that this operation will evaluate. - ExclusiveStartGlobalTableName *string `min:"3" type:"string"` - - // The maximum number of table names to return. - Limit *int64 `min:"1" type:"integer"` - - // Lists the global tables in a specific region. - RegionName *string `type:"string"` -} - -// String returns the string representation -func (s ListGlobalTablesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGlobalTablesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGlobalTablesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGlobalTablesInput"} - if s.ExclusiveStartGlobalTableName != nil && len(*s.ExclusiveStartGlobalTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartGlobalTableName", 3)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExclusiveStartGlobalTableName sets the ExclusiveStartGlobalTableName field's value. -func (s *ListGlobalTablesInput) SetExclusiveStartGlobalTableName(v string) *ListGlobalTablesInput { - s.ExclusiveStartGlobalTableName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListGlobalTablesInput) SetLimit(v int64) *ListGlobalTablesInput { - s.Limit = &v - return s -} - -// SetRegionName sets the RegionName field's value. -func (s *ListGlobalTablesInput) SetRegionName(v string) *ListGlobalTablesInput { - s.RegionName = &v - return s -} - -type ListGlobalTablesOutput struct { - _ struct{} `type:"structure"` - - // List of global table names. - GlobalTables []*GlobalTable `type:"list"` - - // Last evaluated global table name. - LastEvaluatedGlobalTableName *string `min:"3" type:"string"` -} - -// String returns the string representation -func (s ListGlobalTablesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGlobalTablesOutput) GoString() string { - return s.String() -} - -// SetGlobalTables sets the GlobalTables field's value. -func (s *ListGlobalTablesOutput) SetGlobalTables(v []*GlobalTable) *ListGlobalTablesOutput { - s.GlobalTables = v - return s -} - -// SetLastEvaluatedGlobalTableName sets the LastEvaluatedGlobalTableName field's value. -func (s *ListGlobalTablesOutput) SetLastEvaluatedGlobalTableName(v string) *ListGlobalTablesOutput { - s.LastEvaluatedGlobalTableName = &v - return s -} - -// Represents the input of a ListTables operation. -type ListTablesInput struct { - _ struct{} `type:"structure"` - - // The first table name that this operation will evaluate. Use the value that - // was returned for LastEvaluatedTableName in a previous operation, so that - // you can obtain the next page of results. - ExclusiveStartTableName *string `min:"3" type:"string"` - - // A maximum number of table names to return. If this parameter is not specified, - // the limit is 100. - Limit *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListTablesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTablesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTablesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTablesInput"} - if s.ExclusiveStartTableName != nil && len(*s.ExclusiveStartTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartTableName", 3)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExclusiveStartTableName sets the ExclusiveStartTableName field's value. -func (s *ListTablesInput) SetExclusiveStartTableName(v string) *ListTablesInput { - s.ExclusiveStartTableName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListTablesInput) SetLimit(v int64) *ListTablesInput { - s.Limit = &v - return s -} - -// Represents the output of a ListTables operation. -type ListTablesOutput struct { - _ struct{} `type:"structure"` - - // The name of the last table in the current page of results. Use this value - // as the ExclusiveStartTableName in a new request to obtain the next page of - // results, until all the table names are returned. - // - // If you do not receive a LastEvaluatedTableName value in the response, this - // means that there are no more table names to be retrieved. - LastEvaluatedTableName *string `min:"3" type:"string"` - - // The names of the tables associated with the current account at the current - // endpoint. The maximum size of this array is 100. - // - // If LastEvaluatedTableName also appears in the output, you can use this value - // as the ExclusiveStartTableName parameter in a subsequent ListTables request - // and obtain the next page of results. - TableNames []*string `type:"list"` -} - -// String returns the string representation -func (s ListTablesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTablesOutput) GoString() string { - return s.String() -} - -// SetLastEvaluatedTableName sets the LastEvaluatedTableName field's value. -func (s *ListTablesOutput) SetLastEvaluatedTableName(v string) *ListTablesOutput { - s.LastEvaluatedTableName = &v - return s -} - -// SetTableNames sets the TableNames field's value. -func (s *ListTablesOutput) SetTableNames(v []*string) *ListTablesOutput { - s.TableNames = v - return s -} - -type ListTagsOfResourceInput struct { - _ struct{} `type:"structure"` - - // An optional string that, if supplied, must be copied from the output of a - // previous call to ListTagOfResource. When provided in this manner, this API - // fetches the next page of results. - NextToken *string `type:"string"` - - // The Amazon DynamoDB resource with tags to be listed. This value is an Amazon - // Resource Name (ARN). - // - // ResourceArn is a required field - ResourceArn *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTagsOfResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsOfResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsOfResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsOfResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOfResourceInput) SetNextToken(v string) *ListTagsOfResourceInput { - s.NextToken = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsOfResourceInput) SetResourceArn(v string) *ListTagsOfResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsOfResourceOutput struct { - _ struct{} `type:"structure"` - - // If this value is returned, there are additional results to be displayed. - // To retrieve them, call ListTagsOfResource again, with NextToken set to this - // value. - NextToken *string `type:"string"` - - // The tags currently associated with the Amazon DynamoDB resource. - Tags []*Tag `type:"list"` -} - -// String returns the string representation -func (s ListTagsOfResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsOfResourceOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOfResourceOutput) SetNextToken(v string) *ListTagsOfResourceOutput { - s.NextToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListTagsOfResourceOutput) SetTags(v []*Tag) *ListTagsOfResourceOutput { - s.Tags = v - return s -} - -// Represents the properties of a local secondary index. -type LocalSecondaryIndex struct { - _ struct{} `type:"structure"` - - // The name of the local secondary index. The name must be unique among all - // other indexes on this table. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The complete key schema for the local secondary index, consisting of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // Represents attributes that are copied (projected) from the table into the - // local secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - // - // Projection is a required field - Projection *Projection `type:"structure" required:"true"` -} - -// String returns the string representation -func (s LocalSecondaryIndex) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LocalSecondaryIndex) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LocalSecondaryIndex) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LocalSecondaryIndex"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.KeySchema == nil { - invalidParams.Add(request.NewErrParamRequired("KeySchema")) - } - if s.KeySchema != nil && len(s.KeySchema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1)) - } - if s.Projection == nil { - invalidParams.Add(request.NewErrParamRequired("Projection")) - } - if s.KeySchema != nil { - for i, v := range s.KeySchema { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Projection != nil { - if err := s.Projection.Validate(); err != nil { - invalidParams.AddNested("Projection", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *LocalSecondaryIndex) SetIndexName(v string) *LocalSecondaryIndex { - s.IndexName = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *LocalSecondaryIndex) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndex { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *LocalSecondaryIndex) SetProjection(v *Projection) *LocalSecondaryIndex { - s.Projection = v - return s -} - -// Represents the properties of a local secondary index. -type LocalSecondaryIndexDescription struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that uniquely identifies the index. - IndexArn *string `type:"string"` - - // Represents the name of the local secondary index. - IndexName *string `min:"3" type:"string"` - - // The total size of the specified index, in bytes. DynamoDB updates this value - // approximately every six hours. Recent changes might not be reflected in this - // value. - IndexSizeBytes *int64 `type:"long"` - - // The number of items in the specified index. DynamoDB updates this value approximately - // every six hours. Recent changes might not be reflected in this value. - ItemCount *int64 `type:"long"` - - // The complete key schema for the local secondary index, consisting of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - KeySchema []*KeySchemaElement `min:"1" type:"list"` - - // Represents attributes that are copied (projected) from the table into the - // global secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - Projection *Projection `type:"structure"` -} - -// String returns the string representation -func (s LocalSecondaryIndexDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LocalSecondaryIndexDescription) GoString() string { - return s.String() -} - -// SetIndexArn sets the IndexArn field's value. -func (s *LocalSecondaryIndexDescription) SetIndexArn(v string) *LocalSecondaryIndexDescription { - s.IndexArn = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *LocalSecondaryIndexDescription) SetIndexName(v string) *LocalSecondaryIndexDescription { - s.IndexName = &v - return s -} - -// SetIndexSizeBytes sets the IndexSizeBytes field's value. -func (s *LocalSecondaryIndexDescription) SetIndexSizeBytes(v int64) *LocalSecondaryIndexDescription { - s.IndexSizeBytes = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *LocalSecondaryIndexDescription) SetItemCount(v int64) *LocalSecondaryIndexDescription { - s.ItemCount = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *LocalSecondaryIndexDescription) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndexDescription { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *LocalSecondaryIndexDescription) SetProjection(v *Projection) *LocalSecondaryIndexDescription { - s.Projection = v - return s -} - -// Represents the properties of a local secondary index for the table when the -// backup was created. -type LocalSecondaryIndexInfo struct { - _ struct{} `type:"structure"` - - // Represents the name of the local secondary index. - IndexName *string `min:"3" type:"string"` - - // The complete key schema for a local secondary index, which consists of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - KeySchema []*KeySchemaElement `min:"1" type:"list"` - - // Represents attributes that are copied (projected) from the table into the - // global secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - Projection *Projection `type:"structure"` -} - -// String returns the string representation -func (s LocalSecondaryIndexInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LocalSecondaryIndexInfo) GoString() string { - return s.String() -} - -// SetIndexName sets the IndexName field's value. -func (s *LocalSecondaryIndexInfo) SetIndexName(v string) *LocalSecondaryIndexInfo { - s.IndexName = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *LocalSecondaryIndexInfo) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndexInfo { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *LocalSecondaryIndexInfo) SetProjection(v *Projection) *LocalSecondaryIndexInfo { - s.Projection = v - return s -} - -// The description of the point in time settings applied to the table. -type PointInTimeRecoveryDescription struct { - _ struct{} `type:"structure"` - - // Specifies the earliest point in time you can restore your table to. It You - // can restore your table to any point in time during the last 35 days. - EarliestRestorableDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // LatestRestorableDateTime is typically 5 minutes before the current time. - LatestRestorableDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The current state of point in time recovery: - // - // * ENABLING - Point in time recovery is being enabled. - // - // * ENABLED - Point in time recovery is enabled. - // - // * DISABLED - Point in time recovery is disabled. - PointInTimeRecoveryStatus *string `type:"string" enum:"PointInTimeRecoveryStatus"` -} - -// String returns the string representation -func (s PointInTimeRecoveryDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PointInTimeRecoveryDescription) GoString() string { - return s.String() -} - -// SetEarliestRestorableDateTime sets the EarliestRestorableDateTime field's value. -func (s *PointInTimeRecoveryDescription) SetEarliestRestorableDateTime(v time.Time) *PointInTimeRecoveryDescription { - s.EarliestRestorableDateTime = &v - return s -} - -// SetLatestRestorableDateTime sets the LatestRestorableDateTime field's value. -func (s *PointInTimeRecoveryDescription) SetLatestRestorableDateTime(v time.Time) *PointInTimeRecoveryDescription { - s.LatestRestorableDateTime = &v - return s -} - -// SetPointInTimeRecoveryStatus sets the PointInTimeRecoveryStatus field's value. -func (s *PointInTimeRecoveryDescription) SetPointInTimeRecoveryStatus(v string) *PointInTimeRecoveryDescription { - s.PointInTimeRecoveryStatus = &v - return s -} - -// Represents the settings used to enable point in time recovery. -type PointInTimeRecoverySpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether point in time recovery is enabled (true) or disabled (false) - // on the table. - // - // PointInTimeRecoveryEnabled is a required field - PointInTimeRecoveryEnabled *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s PointInTimeRecoverySpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PointInTimeRecoverySpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PointInTimeRecoverySpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PointInTimeRecoverySpecification"} - if s.PointInTimeRecoveryEnabled == nil { - invalidParams.Add(request.NewErrParamRequired("PointInTimeRecoveryEnabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPointInTimeRecoveryEnabled sets the PointInTimeRecoveryEnabled field's value. -func (s *PointInTimeRecoverySpecification) SetPointInTimeRecoveryEnabled(v bool) *PointInTimeRecoverySpecification { - s.PointInTimeRecoveryEnabled = &v - return s -} - -// Represents attributes that are copied (projected) from the table into an -// index. These are in addition to the primary key attributes and index key -// attributes, which are automatically projected. -type Projection struct { - _ struct{} `type:"structure"` - - // Represents the non-key attribute names which will be projected into the index. - // - // For local secondary indexes, the total count of NonKeyAttributes summed across - // all of the local secondary indexes, must not exceed 20. If you project the - // same attribute into two different indexes, this counts as two distinct attributes - // when determining the total. - NonKeyAttributes []*string `min:"1" type:"list"` - - // The set of attributes that are projected into the index: - // - // * KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // * INCLUDE - Only the specified table attributes are projected into the - // index. The list of projected attributes are in NonKeyAttributes. - // - // * ALL - All of the table attributes are projected into the index. - ProjectionType *string `type:"string" enum:"ProjectionType"` -} - -// String returns the string representation -func (s Projection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Projection) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Projection) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Projection"} - if s.NonKeyAttributes != nil && len(s.NonKeyAttributes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NonKeyAttributes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNonKeyAttributes sets the NonKeyAttributes field's value. -func (s *Projection) SetNonKeyAttributes(v []*string) *Projection { - s.NonKeyAttributes = v - return s -} - -// SetProjectionType sets the ProjectionType field's value. -func (s *Projection) SetProjectionType(v string) *Projection { - s.ProjectionType = &v - return s -} - -// Represents the provisioned throughput settings for a specified table or index. -// The settings can be modified using the UpdateTable operation. -// -// For current minimum and maximum provisioned throughput values, see Limits -// (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) -// in the Amazon DynamoDB Developer Guide. -type ProvisionedThroughput struct { - _ struct{} `type:"structure"` - - // The maximum number of strongly consistent reads consumed per second before - // DynamoDB returns a ThrottlingException. For more information, see Specifying - // Read and Write Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - // - // ReadCapacityUnits is a required field - ReadCapacityUnits *int64 `min:"1" type:"long" required:"true"` - - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. For more information, see Specifying Read and Write - // Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - // - // WriteCapacityUnits is a required field - WriteCapacityUnits *int64 `min:"1" type:"long" required:"true"` -} - -// String returns the string representation -func (s ProvisionedThroughput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProvisionedThroughput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProvisionedThroughput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProvisionedThroughput"} - if s.ReadCapacityUnits == nil { - invalidParams.Add(request.NewErrParamRequired("ReadCapacityUnits")) - } - if s.ReadCapacityUnits != nil && *s.ReadCapacityUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("ReadCapacityUnits", 1)) - } - if s.WriteCapacityUnits == nil { - invalidParams.Add(request.NewErrParamRequired("WriteCapacityUnits")) - } - if s.WriteCapacityUnits != nil && *s.WriteCapacityUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("WriteCapacityUnits", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReadCapacityUnits sets the ReadCapacityUnits field's value. -func (s *ProvisionedThroughput) SetReadCapacityUnits(v int64) *ProvisionedThroughput { - s.ReadCapacityUnits = &v - return s -} - -// SetWriteCapacityUnits sets the WriteCapacityUnits field's value. -func (s *ProvisionedThroughput) SetWriteCapacityUnits(v int64) *ProvisionedThroughput { - s.WriteCapacityUnits = &v - return s -} - -// Represents the provisioned throughput settings for the table, consisting -// of read and write capacity units, along with data about increases and decreases. -type ProvisionedThroughputDescription struct { - _ struct{} `type:"structure"` - - // The date and time of the last provisioned throughput decrease for this table. - LastDecreaseDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time of the last provisioned throughput increase for this table. - LastIncreaseDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The number of provisioned throughput decreases for this table during this - // UTC calendar day. For current maximums on provisioned throughput decreases, - // see Limits (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - NumberOfDecreasesToday *int64 `min:"1" type:"long"` - - // The maximum number of strongly consistent reads consumed per second before - // DynamoDB returns a ThrottlingException. Eventually consistent reads require - // less effort than strongly consistent reads, so a setting of 50 ReadCapacityUnits - // per second provides 100 eventually consistent ReadCapacityUnits per second. - ReadCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. - WriteCapacityUnits *int64 `min:"1" type:"long"` -} - -// String returns the string representation -func (s ProvisionedThroughputDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProvisionedThroughputDescription) GoString() string { - return s.String() -} - -// SetLastDecreaseDateTime sets the LastDecreaseDateTime field's value. -func (s *ProvisionedThroughputDescription) SetLastDecreaseDateTime(v time.Time) *ProvisionedThroughputDescription { - s.LastDecreaseDateTime = &v - return s -} - -// SetLastIncreaseDateTime sets the LastIncreaseDateTime field's value. -func (s *ProvisionedThroughputDescription) SetLastIncreaseDateTime(v time.Time) *ProvisionedThroughputDescription { - s.LastIncreaseDateTime = &v - return s -} - -// SetNumberOfDecreasesToday sets the NumberOfDecreasesToday field's value. -func (s *ProvisionedThroughputDescription) SetNumberOfDecreasesToday(v int64) *ProvisionedThroughputDescription { - s.NumberOfDecreasesToday = &v - return s -} - -// SetReadCapacityUnits sets the ReadCapacityUnits field's value. -func (s *ProvisionedThroughputDescription) SetReadCapacityUnits(v int64) *ProvisionedThroughputDescription { - s.ReadCapacityUnits = &v - return s -} - -// SetWriteCapacityUnits sets the WriteCapacityUnits field's value. -func (s *ProvisionedThroughputDescription) SetWriteCapacityUnits(v int64) *ProvisionedThroughputDescription { - s.WriteCapacityUnits = &v - return s -} - -// Represents the input of a PutItem operation. -type PutItemInput struct { - _ struct{} `type:"structure"` - - // A condition that must be satisfied in order for a conditional PutItem operation - // to succeed. - // - // An expression can contain any of the following: - // - // * Functions: attribute_exists | attribute_not_exists | attribute_type - // | contains | begins_with | size - // - // These function names are case-sensitive. - // - // * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN - // - // * Logical operators: AND | OR | NOT - // - // For more information on condition expressions, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ConditionExpression *string `type:"string"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - // in the Amazon DynamoDB Developer Guide. - Expected map[string]*ExpectedAttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A map of attribute name/value pairs, one for each attribute. Only the primary - // key attributes are required; you can optionally provide other attribute name-value - // pairs for the item. - // - // You must provide all of the attributes for the primary key. For example, - // with a simple primary key, you only need to provide a value for the partition - // key. For a composite primary key, you must provide both values for both the - // partition key and the sort key. - // - // If you specify any attributes that are part of an index key, then the data - // types for those attributes must match those of the schema in the table's - // attribute definition. - // - // For more information about primary keys, see Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey) - // in the Amazon DynamoDB Developer Guide. - // - // Each element in the Item map is an AttributeValue object. - // - // Item is a required field - Item map[string]*AttributeValue `type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Determines whether item collection metrics are returned. If set to SIZE, - // the response includes statistics about item collections, if any, that were - // modified during the operation are returned in the response. If set to NONE - // (the default), no statistics are returned. - ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"` - - // Use ReturnValues if you want to get the item attributes as they appeared - // before they were updated with the PutItem request. For PutItem, the valid - // values are: - // - // * NONE - If ReturnValues is not specified, or if its value is NONE, then - // nothing is returned. (This setting is the default for ReturnValues.) - // - // * ALL_OLD - If PutItem overwrote an attribute name-value pair, then the - // content of the old item is returned. - // - // The ReturnValues parameter is used by several DynamoDB operations; however, - // PutItem does not recognize any values other than NONE or ALL_OLD. - ReturnValues *string `type:"string" enum:"ReturnValue"` - - // The name of the table to contain the item. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutItemInput"} - if s.Item == nil { - invalidParams.Add(request.NewErrParamRequired("Item")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConditionExpression sets the ConditionExpression field's value. -func (s *PutItemInput) SetConditionExpression(v string) *PutItemInput { - s.ConditionExpression = &v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *PutItemInput) SetConditionalOperator(v string) *PutItemInput { - s.ConditionalOperator = &v - return s -} - -// SetExpected sets the Expected field's value. -func (s *PutItemInput) SetExpected(v map[string]*ExpectedAttributeValue) *PutItemInput { - s.Expected = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *PutItemInput) SetExpressionAttributeNames(v map[string]*string) *PutItemInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *PutItemInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *PutItemInput { - s.ExpressionAttributeValues = v - return s -} - -// SetItem sets the Item field's value. -func (s *PutItemInput) SetItem(v map[string]*AttributeValue) *PutItemInput { - s.Item = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *PutItemInput) SetReturnConsumedCapacity(v string) *PutItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *PutItemInput) SetReturnItemCollectionMetrics(v string) *PutItemInput { - s.ReturnItemCollectionMetrics = &v - return s -} - -// SetReturnValues sets the ReturnValues field's value. -func (s *PutItemInput) SetReturnValues(v string) *PutItemInput { - s.ReturnValues = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *PutItemInput) SetTableName(v string) *PutItemInput { - s.TableName = &v - return s -} - -// Represents the output of a PutItem operation. -type PutItemOutput struct { - _ struct{} `type:"structure"` - - // The attribute values as they appeared before the PutItem operation, but only - // if ReturnValues is specified as ALL_OLD in the request. Each element consists - // of an attribute name and an attribute value. - Attributes map[string]*AttributeValue `type:"map"` - - // The capacity units consumed by the PutItem operation. The data returned includes - // the total provisioned throughput consumed, along with statistics for the - // table and any indexes involved in the operation. ConsumedCapacity is only - // returned if the ReturnConsumedCapacity parameter was specified. For more - // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // Information about item collections, if any, that were affected by the PutItem - // operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics - // parameter was specified. If the table does not have any local secondary indexes, - // this information is not returned in the response. - // - // Each ItemCollectionMetrics element consists of: - // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item itself. - // - // * SizeEstimateRangeGB - An estimate of item collection size, in gigabytes. - // This value is a two-element array containing a lower bound and an upper - // bound for the estimate. The estimate includes the size of all the items - // in the table, plus the size of all attributes projected into all of the - // local secondary indexes on that table. Use this estimate to measure whether - // a local secondary index is approaching its size limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"` -} - -// String returns the string representation -func (s PutItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutItemOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *PutItemOutput) SetAttributes(v map[string]*AttributeValue) *PutItemOutput { - s.Attributes = v - return s -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *PutItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *PutItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *PutItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *PutItemOutput { - s.ItemCollectionMetrics = v - return s -} - -// Represents a request to perform a PutItem operation on an item. -type PutRequest struct { - _ struct{} `type:"structure"` - - // A map of attribute name to attribute values, representing the primary key - // of an item to be processed by PutItem. All of the table's primary key attributes - // must be specified, and their data types must match those of the table's key - // schema. If any attributes are present in the item which are part of an index - // key schema for the table, their types must match the index key schema. - // - // Item is a required field - Item map[string]*AttributeValue `type:"map" required:"true"` -} - -// String returns the string representation -func (s PutRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRequest) GoString() string { - return s.String() -} - -// SetItem sets the Item field's value. -func (s *PutRequest) SetItem(v map[string]*AttributeValue) *PutRequest { - s.Item = v - return s -} - -// Represents the input of a Query operation. -type QueryInput struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` - - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // Determines the read consistency model: If set to true, then the operation - // uses strongly consistent reads; otherwise, the operation uses eventually - // consistent reads. - // - // Strongly consistent reads are not supported on global secondary indexes. - // If you query a global secondary index with ConsistentRead set to true, you - // will receive a ValidationException. - ConsistentRead *bool `type:"boolean"` - - // The primary key of the first item that this operation will evaluate. Use - // the value that was returned for LastEvaluatedKey in the previous operation. - // - // The data type for ExclusiveStartKey must be String, Number or Binary. No - // set data types are allowed. - ExclusiveStartKey map[string]*AttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A string that contains conditions that DynamoDB applies after the Query operation, - // but before the data is returned to you. Items that do not satisfy the FilterExpression - // criteria are not returned. - // - // A FilterExpression does not allow key attributes. You cannot define a filter - // expression based on a partition key or a sort key. - // - // A FilterExpression is applied after the items have already been read; the - // process of filtering does not consume any additional read capacity units. - // - // For more information, see Filter Expressions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults) - // in the Amazon DynamoDB Developer Guide. - FilterExpression *string `type:"string"` - - // The name of an index to query. This index can be any local secondary index - // or global secondary index on the table. Note that if you use the IndexName - // parameter, you must also provide TableName. - IndexName *string `min:"3" type:"string"` - - // The condition that specifies the key value(s) for items to be retrieved by - // the Query action. - // - // The condition must perform an equality test on a single partition key value. - // - // The condition can optionally perform one of several comparison tests on a - // single sort key value. This allows Query to retrieve one item with a given - // partition key value and sort key value, or several items that have the same - // partition key value but different sort key values. - // - // The partition key equality test is required, and must be specified in the - // following format: - // - // partitionKeyName=:partitionkeyval - // - // If you also want to provide a condition for the sort key, it must be combined - // using AND with the condition for the sort key. Following is an example, using - // the = comparison operator for the sort key: - // - // partitionKeyName=:partitionkeyvalANDsortKeyName=:sortkeyval - // - // Valid comparisons for the sort key condition are as follows: - // - // * sortKeyName=:sortkeyval - true if the sort key value is equal to :sortkeyval. - // - // * sortKeyName<:sortkeyval - true if the sort key value is less than :sortkeyval. - // - // * sortKeyName<=:sortkeyval - true if the sort key value is less than or - // equal to :sortkeyval. - // - // * sortKeyName>:sortkeyval - true if the sort key value is greater than - // :sortkeyval. - // - // * sortKeyName>= :sortkeyval - true if the sort key value is greater than - // or equal to :sortkeyval. - // - // * sortKeyNameBETWEEN:sortkeyval1AND:sortkeyval2 - true if the sort key - // value is greater than or equal to :sortkeyval1, and less than or equal - // to :sortkeyval2. - // - // * begins_with (sortKeyName, :sortkeyval) - true if the sort key value - // begins with a particular operand. (You cannot use this function with a - // sort key that is of type Number.) Note that the function name begins_with - // is case-sensitive. - // - // Use the ExpressionAttributeValues parameter to replace tokens such as :partitionval - // and :sortval with actual values at runtime. - // - // You can optionally use the ExpressionAttributeNames parameter to replace - // the names of the partition key and sort key with placeholder tokens. This - // option might be necessary if an attribute name conflicts with a DynamoDB - // reserved word. For example, the following KeyConditionExpression parameter - // causes an error because Size is a reserved word: - // - // * Size = :myval - // - // To work around this, define a placeholder (such a #S) to represent the attribute - // name Size. KeyConditionExpression then is as follows: - // - // * #S = :myval - // - // For a list of reserved words, see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide. - // - // For more information on ExpressionAttributeNames and ExpressionAttributeValues, - // see Using Placeholders for Attribute Names and Values (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html) - // in the Amazon DynamoDB Developer Guide. - KeyConditionExpression *string `type:"string"` - - // This is a legacy parameter. Use KeyConditionExpression instead. For more - // information, see KeyConditions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html) - // in the Amazon DynamoDB Developer Guide. - KeyConditions map[string]*Condition `type:"map"` - - // The maximum number of items to evaluate (not necessarily the number of matching - // items). If DynamoDB processes the number of items up to the limit while processing - // the results, it stops the operation and returns the matching values up to - // that point, and a key in LastEvaluatedKey to apply in a subsequent operation, - // so that you can pick up where you left off. Also, if the processed data set - // size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation - // and returns the matching values up to the limit, and a key in LastEvaluatedKey - // to apply in a subsequent operation to continue the operation. For more information, - // see Query and Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) - // in the Amazon DynamoDB Developer Guide. - Limit *int64 `min:"1" type:"integer"` - - // A string that identifies one or more attributes to retrieve from the table. - // These attributes can include scalars, sets, or elements of a JSON document. - // The attributes in the expression must be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear in - // the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` - - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see QueryFilter (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html) - // in the Amazon DynamoDB Developer Guide. - QueryFilter map[string]*Condition `type:"map"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Specifies the order for index traversal: If true (default), the traversal - // is performed in ascending order; if false, the traversal is performed in - // descending order. - // - // Items with the same partition key value are stored in sorted order by sort - // key. If the sort key data type is Number, the results are stored in numeric - // order. For type String, the results are stored in order of UTF-8 bytes. For - // type Binary, DynamoDB treats each byte of the binary data as unsigned. - // - // If ScanIndexForward is true, DynamoDB returns the results in the order in - // which they are stored (by sort key value). This is the default behavior. - // If ScanIndexForward is false, DynamoDB reads the results in reverse order - // by sort key value, and then returns the results to the client. - ScanIndexForward *bool `type:"boolean"` - - // The attributes to be returned in the result. You can retrieve all item attributes, - // specific item attributes, the count of matching items, or in the case of - // an index, some or all of the attributes projected into the index. - // - // * ALL_ATTRIBUTES - Returns all of the item attributes from the specified - // table or index. If you query a local secondary index, then for each matching - // item in the index DynamoDB will fetch the entire item from the parent - // table. If the index is configured to project all item attributes, then - // all of the data can be obtained from the local secondary index, and no - // fetching is required. - // - // * ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves - // all attributes that have been projected into the index. If the index is - // configured to project all attributes, this return value is equivalent - // to specifying ALL_ATTRIBUTES. - // - // * COUNT - Returns the number of matching items, rather than the matching - // items themselves. - // - // * SPECIFIC_ATTRIBUTES - Returns only the attributes listed in AttributesToGet. - // This return value is equivalent to specifying AttributesToGet without - // specifying any value for Select. - // - // If you query or scan a local secondary index and request only attributes - // that are projected into that index, the operation will read only the index - // and not the table. If any of the requested attributes are not projected - // into the local secondary index, DynamoDB will fetch each of these attributes - // from the parent table. This extra fetching incurs additional throughput - // cost and latency. - // - // If you query or scan a global secondary index, you can only request attributes - // that are projected into the index. Global secondary index queries cannot - // fetch attributes from the parent table. - // - // If neither Select nor AttributesToGet are specified, DynamoDB defaults to - // ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when - // accessing an index. You cannot use both Select and AttributesToGet together - // in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES. - // (This usage is equivalent to specifying AttributesToGet without any value - // for Select.) - // - // If you use the ProjectionExpression parameter, then the value for Select - // can only be SPECIFIC_ATTRIBUTES. Any other value for Select will return an - // error. - Select *string `type:"string" enum:"Select"` - - // The name of the table containing the requested items. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s QueryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s QueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueryInput"} - if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1)) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.KeyConditions != nil { - for i, v := range s.KeyConditions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeyConditions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.QueryFilter != nil { - for i, v := range s.QueryFilter { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueryFilter", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *QueryInput) SetAttributesToGet(v []*string) *QueryInput { - s.AttributesToGet = v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *QueryInput) SetConditionalOperator(v string) *QueryInput { - s.ConditionalOperator = &v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *QueryInput) SetConsistentRead(v bool) *QueryInput { - s.ConsistentRead = &v - return s -} - -// SetExclusiveStartKey sets the ExclusiveStartKey field's value. -func (s *QueryInput) SetExclusiveStartKey(v map[string]*AttributeValue) *QueryInput { - s.ExclusiveStartKey = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *QueryInput) SetExpressionAttributeNames(v map[string]*string) *QueryInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *QueryInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *QueryInput { - s.ExpressionAttributeValues = v - return s -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *QueryInput) SetFilterExpression(v string) *QueryInput { - s.FilterExpression = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *QueryInput) SetIndexName(v string) *QueryInput { - s.IndexName = &v - return s -} - -// SetKeyConditionExpression sets the KeyConditionExpression field's value. -func (s *QueryInput) SetKeyConditionExpression(v string) *QueryInput { - s.KeyConditionExpression = &v - return s -} - -// SetKeyConditions sets the KeyConditions field's value. -func (s *QueryInput) SetKeyConditions(v map[string]*Condition) *QueryInput { - s.KeyConditions = v - return s -} - -// SetLimit sets the Limit field's value. -func (s *QueryInput) SetLimit(v int64) *QueryInput { - s.Limit = &v - return s -} - -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *QueryInput) SetProjectionExpression(v string) *QueryInput { - s.ProjectionExpression = &v - return s -} - -// SetQueryFilter sets the QueryFilter field's value. -func (s *QueryInput) SetQueryFilter(v map[string]*Condition) *QueryInput { - s.QueryFilter = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *QueryInput) SetReturnConsumedCapacity(v string) *QueryInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetScanIndexForward sets the ScanIndexForward field's value. -func (s *QueryInput) SetScanIndexForward(v bool) *QueryInput { - s.ScanIndexForward = &v - return s -} - -// SetSelect sets the Select field's value. -func (s *QueryInput) SetSelect(v string) *QueryInput { - s.Select = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *QueryInput) SetTableName(v string) *QueryInput { - s.TableName = &v - return s -} - -// Represents the output of a Query operation. -type QueryOutput struct { - _ struct{} `type:"structure"` - - // The capacity units consumed by the Query operation. The data returned includes - // the total provisioned throughput consumed, along with statistics for the - // table and any indexes involved in the operation. ConsumedCapacity is only - // returned if the ReturnConsumedCapacity parameter was specified For more information, - // see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // The number of items in the response. - // - // If you used a QueryFilter in the request, then Count is the number of items - // returned after the filter was applied, and ScannedCount is the number of - // matching items before the filter was applied. - // - // If you did not use a filter in the request, then Count and ScannedCount are - // the same. - Count *int64 `type:"integer"` - - // An array of item attributes that match the query criteria. Each element in - // this array consists of an attribute name and the value for that attribute. - Items []map[string]*AttributeValue `type:"list"` - - // The primary key of the item where the operation stopped, inclusive of the - // previous result set. Use this value to start a new operation, excluding this - // value in the new request. - // - // If LastEvaluatedKey is empty, then the "last page" of results has been processed - // and there is no more data to be retrieved. - // - // If LastEvaluatedKey is not empty, it does not necessarily mean that there - // is more data in the result set. The only way to know when you have reached - // the end of the result set is when LastEvaluatedKey is empty. - LastEvaluatedKey map[string]*AttributeValue `type:"map"` - - // The number of items evaluated, before any QueryFilter is applied. A high - // ScannedCount value with few, or no, Count results indicates an inefficient - // Query operation. For more information, see Count and ScannedCount (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count) - // in the Amazon DynamoDB Developer Guide. - // - // If you did not use a filter in the request, then ScannedCount is the same - // as Count. - ScannedCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s QueryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s QueryOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *QueryOutput) SetConsumedCapacity(v *ConsumedCapacity) *QueryOutput { - s.ConsumedCapacity = v - return s -} - -// SetCount sets the Count field's value. -func (s *QueryOutput) SetCount(v int64) *QueryOutput { - s.Count = &v - return s -} - -// SetItems sets the Items field's value. -func (s *QueryOutput) SetItems(v []map[string]*AttributeValue) *QueryOutput { - s.Items = v - return s -} - -// SetLastEvaluatedKey sets the LastEvaluatedKey field's value. -func (s *QueryOutput) SetLastEvaluatedKey(v map[string]*AttributeValue) *QueryOutput { - s.LastEvaluatedKey = v - return s -} - -// SetScannedCount sets the ScannedCount field's value. -func (s *QueryOutput) SetScannedCount(v int64) *QueryOutput { - s.ScannedCount = &v - return s -} - -// Represents the properties of a replica. -type Replica struct { - _ struct{} `type:"structure"` - - // The region where the replica needs to be created. - RegionName *string `type:"string"` -} - -// String returns the string representation -func (s Replica) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Replica) GoString() string { - return s.String() -} - -// SetRegionName sets the RegionName field's value. -func (s *Replica) SetRegionName(v string) *Replica { - s.RegionName = &v - return s -} - -// Contains the details of the replica. -type ReplicaDescription struct { - _ struct{} `type:"structure"` - - // The name of the region. - RegionName *string `type:"string"` -} - -// String returns the string representation -func (s ReplicaDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicaDescription) GoString() string { - return s.String() -} - -// SetRegionName sets the RegionName field's value. -func (s *ReplicaDescription) SetRegionName(v string) *ReplicaDescription { - s.RegionName = &v - return s -} - -// Represents the properties of a global secondary index. -type ReplicaGlobalSecondaryIndexSettingsDescription struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index. The name must be unique among all - // other indexes on this table. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The current status of the global secondary index: - // - // * CREATING - The global secondary index is being created. - // - // * UPDATING - The global secondary index is being updated. - // - // * DELETING - The global secondary index is being deleted. - // - // * ACTIVE - The global secondary index is ready for use. - IndexStatus *string `type:"string" enum:"IndexStatus"` - - // The maximum number of strongly consistent reads consumed per second before - // DynamoDB returns a ThrottlingException. - ProvisionedReadCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. - ProvisionedWriteCapacityUnits *int64 `min:"1" type:"long"` -} - -// String returns the string representation -func (s ReplicaGlobalSecondaryIndexSettingsDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicaGlobalSecondaryIndexSettingsDescription) GoString() string { - return s.String() -} - -// SetIndexName sets the IndexName field's value. -func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetIndexName(v string) *ReplicaGlobalSecondaryIndexSettingsDescription { - s.IndexName = &v - return s -} - -// SetIndexStatus sets the IndexStatus field's value. -func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetIndexStatus(v string) *ReplicaGlobalSecondaryIndexSettingsDescription { - s.IndexStatus = &v - return s -} - -// SetProvisionedReadCapacityUnits sets the ProvisionedReadCapacityUnits field's value. -func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetProvisionedReadCapacityUnits(v int64) *ReplicaGlobalSecondaryIndexSettingsDescription { - s.ProvisionedReadCapacityUnits = &v - return s -} - -// SetProvisionedWriteCapacityUnits sets the ProvisionedWriteCapacityUnits field's value. -func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetProvisionedWriteCapacityUnits(v int64) *ReplicaGlobalSecondaryIndexSettingsDescription { - s.ProvisionedWriteCapacityUnits = &v - return s -} - -// Represents the settings of a global secondary index for a global table that -// will be modified. -type ReplicaGlobalSecondaryIndexSettingsUpdate struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index. The name must be unique among all - // other indexes on this table. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The maximum number of strongly consistent reads consumed per second before - // DynamoDB returns a ThrottlingException. - ProvisionedReadCapacityUnits *int64 `min:"1" type:"long"` -} - -// String returns the string representation -func (s ReplicaGlobalSecondaryIndexSettingsUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicaGlobalSecondaryIndexSettingsUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicaGlobalSecondaryIndexSettingsUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicaGlobalSecondaryIndexSettingsUpdate"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.ProvisionedReadCapacityUnits != nil && *s.ProvisionedReadCapacityUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("ProvisionedReadCapacityUnits", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *ReplicaGlobalSecondaryIndexSettingsUpdate) SetIndexName(v string) *ReplicaGlobalSecondaryIndexSettingsUpdate { - s.IndexName = &v - return s -} - -// SetProvisionedReadCapacityUnits sets the ProvisionedReadCapacityUnits field's value. -func (s *ReplicaGlobalSecondaryIndexSettingsUpdate) SetProvisionedReadCapacityUnits(v int64) *ReplicaGlobalSecondaryIndexSettingsUpdate { - s.ProvisionedReadCapacityUnits = &v - return s -} - -// Represents the properties of a replica. -type ReplicaSettingsDescription struct { - _ struct{} `type:"structure"` - - // The region name of the replica. - // - // RegionName is a required field - RegionName *string `type:"string" required:"true"` - - // Replica global secondary index settings for the global table. - ReplicaGlobalSecondaryIndexSettings []*ReplicaGlobalSecondaryIndexSettingsDescription `type:"list"` - - // The maximum number of strongly consistent reads consumed per second before - // DynamoDB returns a ThrottlingException. For more information, see Specifying - // Read and Write Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - ReplicaProvisionedReadCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. For more information, see Specifying Read and Write - // Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - ReplicaProvisionedWriteCapacityUnits *int64 `min:"1" type:"long"` - - // The current state of the region: - // - // * CREATING - The region is being created. - // - // * UPDATING - The region is being updated. - // - // * DELETING - The region is being deleted. - // - // * ACTIVE - The region is ready for use. - ReplicaStatus *string `type:"string" enum:"ReplicaStatus"` -} - -// String returns the string representation -func (s ReplicaSettingsDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicaSettingsDescription) GoString() string { - return s.String() -} - -// SetRegionName sets the RegionName field's value. -func (s *ReplicaSettingsDescription) SetRegionName(v string) *ReplicaSettingsDescription { - s.RegionName = &v - return s -} - -// SetReplicaGlobalSecondaryIndexSettings sets the ReplicaGlobalSecondaryIndexSettings field's value. -func (s *ReplicaSettingsDescription) SetReplicaGlobalSecondaryIndexSettings(v []*ReplicaGlobalSecondaryIndexSettingsDescription) *ReplicaSettingsDescription { - s.ReplicaGlobalSecondaryIndexSettings = v - return s -} - -// SetReplicaProvisionedReadCapacityUnits sets the ReplicaProvisionedReadCapacityUnits field's value. -func (s *ReplicaSettingsDescription) SetReplicaProvisionedReadCapacityUnits(v int64) *ReplicaSettingsDescription { - s.ReplicaProvisionedReadCapacityUnits = &v - return s -} - -// SetReplicaProvisionedWriteCapacityUnits sets the ReplicaProvisionedWriteCapacityUnits field's value. -func (s *ReplicaSettingsDescription) SetReplicaProvisionedWriteCapacityUnits(v int64) *ReplicaSettingsDescription { - s.ReplicaProvisionedWriteCapacityUnits = &v - return s -} - -// SetReplicaStatus sets the ReplicaStatus field's value. -func (s *ReplicaSettingsDescription) SetReplicaStatus(v string) *ReplicaSettingsDescription { - s.ReplicaStatus = &v - return s -} - -// Represents the settings for a global table in a region that will be modified. -type ReplicaSettingsUpdate struct { - _ struct{} `type:"structure"` - - // The region of the replica to be added. - // - // RegionName is a required field - RegionName *string `type:"string" required:"true"` - - // Represents the settings of a global secondary index for a global table that - // will be modified. - ReplicaGlobalSecondaryIndexSettingsUpdate []*ReplicaGlobalSecondaryIndexSettingsUpdate `min:"1" type:"list"` - - // The maximum number of strongly consistent reads consumed per second before - // DynamoDB returns a ThrottlingException. For more information, see Specifying - // Read and Write Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - ReplicaProvisionedReadCapacityUnits *int64 `min:"1" type:"long"` -} - -// String returns the string representation -func (s ReplicaSettingsUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicaSettingsUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicaSettingsUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicaSettingsUpdate"} - if s.RegionName == nil { - invalidParams.Add(request.NewErrParamRequired("RegionName")) - } - if s.ReplicaGlobalSecondaryIndexSettingsUpdate != nil && len(s.ReplicaGlobalSecondaryIndexSettingsUpdate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ReplicaGlobalSecondaryIndexSettingsUpdate", 1)) - } - if s.ReplicaProvisionedReadCapacityUnits != nil && *s.ReplicaProvisionedReadCapacityUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("ReplicaProvisionedReadCapacityUnits", 1)) - } - if s.ReplicaGlobalSecondaryIndexSettingsUpdate != nil { - for i, v := range s.ReplicaGlobalSecondaryIndexSettingsUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ReplicaGlobalSecondaryIndexSettingsUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegionName sets the RegionName field's value. -func (s *ReplicaSettingsUpdate) SetRegionName(v string) *ReplicaSettingsUpdate { - s.RegionName = &v - return s -} - -// SetReplicaGlobalSecondaryIndexSettingsUpdate sets the ReplicaGlobalSecondaryIndexSettingsUpdate field's value. -func (s *ReplicaSettingsUpdate) SetReplicaGlobalSecondaryIndexSettingsUpdate(v []*ReplicaGlobalSecondaryIndexSettingsUpdate) *ReplicaSettingsUpdate { - s.ReplicaGlobalSecondaryIndexSettingsUpdate = v - return s -} - -// SetReplicaProvisionedReadCapacityUnits sets the ReplicaProvisionedReadCapacityUnits field's value. -func (s *ReplicaSettingsUpdate) SetReplicaProvisionedReadCapacityUnits(v int64) *ReplicaSettingsUpdate { - s.ReplicaProvisionedReadCapacityUnits = &v - return s -} - -// Represents one of the following: -// -// * A new replica to be added to an existing global table. -// -// * New parameters for an existing replica. -// -// * An existing replica to be removed from an existing global table. -type ReplicaUpdate struct { - _ struct{} `type:"structure"` - - // The parameters required for creating a replica on an existing global table. - Create *CreateReplicaAction `type:"structure"` - - // The name of the existing replica to be removed. - Delete *DeleteReplicaAction `type:"structure"` -} - -// String returns the string representation -func (s ReplicaUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicaUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicaUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicaUpdate"} - if s.Create != nil { - if err := s.Create.Validate(); err != nil { - invalidParams.AddNested("Create", err.(request.ErrInvalidParams)) - } - } - if s.Delete != nil { - if err := s.Delete.Validate(); err != nil { - invalidParams.AddNested("Delete", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreate sets the Create field's value. -func (s *ReplicaUpdate) SetCreate(v *CreateReplicaAction) *ReplicaUpdate { - s.Create = v - return s -} - -// SetDelete sets the Delete field's value. -func (s *ReplicaUpdate) SetDelete(v *DeleteReplicaAction) *ReplicaUpdate { - s.Delete = v - return s -} - -// Contains details for the restore. -type RestoreSummary struct { - _ struct{} `type:"structure"` - - // Point in time or source backup time. - // - // RestoreDateTime is a required field - RestoreDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // Indicates if a restore is in progress or not. - // - // RestoreInProgress is a required field - RestoreInProgress *bool `type:"boolean" required:"true"` - - // ARN of the backup from which the table was restored. - SourceBackupArn *string `min:"37" type:"string"` - - // ARN of the source table of the backup that is being restored. - SourceTableArn *string `type:"string"` -} - -// String returns the string representation -func (s RestoreSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreSummary) GoString() string { - return s.String() -} - -// SetRestoreDateTime sets the RestoreDateTime field's value. -func (s *RestoreSummary) SetRestoreDateTime(v time.Time) *RestoreSummary { - s.RestoreDateTime = &v - return s -} - -// SetRestoreInProgress sets the RestoreInProgress field's value. -func (s *RestoreSummary) SetRestoreInProgress(v bool) *RestoreSummary { - s.RestoreInProgress = &v - return s -} - -// SetSourceBackupArn sets the SourceBackupArn field's value. -func (s *RestoreSummary) SetSourceBackupArn(v string) *RestoreSummary { - s.SourceBackupArn = &v - return s -} - -// SetSourceTableArn sets the SourceTableArn field's value. -func (s *RestoreSummary) SetSourceTableArn(v string) *RestoreSummary { - s.SourceTableArn = &v - return s -} - -type RestoreTableFromBackupInput struct { - _ struct{} `type:"structure"` - - // The ARN associated with the backup. - // - // BackupArn is a required field - BackupArn *string `min:"37" type:"string" required:"true"` - - // The name of the new table to which the backup must be restored. - // - // TargetTableName is a required field - TargetTableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s RestoreTableFromBackupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreTableFromBackupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreTableFromBackupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreTableFromBackupInput"} - if s.BackupArn == nil { - invalidParams.Add(request.NewErrParamRequired("BackupArn")) - } - if s.BackupArn != nil && len(*s.BackupArn) < 37 { - invalidParams.Add(request.NewErrParamMinLen("BackupArn", 37)) - } - if s.TargetTableName == nil { - invalidParams.Add(request.NewErrParamRequired("TargetTableName")) - } - if s.TargetTableName != nil && len(*s.TargetTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TargetTableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupArn sets the BackupArn field's value. -func (s *RestoreTableFromBackupInput) SetBackupArn(v string) *RestoreTableFromBackupInput { - s.BackupArn = &v - return s -} - -// SetTargetTableName sets the TargetTableName field's value. -func (s *RestoreTableFromBackupInput) SetTargetTableName(v string) *RestoreTableFromBackupInput { - s.TargetTableName = &v - return s -} - -type RestoreTableFromBackupOutput struct { - _ struct{} `type:"structure"` - - // The description of the table created from an existing backup. - TableDescription *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s RestoreTableFromBackupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreTableFromBackupOutput) GoString() string { - return s.String() -} - -// SetTableDescription sets the TableDescription field's value. -func (s *RestoreTableFromBackupOutput) SetTableDescription(v *TableDescription) *RestoreTableFromBackupOutput { - s.TableDescription = v - return s -} - -type RestoreTableToPointInTimeInput struct { - _ struct{} `type:"structure"` - - // Time in the past to restore the table to. - RestoreDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // Name of the source table that is being restored. - // - // SourceTableName is a required field - SourceTableName *string `min:"3" type:"string" required:"true"` - - // The name of the new table to which it must be restored to. - // - // TargetTableName is a required field - TargetTableName *string `min:"3" type:"string" required:"true"` - - // Restore the table to the latest possible time. LatestRestorableDateTime is - // typically 5 minutes before the current time. - UseLatestRestorableTime *bool `type:"boolean"` -} - -// String returns the string representation -func (s RestoreTableToPointInTimeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreTableToPointInTimeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreTableToPointInTimeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreTableToPointInTimeInput"} - if s.SourceTableName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceTableName")) - } - if s.SourceTableName != nil && len(*s.SourceTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("SourceTableName", 3)) - } - if s.TargetTableName == nil { - invalidParams.Add(request.NewErrParamRequired("TargetTableName")) - } - if s.TargetTableName != nil && len(*s.TargetTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TargetTableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRestoreDateTime sets the RestoreDateTime field's value. -func (s *RestoreTableToPointInTimeInput) SetRestoreDateTime(v time.Time) *RestoreTableToPointInTimeInput { - s.RestoreDateTime = &v - return s -} - -// SetSourceTableName sets the SourceTableName field's value. -func (s *RestoreTableToPointInTimeInput) SetSourceTableName(v string) *RestoreTableToPointInTimeInput { - s.SourceTableName = &v - return s -} - -// SetTargetTableName sets the TargetTableName field's value. -func (s *RestoreTableToPointInTimeInput) SetTargetTableName(v string) *RestoreTableToPointInTimeInput { - s.TargetTableName = &v - return s -} - -// SetUseLatestRestorableTime sets the UseLatestRestorableTime field's value. -func (s *RestoreTableToPointInTimeInput) SetUseLatestRestorableTime(v bool) *RestoreTableToPointInTimeInput { - s.UseLatestRestorableTime = &v - return s -} - -type RestoreTableToPointInTimeOutput struct { - _ struct{} `type:"structure"` - - // Represents the properties of a table. - TableDescription *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s RestoreTableToPointInTimeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreTableToPointInTimeOutput) GoString() string { - return s.String() -} - -// SetTableDescription sets the TableDescription field's value. -func (s *RestoreTableToPointInTimeOutput) SetTableDescription(v *TableDescription) *RestoreTableToPointInTimeOutput { - s.TableDescription = v - return s -} - -// The description of the server-side encryption status on the specified table. -type SSEDescription struct { - _ struct{} `type:"structure"` - - // The current state of server-side encryption: - // - // * ENABLING - Server-side encryption is being enabled. - // - // * ENABLED - Server-side encryption is enabled. - // - // * DISABLING - Server-side encryption is being disabled. - // - // * DISABLED - Server-side encryption is disabled. - Status *string `type:"string" enum:"SSEStatus"` -} - -// String returns the string representation -func (s SSEDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SSEDescription) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *SSEDescription) SetStatus(v string) *SSEDescription { - s.Status = &v - return s -} - -// Represents the settings used to enable server-side encryption. -type SSESpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether server-side encryption is enabled (true) or disabled (false) - // on the table. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s SSESpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SSESpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SSESpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SSESpecification"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *SSESpecification) SetEnabled(v bool) *SSESpecification { - s.Enabled = &v - return s -} - -// Represents the input of a Scan operation. -type ScanInput struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` - - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // A Boolean value that determines the read consistency model during the scan: - // - // * If ConsistentRead is false, then the data returned from Scan might not - // contain the results from other recently completed write operations (PutItem, - // UpdateItem or DeleteItem). - // - // * If ConsistentRead is true, then all of the write operations that completed - // before the Scan began are guaranteed to be contained in the Scan response. - // - // The default setting for ConsistentRead is false. - // - // The ConsistentRead parameter is not supported on global secondary indexes. - // If you scan a global secondary index with ConsistentRead set to true, you - // will receive a ValidationException. - ConsistentRead *bool `type:"boolean"` - - // The primary key of the first item that this operation will evaluate. Use - // the value that was returned for LastEvaluatedKey in the previous operation. - // - // The data type for ExclusiveStartKey must be String, Number or Binary. No - // set data types are allowed. - // - // In a parallel scan, a Scan request that includes ExclusiveStartKey must specify - // the same segment whose previous Scan returned the corresponding value of - // LastEvaluatedKey. - ExclusiveStartKey map[string]*AttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A string that contains conditions that DynamoDB applies after the Scan operation, - // but before the data is returned to you. Items that do not satisfy the FilterExpression - // criteria are not returned. - // - // A FilterExpression is applied after the items have already been read; the - // process of filtering does not consume any additional read capacity units. - // - // For more information, see Filter Expressions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults) - // in the Amazon DynamoDB Developer Guide. - FilterExpression *string `type:"string"` - - // The name of a secondary index to scan. This index can be any local secondary - // index or global secondary index. Note that if you use the IndexName parameter, - // you must also provide TableName. - IndexName *string `min:"3" type:"string"` - - // The maximum number of items to evaluate (not necessarily the number of matching - // items). If DynamoDB processes the number of items up to the limit while processing - // the results, it stops the operation and returns the matching values up to - // that point, and a key in LastEvaluatedKey to apply in a subsequent operation, - // so that you can pick up where you left off. Also, if the processed data set - // size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation - // and returns the matching values up to the limit, and a key in LastEvaluatedKey - // to apply in a subsequent operation to continue the operation. For more information, - // see Query and Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) - // in the Amazon DynamoDB Developer Guide. - Limit *int64 `min:"1" type:"integer"` - - // A string that identifies one or more attributes to retrieve from the specified - // table or index. These attributes can include scalars, sets, or elements of - // a JSON document. The attributes in the expression must be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear in - // the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see ScanFilter (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html) - // in the Amazon DynamoDB Developer Guide. - ScanFilter map[string]*Condition `type:"map"` - - // For a parallel Scan request, Segment identifies an individual segment to - // be scanned by an application worker. - // - // Segment IDs are zero-based, so the first segment is always 0. For example, - // if you want to use four application threads to scan a table or an index, - // then the first thread specifies a Segment value of 0, the second thread specifies - // 1, and so on. - // - // The value of LastEvaluatedKey returned from a parallel Scan request must - // be used as ExclusiveStartKey with the same segment ID in a subsequent Scan - // operation. - // - // The value for Segment must be greater than or equal to 0, and less than the - // value provided for TotalSegments. - // - // If you provide Segment, you must also provide TotalSegments. - Segment *int64 `type:"integer"` - - // The attributes to be returned in the result. You can retrieve all item attributes, - // specific item attributes, the count of matching items, or in the case of - // an index, some or all of the attributes projected into the index. - // - // * ALL_ATTRIBUTES - Returns all of the item attributes from the specified - // table or index. If you query a local secondary index, then for each matching - // item in the index DynamoDB will fetch the entire item from the parent - // table. If the index is configured to project all item attributes, then - // all of the data can be obtained from the local secondary index, and no - // fetching is required. - // - // * ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves - // all attributes that have been projected into the index. If the index is - // configured to project all attributes, this return value is equivalent - // to specifying ALL_ATTRIBUTES. - // - // * COUNT - Returns the number of matching items, rather than the matching - // items themselves. - // - // * SPECIFIC_ATTRIBUTES - Returns only the attributes listed in AttributesToGet. - // This return value is equivalent to specifying AttributesToGet without - // specifying any value for Select. - // - // If you query or scan a local secondary index and request only attributes - // that are projected into that index, the operation will read only the index - // and not the table. If any of the requested attributes are not projected - // into the local secondary index, DynamoDB will fetch each of these attributes - // from the parent table. This extra fetching incurs additional throughput - // cost and latency. - // - // If you query or scan a global secondary index, you can only request attributes - // that are projected into the index. Global secondary index queries cannot - // fetch attributes from the parent table. - // - // If neither Select nor AttributesToGet are specified, DynamoDB defaults to - // ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when - // accessing an index. You cannot use both Select and AttributesToGet together - // in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES. - // (This usage is equivalent to specifying AttributesToGet without any value - // for Select.) - // - // If you use the ProjectionExpression parameter, then the value for Select - // can only be SPECIFIC_ATTRIBUTES. Any other value for Select will return an - // error. - Select *string `type:"string" enum:"Select"` - - // The name of the table containing the requested items; or, if you provide - // IndexName, the name of the table to which that index belongs. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` - - // For a parallel Scan request, TotalSegments represents the total number of - // segments into which the Scan operation will be divided. The value of TotalSegments - // corresponds to the number of application workers that will perform the parallel - // scan. For example, if you want to use four application threads to scan a - // table or an index, specify a TotalSegments value of 4. - // - // The value for TotalSegments must be greater than or equal to 1, and less - // than or equal to 1000000. If you specify a TotalSegments value of 1, the - // Scan operation will be sequential rather than parallel. - // - // If you specify TotalSegments, you must also specify Segment. - TotalSegments *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ScanInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScanInput"} - if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1)) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.TotalSegments != nil && *s.TotalSegments < 1 { - invalidParams.Add(request.NewErrParamMinValue("TotalSegments", 1)) - } - if s.ScanFilter != nil { - for i, v := range s.ScanFilter { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScanFilter", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *ScanInput) SetAttributesToGet(v []*string) *ScanInput { - s.AttributesToGet = v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *ScanInput) SetConditionalOperator(v string) *ScanInput { - s.ConditionalOperator = &v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *ScanInput) SetConsistentRead(v bool) *ScanInput { - s.ConsistentRead = &v - return s -} - -// SetExclusiveStartKey sets the ExclusiveStartKey field's value. -func (s *ScanInput) SetExclusiveStartKey(v map[string]*AttributeValue) *ScanInput { - s.ExclusiveStartKey = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *ScanInput) SetExpressionAttributeNames(v map[string]*string) *ScanInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *ScanInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *ScanInput { - s.ExpressionAttributeValues = v - return s -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *ScanInput) SetFilterExpression(v string) *ScanInput { - s.FilterExpression = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *ScanInput) SetIndexName(v string) *ScanInput { - s.IndexName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ScanInput) SetLimit(v int64) *ScanInput { - s.Limit = &v - return s -} - -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *ScanInput) SetProjectionExpression(v string) *ScanInput { - s.ProjectionExpression = &v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *ScanInput) SetReturnConsumedCapacity(v string) *ScanInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetScanFilter sets the ScanFilter field's value. -func (s *ScanInput) SetScanFilter(v map[string]*Condition) *ScanInput { - s.ScanFilter = v - return s -} - -// SetSegment sets the Segment field's value. -func (s *ScanInput) SetSegment(v int64) *ScanInput { - s.Segment = &v - return s -} - -// SetSelect sets the Select field's value. -func (s *ScanInput) SetSelect(v string) *ScanInput { - s.Select = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *ScanInput) SetTableName(v string) *ScanInput { - s.TableName = &v - return s -} - -// SetTotalSegments sets the TotalSegments field's value. -func (s *ScanInput) SetTotalSegments(v int64) *ScanInput { - s.TotalSegments = &v - return s -} - -// Represents the output of a Scan operation. -type ScanOutput struct { - _ struct{} `type:"structure"` - - // The capacity units consumed by the Scan operation. The data returned includes - // the total provisioned throughput consumed, along with statistics for the - // table and any indexes involved in the operation. ConsumedCapacity is only - // returned if the ReturnConsumedCapacity parameter was specified. For more - // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // The number of items in the response. - // - // If you set ScanFilter in the request, then Count is the number of items returned - // after the filter was applied, and ScannedCount is the number of matching - // items before the filter was applied. - // - // If you did not use a filter in the request, then Count is the same as ScannedCount. - Count *int64 `type:"integer"` - - // An array of item attributes that match the scan criteria. Each element in - // this array consists of an attribute name and the value for that attribute. - Items []map[string]*AttributeValue `type:"list"` - - // The primary key of the item where the operation stopped, inclusive of the - // previous result set. Use this value to start a new operation, excluding this - // value in the new request. - // - // If LastEvaluatedKey is empty, then the "last page" of results has been processed - // and there is no more data to be retrieved. - // - // If LastEvaluatedKey is not empty, it does not necessarily mean that there - // is more data in the result set. The only way to know when you have reached - // the end of the result set is when LastEvaluatedKey is empty. - LastEvaluatedKey map[string]*AttributeValue `type:"map"` - - // The number of items evaluated, before any ScanFilter is applied. A high ScannedCount - // value with few, or no, Count results indicates an inefficient Scan operation. - // For more information, see Count and ScannedCount (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count) - // in the Amazon DynamoDB Developer Guide. - // - // If you did not use a filter in the request, then ScannedCount is the same - // as Count. - ScannedCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s ScanOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScanOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *ScanOutput) SetConsumedCapacity(v *ConsumedCapacity) *ScanOutput { - s.ConsumedCapacity = v - return s -} - -// SetCount sets the Count field's value. -func (s *ScanOutput) SetCount(v int64) *ScanOutput { - s.Count = &v - return s -} - -// SetItems sets the Items field's value. -func (s *ScanOutput) SetItems(v []map[string]*AttributeValue) *ScanOutput { - s.Items = v - return s -} - -// SetLastEvaluatedKey sets the LastEvaluatedKey field's value. -func (s *ScanOutput) SetLastEvaluatedKey(v map[string]*AttributeValue) *ScanOutput { - s.LastEvaluatedKey = v - return s -} - -// SetScannedCount sets the ScannedCount field's value. -func (s *ScanOutput) SetScannedCount(v int64) *ScanOutput { - s.ScannedCount = &v - return s -} - -// Contains the details of the table when the backup was created. -type SourceTableDetails struct { - _ struct{} `type:"structure"` - - // Number of items in the table. Please note this is an approximate value. - ItemCount *int64 `type:"long"` - - // Schema of the table. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // Read IOPs and Write IOPS on the table when the backup was created. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` - - // ARN of the table for which backup was created. - TableArn *string `type:"string"` - - // Time when the source table was created. - // - // TableCreationDateTime is a required field - TableCreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // Unique identifier for the table for which the backup was created. - // - // TableId is a required field - TableId *string `type:"string" required:"true"` - - // The name of the table for which the backup was created. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` - - // Size of the table in bytes. Please note this is an approximate value. - TableSizeBytes *int64 `type:"long"` -} - -// String returns the string representation -func (s SourceTableDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceTableDetails) GoString() string { - return s.String() -} - -// SetItemCount sets the ItemCount field's value. -func (s *SourceTableDetails) SetItemCount(v int64) *SourceTableDetails { - s.ItemCount = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *SourceTableDetails) SetKeySchema(v []*KeySchemaElement) *SourceTableDetails { - s.KeySchema = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *SourceTableDetails) SetProvisionedThroughput(v *ProvisionedThroughput) *SourceTableDetails { - s.ProvisionedThroughput = v - return s -} - -// SetTableArn sets the TableArn field's value. -func (s *SourceTableDetails) SetTableArn(v string) *SourceTableDetails { - s.TableArn = &v - return s -} - -// SetTableCreationDateTime sets the TableCreationDateTime field's value. -func (s *SourceTableDetails) SetTableCreationDateTime(v time.Time) *SourceTableDetails { - s.TableCreationDateTime = &v - return s -} - -// SetTableId sets the TableId field's value. -func (s *SourceTableDetails) SetTableId(v string) *SourceTableDetails { - s.TableId = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *SourceTableDetails) SetTableName(v string) *SourceTableDetails { - s.TableName = &v - return s -} - -// SetTableSizeBytes sets the TableSizeBytes field's value. -func (s *SourceTableDetails) SetTableSizeBytes(v int64) *SourceTableDetails { - s.TableSizeBytes = &v - return s -} - -// Contains the details of the features enabled on the table when the backup -// was created. For example, LSIs, GSIs, streams, TTL. -type SourceTableFeatureDetails struct { - _ struct{} `type:"structure"` - - // Represents the GSI properties for the table when the backup was created. - // It includes the IndexName, KeySchema, Projection and ProvisionedThroughput - // for the GSIs on the table at the time of backup. - GlobalSecondaryIndexes []*GlobalSecondaryIndexInfo `type:"list"` - - // Represents the LSI properties for the table when the backup was created. - // It includes the IndexName, KeySchema and Projection for the LSIs on the table - // at the time of backup. - LocalSecondaryIndexes []*LocalSecondaryIndexInfo `type:"list"` - - // The description of the server-side encryption status on the table when the - // backup was created. - SSEDescription *SSEDescription `type:"structure"` - - // Stream settings on the table when the backup was created. - StreamDescription *StreamSpecification `type:"structure"` - - // Time to Live settings on the table when the backup was created. - TimeToLiveDescription *TimeToLiveDescription `type:"structure"` -} - -// String returns the string representation -func (s SourceTableFeatureDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceTableFeatureDetails) GoString() string { - return s.String() -} - -// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. -func (s *SourceTableFeatureDetails) SetGlobalSecondaryIndexes(v []*GlobalSecondaryIndexInfo) *SourceTableFeatureDetails { - s.GlobalSecondaryIndexes = v - return s -} - -// SetLocalSecondaryIndexes sets the LocalSecondaryIndexes field's value. -func (s *SourceTableFeatureDetails) SetLocalSecondaryIndexes(v []*LocalSecondaryIndexInfo) *SourceTableFeatureDetails { - s.LocalSecondaryIndexes = v - return s -} - -// SetSSEDescription sets the SSEDescription field's value. -func (s *SourceTableFeatureDetails) SetSSEDescription(v *SSEDescription) *SourceTableFeatureDetails { - s.SSEDescription = v - return s -} - -// SetStreamDescription sets the StreamDescription field's value. -func (s *SourceTableFeatureDetails) SetStreamDescription(v *StreamSpecification) *SourceTableFeatureDetails { - s.StreamDescription = v - return s -} - -// SetTimeToLiveDescription sets the TimeToLiveDescription field's value. -func (s *SourceTableFeatureDetails) SetTimeToLiveDescription(v *TimeToLiveDescription) *SourceTableFeatureDetails { - s.TimeToLiveDescription = v - return s -} - -// Represents the DynamoDB Streams configuration for a table in DynamoDB. -type StreamSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether DynamoDB Streams is enabled (true) or disabled (false) - // on the table. - StreamEnabled *bool `type:"boolean"` - - // When an item in the table is modified, StreamViewType determines what information - // is written to the stream for this table. Valid values for StreamViewType - // are: - // - // * KEYS_ONLY - Only the key attributes of the modified item are written - // to the stream. - // - // * NEW_IMAGE - The entire item, as it appears after it was modified, is - // written to the stream. - // - // * OLD_IMAGE - The entire item, as it appeared before it was modified, - // is written to the stream. - // - // * NEW_AND_OLD_IMAGES - Both the new and the old item images of the item - // are written to the stream. - StreamViewType *string `type:"string" enum:"StreamViewType"` -} - -// String returns the string representation -func (s StreamSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamSpecification) GoString() string { - return s.String() -} - -// SetStreamEnabled sets the StreamEnabled field's value. -func (s *StreamSpecification) SetStreamEnabled(v bool) *StreamSpecification { - s.StreamEnabled = &v - return s -} - -// SetStreamViewType sets the StreamViewType field's value. -func (s *StreamSpecification) SetStreamViewType(v string) *StreamSpecification { - s.StreamViewType = &v - return s -} - -// Represents the properties of a table. -type TableDescription struct { - _ struct{} `type:"structure"` - - // An array of AttributeDefinition objects. Each of these objects describes - // one attribute in the table and index key schema. - // - // Each AttributeDefinition object in this array is composed of: - // - // * AttributeName - The name of the attribute. - // - // * AttributeType - The data type for the attribute. - AttributeDefinitions []*AttributeDefinition `type:"list"` - - // The date and time when the table was created, in UNIX epoch time (http://www.epochconverter.com/) - // format. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The global secondary indexes, if any, on the table. Each index is scoped - // to a given partition key value. Each element is composed of: - // - // * Backfilling - If true, then the index is currently in the backfilling - // phase. Backfilling occurs only when a new global secondary index is added - // to the table; it is the process by which DynamoDB populates the new index - // with data from the table. (This attribute does not appear for indexes - // that were created during a CreateTable operation.) - // - // * IndexName - The name of the global secondary index. - // - // * IndexSizeBytes - The total size of the global secondary index, in bytes. - // DynamoDB updates this value approximately every six hours. Recent changes - // might not be reflected in this value. - // - // * IndexStatus - The current status of the global secondary index: - // - // CREATING - The index is being created. - // - // UPDATING - The index is being updated. - // - // DELETING - The index is being deleted. - // - // ACTIVE - The index is ready for use. - // - // * ItemCount - The number of items in the global secondary index. DynamoDB - // updates this value approximately every six hours. Recent changes might - // not be reflected in this value. - // - // * KeySchema - Specifies the complete index key schema. The attribute names - // in the key schema must be between 1 and 255 characters (inclusive). The - // key schema must begin with the same partition key as the table. - // - // * Projection - Specifies attributes that are copied (projected) from the - // table into the index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. Each attribute - // specification is composed of: - // - // ProjectionType - One of the following: - // - // KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // INCLUDE - Only the specified table attributes are projected into the index. - // The list of projected attributes are in NonKeyAttributes. - // - // ALL - All of the table attributes are projected into the index. - // - // NonKeyAttributes - A list of one or more non-key attribute names that are - // projected into the secondary index. The total count of attributes provided - // in NonKeyAttributes, summed across all of the secondary indexes, must - // not exceed 20. If you project the same attribute into two different indexes, - // this counts as two distinct attributes when determining the total. - // - // * ProvisionedThroughput - The provisioned throughput settings for the - // global secondary index, consisting of read and write capacity units, along - // with data about increases and decreases. - // - // If the table is in the DELETING state, no information about indexes will - // be returned. - GlobalSecondaryIndexes []*GlobalSecondaryIndexDescription `type:"list"` - - // The number of items in the specified table. DynamoDB updates this value approximately - // every six hours. Recent changes might not be reflected in this value. - ItemCount *int64 `type:"long"` - - // The primary key structure for the table. Each KeySchemaElement consists of: - // - // * AttributeName - The name of the attribute. - // - // * KeyType - The role of the attribute: - // - // HASH - partition key - // - // RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // For more information about primary keys, see Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey) - // in the Amazon DynamoDB Developer Guide. - KeySchema []*KeySchemaElement `min:"1" type:"list"` - - // The Amazon Resource Name (ARN) that uniquely identifies the latest stream - // for this table. - LatestStreamArn *string `min:"37" type:"string"` - - // A timestamp, in ISO 8601 format, for this stream. - // - // Note that LatestStreamLabel is not a unique identifier for the stream, because - // it is possible that a stream from another table might have the same timestamp. - // However, the combination of the following three elements is guaranteed to - // be unique: - // - // * the AWS customer ID. - // - // * the table name. - // - // * the StreamLabel. - LatestStreamLabel *string `type:"string"` - - // Represents one or more local secondary indexes on the table. Each index is - // scoped to a given partition key value. Tables with one or more local secondary - // indexes are subject to an item collection size limit, where the amount of - // data within a given item collection cannot exceed 10 GB. Each element is - // composed of: - // - // * IndexName - The name of the local secondary index. - // - // * KeySchema - Specifies the complete index key schema. The attribute names - // in the key schema must be between 1 and 255 characters (inclusive). The - // key schema must begin with the same partition key as the table. - // - // * Projection - Specifies attributes that are copied (projected) from the - // table into the index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. Each attribute - // specification is composed of: - // - // ProjectionType - One of the following: - // - // KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // INCLUDE - Only the specified table attributes are projected into the index. - // The list of projected attributes are in NonKeyAttributes. - // - // ALL - All of the table attributes are projected into the index. - // - // NonKeyAttributes - A list of one or more non-key attribute names that are - // projected into the secondary index. The total count of attributes provided - // in NonKeyAttributes, summed across all of the secondary indexes, must - // not exceed 20. If you project the same attribute into two different indexes, - // this counts as two distinct attributes when determining the total. - // - // * IndexSizeBytes - Represents the total size of the index, in bytes. DynamoDB - // updates this value approximately every six hours. Recent changes might - // not be reflected in this value. - // - // * ItemCount - Represents the number of items in the index. DynamoDB updates - // this value approximately every six hours. Recent changes might not be - // reflected in this value. - // - // If the table is in the DELETING state, no information about indexes will - // be returned. - LocalSecondaryIndexes []*LocalSecondaryIndexDescription `type:"list"` - - // The provisioned throughput settings for the table, consisting of read and - // write capacity units, along with data about increases and decreases. - ProvisionedThroughput *ProvisionedThroughputDescription `type:"structure"` - - // Contains details for the restore. - RestoreSummary *RestoreSummary `type:"structure"` - - // The description of the server-side encryption status on the specified table. - SSEDescription *SSEDescription `type:"structure"` - - // The current DynamoDB Streams configuration for the table. - StreamSpecification *StreamSpecification `type:"structure"` - - // The Amazon Resource Name (ARN) that uniquely identifies the table. - TableArn *string `type:"string"` - - // Unique identifier for the table for which the backup was created. - TableId *string `type:"string"` - - // The name of the table. - TableName *string `min:"3" type:"string"` - - // The total size of the specified table, in bytes. DynamoDB updates this value - // approximately every six hours. Recent changes might not be reflected in this - // value. - TableSizeBytes *int64 `type:"long"` - - // The current state of the table: - // - // * CREATING - The table is being created. - // - // * UPDATING - The table is being updated. - // - // * DELETING - The table is being deleted. - // - // * ACTIVE - The table is ready for use. - TableStatus *string `type:"string" enum:"TableStatus"` -} - -// String returns the string representation -func (s TableDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TableDescription) GoString() string { - return s.String() -} - -// SetAttributeDefinitions sets the AttributeDefinitions field's value. -func (s *TableDescription) SetAttributeDefinitions(v []*AttributeDefinition) *TableDescription { - s.AttributeDefinitions = v - return s -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *TableDescription) SetCreationDateTime(v time.Time) *TableDescription { - s.CreationDateTime = &v - return s -} - -// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. -func (s *TableDescription) SetGlobalSecondaryIndexes(v []*GlobalSecondaryIndexDescription) *TableDescription { - s.GlobalSecondaryIndexes = v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *TableDescription) SetItemCount(v int64) *TableDescription { - s.ItemCount = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *TableDescription) SetKeySchema(v []*KeySchemaElement) *TableDescription { - s.KeySchema = v - return s -} - -// SetLatestStreamArn sets the LatestStreamArn field's value. -func (s *TableDescription) SetLatestStreamArn(v string) *TableDescription { - s.LatestStreamArn = &v - return s -} - -// SetLatestStreamLabel sets the LatestStreamLabel field's value. -func (s *TableDescription) SetLatestStreamLabel(v string) *TableDescription { - s.LatestStreamLabel = &v - return s -} - -// SetLocalSecondaryIndexes sets the LocalSecondaryIndexes field's value. -func (s *TableDescription) SetLocalSecondaryIndexes(v []*LocalSecondaryIndexDescription) *TableDescription { - s.LocalSecondaryIndexes = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *TableDescription) SetProvisionedThroughput(v *ProvisionedThroughputDescription) *TableDescription { - s.ProvisionedThroughput = v - return s -} - -// SetRestoreSummary sets the RestoreSummary field's value. -func (s *TableDescription) SetRestoreSummary(v *RestoreSummary) *TableDescription { - s.RestoreSummary = v - return s -} - -// SetSSEDescription sets the SSEDescription field's value. -func (s *TableDescription) SetSSEDescription(v *SSEDescription) *TableDescription { - s.SSEDescription = v - return s -} - -// SetStreamSpecification sets the StreamSpecification field's value. -func (s *TableDescription) SetStreamSpecification(v *StreamSpecification) *TableDescription { - s.StreamSpecification = v - return s -} - -// SetTableArn sets the TableArn field's value. -func (s *TableDescription) SetTableArn(v string) *TableDescription { - s.TableArn = &v - return s -} - -// SetTableId sets the TableId field's value. -func (s *TableDescription) SetTableId(v string) *TableDescription { - s.TableId = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *TableDescription) SetTableName(v string) *TableDescription { - s.TableName = &v - return s -} - -// SetTableSizeBytes sets the TableSizeBytes field's value. -func (s *TableDescription) SetTableSizeBytes(v int64) *TableDescription { - s.TableSizeBytes = &v - return s -} - -// SetTableStatus sets the TableStatus field's value. -func (s *TableDescription) SetTableStatus(v string) *TableDescription { - s.TableStatus = &v - return s -} - -// Describes a tag. A tag is a key-value pair. You can add up to 50 tags to -// a single DynamoDB table. -// -// AWS-assigned tag names and values are automatically assigned the aws: prefix, -// which the user cannot assign. AWS-assigned tag names do not count towards -// the tag limit of 50. User-assigned tag names have the prefix user: in the -// Cost Allocation Report. You cannot backdate the application of a tag. -// -// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) -// in the Amazon DynamoDB Developer Guide. -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag.Tag keys are case sensitive. Each DynamoDB table can only - // have up to one tag with the same key. If you try to add an existing tag (same - // key), the existing tag value will be updated to the new value. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value of the tag. Tag values are case-sensitive and can be null. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // Identifies the Amazon DynamoDB resource to which tags should be added. This - // value is an Amazon Resource Name (ARN). - // - // ResourceArn is a required field - ResourceArn *string `min:"1" type:"string" required:"true"` - - // The tags to be assigned to the Amazon DynamoDB resource. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// String returns the string representation -func (s TagResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s TagResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagResourceOutput) GoString() string { - return s.String() -} - -// The description of the Time to Live (TTL) status on the specified table. -type TimeToLiveDescription struct { - _ struct{} `type:"structure"` - - // The name of the Time to Live attribute for items in the table. - AttributeName *string `min:"1" type:"string"` - - // The Time to Live status for the table. - TimeToLiveStatus *string `type:"string" enum:"TimeToLiveStatus"` -} - -// String returns the string representation -func (s TimeToLiveDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimeToLiveDescription) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *TimeToLiveDescription) SetAttributeName(v string) *TimeToLiveDescription { - s.AttributeName = &v - return s -} - -// SetTimeToLiveStatus sets the TimeToLiveStatus field's value. -func (s *TimeToLiveDescription) SetTimeToLiveStatus(v string) *TimeToLiveDescription { - s.TimeToLiveStatus = &v - return s -} - -// Represents the settings used to enable or disable Time to Live for the specified -// table. -type TimeToLiveSpecification struct { - _ struct{} `type:"structure"` - - // The name of the Time to Live attribute used to store the expiration time - // for items in the table. - // - // AttributeName is a required field - AttributeName *string `min:"1" type:"string" required:"true"` - - // Indicates whether Time To Live is to be enabled (true) or disabled (false) - // on the table. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s TimeToLiveSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimeToLiveSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TimeToLiveSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TimeToLiveSpecification"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.AttributeName != nil && len(*s.AttributeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1)) - } - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *TimeToLiveSpecification) SetAttributeName(v string) *TimeToLiveSpecification { - s.AttributeName = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *TimeToLiveSpecification) SetEnabled(v bool) *TimeToLiveSpecification { - s.Enabled = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon DyanamoDB resource the tags will be removed from. This value is - // an Amazon Resource Name (ARN). - // - // ResourceArn is a required field - ResourceArn *string `min:"1" type:"string" required:"true"` - - // A list of tag keys. Existing tags of the resource whose keys are members - // of this list will be removed from the Amazon DynamoDB resource. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s UntagResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UntagResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateContinuousBackupsInput struct { - _ struct{} `type:"structure"` - - // Represents the settings used to enable point in time recovery. - // - // PointInTimeRecoverySpecification is a required field - PointInTimeRecoverySpecification *PointInTimeRecoverySpecification `type:"structure" required:"true"` - - // The name of the table. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateContinuousBackupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContinuousBackupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateContinuousBackupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateContinuousBackupsInput"} - if s.PointInTimeRecoverySpecification == nil { - invalidParams.Add(request.NewErrParamRequired("PointInTimeRecoverySpecification")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.PointInTimeRecoverySpecification != nil { - if err := s.PointInTimeRecoverySpecification.Validate(); err != nil { - invalidParams.AddNested("PointInTimeRecoverySpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPointInTimeRecoverySpecification sets the PointInTimeRecoverySpecification field's value. -func (s *UpdateContinuousBackupsInput) SetPointInTimeRecoverySpecification(v *PointInTimeRecoverySpecification) *UpdateContinuousBackupsInput { - s.PointInTimeRecoverySpecification = v - return s -} - -// SetTableName sets the TableName field's value. -func (s *UpdateContinuousBackupsInput) SetTableName(v string) *UpdateContinuousBackupsInput { - s.TableName = &v - return s -} - -type UpdateContinuousBackupsOutput struct { - _ struct{} `type:"structure"` - - // Represents the continuous backups and point in time recovery settings on - // the table. - ContinuousBackupsDescription *ContinuousBackupsDescription `type:"structure"` -} - -// String returns the string representation -func (s UpdateContinuousBackupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContinuousBackupsOutput) GoString() string { - return s.String() -} - -// SetContinuousBackupsDescription sets the ContinuousBackupsDescription field's value. -func (s *UpdateContinuousBackupsOutput) SetContinuousBackupsDescription(v *ContinuousBackupsDescription) *UpdateContinuousBackupsOutput { - s.ContinuousBackupsDescription = v - return s -} - -// Represents the new provisioned throughput settings to be applied to a global -// secondary index. -type UpdateGlobalSecondaryIndexAction struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index to be updated. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateGlobalSecondaryIndexAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGlobalSecondaryIndexAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGlobalSecondaryIndexAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGlobalSecondaryIndexAction"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.ProvisionedThroughput == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput")) - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *UpdateGlobalSecondaryIndexAction) SetIndexName(v string) *UpdateGlobalSecondaryIndexAction { - s.IndexName = &v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *UpdateGlobalSecondaryIndexAction) SetProvisionedThroughput(v *ProvisionedThroughput) *UpdateGlobalSecondaryIndexAction { - s.ProvisionedThroughput = v - return s -} - -type UpdateGlobalTableInput struct { - _ struct{} `type:"structure"` - - // The global table name. - // - // GlobalTableName is a required field - GlobalTableName *string `min:"3" type:"string" required:"true"` - - // A list of regions that should be added or removed from the global table. - // - // ReplicaUpdates is a required field - ReplicaUpdates []*ReplicaUpdate `type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateGlobalTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGlobalTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGlobalTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGlobalTableInput"} - if s.GlobalTableName == nil { - invalidParams.Add(request.NewErrParamRequired("GlobalTableName")) - } - if s.GlobalTableName != nil && len(*s.GlobalTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("GlobalTableName", 3)) - } - if s.ReplicaUpdates == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicaUpdates")) - } - if s.ReplicaUpdates != nil { - for i, v := range s.ReplicaUpdates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ReplicaUpdates", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *UpdateGlobalTableInput) SetGlobalTableName(v string) *UpdateGlobalTableInput { - s.GlobalTableName = &v - return s -} - -// SetReplicaUpdates sets the ReplicaUpdates field's value. -func (s *UpdateGlobalTableInput) SetReplicaUpdates(v []*ReplicaUpdate) *UpdateGlobalTableInput { - s.ReplicaUpdates = v - return s -} - -type UpdateGlobalTableOutput struct { - _ struct{} `type:"structure"` - - // Contains the details of the global table. - GlobalTableDescription *GlobalTableDescription `type:"structure"` -} - -// String returns the string representation -func (s UpdateGlobalTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGlobalTableOutput) GoString() string { - return s.String() -} - -// SetGlobalTableDescription sets the GlobalTableDescription field's value. -func (s *UpdateGlobalTableOutput) SetGlobalTableDescription(v *GlobalTableDescription) *UpdateGlobalTableOutput { - s.GlobalTableDescription = v - return s -} - -type UpdateGlobalTableSettingsInput struct { - _ struct{} `type:"structure"` - - // Represents the settings of a global secondary index for a global table that - // will be modified. - GlobalTableGlobalSecondaryIndexSettingsUpdate []*GlobalTableGlobalSecondaryIndexSettingsUpdate `min:"1" type:"list"` - - // The name of the global table - // - // GlobalTableName is a required field - GlobalTableName *string `min:"3" type:"string" required:"true"` - - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. - GlobalTableProvisionedWriteCapacityUnits *int64 `min:"1" type:"long"` - - // Represents the settings for a global table in a region that will be modified. - ReplicaSettingsUpdate []*ReplicaSettingsUpdate `min:"1" type:"list"` -} - -// String returns the string representation -func (s UpdateGlobalTableSettingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGlobalTableSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGlobalTableSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGlobalTableSettingsInput"} - if s.GlobalTableGlobalSecondaryIndexSettingsUpdate != nil && len(s.GlobalTableGlobalSecondaryIndexSettingsUpdate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GlobalTableGlobalSecondaryIndexSettingsUpdate", 1)) - } - if s.GlobalTableName == nil { - invalidParams.Add(request.NewErrParamRequired("GlobalTableName")) - } - if s.GlobalTableName != nil && len(*s.GlobalTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("GlobalTableName", 3)) - } - if s.GlobalTableProvisionedWriteCapacityUnits != nil && *s.GlobalTableProvisionedWriteCapacityUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("GlobalTableProvisionedWriteCapacityUnits", 1)) - } - if s.ReplicaSettingsUpdate != nil && len(s.ReplicaSettingsUpdate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ReplicaSettingsUpdate", 1)) - } - if s.GlobalTableGlobalSecondaryIndexSettingsUpdate != nil { - for i, v := range s.GlobalTableGlobalSecondaryIndexSettingsUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalTableGlobalSecondaryIndexSettingsUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ReplicaSettingsUpdate != nil { - for i, v := range s.ReplicaSettingsUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ReplicaSettingsUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGlobalTableGlobalSecondaryIndexSettingsUpdate sets the GlobalTableGlobalSecondaryIndexSettingsUpdate field's value. -func (s *UpdateGlobalTableSettingsInput) SetGlobalTableGlobalSecondaryIndexSettingsUpdate(v []*GlobalTableGlobalSecondaryIndexSettingsUpdate) *UpdateGlobalTableSettingsInput { - s.GlobalTableGlobalSecondaryIndexSettingsUpdate = v - return s -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *UpdateGlobalTableSettingsInput) SetGlobalTableName(v string) *UpdateGlobalTableSettingsInput { - s.GlobalTableName = &v - return s -} - -// SetGlobalTableProvisionedWriteCapacityUnits sets the GlobalTableProvisionedWriteCapacityUnits field's value. -func (s *UpdateGlobalTableSettingsInput) SetGlobalTableProvisionedWriteCapacityUnits(v int64) *UpdateGlobalTableSettingsInput { - s.GlobalTableProvisionedWriteCapacityUnits = &v - return s -} - -// SetReplicaSettingsUpdate sets the ReplicaSettingsUpdate field's value. -func (s *UpdateGlobalTableSettingsInput) SetReplicaSettingsUpdate(v []*ReplicaSettingsUpdate) *UpdateGlobalTableSettingsInput { - s.ReplicaSettingsUpdate = v - return s -} - -type UpdateGlobalTableSettingsOutput struct { - _ struct{} `type:"structure"` - - // The name of the global table. - GlobalTableName *string `min:"3" type:"string"` - - // The region specific settings for the global table. - ReplicaSettings []*ReplicaSettingsDescription `type:"list"` -} - -// String returns the string representation -func (s UpdateGlobalTableSettingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGlobalTableSettingsOutput) GoString() string { - return s.String() -} - -// SetGlobalTableName sets the GlobalTableName field's value. -func (s *UpdateGlobalTableSettingsOutput) SetGlobalTableName(v string) *UpdateGlobalTableSettingsOutput { - s.GlobalTableName = &v - return s -} - -// SetReplicaSettings sets the ReplicaSettings field's value. -func (s *UpdateGlobalTableSettingsOutput) SetReplicaSettings(v []*ReplicaSettingsDescription) *UpdateGlobalTableSettingsOutput { - s.ReplicaSettings = v - return s -} - -// Represents the input of an UpdateItem operation. -type UpdateItemInput struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use UpdateExpression instead. For more information, - // see AttributeUpdates (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html) - // in the Amazon DynamoDB Developer Guide. - AttributeUpdates map[string]*AttributeValueUpdate `type:"map"` - - // A condition that must be satisfied in order for a conditional update to succeed. - // - // An expression can contain any of the following: - // - // * Functions: attribute_exists | attribute_not_exists | attribute_type - // | contains | begins_with | size - // - // These function names are case-sensitive. - // - // * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN - // - // * Logical operators: AND | OR | NOT - // - // For more information on condition expressions, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ConditionExpression *string `type:"string"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - // in the Amazon DynamoDB Developer Guide. - Expected map[string]*ExpectedAttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // The primary key of the item to be updated. Each element consists of an attribute - // name and a value for that attribute. - // - // For the primary key, you must provide all of the attributes. For example, - // with a simple primary key, you only need to provide a value for the partition - // key. For a composite primary key, you must provide values for both the partition - // key and the sort key. - // - // Key is a required field - Key map[string]*AttributeValue `type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Determines whether item collection metrics are returned. If set to SIZE, - // the response includes statistics about item collections, if any, that were - // modified during the operation are returned in the response. If set to NONE - // (the default), no statistics are returned. - ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"` - - // Use ReturnValues if you want to get the item attributes as they appear before - // or after they are updated. For UpdateItem, the valid values are: - // - // * NONE - If ReturnValues is not specified, or if its value is NONE, then - // nothing is returned. (This setting is the default for ReturnValues.) - // - // * ALL_OLD - Returns all of the attributes of the item, as they appeared - // before the UpdateItem operation. - // - // * UPDATED_OLD - Returns only the updated attributes, as they appeared - // before the UpdateItem operation. - // - // * ALL_NEW - Returns all of the attributes of the item, as they appear - // after the UpdateItem operation. - // - // * UPDATED_NEW - Returns only the updated attributes, as they appear after - // the UpdateItem operation. - // - // There is no additional cost associated with requesting a return value aside - // from the small network and processing overhead of receiving a larger response. - // No read capacity units are consumed. - // - // The values returned are strongly consistent. - ReturnValues *string `type:"string" enum:"ReturnValue"` - - // The name of the table containing the item to update. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` - - // An expression that defines one or more attributes to be updated, the action - // to be performed on them, and new value(s) for them. - // - // The following action values are available for UpdateExpression. - // - // * SET - Adds one or more attributes and values to an item. If any of these - // attribute already exist, they are replaced by the new values. You can - // also use SET to add or subtract from an attribute that is of type Number. - // For example: SET myNum = myNum + :val - // - // SET supports the following functions: - // - // if_not_exists (path, operand) - if the item does not contain an attribute - // at the specified path, then if_not_exists evaluates to operand; otherwise, - // it evaluates to path. You can use this function to avoid overwriting an - // attribute that may already be present in the item. - // - // list_append (operand, operand) - evaluates to a list with a new element added - // to it. You can append the new element to the start or the end of the list - // by reversing the order of the operands. - // - // These function names are case-sensitive. - // - // * REMOVE - Removes one or more attributes from an item. - // - // * ADD - Adds the specified value to the item, if the attribute does not - // already exist. If the attribute does exist, then the behavior of ADD depends - // on the data type of the attribute: - // - // If the existing attribute is a number, and if Value is also a number, then - // Value is mathematically added to the existing attribute. If Value is a - // negative number, then it is subtracted from the existing attribute. - // - // If you use ADD to increment or decrement a number value for an item that - // doesn't exist before the update, DynamoDB uses 0 as the initial value. - // - // Similarly, if you use ADD for an existing item to increment or decrement - // an attribute value that doesn't exist before the update, DynamoDB uses - // 0 as the initial value. For example, suppose that the item you want to - // update doesn't have an attribute named itemcount, but you decide to ADD - // the number 3 to this attribute anyway. DynamoDB will create the itemcount - // attribute, set its initial value to 0, and finally add 3 to it. The result - // will be a new itemcount attribute in the item, with a value of 3. - // - // If the existing data type is a set and if Value is also a set, then Value - // is added to the existing set. For example, if the attribute value is the - // set [1,2], and the ADD action specified [3], then the final attribute - // value is [1,2,3]. An error occurs if an ADD action is specified for a - // set attribute and the attribute type specified does not match the existing - // set type. - // - // Both sets must have the same primitive data type. For example, if the existing - // data type is a set of strings, the Value must also be a set of strings. - // - // The ADD action only supports Number and set data types. In addition, ADD - // can only be used on top-level attributes, not nested attributes. - // - // * DELETE - Deletes an element from a set. - // - // If a set of values is specified, then those values are subtracted from the - // old set. For example, if the attribute value was the set [a,b,c] and the - // DELETE action specifies [a,c], then the final attribute value is [b]. - // Specifying an empty set is an error. - // - // The DELETE action only supports set data types. In addition, DELETE can only - // be used on top-level attributes, not nested attributes. - // - // You can have many actions in a single expression, such as the following: - // SET a=:value1, b=:value2 DELETE :value3, :value4, :value5 - // - // For more information on update expressions, see Modifying Items and Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html) - // in the Amazon DynamoDB Developer Guide. - UpdateExpression *string `type:"string"` -} - -// String returns the string representation -func (s UpdateItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateItemInput"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeUpdates sets the AttributeUpdates field's value. -func (s *UpdateItemInput) SetAttributeUpdates(v map[string]*AttributeValueUpdate) *UpdateItemInput { - s.AttributeUpdates = v - return s -} - -// SetConditionExpression sets the ConditionExpression field's value. -func (s *UpdateItemInput) SetConditionExpression(v string) *UpdateItemInput { - s.ConditionExpression = &v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *UpdateItemInput) SetConditionalOperator(v string) *UpdateItemInput { - s.ConditionalOperator = &v - return s -} - -// SetExpected sets the Expected field's value. -func (s *UpdateItemInput) SetExpected(v map[string]*ExpectedAttributeValue) *UpdateItemInput { - s.Expected = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *UpdateItemInput) SetExpressionAttributeNames(v map[string]*string) *UpdateItemInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *UpdateItemInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *UpdateItemInput { - s.ExpressionAttributeValues = v - return s -} - -// SetKey sets the Key field's value. -func (s *UpdateItemInput) SetKey(v map[string]*AttributeValue) *UpdateItemInput { - s.Key = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *UpdateItemInput) SetReturnConsumedCapacity(v string) *UpdateItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *UpdateItemInput) SetReturnItemCollectionMetrics(v string) *UpdateItemInput { - s.ReturnItemCollectionMetrics = &v - return s -} - -// SetReturnValues sets the ReturnValues field's value. -func (s *UpdateItemInput) SetReturnValues(v string) *UpdateItemInput { - s.ReturnValues = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *UpdateItemInput) SetTableName(v string) *UpdateItemInput { - s.TableName = &v - return s -} - -// SetUpdateExpression sets the UpdateExpression field's value. -func (s *UpdateItemInput) SetUpdateExpression(v string) *UpdateItemInput { - s.UpdateExpression = &v - return s -} - -// Represents the output of an UpdateItem operation. -type UpdateItemOutput struct { - _ struct{} `type:"structure"` - - // A map of attribute values as they appear before or after the UpdateItem operation, - // as determined by the ReturnValues parameter. - // - // The Attributes map is only present if ReturnValues was specified as something - // other than NONE in the request. Each element represents one attribute. - Attributes map[string]*AttributeValue `type:"map"` - - // The capacity units consumed by the UpdateItem operation. The data returned - // includes the total provisioned throughput consumed, along with statistics - // for the table and any indexes involved in the operation. ConsumedCapacity - // is only returned if the ReturnConsumedCapacity parameter was specified. For - // more information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // Information about item collections, if any, that were affected by the UpdateItem - // operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics - // parameter was specified. If the table does not have any local secondary indexes, - // this information is not returned in the response. - // - // Each ItemCollectionMetrics element consists of: - // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item itself. - // - // * SizeEstimateRangeGB - An estimate of item collection size, in gigabytes. - // This value is a two-element array containing a lower bound and an upper - // bound for the estimate. The estimate includes the size of all the items - // in the table, plus the size of all attributes projected into all of the - // local secondary indexes on that table. Use this estimate to measure whether - // a local secondary index is approaching its size limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"` -} - -// String returns the string representation -func (s UpdateItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateItemOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *UpdateItemOutput) SetAttributes(v map[string]*AttributeValue) *UpdateItemOutput { - s.Attributes = v - return s -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *UpdateItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *UpdateItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *UpdateItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *UpdateItemOutput { - s.ItemCollectionMetrics = v - return s -} - -// Represents the input of an UpdateTable operation. -type UpdateTableInput struct { - _ struct{} `type:"structure"` - - // An array of attributes that describe the key schema for the table and indexes. - // If you are adding a new global secondary index to the table, AttributeDefinitions - // must include the key element(s) of the new index. - AttributeDefinitions []*AttributeDefinition `type:"list"` - - // An array of one or more global secondary indexes for the table. For each - // index in the array, you can request one action: - // - // * Create - add a new global secondary index to the table. - // - // * Update - modify the provisioned throughput settings of an existing global - // secondary index. - // - // * Delete - remove a global secondary index from the table. - // - // For more information, see Managing Global Secondary Indexes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html) - // in the Amazon DynamoDB Developer Guide. - GlobalSecondaryIndexUpdates []*GlobalSecondaryIndexUpdate `type:"list"` - - // The new provisioned throughput settings for the specified table or index. - ProvisionedThroughput *ProvisionedThroughput `type:"structure"` - - // Represents the DynamoDB Streams configuration for the table. - // - // You will receive a ResourceInUseException if you attempt to enable a stream - // on a table that already has a stream, or if you attempt to disable a stream - // on a table which does not have a stream. - StreamSpecification *StreamSpecification `type:"structure"` - - // The name of the table to be updated. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTableInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.AttributeDefinitions != nil { - for i, v := range s.AttributeDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AttributeDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.GlobalSecondaryIndexUpdates != nil { - for i, v := range s.GlobalSecondaryIndexUpdates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexUpdates", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeDefinitions sets the AttributeDefinitions field's value. -func (s *UpdateTableInput) SetAttributeDefinitions(v []*AttributeDefinition) *UpdateTableInput { - s.AttributeDefinitions = v - return s -} - -// SetGlobalSecondaryIndexUpdates sets the GlobalSecondaryIndexUpdates field's value. -func (s *UpdateTableInput) SetGlobalSecondaryIndexUpdates(v []*GlobalSecondaryIndexUpdate) *UpdateTableInput { - s.GlobalSecondaryIndexUpdates = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *UpdateTableInput) SetProvisionedThroughput(v *ProvisionedThroughput) *UpdateTableInput { - s.ProvisionedThroughput = v - return s -} - -// SetStreamSpecification sets the StreamSpecification field's value. -func (s *UpdateTableInput) SetStreamSpecification(v *StreamSpecification) *UpdateTableInput { - s.StreamSpecification = v - return s -} - -// SetTableName sets the TableName field's value. -func (s *UpdateTableInput) SetTableName(v string) *UpdateTableInput { - s.TableName = &v - return s -} - -// Represents the output of an UpdateTable operation. -type UpdateTableOutput struct { - _ struct{} `type:"structure"` - - // Represents the properties of the table. - TableDescription *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s UpdateTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTableOutput) GoString() string { - return s.String() -} - -// SetTableDescription sets the TableDescription field's value. -func (s *UpdateTableOutput) SetTableDescription(v *TableDescription) *UpdateTableOutput { - s.TableDescription = v - return s -} - -// Represents the input of an UpdateTimeToLive operation. -type UpdateTimeToLiveInput struct { - _ struct{} `type:"structure"` - - // The name of the table to be configured. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` - - // Represents the settings used to enable or disable Time to Live for the specified - // table. - // - // TimeToLiveSpecification is a required field - TimeToLiveSpecification *TimeToLiveSpecification `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateTimeToLiveInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTimeToLiveInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTimeToLiveInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTimeToLiveInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.TimeToLiveSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("TimeToLiveSpecification")) - } - if s.TimeToLiveSpecification != nil { - if err := s.TimeToLiveSpecification.Validate(); err != nil { - invalidParams.AddNested("TimeToLiveSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *UpdateTimeToLiveInput) SetTableName(v string) *UpdateTimeToLiveInput { - s.TableName = &v - return s -} - -// SetTimeToLiveSpecification sets the TimeToLiveSpecification field's value. -func (s *UpdateTimeToLiveInput) SetTimeToLiveSpecification(v *TimeToLiveSpecification) *UpdateTimeToLiveInput { - s.TimeToLiveSpecification = v - return s -} - -type UpdateTimeToLiveOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of an UpdateTimeToLive operation. - TimeToLiveSpecification *TimeToLiveSpecification `type:"structure"` -} - -// String returns the string representation -func (s UpdateTimeToLiveOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTimeToLiveOutput) GoString() string { - return s.String() -} - -// SetTimeToLiveSpecification sets the TimeToLiveSpecification field's value. -func (s *UpdateTimeToLiveOutput) SetTimeToLiveSpecification(v *TimeToLiveSpecification) *UpdateTimeToLiveOutput { - s.TimeToLiveSpecification = v - return s -} - -// Represents an operation to perform - either DeleteItem or PutItem. You can -// only request one of these operations, not both, in a single WriteRequest. -// If you do need to perform both of these operations, you will need to provide -// two separate WriteRequest objects. -type WriteRequest struct { - _ struct{} `type:"structure"` - - // A request to perform a DeleteItem operation. - DeleteRequest *DeleteRequest `type:"structure"` - - // A request to perform a PutItem operation. - PutRequest *PutRequest `type:"structure"` -} - -// String returns the string representation -func (s WriteRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WriteRequest) GoString() string { - return s.String() -} - -// SetDeleteRequest sets the DeleteRequest field's value. -func (s *WriteRequest) SetDeleteRequest(v *DeleteRequest) *WriteRequest { - s.DeleteRequest = v - return s -} - -// SetPutRequest sets the PutRequest field's value. -func (s *WriteRequest) SetPutRequest(v *PutRequest) *WriteRequest { - s.PutRequest = v - return s -} - -const ( - // AttributeActionAdd is a AttributeAction enum value - AttributeActionAdd = "ADD" - - // AttributeActionPut is a AttributeAction enum value - AttributeActionPut = "PUT" - - // AttributeActionDelete is a AttributeAction enum value - AttributeActionDelete = "DELETE" -) - -const ( - // BackupStatusCreating is a BackupStatus enum value - BackupStatusCreating = "CREATING" - - // BackupStatusDeleted is a BackupStatus enum value - BackupStatusDeleted = "DELETED" - - // BackupStatusAvailable is a BackupStatus enum value - BackupStatusAvailable = "AVAILABLE" -) - -const ( - // ComparisonOperatorEq is a ComparisonOperator enum value - ComparisonOperatorEq = "EQ" - - // ComparisonOperatorNe is a ComparisonOperator enum value - ComparisonOperatorNe = "NE" - - // ComparisonOperatorIn is a ComparisonOperator enum value - ComparisonOperatorIn = "IN" - - // ComparisonOperatorLe is a ComparisonOperator enum value - ComparisonOperatorLe = "LE" - - // ComparisonOperatorLt is a ComparisonOperator enum value - ComparisonOperatorLt = "LT" - - // ComparisonOperatorGe is a ComparisonOperator enum value - ComparisonOperatorGe = "GE" - - // ComparisonOperatorGt is a ComparisonOperator enum value - ComparisonOperatorGt = "GT" - - // ComparisonOperatorBetween is a ComparisonOperator enum value - ComparisonOperatorBetween = "BETWEEN" - - // ComparisonOperatorNotNull is a ComparisonOperator enum value - ComparisonOperatorNotNull = "NOT_NULL" - - // ComparisonOperatorNull is a ComparisonOperator enum value - ComparisonOperatorNull = "NULL" - - // ComparisonOperatorContains is a ComparisonOperator enum value - ComparisonOperatorContains = "CONTAINS" - - // ComparisonOperatorNotContains is a ComparisonOperator enum value - ComparisonOperatorNotContains = "NOT_CONTAINS" - - // ComparisonOperatorBeginsWith is a ComparisonOperator enum value - ComparisonOperatorBeginsWith = "BEGINS_WITH" -) - -const ( - // ConditionalOperatorAnd is a ConditionalOperator enum value - ConditionalOperatorAnd = "AND" - - // ConditionalOperatorOr is a ConditionalOperator enum value - ConditionalOperatorOr = "OR" -) - -const ( - // ContinuousBackupsStatusEnabled is a ContinuousBackupsStatus enum value - ContinuousBackupsStatusEnabled = "ENABLED" - - // ContinuousBackupsStatusDisabled is a ContinuousBackupsStatus enum value - ContinuousBackupsStatusDisabled = "DISABLED" -) - -const ( - // GlobalTableStatusCreating is a GlobalTableStatus enum value - GlobalTableStatusCreating = "CREATING" - - // GlobalTableStatusActive is a GlobalTableStatus enum value - GlobalTableStatusActive = "ACTIVE" - - // GlobalTableStatusDeleting is a GlobalTableStatus enum value - GlobalTableStatusDeleting = "DELETING" - - // GlobalTableStatusUpdating is a GlobalTableStatus enum value - GlobalTableStatusUpdating = "UPDATING" -) - -const ( - // IndexStatusCreating is a IndexStatus enum value - IndexStatusCreating = "CREATING" - - // IndexStatusUpdating is a IndexStatus enum value - IndexStatusUpdating = "UPDATING" - - // IndexStatusDeleting is a IndexStatus enum value - IndexStatusDeleting = "DELETING" - - // IndexStatusActive is a IndexStatus enum value - IndexStatusActive = "ACTIVE" -) - -const ( - // KeyTypeHash is a KeyType enum value - KeyTypeHash = "HASH" - - // KeyTypeRange is a KeyType enum value - KeyTypeRange = "RANGE" -) - -const ( - // PointInTimeRecoveryStatusEnabled is a PointInTimeRecoveryStatus enum value - PointInTimeRecoveryStatusEnabled = "ENABLED" - - // PointInTimeRecoveryStatusDisabled is a PointInTimeRecoveryStatus enum value - PointInTimeRecoveryStatusDisabled = "DISABLED" -) - -const ( - // ProjectionTypeAll is a ProjectionType enum value - ProjectionTypeAll = "ALL" - - // ProjectionTypeKeysOnly is a ProjectionType enum value - ProjectionTypeKeysOnly = "KEYS_ONLY" - - // ProjectionTypeInclude is a ProjectionType enum value - ProjectionTypeInclude = "INCLUDE" -) - -const ( - // ReplicaStatusCreating is a ReplicaStatus enum value - ReplicaStatusCreating = "CREATING" - - // ReplicaStatusUpdating is a ReplicaStatus enum value - ReplicaStatusUpdating = "UPDATING" - - // ReplicaStatusDeleting is a ReplicaStatus enum value - ReplicaStatusDeleting = "DELETING" - - // ReplicaStatusActive is a ReplicaStatus enum value - ReplicaStatusActive = "ACTIVE" -) - -// Determines the level of detail about provisioned throughput consumption that -// is returned in the response: -// -// * INDEXES - The response includes the aggregate ConsumedCapacity for the -// operation, together with ConsumedCapacity for each table and secondary -// index that was accessed. -// -// Note that some operations, such as GetItem and BatchGetItem, do not access -// any indexes at all. In these cases, specifying INDEXES will only return -// ConsumedCapacity information for table(s). -// -// * TOTAL - The response includes only the aggregate ConsumedCapacity for -// the operation. -// -// * NONE - No ConsumedCapacity details are included in the response. -const ( - // ReturnConsumedCapacityIndexes is a ReturnConsumedCapacity enum value - ReturnConsumedCapacityIndexes = "INDEXES" - - // ReturnConsumedCapacityTotal is a ReturnConsumedCapacity enum value - ReturnConsumedCapacityTotal = "TOTAL" - - // ReturnConsumedCapacityNone is a ReturnConsumedCapacity enum value - ReturnConsumedCapacityNone = "NONE" -) - -const ( - // ReturnItemCollectionMetricsSize is a ReturnItemCollectionMetrics enum value - ReturnItemCollectionMetricsSize = "SIZE" - - // ReturnItemCollectionMetricsNone is a ReturnItemCollectionMetrics enum value - ReturnItemCollectionMetricsNone = "NONE" -) - -const ( - // ReturnValueNone is a ReturnValue enum value - ReturnValueNone = "NONE" - - // ReturnValueAllOld is a ReturnValue enum value - ReturnValueAllOld = "ALL_OLD" - - // ReturnValueUpdatedOld is a ReturnValue enum value - ReturnValueUpdatedOld = "UPDATED_OLD" - - // ReturnValueAllNew is a ReturnValue enum value - ReturnValueAllNew = "ALL_NEW" - - // ReturnValueUpdatedNew is a ReturnValue enum value - ReturnValueUpdatedNew = "UPDATED_NEW" -) - -const ( - // SSEStatusEnabling is a SSEStatus enum value - SSEStatusEnabling = "ENABLING" - - // SSEStatusEnabled is a SSEStatus enum value - SSEStatusEnabled = "ENABLED" - - // SSEStatusDisabling is a SSEStatus enum value - SSEStatusDisabling = "DISABLING" - - // SSEStatusDisabled is a SSEStatus enum value - SSEStatusDisabled = "DISABLED" -) - -const ( - // ScalarAttributeTypeS is a ScalarAttributeType enum value - ScalarAttributeTypeS = "S" - - // ScalarAttributeTypeN is a ScalarAttributeType enum value - ScalarAttributeTypeN = "N" - - // ScalarAttributeTypeB is a ScalarAttributeType enum value - ScalarAttributeTypeB = "B" -) - -const ( - // SelectAllAttributes is a Select enum value - SelectAllAttributes = "ALL_ATTRIBUTES" - - // SelectAllProjectedAttributes is a Select enum value - SelectAllProjectedAttributes = "ALL_PROJECTED_ATTRIBUTES" - - // SelectSpecificAttributes is a Select enum value - SelectSpecificAttributes = "SPECIFIC_ATTRIBUTES" - - // SelectCount is a Select enum value - SelectCount = "COUNT" -) - -const ( - // StreamViewTypeNewImage is a StreamViewType enum value - StreamViewTypeNewImage = "NEW_IMAGE" - - // StreamViewTypeOldImage is a StreamViewType enum value - StreamViewTypeOldImage = "OLD_IMAGE" - - // StreamViewTypeNewAndOldImages is a StreamViewType enum value - StreamViewTypeNewAndOldImages = "NEW_AND_OLD_IMAGES" - - // StreamViewTypeKeysOnly is a StreamViewType enum value - StreamViewTypeKeysOnly = "KEYS_ONLY" -) - -const ( - // TableStatusCreating is a TableStatus enum value - TableStatusCreating = "CREATING" - - // TableStatusUpdating is a TableStatus enum value - TableStatusUpdating = "UPDATING" - - // TableStatusDeleting is a TableStatus enum value - TableStatusDeleting = "DELETING" - - // TableStatusActive is a TableStatus enum value - TableStatusActive = "ACTIVE" -) - -const ( - // TimeToLiveStatusEnabling is a TimeToLiveStatus enum value - TimeToLiveStatusEnabling = "ENABLING" - - // TimeToLiveStatusDisabling is a TimeToLiveStatus enum value - TimeToLiveStatusDisabling = "DISABLING" - - // TimeToLiveStatusEnabled is a TimeToLiveStatus enum value - TimeToLiveStatusEnabled = "ENABLED" - - // TimeToLiveStatusDisabled is a TimeToLiveStatus enum value - TimeToLiveStatusDisabled = "DISABLED" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go deleted file mode 100644 index 333e61bfc..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go +++ /dev/null @@ -1,109 +0,0 @@ -package dynamodb - -import ( - "bytes" - "hash/crc32" - "io" - "io/ioutil" - "math" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/request" -) - -type retryer struct { - client.DefaultRetryer -} - -func (d retryer) RetryRules(r *request.Request) time.Duration { - delay := time.Duration(math.Pow(2, float64(r.RetryCount))) * 50 - return delay * time.Millisecond -} - -func init() { - initClient = func(c *client.Client) { - if c.Config.Retryer == nil { - // Only override the retryer with a custom one if the config - // does not already contain a retryer - setCustomRetryer(c) - } - - c.Handlers.Build.PushBack(disableCompression) - c.Handlers.Unmarshal.PushFront(validateCRC32) - } -} - -func setCustomRetryer(c *client.Client) { - maxRetries := aws.IntValue(c.Config.MaxRetries) - if c.Config.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { - maxRetries = 10 - } - - c.Retryer = retryer{ - DefaultRetryer: client.DefaultRetryer{ - NumMaxRetries: maxRetries, - }, - } -} - -func drainBody(b io.ReadCloser, length int64) (out *bytes.Buffer, err error) { - if length < 0 { - length = 0 - } - buf := bytes.NewBuffer(make([]byte, 0, length)) - - if _, err = buf.ReadFrom(b); err != nil { - return nil, err - } - if err = b.Close(); err != nil { - return nil, err - } - return buf, nil -} - -func disableCompression(r *request.Request) { - r.HTTPRequest.Header.Set("Accept-Encoding", "identity") -} - -func validateCRC32(r *request.Request) { - if r.Error != nil { - return // already have an error, no need to verify CRC - } - - // Checksum validation is off, skip - if aws.BoolValue(r.Config.DisableComputeChecksums) { - return - } - - // Try to get CRC from response - header := r.HTTPResponse.Header.Get("X-Amz-Crc32") - if header == "" { - return // No header, skip - } - - expected, err := strconv.ParseUint(header, 10, 32) - if err != nil { - return // Could not determine CRC value, skip - } - - buf, err := drainBody(r.HTTPResponse.Body, r.HTTPResponse.ContentLength) - if err != nil { // failed to read the response body, skip - return - } - - // Reset body for subsequent reads - r.HTTPResponse.Body = ioutil.NopCloser(bytes.NewReader(buf.Bytes())) - - // Compute the CRC checksum - crc := crc32.ChecksumIEEE(buf.Bytes()) - - if crc != uint32(expected) { - // CRC does not match, set a retryable error - r.Retryable = aws.Bool(true) - r.Error = awserr.New("CRC32CheckFailed", "CRC32 integrity check failed", nil) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc.go deleted file mode 100644 index f244a7330..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package dynamodb provides the client and types for making API -// requests to Amazon DynamoDB. -// -// Amazon DynamoDB is a fully managed NoSQL database service that provides fast -// and predictable performance with seamless scalability. DynamoDB lets you -// offload the administrative burdens of operating and scaling a distributed -// database, so that you don't have to worry about hardware provisioning, setup -// and configuration, replication, software patching, or cluster scaling. -// -// With DynamoDB, you can create database tables that can store and retrieve -// any amount of data, and serve any level of request traffic. You can scale -// up or scale down your tables' throughput capacity without downtime or performance -// degradation, and use the AWS Management Console to monitor resource utilization -// and performance metrics. -// -// DynamoDB automatically spreads the data and traffic for your tables over -// a sufficient number of servers to handle your throughput and storage requirements, -// while maintaining consistent and fast performance. All of your data is stored -// on solid state disks (SSDs) and automatically replicated across multiple -// Availability Zones in an AWS region, providing built-in high availability -// and data durability. -// -// See https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10 for more information on this service. -// -// See dynamodb package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/ -// -// Using the Client -// -// To contact Amazon DynamoDB with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon DynamoDB client DynamoDB for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/#New -package dynamodb diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go deleted file mode 100644 index 5ebc58072..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -AttributeValue Marshaling and Unmarshaling Helpers - -Utility helpers to marshal and unmarshal AttributeValue to and -from Go types can be found in the dynamodbattribute sub package. This package -provides has specialized functions for the common ways of working with -AttributeValues. Such as map[string]*AttributeValue, []*AttributeValue, and -directly with *AttributeValue. This is helpful for marshaling Go types for API -operations such as PutItem, and unmarshaling Query and Scan APIs' responses. - -See the dynamodbattribute package documentation for more information. -https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/dynamodbattribute/ - -Expression Builders - -The expression package provides utility types and functions to build DynamoDB -expression for type safe construction of API ExpressionAttributeNames, and -ExpressionAttribute Values. - -The package represents the various DynamoDB Expressions as structs named -accordingly. For example, ConditionBuilder represents a DynamoDB Condition -Expression, an UpdateBuilder represents a DynamoDB Update Expression, and so on. - -See the expression package documentation for more information. -https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/expression/ -*/ -package dynamodb diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go deleted file mode 100644 index e38e41daf..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go +++ /dev/null @@ -1,443 +0,0 @@ -package dynamodbattribute - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "runtime" - "strconv" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// ConvertToMap accepts a map[string]interface{} or struct and converts it to a -// map[string]*dynamodb.AttributeValue. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a map[string]interface{}, so `json` struct tags are respected. -// -// Deprecated: Use MarshalMap instead -func ConvertToMap(in interface{}) (item map[string]*dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in == nil { - return nil, awserr.New("SerializationError", - "in must be a map[string]interface{} or struct, got ", nil) - } - - v := reflect.ValueOf(in) - if v.Kind() != reflect.Struct && !(v.Kind() == reflect.Map && v.Type().Key().Kind() == reflect.String) { - return nil, awserr.New("SerializationError", - fmt.Sprintf("in must be a map[string]interface{} or struct, got %s", - v.Type().String()), - nil) - } - - if isTyped(reflect.TypeOf(in)) { - var out map[string]interface{} - in = convertToUntyped(in, out) - } - - item = make(map[string]*dynamodb.AttributeValue) - for k, v := range in.(map[string]interface{}) { - item[k] = convertTo(v) - } - - return item, nil -} - -// ConvertFromMap accepts a map[string]*dynamodb.AttributeValue and converts it to a -// map[string]interface{} or struct. -// -// If v points to a struct, the result is first converted it to a -// map[string]interface{}, then JSON encoded/decoded it to convert to a struct, -// so `json` struct tags are respected. -// -// Deprecated: Use UnmarshalMap instead -func ConvertFromMap(item map[string]*dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to a map[string]interface{} or struct, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Struct && !(rv.Elem().Kind() == reflect.Map && rv.Elem().Type().Key().Kind() == reflect.String) { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to a map[string]interface{} or struct, got %s", - rv.Type()), - nil) - } - - m := make(map[string]interface{}) - for k, v := range item { - m[k] = convertFrom(v) - } - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(m, v) - } else { - rv.Elem().Set(reflect.ValueOf(m)) - } - - return err -} - -// ConvertToList accepts an array or slice and converts it to a -// []*dynamodb.AttributeValue. -// -// Converting []byte fields to dynamodb.AttributeValue are only currently supported -// if the input is a map[string]interface{} type. []byte within typed structs are not -// converted correctly and are converted into base64 strings. This is a known bug, -// and will be fixed in a later release. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a []interface{}, so `json` struct tags are respected. -// -// Deprecated: Use MarshalList instead -func ConvertToList(in interface{}) (item []*dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in == nil { - return nil, awserr.New("SerializationError", - "in must be an array or slice, got ", - nil) - } - - v := reflect.ValueOf(in) - if v.Kind() != reflect.Array && v.Kind() != reflect.Slice { - return nil, awserr.New("SerializationError", - fmt.Sprintf("in must be an array or slice, got %s", - v.Type().String()), - nil) - } - - if isTyped(reflect.TypeOf(in)) { - var out []interface{} - in = convertToUntyped(in, out) - } - - item = make([]*dynamodb.AttributeValue, 0, len(in.([]interface{}))) - for _, v := range in.([]interface{}) { - item = append(item, convertTo(v)) - } - - return item, nil -} - -// ConvertFromList accepts a []*dynamodb.AttributeValue and converts it to an array or -// slice. -// -// If v contains any structs, the result is first converted it to a -// []interface{}, then JSON encoded/decoded it to convert to a typed array or -// slice, so `json` struct tags are respected. -// -// Deprecated: Use UnmarshalList instead -func ConvertFromList(item []*dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an array or slice, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Array && rv.Elem().Kind() != reflect.Slice { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an array or slice, got %s", - rv.Type()), - nil) - } - - l := make([]interface{}, 0, len(item)) - for _, v := range item { - l = append(l, convertFrom(v)) - } - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(l, v) - } else { - rv.Elem().Set(reflect.ValueOf(l)) - } - - return err -} - -// ConvertTo accepts any interface{} and converts it to a *dynamodb.AttributeValue. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a interface{}, so `json` struct tags are respected. -// -// Deprecated: Use Marshal instead -func ConvertTo(in interface{}) (item *dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in != nil && isTyped(reflect.TypeOf(in)) { - var out interface{} - in = convertToUntyped(in, out) - } - - item = convertTo(in) - return item, nil -} - -// ConvertFrom accepts a *dynamodb.AttributeValue and converts it to any interface{}. -// -// If v contains any structs, the result is first converted it to a interface{}, -// then JSON encoded/decoded it to convert to a struct, so `json` struct tags -// are respected. -// -// Deprecated: Use Unmarshal instead -func ConvertFrom(item *dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an interface{} or struct, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Interface && rv.Elem().Kind() != reflect.Struct { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an interface{} or struct, got %s", - rv.Type()), - nil) - } - - res := convertFrom(item) - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(res, v) - } else if res != nil { - rv.Elem().Set(reflect.ValueOf(res)) - } - - return err -} - -func isTyped(v reflect.Type) bool { - switch v.Kind() { - case reflect.Struct: - return true - case reflect.Array, reflect.Slice: - if isTyped(v.Elem()) { - return true - } - case reflect.Map: - if isTyped(v.Key()) { - return true - } - if isTyped(v.Elem()) { - return true - } - case reflect.Ptr: - return isTyped(v.Elem()) - } - return false -} - -func convertToUntyped(in, out interface{}) interface{} { - b, err := json.Marshal(in) - if err != nil { - panic(err) - } - - decoder := json.NewDecoder(bytes.NewReader(b)) - decoder.UseNumber() - err = decoder.Decode(&out) - if err != nil { - panic(err) - } - - return out -} - -func convertToTyped(in, out interface{}) error { - b, err := json.Marshal(in) - if err != nil { - return err - } - - decoder := json.NewDecoder(bytes.NewReader(b)) - return decoder.Decode(&out) -} - -func convertTo(in interface{}) *dynamodb.AttributeValue { - a := &dynamodb.AttributeValue{} - - if in == nil { - a.NULL = new(bool) - *a.NULL = true - return a - } - - if m, ok := in.(map[string]interface{}); ok { - a.M = make(map[string]*dynamodb.AttributeValue) - for k, v := range m { - a.M[k] = convertTo(v) - } - return a - } - - v := reflect.ValueOf(in) - switch v.Kind() { - case reflect.Bool: - a.BOOL = new(bool) - *a.BOOL = v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - a.N = new(string) - *a.N = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - a.N = new(string) - *a.N = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - a.N = new(string) - *a.N = strconv.FormatFloat(v.Float(), 'f', -1, 64) - case reflect.String: - if n, ok := in.(json.Number); ok { - a.N = new(string) - *a.N = n.String() - } else { - a.S = new(string) - *a.S = v.String() - } - case reflect.Slice: - switch v.Type() { - case reflect.TypeOf(([]byte)(nil)): - a.B = v.Bytes() - default: - a.L = make([]*dynamodb.AttributeValue, v.Len()) - for i := 0; i < v.Len(); i++ { - a.L[i] = convertTo(v.Index(i).Interface()) - } - } - default: - panic(fmt.Sprintf("the type %s is not supported", v.Type().String())) - } - - return a -} - -func convertFrom(a *dynamodb.AttributeValue) interface{} { - if a.S != nil { - return *a.S - } - - if a.N != nil { - // Number is tricky b/c we don't know which numeric type to use. Here we - // simply try the different types from most to least restrictive. - if n, err := strconv.ParseInt(*a.N, 10, 64); err == nil { - return int(n) - } - if n, err := strconv.ParseUint(*a.N, 10, 64); err == nil { - return uint(n) - } - n, err := strconv.ParseFloat(*a.N, 64) - if err != nil { - panic(err) - } - return n - } - - if a.BOOL != nil { - return *a.BOOL - } - - if a.NULL != nil { - return nil - } - - if a.M != nil { - m := make(map[string]interface{}) - for k, v := range a.M { - m[k] = convertFrom(v) - } - return m - } - - if a.L != nil { - l := make([]interface{}, len(a.L)) - for index, v := range a.L { - l[index] = convertFrom(v) - } - return l - } - - if a.B != nil { - return a.B - } - - panic(fmt.Sprintf("%#v is not a supported dynamodb.AttributeValue", a)) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go deleted file mode 100644 index e02497568..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go +++ /dev/null @@ -1,761 +0,0 @@ -package dynamodbattribute - -import ( - "fmt" - "reflect" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// An Unmarshaler is an interface to provide custom unmarshaling of -// AttributeValues. Use this to provide custom logic determining -// how AttributeValues should be unmarshaled. -// type ExampleUnmarshaler struct { -// Value int -// } -// -// func (u *exampleUnmarshaler) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { -// if av.N == nil { -// return nil -// } -// -// n, err := strconv.ParseInt(*av.N, 10, 0) -// if err != nil { -// return err -// } -// -// u.Value = n -// return nil -// } -type Unmarshaler interface { - UnmarshalDynamoDBAttributeValue(*dynamodb.AttributeValue) error -} - -// Unmarshal will unmarshal DynamoDB AttributeValues to Go value types. -// Both generic interface{} and concrete types are valid unmarshal -// destination types. -// -// Unmarshal will allocate maps, slices, and pointers as needed to -// unmarshal the AttributeValue into the provided type value. -// -// When unmarshaling AttributeValues into structs Unmarshal matches -// the field names of the struct to the AttributeValue Map keys. -// Initially it will look for exact field name matching, but will -// fall back to case insensitive if not exact match is found. -// -// With the exception of omitempty, omitemptyelem, binaryset, numberset -// and stringset all struct tags used by Marshal are also used by -// Unmarshal. -// -// When decoding AttributeValues to interfaces Unmarshal will use the -// following types. -// -// []byte, AV Binary (B) -// [][]byte, AV Binary Set (BS) -// bool, AV Boolean (BOOL) -// []interface{}, AV List (L) -// map[string]interface{}, AV Map (M) -// float64, AV Number (N) -// Number, AV Number (N) with UseNumber set -// []float64, AV Number Set (NS) -// []Number, AV Number Set (NS) with UseNumber set -// string, AV String (S) -// []string, AV String Set (SS) -// -// If the Decoder option, UseNumber is set numbers will be unmarshaled -// as Number values instead of float64. Use this to maintain the original -// string formating of the number as it was represented in the AttributeValue. -// In addition provides additional opportunities to parse the number -// string based on individual use cases. -// -// When unmarshaling any error that occurs will halt the unmarshal -// and return the error. -// -// The output value provided must be a non-nil pointer -func Unmarshal(av *dynamodb.AttributeValue, out interface{}) error { - return NewDecoder().Decode(av, out) -} - -// UnmarshalMap is an alias for Unmarshal which unmarshals from -// a map of AttributeValues. -// -// The output value provided must be a non-nil pointer -func UnmarshalMap(m map[string]*dynamodb.AttributeValue, out interface{}) error { - return NewDecoder().Decode(&dynamodb.AttributeValue{M: m}, out) -} - -// UnmarshalList is an alias for Unmarshal func which unmarshals -// a slice of AttributeValues. -// -// The output value provided must be a non-nil pointer -func UnmarshalList(l []*dynamodb.AttributeValue, out interface{}) error { - return NewDecoder().Decode(&dynamodb.AttributeValue{L: l}, out) -} - -// UnmarshalListOfMaps is an alias for Unmarshal func which unmarshals a -// slice of maps of attribute values. -// -// This is useful for when you need to unmarshal the Items from a DynamoDB -// Query API call. -// -// The output value provided must be a non-nil pointer -func UnmarshalListOfMaps(l []map[string]*dynamodb.AttributeValue, out interface{}) error { - items := make([]*dynamodb.AttributeValue, len(l)) - for i, m := range l { - items[i] = &dynamodb.AttributeValue{M: m} - } - - return UnmarshalList(items, out) -} - -// A Decoder provides unmarshaling AttributeValues to Go value types. -type Decoder struct { - MarshalOptions - - // Instructs the decoder to decode AttributeValue Numbers as - // Number type instead of float64 when the destination type - // is interface{}. Similar to encoding/json.Number - UseNumber bool -} - -// NewDecoder creates a new Decoder with default configuration. Use -// the `opts` functional options to override the default configuration. -func NewDecoder(opts ...func(*Decoder)) *Decoder { - d := &Decoder{ - MarshalOptions: MarshalOptions{ - SupportJSONTags: true, - }, - } - for _, o := range opts { - o(d) - } - - return d -} - -// Decode will unmarshal an AttributeValue into a Go value type. An error -// will be return if the decoder is unable to unmarshal the AttributeValue -// to the provide Go value type. -// -// The output value provided must be a non-nil pointer -func (d *Decoder) Decode(av *dynamodb.AttributeValue, out interface{}, opts ...func(*Decoder)) error { - v := reflect.ValueOf(out) - if v.Kind() != reflect.Ptr || v.IsNil() || !v.IsValid() { - return &InvalidUnmarshalError{Type: reflect.TypeOf(out)} - } - - return d.decode(av, v, tag{}) -} - -var stringInterfaceMapType = reflect.TypeOf(map[string]interface{}(nil)) -var byteSliceType = reflect.TypeOf([]byte(nil)) -var byteSliceSlicetype = reflect.TypeOf([][]byte(nil)) -var numberType = reflect.TypeOf(Number("")) -var timeType = reflect.TypeOf(time.Time{}) - -func (d *Decoder) decode(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - var u Unmarshaler - if av == nil || av.NULL != nil { - u, v = indirect(v, true) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(av) - } - return d.decodeNull(v) - } - - u, v = indirect(v, false) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(av) - } - - switch { - case len(av.B) != 0: - return d.decodeBinary(av.B, v) - case av.BOOL != nil: - return d.decodeBool(av.BOOL, v) - case len(av.BS) != 0: - return d.decodeBinarySet(av.BS, v) - case len(av.L) != 0: - return d.decodeList(av.L, v) - case len(av.M) != 0: - return d.decodeMap(av.M, v) - case av.N != nil: - return d.decodeNumber(av.N, v, fieldTag) - case len(av.NS) != 0: - return d.decodeNumberSet(av.NS, v) - case av.S != nil: - return d.decodeString(av.S, v, fieldTag) - case len(av.SS) != 0: - return d.decodeStringSet(av.SS, v) - } - - return nil -} - -func (d *Decoder) decodeBinary(b []byte, v reflect.Value) error { - if v.Kind() == reflect.Interface { - buf := make([]byte, len(b)) - copy(buf, b) - v.Set(reflect.ValueOf(buf)) - return nil - } - - if v.Kind() != reflect.Slice && v.Kind() != reflect.Array { - return &UnmarshalTypeError{Value: "binary", Type: v.Type()} - } - - if v.Type() == byteSliceType { - // Optimization for []byte types - if v.IsNil() || v.Cap() < len(b) { - v.Set(reflect.MakeSlice(byteSliceType, len(b), len(b))) - } else if v.Len() != len(b) { - v.SetLen(len(b)) - } - copy(v.Interface().([]byte), b) - return nil - } - - switch v.Type().Elem().Kind() { - case reflect.Uint8: - // Fallback to reflection copy for type aliased of []byte type - if v.Kind() != reflect.Array && (v.IsNil() || v.Cap() < len(b)) { - v.Set(reflect.MakeSlice(v.Type(), len(b), len(b))) - } else if v.Len() != len(b) { - v.SetLen(len(b)) - } - for i := 0; i < len(b); i++ { - v.Index(i).SetUint(uint64(b[i])) - } - default: - if v.Kind() == reflect.Array { - switch v.Type().Elem().Kind() { - case reflect.Uint8: - reflect.Copy(v, reflect.ValueOf(b)) - default: - return &UnmarshalTypeError{Value: "binary", Type: v.Type()} - } - - break - } - - return &UnmarshalTypeError{Value: "binary", Type: v.Type()} - } - - return nil -} - -func (d *Decoder) decodeBool(b *bool, v reflect.Value) error { - switch v.Kind() { - case reflect.Bool, reflect.Interface: - v.Set(reflect.ValueOf(*b).Convert(v.Type())) - default: - return &UnmarshalTypeError{Value: "bool", Type: v.Type()} - } - - return nil -} - -func (d *Decoder) decodeBinarySet(bs [][]byte, v reflect.Value) error { - isArray := false - - switch v.Kind() { - case reflect.Slice: - // Make room for the slice elements if needed - if v.IsNil() || v.Cap() < len(bs) { - // What about if ignoring nil/empty values? - v.Set(reflect.MakeSlice(v.Type(), 0, len(bs))) - } - case reflect.Array: - // Limited to capacity of existing array. - isArray = true - case reflect.Interface: - set := make([][]byte, len(bs)) - for i, b := range bs { - if err := d.decodeBinary(b, reflect.ValueOf(&set[i]).Elem()); err != nil { - return err - } - } - v.Set(reflect.ValueOf(set)) - return nil - default: - return &UnmarshalTypeError{Value: "binary set", Type: v.Type()} - } - - for i := 0; i < v.Cap() && i < len(bs); i++ { - if !isArray { - v.SetLen(i + 1) - } - u, elem := indirect(v.Index(i), false) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(&dynamodb.AttributeValue{BS: bs}) - } - if err := d.decodeBinary(bs[i], elem); err != nil { - return err - } - } - - return nil -} - -func (d *Decoder) decodeNumber(n *string, v reflect.Value, fieldTag tag) error { - switch v.Kind() { - case reflect.Interface: - i, err := d.decodeNumberToInterface(n) - if err != nil { - return err - } - v.Set(reflect.ValueOf(i)) - return nil - case reflect.String: - if v.Type() == numberType { // Support Number value type - v.Set(reflect.ValueOf(Number(*n))) - return nil - } - v.Set(reflect.ValueOf(*n)) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - i, err := strconv.ParseInt(*n, 10, 64) - if err != nil { - return err - } - if v.OverflowInt(i) { - return &UnmarshalTypeError{ - Value: fmt.Sprintf("number overflow, %s", *n), - Type: v.Type(), - } - } - v.SetInt(i) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - i, err := strconv.ParseUint(*n, 10, 64) - if err != nil { - return err - } - if v.OverflowUint(i) { - return &UnmarshalTypeError{ - Value: fmt.Sprintf("number overflow, %s", *n), - Type: v.Type(), - } - } - v.SetUint(i) - case reflect.Float32, reflect.Float64: - i, err := strconv.ParseFloat(*n, 64) - if err != nil { - return err - } - if v.OverflowFloat(i) { - return &UnmarshalTypeError{ - Value: fmt.Sprintf("number overflow, %s", *n), - Type: v.Type(), - } - } - v.SetFloat(i) - default: - if v.Type().ConvertibleTo(timeType) && fieldTag.AsUnixTime { - t, err := decodeUnixTime(*n) - if err != nil { - return err - } - v.Set(reflect.ValueOf(t).Convert(v.Type())) - return nil - } - return &UnmarshalTypeError{Value: "number", Type: v.Type()} - } - - return nil -} - -func (d *Decoder) decodeNumberToInterface(n *string) (interface{}, error) { - if d.UseNumber { - return Number(*n), nil - } - - // Default to float64 for all numbers - return strconv.ParseFloat(*n, 64) -} - -func (d *Decoder) decodeNumberSet(ns []*string, v reflect.Value) error { - isArray := false - - switch v.Kind() { - case reflect.Slice: - // Make room for the slice elements if needed - if v.IsNil() || v.Cap() < len(ns) { - // What about if ignoring nil/empty values? - v.Set(reflect.MakeSlice(v.Type(), 0, len(ns))) - } - case reflect.Array: - // Limited to capacity of existing array. - isArray = true - case reflect.Interface: - if d.UseNumber { - set := make([]Number, len(ns)) - for i, n := range ns { - if err := d.decodeNumber(n, reflect.ValueOf(&set[i]).Elem(), tag{}); err != nil { - return err - } - } - v.Set(reflect.ValueOf(set)) - } else { - set := make([]float64, len(ns)) - for i, n := range ns { - if err := d.decodeNumber(n, reflect.ValueOf(&set[i]).Elem(), tag{}); err != nil { - return err - } - } - v.Set(reflect.ValueOf(set)) - } - return nil - default: - return &UnmarshalTypeError{Value: "number set", Type: v.Type()} - } - - for i := 0; i < v.Cap() && i < len(ns); i++ { - if !isArray { - v.SetLen(i + 1) - } - u, elem := indirect(v.Index(i), false) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(&dynamodb.AttributeValue{NS: ns}) - } - if err := d.decodeNumber(ns[i], elem, tag{}); err != nil { - return err - } - } - - return nil -} - -func (d *Decoder) decodeList(avList []*dynamodb.AttributeValue, v reflect.Value) error { - isArray := false - - switch v.Kind() { - case reflect.Slice: - // Make room for the slice elements if needed - if v.IsNil() || v.Cap() < len(avList) { - // What about if ignoring nil/empty values? - v.Set(reflect.MakeSlice(v.Type(), 0, len(avList))) - } - case reflect.Array: - // Limited to capacity of existing array. - isArray = true - case reflect.Interface: - s := make([]interface{}, len(avList)) - for i, av := range avList { - if err := d.decode(av, reflect.ValueOf(&s[i]).Elem(), tag{}); err != nil { - return err - } - } - v.Set(reflect.ValueOf(s)) - return nil - default: - return &UnmarshalTypeError{Value: "list", Type: v.Type()} - } - - // If v is not a slice, array - for i := 0; i < v.Cap() && i < len(avList); i++ { - if !isArray { - v.SetLen(i + 1) - } - - if err := d.decode(avList[i], v.Index(i), tag{}); err != nil { - return err - } - } - - return nil -} - -func (d *Decoder) decodeMap(avMap map[string]*dynamodb.AttributeValue, v reflect.Value) error { - switch v.Kind() { - case reflect.Map: - t := v.Type() - if t.Key().Kind() != reflect.String { - return &UnmarshalTypeError{Value: "map string key", Type: t.Key()} - } - if v.IsNil() { - v.Set(reflect.MakeMap(t)) - } - case reflect.Struct: - case reflect.Interface: - v.Set(reflect.MakeMap(stringInterfaceMapType)) - v = v.Elem() - default: - return &UnmarshalTypeError{Value: "map", Type: v.Type()} - } - - if v.Kind() == reflect.Map { - for k, av := range avMap { - key := reflect.ValueOf(k) - elem := reflect.New(v.Type().Elem()).Elem() - if err := d.decode(av, elem, tag{}); err != nil { - return err - } - v.SetMapIndex(key, elem) - } - } else if v.Kind() == reflect.Struct { - fields := unionStructFields(v.Type(), d.MarshalOptions) - for k, av := range avMap { - if f, ok := fieldByName(fields, k); ok { - fv := fieldByIndex(v, f.Index, func(v *reflect.Value) bool { - v.Set(reflect.New(v.Type().Elem())) - return true // to continue the loop. - }) - if err := d.decode(av, fv, f.tag); err != nil { - return err - } - } - } - } - - return nil -} - -func (d *Decoder) decodeNull(v reflect.Value) error { - if v.IsValid() && v.CanSet() { - v.Set(reflect.Zero(v.Type())) - } - - return nil -} - -func (d *Decoder) decodeString(s *string, v reflect.Value, fieldTag tag) error { - if fieldTag.AsString { - return d.decodeNumber(s, v, fieldTag) - } - - // To maintain backwards compatibility with ConvertFrom family of methods which - // converted strings to time.Time structs - if v.Type().ConvertibleTo(timeType) { - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return err - } - v.Set(reflect.ValueOf(t).Convert(v.Type())) - return nil - } - - switch v.Kind() { - case reflect.String: - v.SetString(*s) - case reflect.Interface: - // Ensure type aliasing is handled properly - v.Set(reflect.ValueOf(*s).Convert(v.Type())) - default: - return &UnmarshalTypeError{Value: "string", Type: v.Type()} - } - - return nil -} - -func (d *Decoder) decodeStringSet(ss []*string, v reflect.Value) error { - isArray := false - - switch v.Kind() { - case reflect.Slice: - // Make room for the slice elements if needed - if v.IsNil() || v.Cap() < len(ss) { - v.Set(reflect.MakeSlice(v.Type(), 0, len(ss))) - } - case reflect.Array: - // Limited to capacity of existing array. - isArray = true - case reflect.Interface: - set := make([]string, len(ss)) - for i, s := range ss { - if err := d.decodeString(s, reflect.ValueOf(&set[i]).Elem(), tag{}); err != nil { - return err - } - } - v.Set(reflect.ValueOf(set)) - return nil - default: - return &UnmarshalTypeError{Value: "string set", Type: v.Type()} - } - - for i := 0; i < v.Cap() && i < len(ss); i++ { - if !isArray { - v.SetLen(i + 1) - } - u, elem := indirect(v.Index(i), false) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(&dynamodb.AttributeValue{SS: ss}) - } - if err := d.decodeString(ss[i], elem, tag{}); err != nil { - return err - } - } - - return nil -} - -func decodeUnixTime(n string) (time.Time, error) { - v, err := strconv.ParseInt(n, 10, 64) - if err != nil { - return time.Time{}, &UnmarshalError{ - Err: err, Value: n, Type: timeType, - } - } - - return time.Unix(v, 0), nil -} - -// indirect will walk a value's interface or pointer value types. Returning -// the final value or the value a unmarshaler is defined on. -// -// Based on the enoding/json type reflect value type indirection in Go Stdlib -// https://golang.org/src/encoding/json/decode.go indirect func. -func indirect(v reflect.Value, decodingNull bool) (Unmarshaler, reflect.Value) { - if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { - v = v.Addr() - } - for { - if v.Kind() == reflect.Interface && !v.IsNil() { - e := v.Elem() - if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { - v = e - continue - } - } - if v.Kind() != reflect.Ptr { - break - } - if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { - break - } - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - if v.Type().NumMethod() > 0 { - if u, ok := v.Interface().(Unmarshaler); ok { - return u, reflect.Value{} - } - } - v = v.Elem() - } - - return nil, v -} - -// A Number represents a Attributevalue number literal. -type Number string - -// Float64 attempts to cast the number ot a float64, returning -// the result of the case or error if the case failed. -func (n Number) Float64() (float64, error) { - return strconv.ParseFloat(string(n), 64) -} - -// Int64 attempts to cast the number ot a int64, returning -// the result of the case or error if the case failed. -func (n Number) Int64() (int64, error) { - return strconv.ParseInt(string(n), 10, 64) -} - -// Uint64 attempts to cast the number ot a uint64, returning -// the result of the case or error if the case failed. -func (n Number) Uint64() (uint64, error) { - return strconv.ParseUint(string(n), 10, 64) -} - -// String returns the raw number represented as a string -func (n Number) String() string { - return string(n) -} - -type emptyOrigError struct{} - -func (e emptyOrigError) OrigErr() error { - return nil -} - -// An UnmarshalTypeError is an error type representing a error -// unmarshaling the AttributeValue's element to a Go value type. -// Includes details about the AttributeValue type and Go value type. -type UnmarshalTypeError struct { - emptyOrigError - Value string - Type reflect.Type -} - -// Error returns the string representation of the error. -// satisfying the error interface -func (e *UnmarshalTypeError) Error() string { - return fmt.Sprintf("%s: %s", e.Code(), e.Message()) -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *UnmarshalTypeError) Code() string { - return "UnmarshalTypeError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *UnmarshalTypeError) Message() string { - return "cannot unmarshal " + e.Value + " into Go value of type " + e.Type.String() -} - -// An InvalidUnmarshalError is an error type representing an invalid type -// encountered while unmarshaling a AttributeValue to a Go value type. -type InvalidUnmarshalError struct { - emptyOrigError - Type reflect.Type -} - -// Error returns the string representation of the error. -// satisfying the error interface -func (e *InvalidUnmarshalError) Error() string { - return fmt.Sprintf("%s: %s", e.Code(), e.Message()) -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *InvalidUnmarshalError) Code() string { - return "InvalidUnmarshalError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *InvalidUnmarshalError) Message() string { - if e.Type == nil { - return "cannot unmarshal to nil value" - } - if e.Type.Kind() != reflect.Ptr { - return "cannot unmarshal to non-pointer value, got " + e.Type.String() - } - return "cannot unmarshal to nil value, " + e.Type.String() -} - -// An UnmarshalError wraps an error that occured while unmarshaling a DynamoDB -// AttributeValue element into a Go type. This is different from UnmarshalTypeError -// in that it wraps the underlying error that occured. -type UnmarshalError struct { - Err error - Value string - Type reflect.Type -} - -// Error returns the string representation of the error. -// satisfying the error interface. -func (e *UnmarshalError) Error() string { - return fmt.Sprintf("%s: %s\ncaused by: %v", e.Code(), e.Message(), e.Err) -} - -// OrigErr returns the original error that caused this issue. -func (e UnmarshalError) OrigErr() error { - return e.Err -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *UnmarshalError) Code() string { - return "UnmarshalError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *UnmarshalError) Message() string { - return fmt.Sprintf("cannot unmarshal %q into %s.", - e.Value, e.Type.String()) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go deleted file mode 100644 index 7a51ac076..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go +++ /dev/null @@ -1,95 +0,0 @@ -// Package dynamodbattribute provides marshaling and unmarshaling utilities to -// convert between Go types and dynamodb.AttributeValues. -// -// These utilities allow you to marshal slices, maps, structs, and scalar values -// to and from dynamodb.AttributeValue. These are useful when marshaling -// Go value tyes to dynamodb.AttributeValue for DynamoDB requests, or -// unmarshaling the dynamodb.AttributeValue back into a Go value type. -// -// AttributeValue Marshaling -// -// To marshal a Go type to a dynamodbAttributeValue you can use the Marshal -// functions in the dynamodbattribute package. There are specialized versions -// of these functions for collections of Attributevalue, such as maps and lists. -// -// The following example uses MarshalMap to convert the Record Go type to a -// dynamodb.AttributeValue type and use the value to make a PutItem API request. -// -// type Record struct { -// ID string -// URLs []string -// } -// -// //... -// -// r := Record{ -// ID: "ABC123", -// URLs: []string{ -// "https://example.com/first/link", -// "https://example.com/second/url", -// }, -// } -// av, err := dynamodbattribute.MarshalMap(r) -// if err != nil { -// panic(fmt.Sprintf("failed to DynamoDB marshal Record, %v", err)) -// } -// -// _, err = svc.PutItem(&dynamodb.PutItemInput{ -// TableName: aws.String(myTableName), -// Item: av, -// }) -// if err != nil { -// panic(fmt.Sprintf("failed to put Record to DynamoDB, %v", err)) -// } -// -// AttributeValue Unmarshaling -// -// To unmarshal a dynamodb.AttributeValue to a Go type you can use the Unmarshal -// functions in the dynamodbattribute package. There are specialized versions -// of these functions for collections of Attributevalue, such as maps and lists. -// -// The following example will unmarshal the DynamoDB's Scan API operation. The -// Items returned by the operation will be unmarshaled into the slice of Records -// Go type. -// -// type Record struct { -// ID string -// URLs []string -// } -// -// //... -// -// var records []Record -// -// // Use the ScanPages method to perform the scan with pagination. Use -// // just Scan method to make the API call without pagination. -// err := svc.ScanPages(&dynamodb.ScanInput{ -// TableName: aws.String(myTableName), -// }, func(page *dynamodb.ScanOutput, last bool) bool { -// recs := []Record{} -// -// err := dynamodbattribute.UnmarshalListOfMaps(page.Items, &recs) -// if err != nil { -// panic(fmt.Sprintf("failed to unmarshal Dynamodb Scan Items, %v", err)) -// } -// -// records = append(records, recs...) -// -// return true // keep paging -// }) -// -// The ConvertTo, ConvertToList, ConvertToMap, ConvertFrom, ConvertFromMap -// and ConvertFromList methods have been deprecated. The Marshal and Unmarshal -// functions should be used instead. The ConvertTo|From marshallers do not -// support BinarySet, NumberSet, nor StringSets, and will incorrect marshal -// binary data fields in structs as base64 strings. -// -// The Marshal and Unmarshal functions correct this behavior, and removes -// the reliance on encoding.json. `json` struct tags are still supported. In -// addition support for a new struct tag `dynamodbav` was added. Support for -// the json.Marshaler and json.Unmarshaler interfaces have been removed and -// replaced with have been replaced with dynamodbattribute.Marshaler and -// dynamodbattribute.Unmarshaler interfaces. -// -// `time.Time` is marshaled as RFC3339 format. -package dynamodbattribute diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go deleted file mode 100644 index fb30eff91..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go +++ /dev/null @@ -1,641 +0,0 @@ -package dynamodbattribute - -import ( - "fmt" - "reflect" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// An UnixTime provides aliasing of time.Time into a type that when marshaled -// and unmarshaled with DynamoDB AttributeValues it will be done so as number -// instead of string in seconds since January 1, 1970 UTC. -// -// This type is useful as an alternative to the struct tag `unixtime` when you -// want to have your time value marshaled as Unix time in seconds intead of -// the default time.RFC3339. -// -// Important to note that zero value time as unixtime is not 0 seconds -// from January 1, 1970 UTC, but -62135596800. Which is seconds between -// January 1, 0001 UTC, and January 1, 0001 UTC. -type UnixTime time.Time - -// MarshalDynamoDBAttributeValue implements the Marshaler interface so that -// the UnixTime can be marshaled from to a DynamoDB AttributeValue number -// value encoded in the number of seconds since January 1, 1970 UTC. -func (e UnixTime) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { - t := time.Time(e) - s := strconv.FormatInt(t.Unix(), 10) - av.N = &s - - return nil -} - -// UnmarshalDynamoDBAttributeValue implements the Unmarshaler interface so that -// the UnixTime can be unmarshaled from a DynamoDB AttributeValue number representing -// the number of seconds since January 1, 1970 UTC. -// -// If an error parsing the AttributeValue number occurs UnmarshalError will be -// returned. -func (e *UnixTime) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { - t, err := decodeUnixTime(aws.StringValue(av.N)) - if err != nil { - return err - } - - *e = UnixTime(t) - return nil -} - -// A Marshaler is an interface to provide custom marshaling of Go value types -// to AttributeValues. Use this to provide custom logic determining how a -// Go Value type should be marshaled. -// -// type ExampleMarshaler struct { -// Value int -// } -// func (m *ExampleMarshaler) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { -// n := fmt.Sprintf("%v", m.Value) -// av.N = &n -// return nil -// } -// -type Marshaler interface { - MarshalDynamoDBAttributeValue(*dynamodb.AttributeValue) error -} - -// Marshal will serialize the passed in Go value type into a DynamoDB AttributeValue -// type. This value can be used in DynamoDB API operations to simplify marshaling -// your Go value types into AttributeValues. -// -// Marshal will recursively transverse the passed in value marshaling its -// contents into a AttributeValue. Marshal supports basic scalars -// (int,uint,float,bool,string), maps, slices, and structs. Anonymous -// nested types are flattened based on Go anonymous type visibility. -// -// Marshaling slices to AttributeValue will default to a List for all -// types except for []byte and [][]byte. []byte will be marshaled as -// Binary data (B), and [][]byte will be marshaled as binary data set -// (BS). -// -// `dynamodbav` struct tag can be used to control how the value will be -// marshaled into a AttributeValue. -// -// // Field is ignored -// Field int `dynamodbav:"-"` -// -// // Field AttributeValue map key "myName" -// Field int `dynamodbav:"myName"` -// -// // Field AttributeValue map key "myName", and -// // Field is omitted if it is empty -// Field int `dynamodbav:"myName,omitempty"` -// -// // Field AttributeValue map key "Field", and -// // Field is omitted if it is empty -// Field int `dynamodbav:",omitempty"` -// -// // Field's elems will be omitted if empty -// // only valid for slices, and maps. -// Field []string `dynamodbav:",omitemptyelem"` -// -// // Field will be marshaled as a AttributeValue string -// // only value for number types, (int,uint,float) -// Field int `dynamodbav:",string"` -// -// // Field will be marshaled as a binary set -// Field [][]byte `dynamodbav:",binaryset"` -// -// // Field will be marshaled as a number set -// Field []int `dynamodbav:",numberset"` -// -// // Field will be marshaled as a string set -// Field []string `dynamodbav:",stringset"` -// -// // Field will be marshaled as Unix time number in seconds. -// // This tag is only valid with time.Time typed struct fields. -// // Important to note that zero value time as unixtime is not 0 seconds -// // from January 1, 1970 UTC, but -62135596800. Which is seconds between -// // January 1, 0001 UTC, and January 1, 0001 UTC. -// Field time.Time `dynamodbav:",unixtime"` -// -// The omitempty tag is only used during Marshaling and is ignored for -// Unmarshal. Any zero value or a value when marshaled results in a -// AttributeValue NULL will be added to AttributeValue Maps during struct -// marshal. The omitemptyelem tag works the same as omitempty except it -// applies to maps and slices instead of struct fields, and will not be -// included in the marshaled AttributeValue Map, List, or Set. -// -// For convenience and backwards compatibility with ConvertTo functions -// json struct tags are supported by the Marshal and Unmarshal. If -// both json and dynamodbav struct tags are provided the json tag will -// be ignored in favor of dynamodbav. -// -// All struct fields and with anonymous fields, are marshaled unless the -// any of the following conditions are meet. -// -// - the field is not exported -// - json or dynamodbav field tag is "-" -// - json or dynamodbav field tag specifies "omitempty", and is empty. -// -// Pointer and interfaces values encode as the value pointed to or contained -// in the interface. A nil value encodes as the AttributeValue NULL value. -// -// Channel, complex, and function values are not encoded and will be skipped -// when walking the value to be marshaled. -// -// When marshaling any error that occurs will halt the marshal and return -// the error. -// -// Marshal cannot represent cyclic data structures and will not handle them. -// Passing cyclic structures to Marshal will result in an infinite recursion. -func Marshal(in interface{}) (*dynamodb.AttributeValue, error) { - return NewEncoder().Encode(in) -} - -// MarshalMap is an alias for Marshal func which marshals Go value -// type to a map of AttributeValues. -// -// This is useful for DynamoDB APIs such as PutItem. -func MarshalMap(in interface{}) (map[string]*dynamodb.AttributeValue, error) { - av, err := NewEncoder().Encode(in) - if err != nil || av == nil || av.M == nil { - return map[string]*dynamodb.AttributeValue{}, err - } - - return av.M, nil -} - -// MarshalList is an alias for Marshal func which marshals Go value -// type to a slice of AttributeValues. -func MarshalList(in interface{}) ([]*dynamodb.AttributeValue, error) { - av, err := NewEncoder().Encode(in) - if err != nil || av == nil || av.L == nil { - return []*dynamodb.AttributeValue{}, err - } - - return av.L, nil -} - -// A MarshalOptions is a collection of options shared between marshaling -// and unmarshaling -type MarshalOptions struct { - // States that the encoding/json struct tags should be supported. - // if a `dynamodbav` struct tag is also provided the encoding/json - // tag will be ignored. - // - // Enabled by default. - SupportJSONTags bool -} - -// An Encoder provides marshaling Go value types to AttributeValues. -type Encoder struct { - MarshalOptions - - // Empty strings, "", will be marked as NULL AttributeValue types. - // Empty strings are not valid values for DynamoDB. Will not apply - // to lists, sets, or maps. Use the struct tag `omitemptyelem` - // to skip empty (zero) values in lists, sets and maps. - // - // Enabled by default. - NullEmptyString bool -} - -// NewEncoder creates a new Encoder with default configuration. Use -// the `opts` functional options to override the default configuration. -func NewEncoder(opts ...func(*Encoder)) *Encoder { - e := &Encoder{ - MarshalOptions: MarshalOptions{ - SupportJSONTags: true, - }, - NullEmptyString: true, - } - for _, o := range opts { - o(e) - } - - return e -} - -// Encode will marshal a Go value type to an AttributeValue. Returning -// the AttributeValue constructed or error. -func (e *Encoder) Encode(in interface{}) (*dynamodb.AttributeValue, error) { - av := &dynamodb.AttributeValue{} - if err := e.encode(av, reflect.ValueOf(in), tag{}); err != nil { - return nil, err - } - - return av, nil -} - -func fieldByIndex(v reflect.Value, index []int, - OnEmbeddedNilStruct func(*reflect.Value) bool) reflect.Value { - fv := v - for i, x := range index { - if i > 0 { - if fv.Kind() == reflect.Ptr && fv.Type().Elem().Kind() == reflect.Struct { - if fv.IsNil() && !OnEmbeddedNilStruct(&fv) { - break - } - fv = fv.Elem() - } - } - fv = fv.Field(x) - } - return fv -} - -func (e *Encoder) encode(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - // We should check for omitted values first before dereferencing. - if fieldTag.OmitEmpty && emptyValue(v) { - encodeNull(av) - return nil - } - - // Handle both pointers and interface conversion into types - v = valueElem(v) - - if v.Kind() != reflect.Invalid { - if used, err := tryMarshaler(av, v); used { - return err - } - } - - switch v.Kind() { - case reflect.Invalid: - encodeNull(av) - case reflect.Struct: - return e.encodeStruct(av, v, fieldTag) - case reflect.Map: - return e.encodeMap(av, v, fieldTag) - case reflect.Slice, reflect.Array: - return e.encodeSlice(av, v, fieldTag) - case reflect.Chan, reflect.Func, reflect.UnsafePointer: - // do nothing for unsupported types - default: - return e.encodeScalar(av, v, fieldTag) - } - - return nil -} - -func (e *Encoder) encodeStruct(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - // To maintain backwards compatibility with ConvertTo family of methods which - // converted time.Time structs to strings - if v.Type().ConvertibleTo(timeType) { - var t time.Time - t = v.Convert(timeType).Interface().(time.Time) - if fieldTag.AsUnixTime { - return UnixTime(t).MarshalDynamoDBAttributeValue(av) - } - s := t.Format(time.RFC3339Nano) - av.S = &s - return nil - } - - av.M = map[string]*dynamodb.AttributeValue{} - fields := unionStructFields(v.Type(), e.MarshalOptions) - for _, f := range fields { - if f.Name == "" { - return &InvalidMarshalError{msg: "map key cannot be empty"} - } - - found := true - fv := fieldByIndex(v, f.Index, func(v *reflect.Value) bool { - found = false - return false // to break the loop. - }) - if !found { - continue - } - elem := &dynamodb.AttributeValue{} - err := e.encode(elem, fv, f.tag) - if err != nil { - return err - } - skip, err := keepOrOmitEmpty(f.OmitEmpty, elem, err) - if err != nil { - return err - } else if skip { - continue - } - - av.M[f.Name] = elem - } - if len(av.M) == 0 { - encodeNull(av) - } - - return nil -} - -func (e *Encoder) encodeMap(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - av.M = map[string]*dynamodb.AttributeValue{} - for _, key := range v.MapKeys() { - keyName := fmt.Sprint(key.Interface()) - if keyName == "" { - return &InvalidMarshalError{msg: "map key cannot be empty"} - } - - elemVal := v.MapIndex(key) - elem := &dynamodb.AttributeValue{} - err := e.encode(elem, elemVal, tag{}) - skip, err := keepOrOmitEmpty(fieldTag.OmitEmptyElem, elem, err) - if err != nil { - return err - } else if skip { - continue - } - - av.M[keyName] = elem - } - if len(av.M) == 0 { - encodeNull(av) - } - - return nil -} - -func (e *Encoder) encodeSlice(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - switch v.Type().Elem().Kind() { - case reflect.Uint8: - slice := reflect.MakeSlice(byteSliceType, v.Len(), v.Len()) - reflect.Copy(slice, v) - - b := slice.Bytes() - if len(b) == 0 { - encodeNull(av) - return nil - } - av.B = append([]byte{}, b...) - default: - var elemFn func(dynamodb.AttributeValue) error - - if fieldTag.AsBinSet || v.Type() == byteSliceSlicetype { // Binary Set - av.BS = make([][]byte, 0, v.Len()) - elemFn = func(elem dynamodb.AttributeValue) error { - if elem.B == nil { - return &InvalidMarshalError{msg: "binary set must only contain non-nil byte slices"} - } - av.BS = append(av.BS, elem.B) - return nil - } - } else if fieldTag.AsNumSet { // Number Set - av.NS = make([]*string, 0, v.Len()) - elemFn = func(elem dynamodb.AttributeValue) error { - if elem.N == nil { - return &InvalidMarshalError{msg: "number set must only contain non-nil string numbers"} - } - av.NS = append(av.NS, elem.N) - return nil - } - } else if fieldTag.AsStrSet { // String Set - av.SS = make([]*string, 0, v.Len()) - elemFn = func(elem dynamodb.AttributeValue) error { - if elem.S == nil { - return &InvalidMarshalError{msg: "string set must only contain non-nil strings"} - } - av.SS = append(av.SS, elem.S) - return nil - } - } else { // List - av.L = make([]*dynamodb.AttributeValue, 0, v.Len()) - elemFn = func(elem dynamodb.AttributeValue) error { - av.L = append(av.L, &elem) - return nil - } - } - - if n, err := e.encodeList(v, fieldTag, elemFn); err != nil { - return err - } else if n == 0 { - encodeNull(av) - } - } - - return nil -} - -func (e *Encoder) encodeList(v reflect.Value, fieldTag tag, elemFn func(dynamodb.AttributeValue) error) (int, error) { - count := 0 - for i := 0; i < v.Len(); i++ { - elem := dynamodb.AttributeValue{} - err := e.encode(&elem, v.Index(i), tag{OmitEmpty: fieldTag.OmitEmptyElem}) - skip, err := keepOrOmitEmpty(fieldTag.OmitEmptyElem, &elem, err) - if err != nil { - return 0, err - } else if skip { - continue - } - - if err := elemFn(elem); err != nil { - return 0, err - } - count++ - } - - return count, nil -} - -func (e *Encoder) encodeScalar(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - if v.Type() == numberType { - s := v.String() - if fieldTag.AsString { - av.S = &s - } else { - av.N = &s - } - return nil - } - - switch v.Kind() { - case reflect.Bool: - av.BOOL = new(bool) - *av.BOOL = v.Bool() - case reflect.String: - if err := e.encodeString(av, v); err != nil { - return err - } - default: - // Fallback to encoding numbers, will return invalid type if not supported - if err := e.encodeNumber(av, v); err != nil { - return err - } - if fieldTag.AsString && av.NULL == nil && av.N != nil { - av.S = av.N - av.N = nil - } - } - - return nil -} - -func (e *Encoder) encodeNumber(av *dynamodb.AttributeValue, v reflect.Value) error { - if used, err := tryMarshaler(av, v); used { - return err - } - - var out string - switch v.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - out = encodeInt(v.Int()) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - out = encodeUint(v.Uint()) - case reflect.Float32, reflect.Float64: - out = encodeFloat(v.Float()) - default: - return &unsupportedMarshalTypeError{Type: v.Type()} - } - - av.N = &out - - return nil -} - -func (e *Encoder) encodeString(av *dynamodb.AttributeValue, v reflect.Value) error { - if used, err := tryMarshaler(av, v); used { - return err - } - - switch v.Kind() { - case reflect.String: - s := v.String() - if len(s) == 0 && e.NullEmptyString { - encodeNull(av) - } else { - av.S = &s - } - default: - return &unsupportedMarshalTypeError{Type: v.Type()} - } - - return nil -} - -func encodeInt(i int64) string { - return strconv.FormatInt(i, 10) -} -func encodeUint(u uint64) string { - return strconv.FormatUint(u, 10) -} -func encodeFloat(f float64) string { - return strconv.FormatFloat(f, 'f', -1, 64) -} -func encodeNull(av *dynamodb.AttributeValue) { - t := true - *av = dynamodb.AttributeValue{NULL: &t} -} - -func valueElem(v reflect.Value) reflect.Value { - switch v.Kind() { - case reflect.Interface, reflect.Ptr: - for v.Kind() == reflect.Interface || v.Kind() == reflect.Ptr { - v = v.Elem() - } - } - - return v -} - -func emptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} - -func tryMarshaler(av *dynamodb.AttributeValue, v reflect.Value) (bool, error) { - if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { - v = v.Addr() - } - - if v.Type().NumMethod() == 0 { - return false, nil - } - - if m, ok := v.Interface().(Marshaler); ok { - return true, m.MarshalDynamoDBAttributeValue(av) - } - - return false, nil -} - -func keepOrOmitEmpty(omitEmpty bool, av *dynamodb.AttributeValue, err error) (bool, error) { - if err != nil { - if _, ok := err.(*unsupportedMarshalTypeError); ok { - return true, nil - } - return false, err - } - - if av.NULL != nil && omitEmpty { - return true, nil - } - - return false, nil -} - -// An InvalidMarshalError is an error type representing an error -// occurring when marshaling a Go value type to an AttributeValue. -type InvalidMarshalError struct { - emptyOrigError - msg string -} - -// Error returns the string representation of the error. -// satisfying the error interface -func (e *InvalidMarshalError) Error() string { - return fmt.Sprintf("%s: %s", e.Code(), e.Message()) -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *InvalidMarshalError) Code() string { - return "InvalidMarshalError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *InvalidMarshalError) Message() string { - return e.msg -} - -// An unsupportedMarshalTypeError represents a Go value type -// which cannot be marshaled into an AttributeValue and should -// be skipped by the marshaler. -type unsupportedMarshalTypeError struct { - emptyOrigError - Type reflect.Type -} - -// Error returns the string representation of the error. -// satisfying the error interface -func (e *unsupportedMarshalTypeError) Error() string { - return fmt.Sprintf("%s: %s", e.Code(), e.Message()) -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *unsupportedMarshalTypeError) Code() string { - return "unsupportedMarshalTypeError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *unsupportedMarshalTypeError) Message() string { - return "Go value type " + e.Type.String() + " is not supported" -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go deleted file mode 100644 index 1fe0d3500..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go +++ /dev/null @@ -1,269 +0,0 @@ -package dynamodbattribute - -import ( - "reflect" - "sort" - "strings" -) - -type field struct { - tag - - Name string - NameFromTag bool - - Index []int - Type reflect.Type -} - -func fieldByName(fields []field, name string) (field, bool) { - foldExists := false - foldField := field{} - - for _, f := range fields { - if f.Name == name { - return f, true - } - if !foldExists && strings.EqualFold(f.Name, name) { - foldField = f - foldExists = true - } - } - - return foldField, foldExists -} - -func buildField(pIdx []int, i int, sf reflect.StructField, fieldTag tag) field { - f := field{ - Name: sf.Name, - Type: sf.Type, - tag: fieldTag, - } - if len(fieldTag.Name) != 0 { - f.NameFromTag = true - f.Name = fieldTag.Name - } - - f.Index = make([]int, len(pIdx)+1) - copy(f.Index, pIdx) - f.Index[len(pIdx)] = i - - return f -} - -func unionStructFields(t reflect.Type, opts MarshalOptions) []field { - fields := enumFields(t, opts) - - sort.Sort(fieldsByName(fields)) - - fields = visibleFields(fields) - - return fields -} - -// enumFields will recursively iterate through a structure and its nested -// anonymous fields. -// -// Based on the enoding/json struct field enumeration of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go typeField func. -func enumFields(t reflect.Type, opts MarshalOptions) []field { - // Fields to explore - current := []field{} - next := []field{{Type: t}} - - // count of queued names - count := map[reflect.Type]int{} - nextCount := map[reflect.Type]int{} - - visited := map[reflect.Type]struct{}{} - fields := []field{} - - for len(next) > 0 { - current, next = next, current[:0] - count, nextCount = nextCount, map[reflect.Type]int{} - - for _, f := range current { - if _, ok := visited[f.Type]; ok { - continue - } - visited[f.Type] = struct{}{} - - for i := 0; i < f.Type.NumField(); i++ { - sf := f.Type.Field(i) - if sf.PkgPath != "" && !sf.Anonymous { - // Ignore unexported and non-anonymous fields - // unexported but anonymous field may still be used if - // the type has exported nested fields - continue - } - - fieldTag := tag{} - fieldTag.parseAVTag(sf.Tag) - if opts.SupportJSONTags && fieldTag == (tag{}) { - fieldTag.parseJSONTag(sf.Tag) - } - - if fieldTag.Ignore { - continue - } - - ft := sf.Type - if ft.Name() == "" && ft.Kind() == reflect.Ptr { - ft = ft.Elem() - } - - structField := buildField(f.Index, i, sf, fieldTag) - structField.Type = ft - - if !sf.Anonymous || ft.Kind() != reflect.Struct { - fields = append(fields, structField) - if count[f.Type] > 1 { - // If there were multiple instances, add a second, - // so that the annihilation code will see a duplicate. - // It only cares about the distinction between 1 or 2, - // so don't bother generating any more copies. - fields = append(fields, structField) - } - continue - } - - // Record new anon struct to explore next round - nextCount[ft]++ - if nextCount[ft] == 1 { - next = append(next, structField) - } - } - } - } - - return fields -} - -// visibleFields will return a slice of fields which are visible based on -// Go's standard visiblity rules with the exception of ties being broken -// by depth and struct tag naming. -// -// Based on the enoding/json field filtering of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go typeField func. -func visibleFields(fields []field) []field { - // Delete all fields that are hidden by the Go rules for embedded fields, - // except that fields with JSON tags are promoted. - - // The fields are sorted in primary order of name, secondary order - // of field index length. Loop over names; for each name, delete - // hidden fields by choosing the one dominant field that survives. - out := fields[:0] - for advance, i := 0, 0; i < len(fields); i += advance { - // One iteration per name. - // Find the sequence of fields with the name of this first field. - fi := fields[i] - name := fi.Name - for advance = 1; i+advance < len(fields); advance++ { - fj := fields[i+advance] - if fj.Name != name { - break - } - } - if advance == 1 { // Only one field with this name - out = append(out, fi) - continue - } - dominant, ok := dominantField(fields[i : i+advance]) - if ok { - out = append(out, dominant) - } - } - - fields = out - sort.Sort(fieldsByIndex(fields)) - - return fields -} - -// dominantField looks through the fields, all of which are known to -// have the same name, to find the single field that dominates the -// others using Go's embedding rules, modified by the presence of -// JSON tags. If there are multiple top-level fields, the boolean -// will be false: This condition is an error in Go and we skip all -// the fields. -// -// Based on the enoding/json field filtering of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go dominantField func. -func dominantField(fields []field) (field, bool) { - // The fields are sorted in increasing index-length order. The winner - // must therefore be one with the shortest index length. Drop all - // longer entries, which is easy: just truncate the slice. - length := len(fields[0].Index) - tagged := -1 // Index of first tagged field. - for i, f := range fields { - if len(f.Index) > length { - fields = fields[:i] - break - } - if f.NameFromTag { - if tagged >= 0 { - // Multiple tagged fields at the same level: conflict. - // Return no field. - return field{}, false - } - tagged = i - } - } - if tagged >= 0 { - return fields[tagged], true - } - // All remaining fields have the same length. If there's more than one, - // we have a conflict (two fields named "X" at the same level) and we - // return no field. - if len(fields) > 1 { - return field{}, false - } - return fields[0], true -} - -// fieldsByName sorts field by name, breaking ties with depth, -// then breaking ties with "name came from json tag", then -// breaking ties with index sequence. -// -// Based on the enoding/json field filtering of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go fieldsByName type. -type fieldsByName []field - -func (x fieldsByName) Len() int { return len(x) } - -func (x fieldsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x fieldsByName) Less(i, j int) bool { - if x[i].Name != x[j].Name { - return x[i].Name < x[j].Name - } - if len(x[i].Index) != len(x[j].Index) { - return len(x[i].Index) < len(x[j].Index) - } - if x[i].NameFromTag != x[j].NameFromTag { - return x[i].NameFromTag - } - return fieldsByIndex(x).Less(i, j) -} - -// fieldsByIndex sorts field by index sequence. -// -// Based on the enoding/json field filtering of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go fieldsByIndex type. -type fieldsByIndex []field - -func (x fieldsByIndex) Len() int { return len(x) } - -func (x fieldsByIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x fieldsByIndex) Less(i, j int) bool { - for k, xik := range x[i].Index { - if k >= len(x[j].Index) { - return false - } - if xik != x[j].Index[k] { - return xik < x[j].Index[k] - } - } - return len(x[i].Index) < len(x[j].Index) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go deleted file mode 100644 index 60bd609b5..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go +++ /dev/null @@ -1,68 +0,0 @@ -package dynamodbattribute - -import ( - "reflect" - "strings" -) - -type tag struct { - Name string - Ignore bool - OmitEmpty bool - OmitEmptyElem bool - AsString bool - AsBinSet, AsNumSet, AsStrSet bool - AsUnixTime bool -} - -func (t *tag) parseAVTag(structTag reflect.StructTag) { - tagStr := structTag.Get("dynamodbav") - if len(tagStr) == 0 { - return - } - - t.parseTagStr(tagStr) -} - -func (t *tag) parseJSONTag(structTag reflect.StructTag) { - tagStr := structTag.Get("json") - if len(tagStr) == 0 { - return - } - - t.parseTagStr(tagStr) -} - -func (t *tag) parseTagStr(tagStr string) { - parts := strings.Split(tagStr, ",") - if len(parts) == 0 { - return - } - - if name := parts[0]; name == "-" { - t.Name = "" - t.Ignore = true - } else { - t.Name = name - t.Ignore = false - } - - for _, opt := range parts[1:] { - switch opt { - case "omitempty": - t.OmitEmpty = true - case "omitemptyelem": - t.OmitEmptyElem = true - case "string": - t.AsString = true - case "binaryset": - t.AsBinSet = true - case "numberset": - t.AsNumSet = true - case "stringset": - t.AsStrSet = true - case "unixtime": - t.AsUnixTime = true - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go deleted file mode 100644 index 9450ae38e..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package dynamodbiface provides an interface to enable mocking the Amazon DynamoDB service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package dynamodbiface - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// DynamoDBAPI provides an interface to enable mocking the -// dynamodb.DynamoDB service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon DynamoDB. -// func myFunc(svc dynamodbiface.DynamoDBAPI) bool { -// // Make svc.BatchGetItem request -// } -// -// func main() { -// sess := session.New() -// svc := dynamodb.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockDynamoDBClient struct { -// dynamodbiface.DynamoDBAPI -// } -// func (m *mockDynamoDBClient) BatchGetItem(input *dynamodb.BatchGetItemInput) (*dynamodb.BatchGetItemOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockDynamoDBClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type DynamoDBAPI interface { - BatchGetItem(*dynamodb.BatchGetItemInput) (*dynamodb.BatchGetItemOutput, error) - BatchGetItemWithContext(aws.Context, *dynamodb.BatchGetItemInput, ...request.Option) (*dynamodb.BatchGetItemOutput, error) - BatchGetItemRequest(*dynamodb.BatchGetItemInput) (*request.Request, *dynamodb.BatchGetItemOutput) - - BatchGetItemPages(*dynamodb.BatchGetItemInput, func(*dynamodb.BatchGetItemOutput, bool) bool) error - BatchGetItemPagesWithContext(aws.Context, *dynamodb.BatchGetItemInput, func(*dynamodb.BatchGetItemOutput, bool) bool, ...request.Option) error - - BatchWriteItem(*dynamodb.BatchWriteItemInput) (*dynamodb.BatchWriteItemOutput, error) - BatchWriteItemWithContext(aws.Context, *dynamodb.BatchWriteItemInput, ...request.Option) (*dynamodb.BatchWriteItemOutput, error) - BatchWriteItemRequest(*dynamodb.BatchWriteItemInput) (*request.Request, *dynamodb.BatchWriteItemOutput) - - CreateBackup(*dynamodb.CreateBackupInput) (*dynamodb.CreateBackupOutput, error) - CreateBackupWithContext(aws.Context, *dynamodb.CreateBackupInput, ...request.Option) (*dynamodb.CreateBackupOutput, error) - CreateBackupRequest(*dynamodb.CreateBackupInput) (*request.Request, *dynamodb.CreateBackupOutput) - - CreateGlobalTable(*dynamodb.CreateGlobalTableInput) (*dynamodb.CreateGlobalTableOutput, error) - CreateGlobalTableWithContext(aws.Context, *dynamodb.CreateGlobalTableInput, ...request.Option) (*dynamodb.CreateGlobalTableOutput, error) - CreateGlobalTableRequest(*dynamodb.CreateGlobalTableInput) (*request.Request, *dynamodb.CreateGlobalTableOutput) - - CreateTable(*dynamodb.CreateTableInput) (*dynamodb.CreateTableOutput, error) - CreateTableWithContext(aws.Context, *dynamodb.CreateTableInput, ...request.Option) (*dynamodb.CreateTableOutput, error) - CreateTableRequest(*dynamodb.CreateTableInput) (*request.Request, *dynamodb.CreateTableOutput) - - DeleteBackup(*dynamodb.DeleteBackupInput) (*dynamodb.DeleteBackupOutput, error) - DeleteBackupWithContext(aws.Context, *dynamodb.DeleteBackupInput, ...request.Option) (*dynamodb.DeleteBackupOutput, error) - DeleteBackupRequest(*dynamodb.DeleteBackupInput) (*request.Request, *dynamodb.DeleteBackupOutput) - - DeleteItem(*dynamodb.DeleteItemInput) (*dynamodb.DeleteItemOutput, error) - DeleteItemWithContext(aws.Context, *dynamodb.DeleteItemInput, ...request.Option) (*dynamodb.DeleteItemOutput, error) - DeleteItemRequest(*dynamodb.DeleteItemInput) (*request.Request, *dynamodb.DeleteItemOutput) - - DeleteTable(*dynamodb.DeleteTableInput) (*dynamodb.DeleteTableOutput, error) - DeleteTableWithContext(aws.Context, *dynamodb.DeleteTableInput, ...request.Option) (*dynamodb.DeleteTableOutput, error) - DeleteTableRequest(*dynamodb.DeleteTableInput) (*request.Request, *dynamodb.DeleteTableOutput) - - DescribeBackup(*dynamodb.DescribeBackupInput) (*dynamodb.DescribeBackupOutput, error) - DescribeBackupWithContext(aws.Context, *dynamodb.DescribeBackupInput, ...request.Option) (*dynamodb.DescribeBackupOutput, error) - DescribeBackupRequest(*dynamodb.DescribeBackupInput) (*request.Request, *dynamodb.DescribeBackupOutput) - - DescribeContinuousBackups(*dynamodb.DescribeContinuousBackupsInput) (*dynamodb.DescribeContinuousBackupsOutput, error) - DescribeContinuousBackupsWithContext(aws.Context, *dynamodb.DescribeContinuousBackupsInput, ...request.Option) (*dynamodb.DescribeContinuousBackupsOutput, error) - DescribeContinuousBackupsRequest(*dynamodb.DescribeContinuousBackupsInput) (*request.Request, *dynamodb.DescribeContinuousBackupsOutput) - - DescribeGlobalTable(*dynamodb.DescribeGlobalTableInput) (*dynamodb.DescribeGlobalTableOutput, error) - DescribeGlobalTableWithContext(aws.Context, *dynamodb.DescribeGlobalTableInput, ...request.Option) (*dynamodb.DescribeGlobalTableOutput, error) - DescribeGlobalTableRequest(*dynamodb.DescribeGlobalTableInput) (*request.Request, *dynamodb.DescribeGlobalTableOutput) - - DescribeGlobalTableSettings(*dynamodb.DescribeGlobalTableSettingsInput) (*dynamodb.DescribeGlobalTableSettingsOutput, error) - DescribeGlobalTableSettingsWithContext(aws.Context, *dynamodb.DescribeGlobalTableSettingsInput, ...request.Option) (*dynamodb.DescribeGlobalTableSettingsOutput, error) - DescribeGlobalTableSettingsRequest(*dynamodb.DescribeGlobalTableSettingsInput) (*request.Request, *dynamodb.DescribeGlobalTableSettingsOutput) - - DescribeLimits(*dynamodb.DescribeLimitsInput) (*dynamodb.DescribeLimitsOutput, error) - DescribeLimitsWithContext(aws.Context, *dynamodb.DescribeLimitsInput, ...request.Option) (*dynamodb.DescribeLimitsOutput, error) - DescribeLimitsRequest(*dynamodb.DescribeLimitsInput) (*request.Request, *dynamodb.DescribeLimitsOutput) - - DescribeTable(*dynamodb.DescribeTableInput) (*dynamodb.DescribeTableOutput, error) - DescribeTableWithContext(aws.Context, *dynamodb.DescribeTableInput, ...request.Option) (*dynamodb.DescribeTableOutput, error) - DescribeTableRequest(*dynamodb.DescribeTableInput) (*request.Request, *dynamodb.DescribeTableOutput) - - DescribeTimeToLive(*dynamodb.DescribeTimeToLiveInput) (*dynamodb.DescribeTimeToLiveOutput, error) - DescribeTimeToLiveWithContext(aws.Context, *dynamodb.DescribeTimeToLiveInput, ...request.Option) (*dynamodb.DescribeTimeToLiveOutput, error) - DescribeTimeToLiveRequest(*dynamodb.DescribeTimeToLiveInput) (*request.Request, *dynamodb.DescribeTimeToLiveOutput) - - GetItem(*dynamodb.GetItemInput) (*dynamodb.GetItemOutput, error) - GetItemWithContext(aws.Context, *dynamodb.GetItemInput, ...request.Option) (*dynamodb.GetItemOutput, error) - GetItemRequest(*dynamodb.GetItemInput) (*request.Request, *dynamodb.GetItemOutput) - - ListBackups(*dynamodb.ListBackupsInput) (*dynamodb.ListBackupsOutput, error) - ListBackupsWithContext(aws.Context, *dynamodb.ListBackupsInput, ...request.Option) (*dynamodb.ListBackupsOutput, error) - ListBackupsRequest(*dynamodb.ListBackupsInput) (*request.Request, *dynamodb.ListBackupsOutput) - - ListGlobalTables(*dynamodb.ListGlobalTablesInput) (*dynamodb.ListGlobalTablesOutput, error) - ListGlobalTablesWithContext(aws.Context, *dynamodb.ListGlobalTablesInput, ...request.Option) (*dynamodb.ListGlobalTablesOutput, error) - ListGlobalTablesRequest(*dynamodb.ListGlobalTablesInput) (*request.Request, *dynamodb.ListGlobalTablesOutput) - - ListTables(*dynamodb.ListTablesInput) (*dynamodb.ListTablesOutput, error) - ListTablesWithContext(aws.Context, *dynamodb.ListTablesInput, ...request.Option) (*dynamodb.ListTablesOutput, error) - ListTablesRequest(*dynamodb.ListTablesInput) (*request.Request, *dynamodb.ListTablesOutput) - - ListTablesPages(*dynamodb.ListTablesInput, func(*dynamodb.ListTablesOutput, bool) bool) error - ListTablesPagesWithContext(aws.Context, *dynamodb.ListTablesInput, func(*dynamodb.ListTablesOutput, bool) bool, ...request.Option) error - - ListTagsOfResource(*dynamodb.ListTagsOfResourceInput) (*dynamodb.ListTagsOfResourceOutput, error) - ListTagsOfResourceWithContext(aws.Context, *dynamodb.ListTagsOfResourceInput, ...request.Option) (*dynamodb.ListTagsOfResourceOutput, error) - ListTagsOfResourceRequest(*dynamodb.ListTagsOfResourceInput) (*request.Request, *dynamodb.ListTagsOfResourceOutput) - - PutItem(*dynamodb.PutItemInput) (*dynamodb.PutItemOutput, error) - PutItemWithContext(aws.Context, *dynamodb.PutItemInput, ...request.Option) (*dynamodb.PutItemOutput, error) - PutItemRequest(*dynamodb.PutItemInput) (*request.Request, *dynamodb.PutItemOutput) - - Query(*dynamodb.QueryInput) (*dynamodb.QueryOutput, error) - QueryWithContext(aws.Context, *dynamodb.QueryInput, ...request.Option) (*dynamodb.QueryOutput, error) - QueryRequest(*dynamodb.QueryInput) (*request.Request, *dynamodb.QueryOutput) - - QueryPages(*dynamodb.QueryInput, func(*dynamodb.QueryOutput, bool) bool) error - QueryPagesWithContext(aws.Context, *dynamodb.QueryInput, func(*dynamodb.QueryOutput, bool) bool, ...request.Option) error - - RestoreTableFromBackup(*dynamodb.RestoreTableFromBackupInput) (*dynamodb.RestoreTableFromBackupOutput, error) - RestoreTableFromBackupWithContext(aws.Context, *dynamodb.RestoreTableFromBackupInput, ...request.Option) (*dynamodb.RestoreTableFromBackupOutput, error) - RestoreTableFromBackupRequest(*dynamodb.RestoreTableFromBackupInput) (*request.Request, *dynamodb.RestoreTableFromBackupOutput) - - RestoreTableToPointInTime(*dynamodb.RestoreTableToPointInTimeInput) (*dynamodb.RestoreTableToPointInTimeOutput, error) - RestoreTableToPointInTimeWithContext(aws.Context, *dynamodb.RestoreTableToPointInTimeInput, ...request.Option) (*dynamodb.RestoreTableToPointInTimeOutput, error) - RestoreTableToPointInTimeRequest(*dynamodb.RestoreTableToPointInTimeInput) (*request.Request, *dynamodb.RestoreTableToPointInTimeOutput) - - Scan(*dynamodb.ScanInput) (*dynamodb.ScanOutput, error) - ScanWithContext(aws.Context, *dynamodb.ScanInput, ...request.Option) (*dynamodb.ScanOutput, error) - ScanRequest(*dynamodb.ScanInput) (*request.Request, *dynamodb.ScanOutput) - - ScanPages(*dynamodb.ScanInput, func(*dynamodb.ScanOutput, bool) bool) error - ScanPagesWithContext(aws.Context, *dynamodb.ScanInput, func(*dynamodb.ScanOutput, bool) bool, ...request.Option) error - - TagResource(*dynamodb.TagResourceInput) (*dynamodb.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *dynamodb.TagResourceInput, ...request.Option) (*dynamodb.TagResourceOutput, error) - TagResourceRequest(*dynamodb.TagResourceInput) (*request.Request, *dynamodb.TagResourceOutput) - - UntagResource(*dynamodb.UntagResourceInput) (*dynamodb.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *dynamodb.UntagResourceInput, ...request.Option) (*dynamodb.UntagResourceOutput, error) - UntagResourceRequest(*dynamodb.UntagResourceInput) (*request.Request, *dynamodb.UntagResourceOutput) - - UpdateContinuousBackups(*dynamodb.UpdateContinuousBackupsInput) (*dynamodb.UpdateContinuousBackupsOutput, error) - UpdateContinuousBackupsWithContext(aws.Context, *dynamodb.UpdateContinuousBackupsInput, ...request.Option) (*dynamodb.UpdateContinuousBackupsOutput, error) - UpdateContinuousBackupsRequest(*dynamodb.UpdateContinuousBackupsInput) (*request.Request, *dynamodb.UpdateContinuousBackupsOutput) - - UpdateGlobalTable(*dynamodb.UpdateGlobalTableInput) (*dynamodb.UpdateGlobalTableOutput, error) - UpdateGlobalTableWithContext(aws.Context, *dynamodb.UpdateGlobalTableInput, ...request.Option) (*dynamodb.UpdateGlobalTableOutput, error) - UpdateGlobalTableRequest(*dynamodb.UpdateGlobalTableInput) (*request.Request, *dynamodb.UpdateGlobalTableOutput) - - UpdateGlobalTableSettings(*dynamodb.UpdateGlobalTableSettingsInput) (*dynamodb.UpdateGlobalTableSettingsOutput, error) - UpdateGlobalTableSettingsWithContext(aws.Context, *dynamodb.UpdateGlobalTableSettingsInput, ...request.Option) (*dynamodb.UpdateGlobalTableSettingsOutput, error) - UpdateGlobalTableSettingsRequest(*dynamodb.UpdateGlobalTableSettingsInput) (*request.Request, *dynamodb.UpdateGlobalTableSettingsOutput) - - UpdateItem(*dynamodb.UpdateItemInput) (*dynamodb.UpdateItemOutput, error) - UpdateItemWithContext(aws.Context, *dynamodb.UpdateItemInput, ...request.Option) (*dynamodb.UpdateItemOutput, error) - UpdateItemRequest(*dynamodb.UpdateItemInput) (*request.Request, *dynamodb.UpdateItemOutput) - - UpdateTable(*dynamodb.UpdateTableInput) (*dynamodb.UpdateTableOutput, error) - UpdateTableWithContext(aws.Context, *dynamodb.UpdateTableInput, ...request.Option) (*dynamodb.UpdateTableOutput, error) - UpdateTableRequest(*dynamodb.UpdateTableInput) (*request.Request, *dynamodb.UpdateTableOutput) - - UpdateTimeToLive(*dynamodb.UpdateTimeToLiveInput) (*dynamodb.UpdateTimeToLiveOutput, error) - UpdateTimeToLiveWithContext(aws.Context, *dynamodb.UpdateTimeToLiveInput, ...request.Option) (*dynamodb.UpdateTimeToLiveOutput, error) - UpdateTimeToLiveRequest(*dynamodb.UpdateTimeToLiveInput) (*request.Request, *dynamodb.UpdateTimeToLiveOutput) - - WaitUntilTableExists(*dynamodb.DescribeTableInput) error - WaitUntilTableExistsWithContext(aws.Context, *dynamodb.DescribeTableInput, ...request.WaiterOption) error - - WaitUntilTableNotExists(*dynamodb.DescribeTableInput) error - WaitUntilTableNotExistsWithContext(aws.Context, *dynamodb.DescribeTableInput, ...request.WaiterOption) error -} - -var _ DynamoDBAPI = (*dynamodb.DynamoDB)(nil) diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go deleted file mode 100644 index 5f6016521..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package dynamodb - -const ( - - // ErrCodeBackupInUseException for service response error code - // "BackupInUseException". - // - // There is another ongoing conflicting backup control plane operation on the - // table. The backups is either being created, deleted or restored to a table. - ErrCodeBackupInUseException = "BackupInUseException" - - // ErrCodeBackupNotFoundException for service response error code - // "BackupNotFoundException". - // - // Backup not found for the given BackupARN. - ErrCodeBackupNotFoundException = "BackupNotFoundException" - - // ErrCodeConditionalCheckFailedException for service response error code - // "ConditionalCheckFailedException". - // - // A condition specified in the operation could not be evaluated. - ErrCodeConditionalCheckFailedException = "ConditionalCheckFailedException" - - // ErrCodeContinuousBackupsUnavailableException for service response error code - // "ContinuousBackupsUnavailableException". - // - // Backups have not yet been enabled for this table. - ErrCodeContinuousBackupsUnavailableException = "ContinuousBackupsUnavailableException" - - // ErrCodeGlobalTableAlreadyExistsException for service response error code - // "GlobalTableAlreadyExistsException". - // - // The specified global table already exists. - ErrCodeGlobalTableAlreadyExistsException = "GlobalTableAlreadyExistsException" - - // ErrCodeGlobalTableNotFoundException for service response error code - // "GlobalTableNotFoundException". - // - // The specified global table does not exist. - ErrCodeGlobalTableNotFoundException = "GlobalTableNotFoundException" - - // ErrCodeIndexNotFoundException for service response error code - // "IndexNotFoundException". - // - // The operation tried to access a nonexistent index. - ErrCodeIndexNotFoundException = "IndexNotFoundException" - - // ErrCodeInternalServerError for service response error code - // "InternalServerError". - // - // An error occurred on the server side. - ErrCodeInternalServerError = "InternalServerError" - - // ErrCodeInvalidRestoreTimeException for service response error code - // "InvalidRestoreTimeException". - // - // An invalid restore time was specified. RestoreDateTime must be between EarliestRestorableDateTime - // and LatestRestorableDateTime. - ErrCodeInvalidRestoreTimeException = "InvalidRestoreTimeException" - - // ErrCodeItemCollectionSizeLimitExceededException for service response error code - // "ItemCollectionSizeLimitExceededException". - // - // An item collection is too large. This exception is only returned for tables - // that have one or more local secondary indexes. - ErrCodeItemCollectionSizeLimitExceededException = "ItemCollectionSizeLimitExceededException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // Up to 50 CreateBackup operations are allowed per second, per account. There - // is no limit to the number of daily on-demand backups that can be taken. - // - // Up to 10 simultaneous table operations are allowed per account. These operations - // include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, - // and RestoreTableToPointInTime. - // - // For tables with secondary indexes, only one of those tables can be in the - // CREATING state at any point in time. Do not attempt to create more than one - // such table simultaneously. - // - // The total limit of tables in the ACTIVE state is 250. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodePointInTimeRecoveryUnavailableException for service response error code - // "PointInTimeRecoveryUnavailableException". - // - // Point in time recovery has not yet been enabled for this source table. - ErrCodePointInTimeRecoveryUnavailableException = "PointInTimeRecoveryUnavailableException" - - // ErrCodeProvisionedThroughputExceededException for service response error code - // "ProvisionedThroughputExceededException". - // - // Your request rate is too high. The AWS SDKs for DynamoDB automatically retry - // requests that receive this exception. Your request is eventually successful, - // unless your retry queue is too large to finish. Reduce the frequency of requests - // and use exponential backoff. For more information, go to Error Retries and - // Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) - // in the Amazon DynamoDB Developer Guide. - ErrCodeProvisionedThroughputExceededException = "ProvisionedThroughputExceededException" - - // ErrCodeReplicaAlreadyExistsException for service response error code - // "ReplicaAlreadyExistsException". - // - // The specified replica is already part of the global table. - ErrCodeReplicaAlreadyExistsException = "ReplicaAlreadyExistsException" - - // ErrCodeReplicaNotFoundException for service response error code - // "ReplicaNotFoundException". - // - // The specified replica is no longer part of the global table. - ErrCodeReplicaNotFoundException = "ReplicaNotFoundException" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUseException". - // - // The operation conflicts with the resource's availability. For example, you - // attempted to recreate an existing table, or tried to delete a table currently - // in the CREATING state. - ErrCodeResourceInUseException = "ResourceInUseException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The operation tried to access a nonexistent table or index. The resource - // might not be specified correctly, or its status might not be ACTIVE. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeTableAlreadyExistsException for service response error code - // "TableAlreadyExistsException". - // - // A target table with the specified name already exists. - ErrCodeTableAlreadyExistsException = "TableAlreadyExistsException" - - // ErrCodeTableInUseException for service response error code - // "TableInUseException". - // - // A target table with the specified name is either being created or deleted. - ErrCodeTableInUseException = "TableInUseException" - - // ErrCodeTableNotFoundException for service response error code - // "TableNotFoundException". - // - // A source table with the name TableName does not currently exist within the - // subscriber's account. - ErrCodeTableNotFoundException = "TableNotFoundException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go deleted file mode 100644 index 80dcd19fd..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package dynamodb - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// DynamoDB provides the API operation methods for making requests to -// Amazon DynamoDB. See this package's package overview docs -// for details on the service. -// -// DynamoDB methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type DynamoDB struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "dynamodb" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the DynamoDB client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// // Create a DynamoDB client from just a session. -// svc := dynamodb.New(mySession) -// -// // Create a DynamoDB client with additional configuration -// svc := dynamodb.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *DynamoDB { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DynamoDB { - svc := &DynamoDB{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2012-08-10", - JSONVersion: "1.0", - TargetPrefix: "DynamoDB_20120810", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a DynamoDB operation and runs any -// custom request initialization. -func (c *DynamoDB) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go deleted file mode 100644 index ae515f7de..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package dynamodb - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilTableExists uses the DynamoDB API operation -// DescribeTable to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *DynamoDB) WaitUntilTableExists(input *DescribeTableInput) error { - return c.WaitUntilTableExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilTableExistsWithContext is an extended version of WaitUntilTableExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) WaitUntilTableExistsWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilTableExists", - MaxAttempts: 25, - Delay: request.ConstantWaiterDelay(20 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "Table.TableStatus", - Expected: "ACTIVE", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "ResourceNotFoundException", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeTableInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTableRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilTableNotExists uses the DynamoDB API operation -// DescribeTable to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *DynamoDB) WaitUntilTableNotExists(input *DescribeTableInput) error { - return c.WaitUntilTableNotExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilTableNotExistsWithContext is an extended version of WaitUntilTableNotExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *DynamoDB) WaitUntilTableNotExistsWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilTableNotExists", - MaxAttempts: 25, - Delay: request.ConstantWaiterDelay(20 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "ResourceNotFoundException", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeTableInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTableRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go deleted file mode 100644 index 342596b83..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ /dev/null @@ -1,71742 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ec2 - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/ec2query" -) - -const opAcceptReservedInstancesExchangeQuote = "AcceptReservedInstancesExchangeQuote" - -// AcceptReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the -// client's request for the AcceptReservedInstancesExchangeQuote operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AcceptReservedInstancesExchangeQuote for more information on using the AcceptReservedInstancesExchangeQuote -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AcceptReservedInstancesExchangeQuoteRequest method. -// req, resp := client.AcceptReservedInstancesExchangeQuoteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuote -func (c *EC2) AcceptReservedInstancesExchangeQuoteRequest(input *AcceptReservedInstancesExchangeQuoteInput) (req *request.Request, output *AcceptReservedInstancesExchangeQuoteOutput) { - op := &request.Operation{ - Name: opAcceptReservedInstancesExchangeQuote, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AcceptReservedInstancesExchangeQuoteInput{} - } - - output = &AcceptReservedInstancesExchangeQuoteOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcceptReservedInstancesExchangeQuote API operation for Amazon Elastic Compute Cloud. -// -// Accepts the Convertible Reserved Instance exchange quote described in the -// GetReservedInstancesExchangeQuote call. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AcceptReservedInstancesExchangeQuote for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuote -func (c *EC2) AcceptReservedInstancesExchangeQuote(input *AcceptReservedInstancesExchangeQuoteInput) (*AcceptReservedInstancesExchangeQuoteOutput, error) { - req, out := c.AcceptReservedInstancesExchangeQuoteRequest(input) - return out, req.Send() -} - -// AcceptReservedInstancesExchangeQuoteWithContext is the same as AcceptReservedInstancesExchangeQuote with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptReservedInstancesExchangeQuote for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AcceptReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *AcceptReservedInstancesExchangeQuoteInput, opts ...request.Option) (*AcceptReservedInstancesExchangeQuoteOutput, error) { - req, out := c.AcceptReservedInstancesExchangeQuoteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAcceptVpcEndpointConnections = "AcceptVpcEndpointConnections" - -// AcceptVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the AcceptVpcEndpointConnections operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AcceptVpcEndpointConnections for more information on using the AcceptVpcEndpointConnections -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AcceptVpcEndpointConnectionsRequest method. -// req, resp := client.AcceptVpcEndpointConnectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcEndpointConnections -func (c *EC2) AcceptVpcEndpointConnectionsRequest(input *AcceptVpcEndpointConnectionsInput) (req *request.Request, output *AcceptVpcEndpointConnectionsOutput) { - op := &request.Operation{ - Name: opAcceptVpcEndpointConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AcceptVpcEndpointConnectionsInput{} - } - - output = &AcceptVpcEndpointConnectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcceptVpcEndpointConnections API operation for Amazon Elastic Compute Cloud. -// -// Accepts one or more interface VPC endpoint connection requests to your VPC -// endpoint service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AcceptVpcEndpointConnections for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcEndpointConnections -func (c *EC2) AcceptVpcEndpointConnections(input *AcceptVpcEndpointConnectionsInput) (*AcceptVpcEndpointConnectionsOutput, error) { - req, out := c.AcceptVpcEndpointConnectionsRequest(input) - return out, req.Send() -} - -// AcceptVpcEndpointConnectionsWithContext is the same as AcceptVpcEndpointConnections with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptVpcEndpointConnections for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AcceptVpcEndpointConnectionsWithContext(ctx aws.Context, input *AcceptVpcEndpointConnectionsInput, opts ...request.Option) (*AcceptVpcEndpointConnectionsOutput, error) { - req, out := c.AcceptVpcEndpointConnectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAcceptVpcPeeringConnection = "AcceptVpcPeeringConnection" - -// AcceptVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the AcceptVpcPeeringConnection operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AcceptVpcPeeringConnection for more information on using the AcceptVpcPeeringConnection -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AcceptVpcPeeringConnectionRequest method. -// req, resp := client.AcceptVpcPeeringConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnection -func (c *EC2) AcceptVpcPeeringConnectionRequest(input *AcceptVpcPeeringConnectionInput) (req *request.Request, output *AcceptVpcPeeringConnectionOutput) { - op := &request.Operation{ - Name: opAcceptVpcPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AcceptVpcPeeringConnectionInput{} - } - - output = &AcceptVpcPeeringConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcceptVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. -// -// Accept a VPC peering connection request. To accept a request, the VPC peering -// connection must be in the pending-acceptance state, and you must be the owner -// of the peer VPC. Use DescribeVpcPeeringConnections to view your outstanding -// VPC peering connection requests. -// -// For an inter-region VPC peering connection request, you must accept the VPC -// peering connection in the region of the accepter VPC. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AcceptVpcPeeringConnection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnection -func (c *EC2) AcceptVpcPeeringConnection(input *AcceptVpcPeeringConnectionInput) (*AcceptVpcPeeringConnectionOutput, error) { - req, out := c.AcceptVpcPeeringConnectionRequest(input) - return out, req.Send() -} - -// AcceptVpcPeeringConnectionWithContext is the same as AcceptVpcPeeringConnection with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptVpcPeeringConnection for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AcceptVpcPeeringConnectionWithContext(ctx aws.Context, input *AcceptVpcPeeringConnectionInput, opts ...request.Option) (*AcceptVpcPeeringConnectionOutput, error) { - req, out := c.AcceptVpcPeeringConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAllocateAddress = "AllocateAddress" - -// AllocateAddressRequest generates a "aws/request.Request" representing the -// client's request for the AllocateAddress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AllocateAddress for more information on using the AllocateAddress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AllocateAddressRequest method. -// req, resp := client.AllocateAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddress -func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request.Request, output *AllocateAddressOutput) { - op := &request.Operation{ - Name: opAllocateAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AllocateAddressInput{} - } - - output = &AllocateAddressOutput{} - req = c.newRequest(op, input, output) - return -} - -// AllocateAddress API operation for Amazon Elastic Compute Cloud. -// -// Allocates an Elastic IP address. -// -// An Elastic IP address is for use either in the EC2-Classic platform or in -// a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic -// per region and 5 Elastic IP addresses for EC2-VPC per region. -// -// If you release an Elastic IP address for use in a VPC, you might be able -// to recover it. To recover an Elastic IP address that you released, specify -// it in the Address parameter. Note that you cannot recover an Elastic IP address -// that you released after it is allocated to another AWS account. -// -// For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AllocateAddress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddress -func (c *EC2) AllocateAddress(input *AllocateAddressInput) (*AllocateAddressOutput, error) { - req, out := c.AllocateAddressRequest(input) - return out, req.Send() -} - -// AllocateAddressWithContext is the same as AllocateAddress with the addition of -// the ability to pass a context and additional request options. -// -// See AllocateAddress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AllocateAddressWithContext(ctx aws.Context, input *AllocateAddressInput, opts ...request.Option) (*AllocateAddressOutput, error) { - req, out := c.AllocateAddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAllocateHosts = "AllocateHosts" - -// AllocateHostsRequest generates a "aws/request.Request" representing the -// client's request for the AllocateHosts operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AllocateHosts for more information on using the AllocateHosts -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AllocateHostsRequest method. -// req, resp := client.AllocateHostsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHosts -func (c *EC2) AllocateHostsRequest(input *AllocateHostsInput) (req *request.Request, output *AllocateHostsOutput) { - op := &request.Operation{ - Name: opAllocateHosts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AllocateHostsInput{} - } - - output = &AllocateHostsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AllocateHosts API operation for Amazon Elastic Compute Cloud. -// -// Allocates a Dedicated Host to your account. At minimum you need to specify -// the instance size type, Availability Zone, and quantity of hosts you want -// to allocate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AllocateHosts for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHosts -func (c *EC2) AllocateHosts(input *AllocateHostsInput) (*AllocateHostsOutput, error) { - req, out := c.AllocateHostsRequest(input) - return out, req.Send() -} - -// AllocateHostsWithContext is the same as AllocateHosts with the addition of -// the ability to pass a context and additional request options. -// -// See AllocateHosts for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AllocateHostsWithContext(ctx aws.Context, input *AllocateHostsInput, opts ...request.Option) (*AllocateHostsOutput, error) { - req, out := c.AllocateHostsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssignIpv6Addresses = "AssignIpv6Addresses" - -// AssignIpv6AddressesRequest generates a "aws/request.Request" representing the -// client's request for the AssignIpv6Addresses operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssignIpv6Addresses for more information on using the AssignIpv6Addresses -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AssignIpv6AddressesRequest method. -// req, resp := client.AssignIpv6AddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6Addresses -func (c *EC2) AssignIpv6AddressesRequest(input *AssignIpv6AddressesInput) (req *request.Request, output *AssignIpv6AddressesOutput) { - op := &request.Operation{ - Name: opAssignIpv6Addresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssignIpv6AddressesInput{} - } - - output = &AssignIpv6AddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssignIpv6Addresses API operation for Amazon Elastic Compute Cloud. -// -// Assigns one or more IPv6 addresses to the specified network interface. You -// can specify one or more specific IPv6 addresses, or you can specify the number -// of IPv6 addresses to be automatically assigned from within the subnet's IPv6 -// CIDR block range. You can assign as many IPv6 addresses to a network interface -// as you can assign private IPv4 addresses, and the limit varies per instance -// type. For information, see IP Addresses Per Network Interface Per Instance -// Type (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AssignIpv6Addresses for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6Addresses -func (c *EC2) AssignIpv6Addresses(input *AssignIpv6AddressesInput) (*AssignIpv6AddressesOutput, error) { - req, out := c.AssignIpv6AddressesRequest(input) - return out, req.Send() -} - -// AssignIpv6AddressesWithContext is the same as AssignIpv6Addresses with the addition of -// the ability to pass a context and additional request options. -// -// See AssignIpv6Addresses for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AssignIpv6AddressesWithContext(ctx aws.Context, input *AssignIpv6AddressesInput, opts ...request.Option) (*AssignIpv6AddressesOutput, error) { - req, out := c.AssignIpv6AddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses" - -// AssignPrivateIpAddressesRequest generates a "aws/request.Request" representing the -// client's request for the AssignPrivateIpAddresses operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssignPrivateIpAddresses for more information on using the AssignPrivateIpAddresses -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AssignPrivateIpAddressesRequest method. -// req, resp := client.AssignPrivateIpAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddresses -func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInput) (req *request.Request, output *AssignPrivateIpAddressesOutput) { - op := &request.Operation{ - Name: opAssignPrivateIpAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssignPrivateIpAddressesInput{} - } - - output = &AssignPrivateIpAddressesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssignPrivateIpAddresses API operation for Amazon Elastic Compute Cloud. -// -// Assigns one or more secondary private IP addresses to the specified network -// interface. You can specify one or more specific secondary IP addresses, or -// you can specify the number of secondary IP addresses to be automatically -// assigned within the subnet's CIDR block range. The number of secondary IP -// addresses that you can assign to an instance varies by instance type. For -// information about instance types, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) -// in the Amazon Elastic Compute Cloud User Guide. For more information about -// Elastic IP addresses, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// AssignPrivateIpAddresses is available only in EC2-VPC. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AssignPrivateIpAddresses for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddresses -func (c *EC2) AssignPrivateIpAddresses(input *AssignPrivateIpAddressesInput) (*AssignPrivateIpAddressesOutput, error) { - req, out := c.AssignPrivateIpAddressesRequest(input) - return out, req.Send() -} - -// AssignPrivateIpAddressesWithContext is the same as AssignPrivateIpAddresses with the addition of -// the ability to pass a context and additional request options. -// -// See AssignPrivateIpAddresses for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AssignPrivateIpAddressesWithContext(ctx aws.Context, input *AssignPrivateIpAddressesInput, opts ...request.Option) (*AssignPrivateIpAddressesOutput, error) { - req, out := c.AssignPrivateIpAddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateAddress = "AssociateAddress" - -// AssociateAddressRequest generates a "aws/request.Request" representing the -// client's request for the AssociateAddress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssociateAddress for more information on using the AssociateAddress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AssociateAddressRequest method. -// req, resp := client.AssociateAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddress -func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *request.Request, output *AssociateAddressOutput) { - op := &request.Operation{ - Name: opAssociateAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateAddressInput{} - } - - output = &AssociateAddressOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateAddress API operation for Amazon Elastic Compute Cloud. -// -// Associates an Elastic IP address with an instance or a network interface. -// -// An Elastic IP address is for use in either the EC2-Classic platform or in -// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// [EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is -// already associated with a different instance, it is disassociated from that -// instance and associated with the specified instance. If you associate an -// Elastic IP address with an instance that has an existing Elastic IP address, -// the existing address is disassociated from the instance, but remains allocated -// to your account. -// -// [VPC in an EC2-Classic account] If you don't specify a private IP address, -// the Elastic IP address is associated with the primary IP address. If the -// Elastic IP address is already associated with a different instance or a network -// interface, you get an error unless you allow reassociation. You cannot associate -// an Elastic IP address with an instance or network interface that has an existing -// Elastic IP address. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error, and you may be charged for each time -// the Elastic IP address is remapped to the same instance. For more information, -// see the Elastic IP Addresses section of Amazon EC2 Pricing (http://aws.amazon.com/ec2/pricing/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AssociateAddress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddress -func (c *EC2) AssociateAddress(input *AssociateAddressInput) (*AssociateAddressOutput, error) { - req, out := c.AssociateAddressRequest(input) - return out, req.Send() -} - -// AssociateAddressWithContext is the same as AssociateAddress with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateAddress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AssociateAddressWithContext(ctx aws.Context, input *AssociateAddressInput, opts ...request.Option) (*AssociateAddressOutput, error) { - req, out := c.AssociateAddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateDhcpOptions = "AssociateDhcpOptions" - -// AssociateDhcpOptionsRequest generates a "aws/request.Request" representing the -// client's request for the AssociateDhcpOptions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssociateDhcpOptions for more information on using the AssociateDhcpOptions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AssociateDhcpOptionsRequest method. -// req, resp := client.AssociateDhcpOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptions -func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) (req *request.Request, output *AssociateDhcpOptionsOutput) { - op := &request.Operation{ - Name: opAssociateDhcpOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateDhcpOptionsInput{} - } - - output = &AssociateDhcpOptionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssociateDhcpOptions API operation for Amazon Elastic Compute Cloud. -// -// Associates a set of DHCP options (that you've previously created) with the -// specified VPC, or associates no DHCP options with the VPC. -// -// After you associate the options with the VPC, any existing instances and -// all new instances that you launch in that VPC use the options. You don't -// need to restart or relaunch the instances. They automatically pick up the -// changes within a few hours, depending on how frequently the instance renews -// its DHCP lease. You can explicitly renew the lease using the operating system -// on the instance. -// -// For more information, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AssociateDhcpOptions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptions -func (c *EC2) AssociateDhcpOptions(input *AssociateDhcpOptionsInput) (*AssociateDhcpOptionsOutput, error) { - req, out := c.AssociateDhcpOptionsRequest(input) - return out, req.Send() -} - -// AssociateDhcpOptionsWithContext is the same as AssociateDhcpOptions with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateDhcpOptions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AssociateDhcpOptionsWithContext(ctx aws.Context, input *AssociateDhcpOptionsInput, opts ...request.Option) (*AssociateDhcpOptionsOutput, error) { - req, out := c.AssociateDhcpOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateIamInstanceProfile = "AssociateIamInstanceProfile" - -// AssociateIamInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the AssociateIamInstanceProfile operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssociateIamInstanceProfile for more information on using the AssociateIamInstanceProfile -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AssociateIamInstanceProfileRequest method. -// req, resp := client.AssociateIamInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile -func (c *EC2) AssociateIamInstanceProfileRequest(input *AssociateIamInstanceProfileInput) (req *request.Request, output *AssociateIamInstanceProfileOutput) { - op := &request.Operation{ - Name: opAssociateIamInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateIamInstanceProfileInput{} - } - - output = &AssociateIamInstanceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateIamInstanceProfile API operation for Amazon Elastic Compute Cloud. -// -// Associates an IAM instance profile with a running or stopped instance. You -// cannot associate more than one IAM instance profile with an instance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AssociateIamInstanceProfile for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile -func (c *EC2) AssociateIamInstanceProfile(input *AssociateIamInstanceProfileInput) (*AssociateIamInstanceProfileOutput, error) { - req, out := c.AssociateIamInstanceProfileRequest(input) - return out, req.Send() -} - -// AssociateIamInstanceProfileWithContext is the same as AssociateIamInstanceProfile with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateIamInstanceProfile for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AssociateIamInstanceProfileWithContext(ctx aws.Context, input *AssociateIamInstanceProfileInput, opts ...request.Option) (*AssociateIamInstanceProfileOutput, error) { - req, out := c.AssociateIamInstanceProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateRouteTable = "AssociateRouteTable" - -// AssociateRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the AssociateRouteTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssociateRouteTable for more information on using the AssociateRouteTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AssociateRouteTableRequest method. -// req, resp := client.AssociateRouteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTable -func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req *request.Request, output *AssociateRouteTableOutput) { - op := &request.Operation{ - Name: opAssociateRouteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateRouteTableInput{} - } - - output = &AssociateRouteTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateRouteTable API operation for Amazon Elastic Compute Cloud. -// -// Associates a subnet with a route table. The subnet and route table must be -// in the same VPC. This association causes traffic originating from the subnet -// to be routed according to the routes in the route table. The action returns -// an association ID, which you need in order to disassociate the route table -// from the subnet later. A route table can be associated with multiple subnets. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AssociateRouteTable for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTable -func (c *EC2) AssociateRouteTable(input *AssociateRouteTableInput) (*AssociateRouteTableOutput, error) { - req, out := c.AssociateRouteTableRequest(input) - return out, req.Send() -} - -// AssociateRouteTableWithContext is the same as AssociateRouteTable with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateRouteTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AssociateRouteTableWithContext(ctx aws.Context, input *AssociateRouteTableInput, opts ...request.Option) (*AssociateRouteTableOutput, error) { - req, out := c.AssociateRouteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateSubnetCidrBlock = "AssociateSubnetCidrBlock" - -// AssociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the AssociateSubnetCidrBlock operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssociateSubnetCidrBlock for more information on using the AssociateSubnetCidrBlock -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AssociateSubnetCidrBlockRequest method. -// req, resp := client.AssociateSubnetCidrBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlock -func (c *EC2) AssociateSubnetCidrBlockRequest(input *AssociateSubnetCidrBlockInput) (req *request.Request, output *AssociateSubnetCidrBlockOutput) { - op := &request.Operation{ - Name: opAssociateSubnetCidrBlock, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateSubnetCidrBlockInput{} - } - - output = &AssociateSubnetCidrBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateSubnetCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Associates a CIDR block with your subnet. You can only associate a single -// IPv6 CIDR block with your subnet. An IPv6 CIDR block must have a prefix length -// of /64. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AssociateSubnetCidrBlock for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlock -func (c *EC2) AssociateSubnetCidrBlock(input *AssociateSubnetCidrBlockInput) (*AssociateSubnetCidrBlockOutput, error) { - req, out := c.AssociateSubnetCidrBlockRequest(input) - return out, req.Send() -} - -// AssociateSubnetCidrBlockWithContext is the same as AssociateSubnetCidrBlock with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateSubnetCidrBlock for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AssociateSubnetCidrBlockWithContext(ctx aws.Context, input *AssociateSubnetCidrBlockInput, opts ...request.Option) (*AssociateSubnetCidrBlockOutput, error) { - req, out := c.AssociateSubnetCidrBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateVpcCidrBlock = "AssociateVpcCidrBlock" - -// AssociateVpcCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the AssociateVpcCidrBlock operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssociateVpcCidrBlock for more information on using the AssociateVpcCidrBlock -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AssociateVpcCidrBlockRequest method. -// req, resp := client.AssociateVpcCidrBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlock -func (c *EC2) AssociateVpcCidrBlockRequest(input *AssociateVpcCidrBlockInput) (req *request.Request, output *AssociateVpcCidrBlockOutput) { - op := &request.Operation{ - Name: opAssociateVpcCidrBlock, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateVpcCidrBlockInput{} - } - - output = &AssociateVpcCidrBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateVpcCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Associates a CIDR block with your VPC. You can associate a secondary IPv4 -// CIDR block, or you can associate an Amazon-provided IPv6 CIDR block. The -// IPv6 CIDR block size is fixed at /56. -// -// For more information about associating CIDR blocks with your VPC and applicable -// restrictions, see VPC and Subnet Sizing (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html#VPC_Sizing) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AssociateVpcCidrBlock for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlock -func (c *EC2) AssociateVpcCidrBlock(input *AssociateVpcCidrBlockInput) (*AssociateVpcCidrBlockOutput, error) { - req, out := c.AssociateVpcCidrBlockRequest(input) - return out, req.Send() -} - -// AssociateVpcCidrBlockWithContext is the same as AssociateVpcCidrBlock with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateVpcCidrBlock for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AssociateVpcCidrBlockWithContext(ctx aws.Context, input *AssociateVpcCidrBlockInput, opts ...request.Option) (*AssociateVpcCidrBlockOutput, error) { - req, out := c.AssociateVpcCidrBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachClassicLinkVpc = "AttachClassicLinkVpc" - -// AttachClassicLinkVpcRequest generates a "aws/request.Request" representing the -// client's request for the AttachClassicLinkVpc operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AttachClassicLinkVpc for more information on using the AttachClassicLinkVpc -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AttachClassicLinkVpcRequest method. -// req, resp := client.AttachClassicLinkVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpc -func (c *EC2) AttachClassicLinkVpcRequest(input *AttachClassicLinkVpcInput) (req *request.Request, output *AttachClassicLinkVpcOutput) { - op := &request.Operation{ - Name: opAttachClassicLinkVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachClassicLinkVpcInput{} - } - - output = &AttachClassicLinkVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachClassicLinkVpc API operation for Amazon Elastic Compute Cloud. -// -// Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or -// more of the VPC's security groups. You cannot link an EC2-Classic instance -// to more than one VPC at a time. You can only link an instance that's in the -// running state. An instance is automatically unlinked from a VPC when it's -// stopped - you can link it to the VPC again when you restart it. -// -// After you've linked an instance, you cannot change the VPC security groups -// that are associated with it. To change the security groups, you must first -// unlink the instance, and then link it again. -// -// Linking your instance to a VPC is sometimes referred to as attaching your -// instance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AttachClassicLinkVpc for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpc -func (c *EC2) AttachClassicLinkVpc(input *AttachClassicLinkVpcInput) (*AttachClassicLinkVpcOutput, error) { - req, out := c.AttachClassicLinkVpcRequest(input) - return out, req.Send() -} - -// AttachClassicLinkVpcWithContext is the same as AttachClassicLinkVpc with the addition of -// the ability to pass a context and additional request options. -// -// See AttachClassicLinkVpc for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AttachClassicLinkVpcWithContext(ctx aws.Context, input *AttachClassicLinkVpcInput, opts ...request.Option) (*AttachClassicLinkVpcOutput, error) { - req, out := c.AttachClassicLinkVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachInternetGateway = "AttachInternetGateway" - -// AttachInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the AttachInternetGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AttachInternetGateway for more information on using the AttachInternetGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AttachInternetGatewayRequest method. -// req, resp := client.AttachInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGateway -func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (req *request.Request, output *AttachInternetGatewayOutput) { - op := &request.Operation{ - Name: opAttachInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachInternetGatewayInput{} - } - - output = &AttachInternetGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AttachInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Attaches an Internet gateway to a VPC, enabling connectivity between the -// Internet and the VPC. For more information about your VPC and Internet gateway, -// see the Amazon Virtual Private Cloud User Guide (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AttachInternetGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGateway -func (c *EC2) AttachInternetGateway(input *AttachInternetGatewayInput) (*AttachInternetGatewayOutput, error) { - req, out := c.AttachInternetGatewayRequest(input) - return out, req.Send() -} - -// AttachInternetGatewayWithContext is the same as AttachInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See AttachInternetGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AttachInternetGatewayWithContext(ctx aws.Context, input *AttachInternetGatewayInput, opts ...request.Option) (*AttachInternetGatewayOutput, error) { - req, out := c.AttachInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachNetworkInterface = "AttachNetworkInterface" - -// AttachNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the AttachNetworkInterface operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AttachNetworkInterface for more information on using the AttachNetworkInterface -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AttachNetworkInterfaceRequest method. -// req, resp := client.AttachNetworkInterfaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterface -func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) (req *request.Request, output *AttachNetworkInterfaceOutput) { - op := &request.Operation{ - Name: opAttachNetworkInterface, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachNetworkInterfaceInput{} - } - - output = &AttachNetworkInterfaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachNetworkInterface API operation for Amazon Elastic Compute Cloud. -// -// Attaches a network interface to an instance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AttachNetworkInterface for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterface -func (c *EC2) AttachNetworkInterface(input *AttachNetworkInterfaceInput) (*AttachNetworkInterfaceOutput, error) { - req, out := c.AttachNetworkInterfaceRequest(input) - return out, req.Send() -} - -// AttachNetworkInterfaceWithContext is the same as AttachNetworkInterface with the addition of -// the ability to pass a context and additional request options. -// -// See AttachNetworkInterface for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AttachNetworkInterfaceWithContext(ctx aws.Context, input *AttachNetworkInterfaceInput, opts ...request.Option) (*AttachNetworkInterfaceOutput, error) { - req, out := c.AttachNetworkInterfaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachVolume = "AttachVolume" - -// AttachVolumeRequest generates a "aws/request.Request" representing the -// client's request for the AttachVolume operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AttachVolume for more information on using the AttachVolume -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AttachVolumeRequest method. -// req, resp := client.AttachVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVolume -func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Request, output *VolumeAttachment) { - op := &request.Operation{ - Name: opAttachVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachVolumeInput{} - } - - output = &VolumeAttachment{} - req = c.newRequest(op, input, output) - return -} - -// AttachVolume API operation for Amazon Elastic Compute Cloud. -// -// Attaches an EBS volume to a running or stopped instance and exposes it to -// the instance with the specified device name. -// -// Encrypted EBS volumes may only be attached to instances that support Amazon -// EBS encryption. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For a list of supported device names, see Attaching an EBS Volume to an Instance -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html). -// Any device names that aren't reserved for instance store volumes can be used -// for EBS volumes. For more information, see Amazon EC2 Instance Store (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// If a volume has an AWS Marketplace product code: -// -// * The volume can be attached only to a stopped instance. -// -// * AWS Marketplace product codes are copied from the volume to the instance. -// -// * You must be subscribed to the product. -// -// * The instance type and operating system of the instance must support -// the product. For example, you can't detach a volume from a Windows instance -// and attach it to a Linux instance. -// -// For an overview of the AWS Marketplace, see Introducing AWS Marketplace (https://aws.amazon.com/marketplace/help/200900000). -// -// For more information about EBS volumes, see Attaching Amazon EBS Volumes -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AttachVolume for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVolume -func (c *EC2) AttachVolume(input *AttachVolumeInput) (*VolumeAttachment, error) { - req, out := c.AttachVolumeRequest(input) - return out, req.Send() -} - -// AttachVolumeWithContext is the same as AttachVolume with the addition of -// the ability to pass a context and additional request options. -// -// See AttachVolume for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AttachVolumeWithContext(ctx aws.Context, input *AttachVolumeInput, opts ...request.Option) (*VolumeAttachment, error) { - req, out := c.AttachVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachVpnGateway = "AttachVpnGateway" - -// AttachVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the AttachVpnGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AttachVpnGateway for more information on using the AttachVpnGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AttachVpnGatewayRequest method. -// req, resp := client.AttachVpnGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGateway -func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) (req *request.Request, output *AttachVpnGatewayOutput) { - op := &request.Operation{ - Name: opAttachVpnGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachVpnGatewayInput{} - } - - output = &AttachVpnGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachVpnGateway API operation for Amazon Elastic Compute Cloud. -// -// Attaches a virtual private gateway to a VPC. You can attach one virtual private -// gateway to one VPC at a time. -// -// For more information, see AWS Managed VPN Connections (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AttachVpnGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGateway -func (c *EC2) AttachVpnGateway(input *AttachVpnGatewayInput) (*AttachVpnGatewayOutput, error) { - req, out := c.AttachVpnGatewayRequest(input) - return out, req.Send() -} - -// AttachVpnGatewayWithContext is the same as AttachVpnGateway with the addition of -// the ability to pass a context and additional request options. -// -// See AttachVpnGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AttachVpnGatewayWithContext(ctx aws.Context, input *AttachVpnGatewayInput, opts ...request.Option) (*AttachVpnGatewayOutput, error) { - req, out := c.AttachVpnGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAuthorizeSecurityGroupEgress = "AuthorizeSecurityGroupEgress" - -// AuthorizeSecurityGroupEgressRequest generates a "aws/request.Request" representing the -// client's request for the AuthorizeSecurityGroupEgress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AuthorizeSecurityGroupEgress for more information on using the AuthorizeSecurityGroupEgress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AuthorizeSecurityGroupEgressRequest method. -// req, resp := client.AuthorizeSecurityGroupEgressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgress -func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupEgressInput) (req *request.Request, output *AuthorizeSecurityGroupEgressOutput) { - op := &request.Operation{ - Name: opAuthorizeSecurityGroupEgress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AuthorizeSecurityGroupEgressInput{} - } - - output = &AuthorizeSecurityGroupEgressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AuthorizeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Adds one or more egress rules to a security group for use -// with a VPC. Specifically, this action permits instances to send traffic to -// one or more destination IPv4 or IPv6 CIDR address ranges, or to one or more -// destination security groups for the same VPC. This action doesn't apply to -// security groups for use in EC2-Classic. For more information, see Security -// Groups for Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) -// in the Amazon Virtual Private Cloud User Guide. For more information about -// security group limits, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html). -// -// Each rule consists of the protocol (for example, TCP), plus either a CIDR -// range or a source group. For the TCP and UDP protocols, you must also specify -// the destination port or port range. For the ICMP protocol, you must also -// specify the ICMP type and code. You can use -1 for the type or code to mean -// all types or all codes. You can optionally specify a description for the -// rule. -// -// Rule changes are propagated to affected instances as quickly as possible. -// However, a small delay might occur. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AuthorizeSecurityGroupEgress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgress -func (c *EC2) AuthorizeSecurityGroupEgress(input *AuthorizeSecurityGroupEgressInput) (*AuthorizeSecurityGroupEgressOutput, error) { - req, out := c.AuthorizeSecurityGroupEgressRequest(input) - return out, req.Send() -} - -// AuthorizeSecurityGroupEgressWithContext is the same as AuthorizeSecurityGroupEgress with the addition of -// the ability to pass a context and additional request options. -// -// See AuthorizeSecurityGroupEgress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AuthorizeSecurityGroupEgressWithContext(ctx aws.Context, input *AuthorizeSecurityGroupEgressInput, opts ...request.Option) (*AuthorizeSecurityGroupEgressOutput, error) { - req, out := c.AuthorizeSecurityGroupEgressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAuthorizeSecurityGroupIngress = "AuthorizeSecurityGroupIngress" - -// AuthorizeSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the AuthorizeSecurityGroupIngress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AuthorizeSecurityGroupIngress for more information on using the AuthorizeSecurityGroupIngress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the AuthorizeSecurityGroupIngressRequest method. -// req, resp := client.AuthorizeSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngress -func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroupIngressInput) (req *request.Request, output *AuthorizeSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opAuthorizeSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AuthorizeSecurityGroupIngressInput{} - } - - output = &AuthorizeSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AuthorizeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud. -// -// Adds one or more ingress rules to a security group. -// -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. -// -// [EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission -// to access a security group in your account, or gives one or more security -// groups (called the source groups) permission to access a security group for -// your account. A source group can be for your own AWS account, or another. -// You can have up to 100 rules per group. -// -// [EC2-VPC] This action gives one or more IPv4 or IPv6 CIDR address ranges -// permission to access a security group in your VPC, or gives one or more other -// security groups (called the source groups) permission to access a security -// group for your VPC. The security groups must all be for the same VPC or a -// peer VPC in a VPC peering connection. For more information about VPC security -// group limits, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html). -// -// You can optionally specify a description for the security group rule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation AuthorizeSecurityGroupIngress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngress -func (c *EC2) AuthorizeSecurityGroupIngress(input *AuthorizeSecurityGroupIngressInput) (*AuthorizeSecurityGroupIngressOutput, error) { - req, out := c.AuthorizeSecurityGroupIngressRequest(input) - return out, req.Send() -} - -// AuthorizeSecurityGroupIngressWithContext is the same as AuthorizeSecurityGroupIngress with the addition of -// the ability to pass a context and additional request options. -// -// See AuthorizeSecurityGroupIngress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) AuthorizeSecurityGroupIngressWithContext(ctx aws.Context, input *AuthorizeSecurityGroupIngressInput, opts ...request.Option) (*AuthorizeSecurityGroupIngressOutput, error) { - req, out := c.AuthorizeSecurityGroupIngressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBundleInstance = "BundleInstance" - -// BundleInstanceRequest generates a "aws/request.Request" representing the -// client's request for the BundleInstance operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See BundleInstance for more information on using the BundleInstance -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the BundleInstanceRequest method. -// req, resp := client.BundleInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstance -func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *request.Request, output *BundleInstanceOutput) { - op := &request.Operation{ - Name: opBundleInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BundleInstanceInput{} - } - - output = &BundleInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// BundleInstance API operation for Amazon Elastic Compute Cloud. -// -// Bundles an Amazon instance store-backed Windows instance. -// -// During bundling, only the root device volume (C:\) is bundled. Data on other -// instance store volumes is not preserved. -// -// This action is not applicable for Linux/Unix instances or Windows instances -// that are backed by Amazon EBS. -// -// For more information, see Creating an Instance Store-Backed Windows AMI (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_InstanceStoreBacked_WinAMI.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation BundleInstance for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstance -func (c *EC2) BundleInstance(input *BundleInstanceInput) (*BundleInstanceOutput, error) { - req, out := c.BundleInstanceRequest(input) - return out, req.Send() -} - -// BundleInstanceWithContext is the same as BundleInstance with the addition of -// the ability to pass a context and additional request options. -// -// See BundleInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) BundleInstanceWithContext(ctx aws.Context, input *BundleInstanceInput, opts ...request.Option) (*BundleInstanceOutput, error) { - req, out := c.BundleInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelBundleTask = "CancelBundleTask" - -// CancelBundleTaskRequest generates a "aws/request.Request" representing the -// client's request for the CancelBundleTask operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelBundleTask for more information on using the CancelBundleTask -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CancelBundleTaskRequest method. -// req, resp := client.CancelBundleTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTask -func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *request.Request, output *CancelBundleTaskOutput) { - op := &request.Operation{ - Name: opCancelBundleTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelBundleTaskInput{} - } - - output = &CancelBundleTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelBundleTask API operation for Amazon Elastic Compute Cloud. -// -// Cancels a bundling operation for an instance store-backed Windows instance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CancelBundleTask for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTask -func (c *EC2) CancelBundleTask(input *CancelBundleTaskInput) (*CancelBundleTaskOutput, error) { - req, out := c.CancelBundleTaskRequest(input) - return out, req.Send() -} - -// CancelBundleTaskWithContext is the same as CancelBundleTask with the addition of -// the ability to pass a context and additional request options. -// -// See CancelBundleTask for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CancelBundleTaskWithContext(ctx aws.Context, input *CancelBundleTaskInput, opts ...request.Option) (*CancelBundleTaskOutput, error) { - req, out := c.CancelBundleTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelConversionTask = "CancelConversionTask" - -// CancelConversionTaskRequest generates a "aws/request.Request" representing the -// client's request for the CancelConversionTask operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelConversionTask for more information on using the CancelConversionTask -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CancelConversionTaskRequest method. -// req, resp := client.CancelConversionTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionTask -func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req *request.Request, output *CancelConversionTaskOutput) { - op := &request.Operation{ - Name: opCancelConversionTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelConversionTaskInput{} - } - - output = &CancelConversionTaskOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CancelConversionTask API operation for Amazon Elastic Compute Cloud. -// -// Cancels an active conversion task. The task can be the import of an instance -// or volume. The action removes all artifacts of the conversion, including -// a partially uploaded volume or instance. If the conversion is complete or -// is in the process of transferring the final disk image, the command fails -// and returns an exception. -// -// For more information, see Importing a Virtual Machine Using the Amazon EC2 -// CLI (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CancelConversionTask for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionTask -func (c *EC2) CancelConversionTask(input *CancelConversionTaskInput) (*CancelConversionTaskOutput, error) { - req, out := c.CancelConversionTaskRequest(input) - return out, req.Send() -} - -// CancelConversionTaskWithContext is the same as CancelConversionTask with the addition of -// the ability to pass a context and additional request options. -// -// See CancelConversionTask for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CancelConversionTaskWithContext(ctx aws.Context, input *CancelConversionTaskInput, opts ...request.Option) (*CancelConversionTaskOutput, error) { - req, out := c.CancelConversionTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelExportTask = "CancelExportTask" - -// CancelExportTaskRequest generates a "aws/request.Request" representing the -// client's request for the CancelExportTask operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelExportTask for more information on using the CancelExportTask -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CancelExportTaskRequest method. -// req, resp := client.CancelExportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTask -func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *request.Request, output *CancelExportTaskOutput) { - op := &request.Operation{ - Name: opCancelExportTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelExportTaskInput{} - } - - output = &CancelExportTaskOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CancelExportTask API operation for Amazon Elastic Compute Cloud. -// -// Cancels an active export task. The request removes all artifacts of the export, -// including any partially-created Amazon S3 objects. If the export task is -// complete or is in the process of transferring the final disk image, the command -// fails and returns an error. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CancelExportTask for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTask -func (c *EC2) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) { - req, out := c.CancelExportTaskRequest(input) - return out, req.Send() -} - -// CancelExportTaskWithContext is the same as CancelExportTask with the addition of -// the ability to pass a context and additional request options. -// -// See CancelExportTask for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CancelExportTaskWithContext(ctx aws.Context, input *CancelExportTaskInput, opts ...request.Option) (*CancelExportTaskOutput, error) { - req, out := c.CancelExportTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelImportTask = "CancelImportTask" - -// CancelImportTaskRequest generates a "aws/request.Request" representing the -// client's request for the CancelImportTask operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelImportTask for more information on using the CancelImportTask -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CancelImportTaskRequest method. -// req, resp := client.CancelImportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTask -func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *request.Request, output *CancelImportTaskOutput) { - op := &request.Operation{ - Name: opCancelImportTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelImportTaskInput{} - } - - output = &CancelImportTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelImportTask API operation for Amazon Elastic Compute Cloud. -// -// Cancels an in-process import virtual machine or import snapshot task. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CancelImportTask for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTask -func (c *EC2) CancelImportTask(input *CancelImportTaskInput) (*CancelImportTaskOutput, error) { - req, out := c.CancelImportTaskRequest(input) - return out, req.Send() -} - -// CancelImportTaskWithContext is the same as CancelImportTask with the addition of -// the ability to pass a context and additional request options. -// -// See CancelImportTask for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CancelImportTaskWithContext(ctx aws.Context, input *CancelImportTaskInput, opts ...request.Option) (*CancelImportTaskOutput, error) { - req, out := c.CancelImportTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelReservedInstancesListing = "CancelReservedInstancesListing" - -// CancelReservedInstancesListingRequest generates a "aws/request.Request" representing the -// client's request for the CancelReservedInstancesListing operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelReservedInstancesListing for more information on using the CancelReservedInstancesListing -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CancelReservedInstancesListingRequest method. -// req, resp := client.CancelReservedInstancesListingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListing -func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstancesListingInput) (req *request.Request, output *CancelReservedInstancesListingOutput) { - op := &request.Operation{ - Name: opCancelReservedInstancesListing, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelReservedInstancesListingInput{} - } - - output = &CancelReservedInstancesListingOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelReservedInstancesListing API operation for Amazon Elastic Compute Cloud. -// -// Cancels the specified Reserved Instance listing in the Reserved Instance -// Marketplace. -// -// For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CancelReservedInstancesListing for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListing -func (c *EC2) CancelReservedInstancesListing(input *CancelReservedInstancesListingInput) (*CancelReservedInstancesListingOutput, error) { - req, out := c.CancelReservedInstancesListingRequest(input) - return out, req.Send() -} - -// CancelReservedInstancesListingWithContext is the same as CancelReservedInstancesListing with the addition of -// the ability to pass a context and additional request options. -// -// See CancelReservedInstancesListing for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CancelReservedInstancesListingWithContext(ctx aws.Context, input *CancelReservedInstancesListingInput, opts ...request.Option) (*CancelReservedInstancesListingOutput, error) { - req, out := c.CancelReservedInstancesListingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelSpotFleetRequests = "CancelSpotFleetRequests" - -// CancelSpotFleetRequestsRequest generates a "aws/request.Request" representing the -// client's request for the CancelSpotFleetRequests operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelSpotFleetRequests for more information on using the CancelSpotFleetRequests -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CancelSpotFleetRequestsRequest method. -// req, resp := client.CancelSpotFleetRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequests -func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput) (req *request.Request, output *CancelSpotFleetRequestsOutput) { - op := &request.Operation{ - Name: opCancelSpotFleetRequests, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelSpotFleetRequestsInput{} - } - - output = &CancelSpotFleetRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelSpotFleetRequests API operation for Amazon Elastic Compute Cloud. -// -// Cancels the specified Spot Fleet requests. -// -// After you cancel a Spot Fleet request, the Spot Fleet launches no new Spot -// Instances. You must specify whether the Spot Fleet should also terminate -// its Spot Instances. If you terminate the instances, the Spot Fleet request -// enters the cancelled_terminating state. Otherwise, the Spot Fleet request -// enters the cancelled_running state and the instances continue to run until -// they are interrupted or you terminate them manually. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CancelSpotFleetRequests for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequests -func (c *EC2) CancelSpotFleetRequests(input *CancelSpotFleetRequestsInput) (*CancelSpotFleetRequestsOutput, error) { - req, out := c.CancelSpotFleetRequestsRequest(input) - return out, req.Send() -} - -// CancelSpotFleetRequestsWithContext is the same as CancelSpotFleetRequests with the addition of -// the ability to pass a context and additional request options. -// -// See CancelSpotFleetRequests for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CancelSpotFleetRequestsWithContext(ctx aws.Context, input *CancelSpotFleetRequestsInput, opts ...request.Option) (*CancelSpotFleetRequestsOutput, error) { - req, out := c.CancelSpotFleetRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelSpotInstanceRequests = "CancelSpotInstanceRequests" - -// CancelSpotInstanceRequestsRequest generates a "aws/request.Request" representing the -// client's request for the CancelSpotInstanceRequests operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelSpotInstanceRequests for more information on using the CancelSpotInstanceRequests -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CancelSpotInstanceRequestsRequest method. -// req, resp := client.CancelSpotInstanceRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequests -func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequestsInput) (req *request.Request, output *CancelSpotInstanceRequestsOutput) { - op := &request.Operation{ - Name: opCancelSpotInstanceRequests, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelSpotInstanceRequestsInput{} - } - - output = &CancelSpotInstanceRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelSpotInstanceRequests API operation for Amazon Elastic Compute Cloud. -// -// Cancels one or more Spot Instance requests. -// -// Canceling a Spot Instance request does not terminate running Spot Instances -// associated with the request. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CancelSpotInstanceRequests for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequests -func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) (*CancelSpotInstanceRequestsOutput, error) { - req, out := c.CancelSpotInstanceRequestsRequest(input) - return out, req.Send() -} - -// CancelSpotInstanceRequestsWithContext is the same as CancelSpotInstanceRequests with the addition of -// the ability to pass a context and additional request options. -// -// See CancelSpotInstanceRequests for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CancelSpotInstanceRequestsWithContext(ctx aws.Context, input *CancelSpotInstanceRequestsInput, opts ...request.Option) (*CancelSpotInstanceRequestsOutput, error) { - req, out := c.CancelSpotInstanceRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opConfirmProductInstance = "ConfirmProductInstance" - -// ConfirmProductInstanceRequest generates a "aws/request.Request" representing the -// client's request for the ConfirmProductInstance operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ConfirmProductInstance for more information on using the ConfirmProductInstance -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ConfirmProductInstanceRequest method. -// req, resp := client.ConfirmProductInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstance -func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) (req *request.Request, output *ConfirmProductInstanceOutput) { - op := &request.Operation{ - Name: opConfirmProductInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ConfirmProductInstanceInput{} - } - - output = &ConfirmProductInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ConfirmProductInstance API operation for Amazon Elastic Compute Cloud. -// -// Determines whether a product code is associated with an instance. This action -// can only be used by the owner of the product code. It is useful when a product -// code owner must verify whether another user's instance is eligible for support. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ConfirmProductInstance for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstance -func (c *EC2) ConfirmProductInstance(input *ConfirmProductInstanceInput) (*ConfirmProductInstanceOutput, error) { - req, out := c.ConfirmProductInstanceRequest(input) - return out, req.Send() -} - -// ConfirmProductInstanceWithContext is the same as ConfirmProductInstance with the addition of -// the ability to pass a context and additional request options. -// -// See ConfirmProductInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ConfirmProductInstanceWithContext(ctx aws.Context, input *ConfirmProductInstanceInput, opts ...request.Option) (*ConfirmProductInstanceOutput, error) { - req, out := c.ConfirmProductInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCopyFpgaImage = "CopyFpgaImage" - -// CopyFpgaImageRequest generates a "aws/request.Request" representing the -// client's request for the CopyFpgaImage operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CopyFpgaImage for more information on using the CopyFpgaImage -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CopyFpgaImageRequest method. -// req, resp := client.CopyFpgaImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyFpgaImage -func (c *EC2) CopyFpgaImageRequest(input *CopyFpgaImageInput) (req *request.Request, output *CopyFpgaImageOutput) { - op := &request.Operation{ - Name: opCopyFpgaImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyFpgaImageInput{} - } - - output = &CopyFpgaImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyFpgaImage API operation for Amazon Elastic Compute Cloud. -// -// Copies the specified Amazon FPGA Image (AFI) to the current region. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CopyFpgaImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyFpgaImage -func (c *EC2) CopyFpgaImage(input *CopyFpgaImageInput) (*CopyFpgaImageOutput, error) { - req, out := c.CopyFpgaImageRequest(input) - return out, req.Send() -} - -// CopyFpgaImageWithContext is the same as CopyFpgaImage with the addition of -// the ability to pass a context and additional request options. -// -// See CopyFpgaImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CopyFpgaImageWithContext(ctx aws.Context, input *CopyFpgaImageInput, opts ...request.Option) (*CopyFpgaImageOutput, error) { - req, out := c.CopyFpgaImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCopyImage = "CopyImage" - -// CopyImageRequest generates a "aws/request.Request" representing the -// client's request for the CopyImage operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CopyImage for more information on using the CopyImage -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CopyImageRequest method. -// req, resp := client.CopyImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImage -func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, output *CopyImageOutput) { - op := &request.Operation{ - Name: opCopyImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyImageInput{} - } - - output = &CopyImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyImage API operation for Amazon Elastic Compute Cloud. -// -// Initiates the copy of an AMI from the specified source region to the current -// region. You specify the destination region by using its endpoint when making -// the request. -// -// For more information about the prerequisites and limits when copying an AMI, -// see Copying an AMI (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CopyImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImage -func (c *EC2) CopyImage(input *CopyImageInput) (*CopyImageOutput, error) { - req, out := c.CopyImageRequest(input) - return out, req.Send() -} - -// CopyImageWithContext is the same as CopyImage with the addition of -// the ability to pass a context and additional request options. -// -// See CopyImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CopyImageWithContext(ctx aws.Context, input *CopyImageInput, opts ...request.Option) (*CopyImageOutput, error) { - req, out := c.CopyImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCopySnapshot = "CopySnapshot" - -// CopySnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CopySnapshot operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CopySnapshot for more information on using the CopySnapshot -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CopySnapshotRequest method. -// req, resp := client.CopySnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshot -func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Request, output *CopySnapshotOutput) { - op := &request.Operation{ - Name: opCopySnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopySnapshotInput{} - } - - output = &CopySnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopySnapshot API operation for Amazon Elastic Compute Cloud. -// -// Copies a point-in-time snapshot of an EBS volume and stores it in Amazon -// S3. You can copy the snapshot within the same region or from one region to -// another. You can use the snapshot to create EBS volumes or Amazon Machine -// Images (AMIs). The snapshot is copied to the regional endpoint that you send -// the HTTP request to. -// -// Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted -// snapshots remain unencrypted, unless the Encrypted flag is specified during -// the snapshot copy operation. By default, encrypted snapshot copies use the -// default AWS Key Management Service (AWS KMS) customer master key (CMK); however, -// you can specify a non-default CMK with the KmsKeyId parameter. -// -// To copy an encrypted snapshot that has been shared from another account, -// you must have permissions for the CMK used to encrypt the snapshot. -// -// Snapshots created by the CopySnapshot action have an arbitrary volume ID -// that should not be used for any purpose. -// -// For more information, see Copying an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CopySnapshot for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshot -func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) { - req, out := c.CopySnapshotRequest(input) - return out, req.Send() -} - -// CopySnapshotWithContext is the same as CopySnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See CopySnapshot for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CopySnapshotWithContext(ctx aws.Context, input *CopySnapshotInput, opts ...request.Option) (*CopySnapshotOutput, error) { - req, out := c.CopySnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateCustomerGateway = "CreateCustomerGateway" - -// CreateCustomerGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateCustomerGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateCustomerGateway for more information on using the CreateCustomerGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateCustomerGatewayRequest method. -// req, resp := client.CreateCustomerGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGateway -func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (req *request.Request, output *CreateCustomerGatewayOutput) { - op := &request.Operation{ - Name: opCreateCustomerGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCustomerGatewayInput{} - } - - output = &CreateCustomerGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCustomerGateway API operation for Amazon Elastic Compute Cloud. -// -// Provides information to AWS about your VPN customer gateway device. The customer -// gateway is the appliance at your end of the VPN connection. (The device on -// the AWS side of the VPN connection is the virtual private gateway.) You must -// provide the Internet-routable IP address of the customer gateway's external -// interface. The IP address must be static and may be behind a device performing -// network address translation (NAT). -// -// For devices that use Border Gateway Protocol (BGP), you can also provide -// the device's BGP Autonomous System Number (ASN). You can use an existing -// ASN assigned to your network. If you don't have an ASN already, you can use -// a private ASN (in the 64512 - 65534 range). -// -// Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with -// the exception of 7224, which is reserved in the us-east-1 region, and 9059, -// which is reserved in the eu-west-1 region. -// -// For more information about VPN customer gateways, see AWS Managed VPN Connections -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) in the -// Amazon Virtual Private Cloud User Guide. -// -// You cannot create more than one customer gateway with the same VPN type, -// IP address, and BGP ASN parameter values. If you run an identical request -// more than one time, the first request creates the customer gateway, and subsequent -// requests return information about the existing customer gateway. The subsequent -// requests do not create new customer gateway resources. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateCustomerGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGateway -func (c *EC2) CreateCustomerGateway(input *CreateCustomerGatewayInput) (*CreateCustomerGatewayOutput, error) { - req, out := c.CreateCustomerGatewayRequest(input) - return out, req.Send() -} - -// CreateCustomerGatewayWithContext is the same as CreateCustomerGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCustomerGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateCustomerGatewayWithContext(ctx aws.Context, input *CreateCustomerGatewayInput, opts ...request.Option) (*CreateCustomerGatewayOutput, error) { - req, out := c.CreateCustomerGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDefaultSubnet = "CreateDefaultSubnet" - -// CreateDefaultSubnetRequest generates a "aws/request.Request" representing the -// client's request for the CreateDefaultSubnet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateDefaultSubnet for more information on using the CreateDefaultSubnet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateDefaultSubnetRequest method. -// req, resp := client.CreateDefaultSubnetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDefaultSubnet -func (c *EC2) CreateDefaultSubnetRequest(input *CreateDefaultSubnetInput) (req *request.Request, output *CreateDefaultSubnetOutput) { - op := &request.Operation{ - Name: opCreateDefaultSubnet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDefaultSubnetInput{} - } - - output = &CreateDefaultSubnetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDefaultSubnet API operation for Amazon Elastic Compute Cloud. -// -// Creates a default subnet with a size /20 IPv4 CIDR block in the specified -// Availability Zone in your default VPC. You can have only one default subnet -// per Availability Zone. For more information, see Creating a Default Subnet -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html#create-default-subnet) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateDefaultSubnet for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDefaultSubnet -func (c *EC2) CreateDefaultSubnet(input *CreateDefaultSubnetInput) (*CreateDefaultSubnetOutput, error) { - req, out := c.CreateDefaultSubnetRequest(input) - return out, req.Send() -} - -// CreateDefaultSubnetWithContext is the same as CreateDefaultSubnet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDefaultSubnet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateDefaultSubnetWithContext(ctx aws.Context, input *CreateDefaultSubnetInput, opts ...request.Option) (*CreateDefaultSubnetOutput, error) { - req, out := c.CreateDefaultSubnetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDefaultVpc = "CreateDefaultVpc" - -// CreateDefaultVpcRequest generates a "aws/request.Request" representing the -// client's request for the CreateDefaultVpc operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateDefaultVpc for more information on using the CreateDefaultVpc -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateDefaultVpcRequest method. -// req, resp := client.CreateDefaultVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDefaultVpc -func (c *EC2) CreateDefaultVpcRequest(input *CreateDefaultVpcInput) (req *request.Request, output *CreateDefaultVpcOutput) { - op := &request.Operation{ - Name: opCreateDefaultVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDefaultVpcInput{} - } - - output = &CreateDefaultVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDefaultVpc API operation for Amazon Elastic Compute Cloud. -// -// Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet -// in each Availability Zone. For more information about the components of a -// default VPC, see Default VPC and Default Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html) -// in the Amazon Virtual Private Cloud User Guide. You cannot specify the components -// of the default VPC yourself. -// -// You can create a default VPC if you deleted your previous default VPC. You -// cannot have more than one default VPC per region. -// -// If your account supports EC2-Classic, you cannot use this action to create -// a default VPC in a region that supports EC2-Classic. If you want a default -// VPC in a region that supports EC2-Classic, see "I really want a default VPC -// for my existing EC2 account. Is that possible?" in the Default VPCs FAQ (http://aws.amazon.com/vpc/faqs/#Default_VPCs). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateDefaultVpc for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDefaultVpc -func (c *EC2) CreateDefaultVpc(input *CreateDefaultVpcInput) (*CreateDefaultVpcOutput, error) { - req, out := c.CreateDefaultVpcRequest(input) - return out, req.Send() -} - -// CreateDefaultVpcWithContext is the same as CreateDefaultVpc with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDefaultVpc for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateDefaultVpcWithContext(ctx aws.Context, input *CreateDefaultVpcInput, opts ...request.Option) (*CreateDefaultVpcOutput, error) { - req, out := c.CreateDefaultVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDhcpOptions = "CreateDhcpOptions" - -// CreateDhcpOptionsRequest generates a "aws/request.Request" representing the -// client's request for the CreateDhcpOptions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateDhcpOptions for more information on using the CreateDhcpOptions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateDhcpOptionsRequest method. -// req, resp := client.CreateDhcpOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptions -func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *request.Request, output *CreateDhcpOptionsOutput) { - op := &request.Operation{ - Name: opCreateDhcpOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDhcpOptionsInput{} - } - - output = &CreateDhcpOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDhcpOptions API operation for Amazon Elastic Compute Cloud. -// -// Creates a set of DHCP options for your VPC. After creating the set, you must -// associate it with the VPC, causing all existing and new instances that you -// launch in the VPC to use this set of DHCP options. The following are the -// individual DHCP options you can specify. For more information about the options, -// see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt). -// -// * domain-name-servers - The IP addresses of up to four domain name servers, -// or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. -// If specifying more than one domain name server, specify the IP addresses -// in a single parameter, separated by commas. If you want your instance -// to receive a custom DNS hostname as specified in domain-name, you must -// set domain-name-servers to a custom DNS server. -// -// * domain-name - If you're using AmazonProvidedDNS in us-east-1, specify -// ec2.internal. If you're using AmazonProvidedDNS in another region, specify -// region.compute.internal (for example, ap-northeast-1.compute.internal). -// Otherwise, specify a domain name (for example, MyCompany.com). This value -// is used to complete unqualified DNS hostnames. Important: Some Linux operating -// systems accept multiple domain names separated by spaces. However, Windows -// and other Linux operating systems treat the value as a single domain, -// which results in unexpected behavior. If your DHCP options set is associated -// with a VPC that has instances with multiple operating systems, specify -// only one domain name. -// -// * ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) -// servers. -// -// * netbios-name-servers - The IP addresses of up to four NetBIOS name servers. -// -// * netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend -// that you specify 2 (broadcast and multicast are not currently supported). -// For more information about these node types, see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt). -// -// Your VPC automatically starts out with a set of DHCP options that includes -// only a DNS server that we provide (AmazonProvidedDNS). If you create a set -// of options, and if your VPC has an Internet gateway, make sure to set the -// domain-name-servers option either to AmazonProvidedDNS or to a domain name -// server of your choice. For more information about DHCP options, see DHCP -// Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateDhcpOptions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptions -func (c *EC2) CreateDhcpOptions(input *CreateDhcpOptionsInput) (*CreateDhcpOptionsOutput, error) { - req, out := c.CreateDhcpOptionsRequest(input) - return out, req.Send() -} - -// CreateDhcpOptionsWithContext is the same as CreateDhcpOptions with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDhcpOptions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateDhcpOptionsWithContext(ctx aws.Context, input *CreateDhcpOptionsInput, opts ...request.Option) (*CreateDhcpOptionsOutput, error) { - req, out := c.CreateDhcpOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateEgressOnlyInternetGateway = "CreateEgressOnlyInternetGateway" - -// CreateEgressOnlyInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateEgressOnlyInternetGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateEgressOnlyInternetGateway for more information on using the CreateEgressOnlyInternetGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateEgressOnlyInternetGatewayRequest method. -// req, resp := client.CreateEgressOnlyInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGateway -func (c *EC2) CreateEgressOnlyInternetGatewayRequest(input *CreateEgressOnlyInternetGatewayInput) (req *request.Request, output *CreateEgressOnlyInternetGatewayOutput) { - op := &request.Operation{ - Name: opCreateEgressOnlyInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateEgressOnlyInternetGatewayInput{} - } - - output = &CreateEgressOnlyInternetGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEgressOnlyInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// [IPv6 only] Creates an egress-only Internet gateway for your VPC. An egress-only -// Internet gateway is used to enable outbound communication over IPv6 from -// instances in your VPC to the Internet, and prevents hosts outside of your -// VPC from initiating an IPv6 connection with your instance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateEgressOnlyInternetGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGateway -func (c *EC2) CreateEgressOnlyInternetGateway(input *CreateEgressOnlyInternetGatewayInput) (*CreateEgressOnlyInternetGatewayOutput, error) { - req, out := c.CreateEgressOnlyInternetGatewayRequest(input) - return out, req.Send() -} - -// CreateEgressOnlyInternetGatewayWithContext is the same as CreateEgressOnlyInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEgressOnlyInternetGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateEgressOnlyInternetGatewayWithContext(ctx aws.Context, input *CreateEgressOnlyInternetGatewayInput, opts ...request.Option) (*CreateEgressOnlyInternetGatewayOutput, error) { - req, out := c.CreateEgressOnlyInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateFleet = "CreateFleet" - -// CreateFleetRequest generates a "aws/request.Request" representing the -// client's request for the CreateFleet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateFleet for more information on using the CreateFleet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateFleetRequest method. -// req, resp := client.CreateFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFleet -func (c *EC2) CreateFleetRequest(input *CreateFleetInput) (req *request.Request, output *CreateFleetOutput) { - op := &request.Operation{ - Name: opCreateFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateFleetInput{} - } - - output = &CreateFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateFleet API operation for Amazon Elastic Compute Cloud. -// -// Launches an EC2 Fleet. -// -// You can create a single EC2 Fleet that includes multiple launch specifications -// that vary by instance type, AMI, Availability Zone, or subnet. -// -// For more information, see Launching an EC2 Fleet (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateFleet for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFleet -func (c *EC2) CreateFleet(input *CreateFleetInput) (*CreateFleetOutput, error) { - req, out := c.CreateFleetRequest(input) - return out, req.Send() -} - -// CreateFleetWithContext is the same as CreateFleet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateFleet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateFleetWithContext(ctx aws.Context, input *CreateFleetInput, opts ...request.Option) (*CreateFleetOutput, error) { - req, out := c.CreateFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateFlowLogs = "CreateFlowLogs" - -// CreateFlowLogsRequest generates a "aws/request.Request" representing the -// client's request for the CreateFlowLogs operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateFlowLogs for more information on using the CreateFlowLogs -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateFlowLogsRequest method. -// req, resp := client.CreateFlowLogsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogs -func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Request, output *CreateFlowLogsOutput) { - op := &request.Operation{ - Name: opCreateFlowLogs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateFlowLogsInput{} - } - - output = &CreateFlowLogsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateFlowLogs API operation for Amazon Elastic Compute Cloud. -// -// Creates one or more flow logs to capture IP traffic for a specific network -// interface, subnet, or VPC. Flow logs are delivered to a specified log group -// in Amazon CloudWatch Logs. If you specify a VPC or subnet in the request, -// a log stream is created in CloudWatch Logs for each network interface in -// the subnet or VPC. Log streams can include information about accepted and -// rejected traffic to a network interface. You can view the data in your log -// streams using Amazon CloudWatch Logs. -// -// In your request, you must also specify an IAM role that has permission to -// publish logs to CloudWatch Logs. -// -// For more information, see VPC Flow Logs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/flow-logs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateFlowLogs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogs -func (c *EC2) CreateFlowLogs(input *CreateFlowLogsInput) (*CreateFlowLogsOutput, error) { - req, out := c.CreateFlowLogsRequest(input) - return out, req.Send() -} - -// CreateFlowLogsWithContext is the same as CreateFlowLogs with the addition of -// the ability to pass a context and additional request options. -// -// See CreateFlowLogs for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateFlowLogsWithContext(ctx aws.Context, input *CreateFlowLogsInput, opts ...request.Option) (*CreateFlowLogsOutput, error) { - req, out := c.CreateFlowLogsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateFpgaImage = "CreateFpgaImage" - -// CreateFpgaImageRequest generates a "aws/request.Request" representing the -// client's request for the CreateFpgaImage operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateFpgaImage for more information on using the CreateFpgaImage -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateFpgaImageRequest method. -// req, resp := client.CreateFpgaImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFpgaImage -func (c *EC2) CreateFpgaImageRequest(input *CreateFpgaImageInput) (req *request.Request, output *CreateFpgaImageOutput) { - op := &request.Operation{ - Name: opCreateFpgaImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateFpgaImageInput{} - } - - output = &CreateFpgaImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateFpgaImage API operation for Amazon Elastic Compute Cloud. -// -// Creates an Amazon FPGA Image (AFI) from the specified design checkpoint (DCP). -// -// The create operation is asynchronous. To verify that the AFI is ready for -// use, check the output logs. -// -// An AFI contains the FPGA bitstream that is ready to download to an FPGA. -// You can securely deploy an AFI on one or more FPGA-accelerated instances. -// For more information, see the AWS FPGA Hardware Development Kit (https://github.com/aws/aws-fpga/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateFpgaImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFpgaImage -func (c *EC2) CreateFpgaImage(input *CreateFpgaImageInput) (*CreateFpgaImageOutput, error) { - req, out := c.CreateFpgaImageRequest(input) - return out, req.Send() -} - -// CreateFpgaImageWithContext is the same as CreateFpgaImage with the addition of -// the ability to pass a context and additional request options. -// -// See CreateFpgaImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateFpgaImageWithContext(ctx aws.Context, input *CreateFpgaImageInput, opts ...request.Option) (*CreateFpgaImageOutput, error) { - req, out := c.CreateFpgaImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateImage = "CreateImage" - -// CreateImageRequest generates a "aws/request.Request" representing the -// client's request for the CreateImage operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateImage for more information on using the CreateImage -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateImageRequest method. -// req, resp := client.CreateImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImage -func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *request.Request, output *CreateImageOutput) { - op := &request.Operation{ - Name: opCreateImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateImageInput{} - } - - output = &CreateImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateImage API operation for Amazon Elastic Compute Cloud. -// -// Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that -// is either running or stopped. -// -// If you customized your instance with instance store volumes or EBS volumes -// in addition to the root device volume, the new AMI contains block device -// mapping information for those volumes. When you launch an instance from this -// new AMI, the instance automatically launches with those additional volumes. -// -// For more information, see Creating Amazon EBS-Backed Linux AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImage -func (c *EC2) CreateImage(input *CreateImageInput) (*CreateImageOutput, error) { - req, out := c.CreateImageRequest(input) - return out, req.Send() -} - -// CreateImageWithContext is the same as CreateImage with the addition of -// the ability to pass a context and additional request options. -// -// See CreateImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateImageWithContext(ctx aws.Context, input *CreateImageInput, opts ...request.Option) (*CreateImageOutput, error) { - req, out := c.CreateImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateInstanceExportTask = "CreateInstanceExportTask" - -// CreateInstanceExportTaskRequest generates a "aws/request.Request" representing the -// client's request for the CreateInstanceExportTask operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateInstanceExportTask for more information on using the CreateInstanceExportTask -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateInstanceExportTaskRequest method. -// req, resp := client.CreateInstanceExportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTask -func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInput) (req *request.Request, output *CreateInstanceExportTaskOutput) { - op := &request.Operation{ - Name: opCreateInstanceExportTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInstanceExportTaskInput{} - } - - output = &CreateInstanceExportTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInstanceExportTask API operation for Amazon Elastic Compute Cloud. -// -// Exports a running or stopped instance to an S3 bucket. -// -// For information about the supported operating systems, image formats, and -// known limitations for the types of instances you can export, see Exporting -// an Instance as a VM Using VM Import/Export (http://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html) -// in the VM Import/Export User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateInstanceExportTask for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTask -func (c *EC2) CreateInstanceExportTask(input *CreateInstanceExportTaskInput) (*CreateInstanceExportTaskOutput, error) { - req, out := c.CreateInstanceExportTaskRequest(input) - return out, req.Send() -} - -// CreateInstanceExportTaskWithContext is the same as CreateInstanceExportTask with the addition of -// the ability to pass a context and additional request options. -// -// See CreateInstanceExportTask for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateInstanceExportTaskWithContext(ctx aws.Context, input *CreateInstanceExportTaskInput, opts ...request.Option) (*CreateInstanceExportTaskOutput, error) { - req, out := c.CreateInstanceExportTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateInternetGateway = "CreateInternetGateway" - -// CreateInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateInternetGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateInternetGateway for more information on using the CreateInternetGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateInternetGatewayRequest method. -// req, resp := client.CreateInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGateway -func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (req *request.Request, output *CreateInternetGatewayOutput) { - op := &request.Operation{ - Name: opCreateInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInternetGatewayInput{} - } - - output = &CreateInternetGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Creates an Internet gateway for use with a VPC. After creating the Internet -// gateway, you attach it to a VPC using AttachInternetGateway. -// -// For more information about your VPC and Internet gateway, see the Amazon -// Virtual Private Cloud User Guide (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateInternetGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGateway -func (c *EC2) CreateInternetGateway(input *CreateInternetGatewayInput) (*CreateInternetGatewayOutput, error) { - req, out := c.CreateInternetGatewayRequest(input) - return out, req.Send() -} - -// CreateInternetGatewayWithContext is the same as CreateInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateInternetGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateInternetGatewayWithContext(ctx aws.Context, input *CreateInternetGatewayInput, opts ...request.Option) (*CreateInternetGatewayOutput, error) { - req, out := c.CreateInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateKeyPair = "CreateKeyPair" - -// CreateKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the CreateKeyPair operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateKeyPair for more information on using the CreateKeyPair -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateKeyPairRequest method. -// req, resp := client.CreateKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateKeyPair -func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *request.Request, output *CreateKeyPairOutput) { - op := &request.Operation{ - Name: opCreateKeyPair, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateKeyPairInput{} - } - - output = &CreateKeyPairOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateKeyPair API operation for Amazon Elastic Compute Cloud. -// -// Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores -// the public key and displays the private key for you to save to a file. The -// private key is returned as an unencrypted PEM encoded PKCS#1 private key. -// If a key with the specified name already exists, Amazon EC2 returns an error. -// -// You can have up to five thousand key pairs per region. -// -// The key pair returned to you is available only in the region in which you -// create it. If you prefer, you can create your own key pair using a third-party -// tool and upload it to any region using ImportKeyPair. -// -// For more information, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateKeyPair for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateKeyPair -func (c *EC2) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, error) { - req, out := c.CreateKeyPairRequest(input) - return out, req.Send() -} - -// CreateKeyPairWithContext is the same as CreateKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See CreateKeyPair for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateKeyPairWithContext(ctx aws.Context, input *CreateKeyPairInput, opts ...request.Option) (*CreateKeyPairOutput, error) { - req, out := c.CreateKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateLaunchTemplate = "CreateLaunchTemplate" - -// CreateLaunchTemplateRequest generates a "aws/request.Request" representing the -// client's request for the CreateLaunchTemplate operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateLaunchTemplate for more information on using the CreateLaunchTemplate -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateLaunchTemplateRequest method. -// req, resp := client.CreateLaunchTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLaunchTemplate -func (c *EC2) CreateLaunchTemplateRequest(input *CreateLaunchTemplateInput) (req *request.Request, output *CreateLaunchTemplateOutput) { - op := &request.Operation{ - Name: opCreateLaunchTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLaunchTemplateInput{} - } - - output = &CreateLaunchTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLaunchTemplate API operation for Amazon Elastic Compute Cloud. -// -// Creates a launch template. A launch template contains the parameters to launch -// an instance. When you launch an instance using RunInstances, you can specify -// a launch template instead of providing the launch parameters in the request. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateLaunchTemplate for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLaunchTemplate -func (c *EC2) CreateLaunchTemplate(input *CreateLaunchTemplateInput) (*CreateLaunchTemplateOutput, error) { - req, out := c.CreateLaunchTemplateRequest(input) - return out, req.Send() -} - -// CreateLaunchTemplateWithContext is the same as CreateLaunchTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See CreateLaunchTemplate for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateLaunchTemplateWithContext(ctx aws.Context, input *CreateLaunchTemplateInput, opts ...request.Option) (*CreateLaunchTemplateOutput, error) { - req, out := c.CreateLaunchTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateLaunchTemplateVersion = "CreateLaunchTemplateVersion" - -// CreateLaunchTemplateVersionRequest generates a "aws/request.Request" representing the -// client's request for the CreateLaunchTemplateVersion operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateLaunchTemplateVersion for more information on using the CreateLaunchTemplateVersion -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateLaunchTemplateVersionRequest method. -// req, resp := client.CreateLaunchTemplateVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLaunchTemplateVersion -func (c *EC2) CreateLaunchTemplateVersionRequest(input *CreateLaunchTemplateVersionInput) (req *request.Request, output *CreateLaunchTemplateVersionOutput) { - op := &request.Operation{ - Name: opCreateLaunchTemplateVersion, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLaunchTemplateVersionInput{} - } - - output = &CreateLaunchTemplateVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLaunchTemplateVersion API operation for Amazon Elastic Compute Cloud. -// -// Creates a new version for a launch template. You can specify an existing -// version of launch template from which to base the new version. -// -// Launch template versions are numbered in the order in which they are created. -// You cannot specify, change, or replace the numbering of launch template versions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateLaunchTemplateVersion for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLaunchTemplateVersion -func (c *EC2) CreateLaunchTemplateVersion(input *CreateLaunchTemplateVersionInput) (*CreateLaunchTemplateVersionOutput, error) { - req, out := c.CreateLaunchTemplateVersionRequest(input) - return out, req.Send() -} - -// CreateLaunchTemplateVersionWithContext is the same as CreateLaunchTemplateVersion with the addition of -// the ability to pass a context and additional request options. -// -// See CreateLaunchTemplateVersion for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateLaunchTemplateVersionWithContext(ctx aws.Context, input *CreateLaunchTemplateVersionInput, opts ...request.Option) (*CreateLaunchTemplateVersionOutput, error) { - req, out := c.CreateLaunchTemplateVersionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNatGateway = "CreateNatGateway" - -// CreateNatGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateNatGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateNatGateway for more information on using the CreateNatGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateNatGatewayRequest method. -// req, resp := client.CreateNatGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGateway -func (c *EC2) CreateNatGatewayRequest(input *CreateNatGatewayInput) (req *request.Request, output *CreateNatGatewayOutput) { - op := &request.Operation{ - Name: opCreateNatGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNatGatewayInput{} - } - - output = &CreateNatGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNatGateway API operation for Amazon Elastic Compute Cloud. -// -// Creates a NAT gateway in the specified public subnet. This action creates -// a network interface in the specified subnet with a private IP address from -// the IP address range of the subnet. Internet-bound traffic from a private -// subnet can be routed to the NAT gateway, therefore enabling instances in -// the private subnet to connect to the internet. For more information, see -// NAT Gateways (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateNatGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGateway -func (c *EC2) CreateNatGateway(input *CreateNatGatewayInput) (*CreateNatGatewayOutput, error) { - req, out := c.CreateNatGatewayRequest(input) - return out, req.Send() -} - -// CreateNatGatewayWithContext is the same as CreateNatGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNatGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateNatGatewayWithContext(ctx aws.Context, input *CreateNatGatewayInput, opts ...request.Option) (*CreateNatGatewayOutput, error) { - req, out := c.CreateNatGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetworkAcl = "CreateNetworkAcl" - -// CreateNetworkAclRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetworkAcl operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateNetworkAcl for more information on using the CreateNetworkAcl -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateNetworkAclRequest method. -// req, resp := client.CreateNetworkAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAcl -func (c *EC2) CreateNetworkAclRequest(input *CreateNetworkAclInput) (req *request.Request, output *CreateNetworkAclOutput) { - op := &request.Operation{ - Name: opCreateNetworkAcl, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNetworkAclInput{} - } - - output = &CreateNetworkAclOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNetworkAcl API operation for Amazon Elastic Compute Cloud. -// -// Creates a network ACL in a VPC. Network ACLs provide an optional layer of -// security (in addition to security groups) for the instances in your VPC. -// -// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateNetworkAcl for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAcl -func (c *EC2) CreateNetworkAcl(input *CreateNetworkAclInput) (*CreateNetworkAclOutput, error) { - req, out := c.CreateNetworkAclRequest(input) - return out, req.Send() -} - -// CreateNetworkAclWithContext is the same as CreateNetworkAcl with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetworkAcl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateNetworkAclWithContext(ctx aws.Context, input *CreateNetworkAclInput, opts ...request.Option) (*CreateNetworkAclOutput, error) { - req, out := c.CreateNetworkAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetworkAclEntry = "CreateNetworkAclEntry" - -// CreateNetworkAclEntryRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetworkAclEntry operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateNetworkAclEntry for more information on using the CreateNetworkAclEntry -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateNetworkAclEntryRequest method. -// req, resp := client.CreateNetworkAclEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntry -func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) (req *request.Request, output *CreateNetworkAclEntryOutput) { - op := &request.Operation{ - Name: opCreateNetworkAclEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNetworkAclEntryInput{} - } - - output = &CreateNetworkAclEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateNetworkAclEntry API operation for Amazon Elastic Compute Cloud. -// -// Creates an entry (a rule) in a network ACL with the specified rule number. -// Each network ACL has a set of numbered ingress rules and a separate set of -// numbered egress rules. When determining whether a packet should be allowed -// in or out of a subnet associated with the ACL, we process the entries in -// the ACL according to the rule numbers, in ascending order. Each network ACL -// has a set of ingress rules and a separate set of egress rules. -// -// We recommend that you leave room between the rule numbers (for example, 100, -// 110, 120, ...), and not number them one right after the other (for example, -// 101, 102, 103, ...). This makes it easier to add a rule between existing -// ones without having to renumber the rules. -// -// After you add an entry, you can't modify it; you must either replace it, -// or create an entry and delete the old one. -// -// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateNetworkAclEntry for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntry -func (c *EC2) CreateNetworkAclEntry(input *CreateNetworkAclEntryInput) (*CreateNetworkAclEntryOutput, error) { - req, out := c.CreateNetworkAclEntryRequest(input) - return out, req.Send() -} - -// CreateNetworkAclEntryWithContext is the same as CreateNetworkAclEntry with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetworkAclEntry for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateNetworkAclEntryWithContext(ctx aws.Context, input *CreateNetworkAclEntryInput, opts ...request.Option) (*CreateNetworkAclEntryOutput, error) { - req, out := c.CreateNetworkAclEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetworkInterface = "CreateNetworkInterface" - -// CreateNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetworkInterface operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateNetworkInterface for more information on using the CreateNetworkInterface -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateNetworkInterfaceRequest method. -// req, resp := client.CreateNetworkInterfaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterface -func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) (req *request.Request, output *CreateNetworkInterfaceOutput) { - op := &request.Operation{ - Name: opCreateNetworkInterface, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNetworkInterfaceInput{} - } - - output = &CreateNetworkInterfaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNetworkInterface API operation for Amazon Elastic Compute Cloud. -// -// Creates a network interface in the specified subnet. -// -// For more information about network interfaces, see Elastic Network Interfaces -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in the -// Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateNetworkInterface for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterface -func (c *EC2) CreateNetworkInterface(input *CreateNetworkInterfaceInput) (*CreateNetworkInterfaceOutput, error) { - req, out := c.CreateNetworkInterfaceRequest(input) - return out, req.Send() -} - -// CreateNetworkInterfaceWithContext is the same as CreateNetworkInterface with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetworkInterface for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateNetworkInterfaceWithContext(ctx aws.Context, input *CreateNetworkInterfaceInput, opts ...request.Option) (*CreateNetworkInterfaceOutput, error) { - req, out := c.CreateNetworkInterfaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetworkInterfacePermission = "CreateNetworkInterfacePermission" - -// CreateNetworkInterfacePermissionRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetworkInterfacePermission operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateNetworkInterfacePermission for more information on using the CreateNetworkInterfacePermission -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateNetworkInterfacePermissionRequest method. -// req, resp := client.CreateNetworkInterfacePermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterfacePermission -func (c *EC2) CreateNetworkInterfacePermissionRequest(input *CreateNetworkInterfacePermissionInput) (req *request.Request, output *CreateNetworkInterfacePermissionOutput) { - op := &request.Operation{ - Name: opCreateNetworkInterfacePermission, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNetworkInterfacePermissionInput{} - } - - output = &CreateNetworkInterfacePermissionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNetworkInterfacePermission API operation for Amazon Elastic Compute Cloud. -// -// Grants an AWS-authorized account permission to attach the specified network -// interface to an instance in their account. -// -// You can grant permission to a single AWS account only, and only one account -// at a time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateNetworkInterfacePermission for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterfacePermission -func (c *EC2) CreateNetworkInterfacePermission(input *CreateNetworkInterfacePermissionInput) (*CreateNetworkInterfacePermissionOutput, error) { - req, out := c.CreateNetworkInterfacePermissionRequest(input) - return out, req.Send() -} - -// CreateNetworkInterfacePermissionWithContext is the same as CreateNetworkInterfacePermission with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetworkInterfacePermission for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateNetworkInterfacePermissionWithContext(ctx aws.Context, input *CreateNetworkInterfacePermissionInput, opts ...request.Option) (*CreateNetworkInterfacePermissionOutput, error) { - req, out := c.CreateNetworkInterfacePermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePlacementGroup = "CreatePlacementGroup" - -// CreatePlacementGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreatePlacementGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreatePlacementGroup for more information on using the CreatePlacementGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreatePlacementGroupRequest method. -// req, resp := client.CreatePlacementGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroup -func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req *request.Request, output *CreatePlacementGroupOutput) { - op := &request.Operation{ - Name: opCreatePlacementGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePlacementGroupInput{} - } - - output = &CreatePlacementGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreatePlacementGroup API operation for Amazon Elastic Compute Cloud. -// -// Creates a placement group in which to launch instances. The strategy of the -// placement group determines how the instances are organized within the group. -// -// A cluster placement group is a logical grouping of instances within a single -// Availability Zone that benefit from low network latency, high network throughput. -// A spread placement group places instances on distinct hardware. -// -// For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreatePlacementGroup for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroup -func (c *EC2) CreatePlacementGroup(input *CreatePlacementGroupInput) (*CreatePlacementGroupOutput, error) { - req, out := c.CreatePlacementGroupRequest(input) - return out, req.Send() -} - -// CreatePlacementGroupWithContext is the same as CreatePlacementGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePlacementGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreatePlacementGroupWithContext(ctx aws.Context, input *CreatePlacementGroupInput, opts ...request.Option) (*CreatePlacementGroupOutput, error) { - req, out := c.CreatePlacementGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateReservedInstancesListing = "CreateReservedInstancesListing" - -// CreateReservedInstancesListingRequest generates a "aws/request.Request" representing the -// client's request for the CreateReservedInstancesListing operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateReservedInstancesListing for more information on using the CreateReservedInstancesListing -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateReservedInstancesListingRequest method. -// req, resp := client.CreateReservedInstancesListingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListing -func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstancesListingInput) (req *request.Request, output *CreateReservedInstancesListingOutput) { - op := &request.Operation{ - Name: opCreateReservedInstancesListing, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReservedInstancesListingInput{} - } - - output = &CreateReservedInstancesListingOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReservedInstancesListing API operation for Amazon Elastic Compute Cloud. -// -// Creates a listing for Amazon EC2 Standard Reserved Instances to be sold in -// the Reserved Instance Marketplace. You can submit one Standard Reserved Instance -// listing at a time. To get a list of your Standard Reserved Instances, you -// can use the DescribeReservedInstances operation. -// -// Only Standard Reserved Instances with a capacity reservation can be sold -// in the Reserved Instance Marketplace. Convertible Reserved Instances and -// Standard Reserved Instances with a regional benefit cannot be sold. -// -// The Reserved Instance Marketplace matches sellers who want to resell Standard -// Reserved Instance capacity that they no longer need with buyers who want -// to purchase additional capacity. Reserved Instances bought and sold through -// the Reserved Instance Marketplace work like any other Reserved Instances. -// -// To sell your Standard Reserved Instances, you must first register as a seller -// in the Reserved Instance Marketplace. After completing the registration process, -// you can create a Reserved Instance Marketplace listing of some or all of -// your Standard Reserved Instances, and specify the upfront price to receive -// for them. Your Standard Reserved Instance listings then become available -// for purchase. To view the details of your Standard Reserved Instance listing, -// you can use the DescribeReservedInstancesListings operation. -// -// For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateReservedInstancesListing for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListing -func (c *EC2) CreateReservedInstancesListing(input *CreateReservedInstancesListingInput) (*CreateReservedInstancesListingOutput, error) { - req, out := c.CreateReservedInstancesListingRequest(input) - return out, req.Send() -} - -// CreateReservedInstancesListingWithContext is the same as CreateReservedInstancesListing with the addition of -// the ability to pass a context and additional request options. -// -// See CreateReservedInstancesListing for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateReservedInstancesListingWithContext(ctx aws.Context, input *CreateReservedInstancesListingInput, opts ...request.Option) (*CreateReservedInstancesListingOutput, error) { - req, out := c.CreateReservedInstancesListingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRoute = "CreateRoute" - -// CreateRouteRequest generates a "aws/request.Request" representing the -// client's request for the CreateRoute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateRoute for more information on using the CreateRoute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateRouteRequest method. -// req, resp := client.CreateRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRoute -func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request, output *CreateRouteOutput) { - op := &request.Operation{ - Name: opCreateRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRouteInput{} - } - - output = &CreateRouteOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRoute API operation for Amazon Elastic Compute Cloud. -// -// Creates a route in a route table within a VPC. -// -// You must specify one of the following targets: Internet gateway or virtual -// private gateway, NAT instance, NAT gateway, VPC peering connection, network -// interface, or egress-only Internet gateway. -// -// When determining how to route traffic, we use the route with the most specific -// match. For example, traffic is destined for the IPv4 address 192.0.2.3, and -// the route table includes the following two IPv4 routes: -// -// * 192.0.2.0/24 (goes to some target A) -// -// * 192.0.2.0/28 (goes to some target B) -// -// Both routes apply to the traffic destined for 192.0.2.3. However, the second -// route in the list covers a smaller number of IP addresses and is therefore -// more specific, so we use that route to determine where to target the traffic. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateRoute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRoute -func (c *EC2) CreateRoute(input *CreateRouteInput) (*CreateRouteOutput, error) { - req, out := c.CreateRouteRequest(input) - return out, req.Send() -} - -// CreateRouteWithContext is the same as CreateRoute with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRoute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateRouteWithContext(ctx aws.Context, input *CreateRouteInput, opts ...request.Option) (*CreateRouteOutput, error) { - req, out := c.CreateRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRouteTable = "CreateRouteTable" - -// CreateRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the CreateRouteTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateRouteTable for more information on using the CreateRouteTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateRouteTableRequest method. -// req, resp := client.CreateRouteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTable -func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *request.Request, output *CreateRouteTableOutput) { - op := &request.Operation{ - Name: opCreateRouteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRouteTableInput{} - } - - output = &CreateRouteTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRouteTable API operation for Amazon Elastic Compute Cloud. -// -// Creates a route table for the specified VPC. After you create a route table, -// you can add routes and associate the table with a subnet. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateRouteTable for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTable -func (c *EC2) CreateRouteTable(input *CreateRouteTableInput) (*CreateRouteTableOutput, error) { - req, out := c.CreateRouteTableRequest(input) - return out, req.Send() -} - -// CreateRouteTableWithContext is the same as CreateRouteTable with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRouteTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateRouteTableWithContext(ctx aws.Context, input *CreateRouteTableInput, opts ...request.Option) (*CreateRouteTableOutput, error) { - req, out := c.CreateRouteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSecurityGroup = "CreateSecurityGroup" - -// CreateSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateSecurityGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateSecurityGroup for more information on using the CreateSecurityGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateSecurityGroupRequest method. -// req, resp := client.CreateSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroup -func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *request.Request, output *CreateSecurityGroupOutput) { - op := &request.Operation{ - Name: opCreateSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSecurityGroupInput{} - } - - output = &CreateSecurityGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSecurityGroup API operation for Amazon Elastic Compute Cloud. -// -// Creates a security group. -// -// A security group is for use with instances either in the EC2-Classic platform -// or in a specific VPC. For more information, see Amazon EC2 Security Groups -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) -// in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your -// VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// EC2-Classic: You can have up to 500 security groups. -// -// EC2-VPC: You can create up to 500 security groups per VPC. -// -// When you create a security group, you specify a friendly name of your choice. -// You can have a security group for use in EC2-Classic with the same name as -// a security group for use in a VPC. However, you can't have two security groups -// for use in EC2-Classic with the same name or two security groups for use -// in a VPC with the same name. -// -// You have a default security group for use in EC2-Classic and a default security -// group for use in your VPC. If you don't specify a security group when you -// launch an instance, the instance is launched into the appropriate default -// security group. A default security group includes a default rule that grants -// instances unrestricted network access to each other. -// -// You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, -// AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateSecurityGroup for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroup -func (c *EC2) CreateSecurityGroup(input *CreateSecurityGroupInput) (*CreateSecurityGroupOutput, error) { - req, out := c.CreateSecurityGroupRequest(input) - return out, req.Send() -} - -// CreateSecurityGroupWithContext is the same as CreateSecurityGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSecurityGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateSecurityGroupWithContext(ctx aws.Context, input *CreateSecurityGroupInput, opts ...request.Option) (*CreateSecurityGroupOutput, error) { - req, out := c.CreateSecurityGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSnapshot = "CreateSnapshot" - -// CreateSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateSnapshot operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateSnapshot for more information on using the CreateSnapshot -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateSnapshotRequest method. -// req, resp := client.CreateSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshot -func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *Snapshot) { - op := &request.Operation{ - Name: opCreateSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSnapshotInput{} - } - - output = &Snapshot{} - req = c.newRequest(op, input, output) - return -} - -// CreateSnapshot API operation for Amazon Elastic Compute Cloud. -// -// Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use -// snapshots for backups, to make copies of EBS volumes, and to save data before -// shutting down an instance. -// -// When a snapshot is created, any AWS Marketplace product codes that are associated -// with the source volume are propagated to the snapshot. -// -// You can take a snapshot of an attached volume that is in use. However, snapshots -// only capture data that has been written to your EBS volume at the time the -// snapshot command is issued; this may exclude any data that has been cached -// by any applications or the operating system. If you can pause any file systems -// on the volume long enough to take a snapshot, your snapshot should be complete. -// However, if you cannot pause all file writes to the volume, you should unmount -// the volume from within the instance, issue the snapshot command, and then -// remount the volume to ensure a consistent and complete snapshot. You may -// remount and use your volume while the snapshot status is pending. -// -// To create a snapshot for EBS volumes that serve as root devices, you should -// stop the instance before taking the snapshot. -// -// Snapshots that are taken from encrypted volumes are automatically encrypted. -// Volumes that are created from encrypted snapshots are also automatically -// encrypted. Your encrypted volumes and any associated snapshots always remain -// protected. -// -// You can tag your snapshots during creation. For more information, see Tagging -// Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). -// -// For more information, see Amazon Elastic Block Store (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) -// and Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateSnapshot for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshot -func (c *EC2) CreateSnapshot(input *CreateSnapshotInput) (*Snapshot, error) { - req, out := c.CreateSnapshotRequest(input) - return out, req.Send() -} - -// CreateSnapshotWithContext is the same as CreateSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSnapshot for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*Snapshot, error) { - req, out := c.CreateSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSpotDatafeedSubscription = "CreateSpotDatafeedSubscription" - -// CreateSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the CreateSpotDatafeedSubscription operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateSpotDatafeedSubscription for more information on using the CreateSpotDatafeedSubscription -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateSpotDatafeedSubscriptionRequest method. -// req, resp := client.CreateSpotDatafeedSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscription -func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSubscriptionInput) (req *request.Request, output *CreateSpotDatafeedSubscriptionOutput) { - op := &request.Operation{ - Name: opCreateSpotDatafeedSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSpotDatafeedSubscriptionInput{} - } - - output = &CreateSpotDatafeedSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. -// -// Creates a data feed for Spot Instances, enabling you to view Spot Instance -// usage logs. You can create one data feed per AWS account. For more information, -// see Spot Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) -// in the Amazon EC2 User Guide for Linux Instances. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateSpotDatafeedSubscription for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscription -func (c *EC2) CreateSpotDatafeedSubscription(input *CreateSpotDatafeedSubscriptionInput) (*CreateSpotDatafeedSubscriptionOutput, error) { - req, out := c.CreateSpotDatafeedSubscriptionRequest(input) - return out, req.Send() -} - -// CreateSpotDatafeedSubscriptionWithContext is the same as CreateSpotDatafeedSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSpotDatafeedSubscription for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *CreateSpotDatafeedSubscriptionInput, opts ...request.Option) (*CreateSpotDatafeedSubscriptionOutput, error) { - req, out := c.CreateSpotDatafeedSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSubnet = "CreateSubnet" - -// CreateSubnetRequest generates a "aws/request.Request" representing the -// client's request for the CreateSubnet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateSubnet for more information on using the CreateSubnet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateSubnetRequest method. -// req, resp := client.CreateSubnetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnet -func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Request, output *CreateSubnetOutput) { - op := &request.Operation{ - Name: opCreateSubnet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSubnetInput{} - } - - output = &CreateSubnetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSubnet API operation for Amazon Elastic Compute Cloud. -// -// Creates a subnet in an existing VPC. -// -// When you create each subnet, you provide the VPC ID and the IPv4 CIDR block -// you want for the subnet. After you create a subnet, you can't change its -// CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a -// VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create -// more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. -// The smallest IPv4 subnet (and VPC) you can create uses a /28 netmask (16 -// IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). -// -// If you've associated an IPv6 CIDR block with your VPC, you can create a subnet -// with an IPv6 CIDR block that uses a /64 prefix length. -// -// AWS reserves both the first four and the last IPv4 address in each subnet's -// CIDR block. They're not available for use. -// -// If you add more than one subnet to a VPC, they're set up in a star topology -// with a logical router in the middle. -// -// If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP -// address doesn't change if you stop and restart the instance (unlike a similar -// instance launched outside a VPC, which gets a new IP address when restarted). -// It's therefore possible to have a subnet with no running instances (they're -// all stopped), but no remaining IP addresses available. -// -// For more information about subnets, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateSubnet for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnet -func (c *EC2) CreateSubnet(input *CreateSubnetInput) (*CreateSubnetOutput, error) { - req, out := c.CreateSubnetRequest(input) - return out, req.Send() -} - -// CreateSubnetWithContext is the same as CreateSubnet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSubnet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateSubnetWithContext(ctx aws.Context, input *CreateSubnetInput, opts ...request.Option) (*CreateSubnetOutput, error) { - req, out := c.CreateSubnetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTags = "CreateTags" - -// CreateTagsRequest generates a "aws/request.Request" representing the -// client's request for the CreateTags operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateTags for more information on using the CreateTags -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateTagsRequest method. -// req, resp := client.CreateTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTags -func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, output *CreateTagsOutput) { - op := &request.Operation{ - Name: opCreateTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTagsInput{} - } - - output = &CreateTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateTags API operation for Amazon Elastic Compute Cloud. -// -// Adds or overwrites one or more tags for the specified Amazon EC2 resource -// or resources. Each resource can have a maximum of 50 tags. Each tag consists -// of a key and optional value. Tag keys must be unique per resource. -// -// For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) -// in the Amazon Elastic Compute Cloud User Guide. For more information about -// creating IAM policies that control users' access to resources based on tags, -// see Supported Resource-Level Permissions for Amazon EC2 API Actions (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-iam-actions-resources.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateTags for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTags -func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { - req, out := c.CreateTagsRequest(input) - return out, req.Send() -} - -// CreateTagsWithContext is the same as CreateTags with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opts ...request.Option) (*CreateTagsOutput, error) { - req, out := c.CreateTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVolume = "CreateVolume" - -// CreateVolumeRequest generates a "aws/request.Request" representing the -// client's request for the CreateVolume operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVolume for more information on using the CreateVolume -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVolumeRequest method. -// req, resp := client.CreateVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolume -func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Request, output *Volume) { - op := &request.Operation{ - Name: opCreateVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVolumeInput{} - } - - output = &Volume{} - req = c.newRequest(op, input, output) - return -} - -// CreateVolume API operation for Amazon Elastic Compute Cloud. -// -// Creates an EBS volume that can be attached to an instance in the same Availability -// Zone. The volume is created in the regional endpoint that you send the HTTP -// request to. For more information see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). -// -// You can create a new empty volume or restore a volume from an EBS snapshot. -// Any AWS Marketplace product codes from the snapshot are propagated to the -// volume. -// -// You can create encrypted volumes with the Encrypted parameter. Encrypted -// volumes may only be attached to instances that support Amazon EBS encryption. -// Volumes that are created from encrypted snapshots are also automatically -// encrypted. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// You can tag your volumes during creation. For more information, see Tagging -// Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). -// -// For more information, see Creating an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVolume for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolume -func (c *EC2) CreateVolume(input *CreateVolumeInput) (*Volume, error) { - req, out := c.CreateVolumeRequest(input) - return out, req.Send() -} - -// CreateVolumeWithContext is the same as CreateVolume with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVolume for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVolumeWithContext(ctx aws.Context, input *CreateVolumeInput, opts ...request.Option) (*Volume, error) { - req, out := c.CreateVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpc = "CreateVpc" - -// CreateVpcRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpc operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVpc for more information on using the CreateVpc -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVpcRequest method. -// req, resp := client.CreateVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpc -func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, output *CreateVpcOutput) { - op := &request.Operation{ - Name: opCreateVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcInput{} - } - - output = &CreateVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpc API operation for Amazon Elastic Compute Cloud. -// -// Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can -// create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 -// netmask (65,536 IPv4 addresses). To help you decide how big to make your -// VPC, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// You can optionally request an Amazon-provided IPv6 CIDR block for the VPC. -// The IPv6 CIDR block uses a /56 prefix length, and is allocated from Amazon's -// pool of IPv6 addresses. You cannot choose the IPv6 range for your VPC. -// -// By default, each instance you launch in the VPC has the default DHCP options, -// which includes only a default DNS server that we provide (AmazonProvidedDNS). -// For more information about DHCP options, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// You can specify the instance tenancy value for the VPC when you create it. -// You can't change this value for the VPC after you create it. For more information, -// see Dedicated Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVpc for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpc -func (c *EC2) CreateVpc(input *CreateVpcInput) (*CreateVpcOutput, error) { - req, out := c.CreateVpcRequest(input) - return out, req.Send() -} - -// CreateVpcWithContext is the same as CreateVpc with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpc for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVpcWithContext(ctx aws.Context, input *CreateVpcInput, opts ...request.Option) (*CreateVpcOutput, error) { - req, out := c.CreateVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpcEndpoint = "CreateVpcEndpoint" - -// CreateVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpcEndpoint operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVpcEndpoint for more information on using the CreateVpcEndpoint -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVpcEndpointRequest method. -// req, resp := client.CreateVpcEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpoint -func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *request.Request, output *CreateVpcEndpointOutput) { - op := &request.Operation{ - Name: opCreateVpcEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcEndpointInput{} - } - - output = &CreateVpcEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpcEndpoint API operation for Amazon Elastic Compute Cloud. -// -// Creates a VPC endpoint for a specified service. An endpoint enables you to -// create a private connection between your VPC and the service. The service -// may be provided by AWS, an AWS Marketplace partner, or another AWS account. -// For more information, see VPC Endpoints (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// A gateway endpoint serves as a target for a route in your route table for -// traffic destined for the AWS service. You can specify an endpoint policy -// to attach to the endpoint that will control access to the service from your -// VPC. You can also specify the VPC route tables that use the endpoint. -// -// An interface endpoint is a network interface in your subnet that serves as -// an endpoint for communicating with the specified service. You can specify -// the subnets in which to create an endpoint, and the security groups to associate -// with the endpoint network interface. -// -// Use DescribeVpcEndpointServices to get a list of supported services. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVpcEndpoint for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpoint -func (c *EC2) CreateVpcEndpoint(input *CreateVpcEndpointInput) (*CreateVpcEndpointOutput, error) { - req, out := c.CreateVpcEndpointRequest(input) - return out, req.Send() -} - -// CreateVpcEndpointWithContext is the same as CreateVpcEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpcEndpoint for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVpcEndpointWithContext(ctx aws.Context, input *CreateVpcEndpointInput, opts ...request.Option) (*CreateVpcEndpointOutput, error) { - req, out := c.CreateVpcEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpcEndpointConnectionNotification = "CreateVpcEndpointConnectionNotification" - -// CreateVpcEndpointConnectionNotificationRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpcEndpointConnectionNotification operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVpcEndpointConnectionNotification for more information on using the CreateVpcEndpointConnectionNotification -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVpcEndpointConnectionNotificationRequest method. -// req, resp := client.CreateVpcEndpointConnectionNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointConnectionNotification -func (c *EC2) CreateVpcEndpointConnectionNotificationRequest(input *CreateVpcEndpointConnectionNotificationInput) (req *request.Request, output *CreateVpcEndpointConnectionNotificationOutput) { - op := &request.Operation{ - Name: opCreateVpcEndpointConnectionNotification, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcEndpointConnectionNotificationInput{} - } - - output = &CreateVpcEndpointConnectionNotificationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpcEndpointConnectionNotification API operation for Amazon Elastic Compute Cloud. -// -// Creates a connection notification for a specified VPC endpoint or VPC endpoint -// service. A connection notification notifies you of specific endpoint events. -// You must create an SNS topic to receive notifications. For more information, -// see Create a Topic (http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html) -// in the Amazon Simple Notification Service Developer Guide. -// -// You can create a connection notification for interface endpoints only. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVpcEndpointConnectionNotification for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointConnectionNotification -func (c *EC2) CreateVpcEndpointConnectionNotification(input *CreateVpcEndpointConnectionNotificationInput) (*CreateVpcEndpointConnectionNotificationOutput, error) { - req, out := c.CreateVpcEndpointConnectionNotificationRequest(input) - return out, req.Send() -} - -// CreateVpcEndpointConnectionNotificationWithContext is the same as CreateVpcEndpointConnectionNotification with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpcEndpointConnectionNotification for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVpcEndpointConnectionNotificationWithContext(ctx aws.Context, input *CreateVpcEndpointConnectionNotificationInput, opts ...request.Option) (*CreateVpcEndpointConnectionNotificationOutput, error) { - req, out := c.CreateVpcEndpointConnectionNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpcEndpointServiceConfiguration = "CreateVpcEndpointServiceConfiguration" - -// CreateVpcEndpointServiceConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpcEndpointServiceConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVpcEndpointServiceConfiguration for more information on using the CreateVpcEndpointServiceConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVpcEndpointServiceConfigurationRequest method. -// req, resp := client.CreateVpcEndpointServiceConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointServiceConfiguration -func (c *EC2) CreateVpcEndpointServiceConfigurationRequest(input *CreateVpcEndpointServiceConfigurationInput) (req *request.Request, output *CreateVpcEndpointServiceConfigurationOutput) { - op := &request.Operation{ - Name: opCreateVpcEndpointServiceConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcEndpointServiceConfigurationInput{} - } - - output = &CreateVpcEndpointServiceConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpcEndpointServiceConfiguration API operation for Amazon Elastic Compute Cloud. -// -// Creates a VPC endpoint service configuration to which service consumers (AWS -// accounts, IAM users, and IAM roles) can connect. Service consumers can create -// an interface VPC endpoint to connect to your service. -// -// To create an endpoint service configuration, you must first create a Network -// Load Balancer for your service. For more information, see VPC Endpoint Services -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/endpoint-service.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVpcEndpointServiceConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointServiceConfiguration -func (c *EC2) CreateVpcEndpointServiceConfiguration(input *CreateVpcEndpointServiceConfigurationInput) (*CreateVpcEndpointServiceConfigurationOutput, error) { - req, out := c.CreateVpcEndpointServiceConfigurationRequest(input) - return out, req.Send() -} - -// CreateVpcEndpointServiceConfigurationWithContext is the same as CreateVpcEndpointServiceConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpcEndpointServiceConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVpcEndpointServiceConfigurationWithContext(ctx aws.Context, input *CreateVpcEndpointServiceConfigurationInput, opts ...request.Option) (*CreateVpcEndpointServiceConfigurationOutput, error) { - req, out := c.CreateVpcEndpointServiceConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" - -// CreateVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpcPeeringConnection operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVpcPeeringConnection for more information on using the CreateVpcPeeringConnection -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVpcPeeringConnectionRequest method. -// req, resp := client.CreateVpcPeeringConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnection -func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectionInput) (req *request.Request, output *CreateVpcPeeringConnectionOutput) { - op := &request.Operation{ - Name: opCreateVpcPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcPeeringConnectionInput{} - } - - output = &CreateVpcPeeringConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. -// -// Requests a VPC peering connection between two VPCs: a requester VPC that -// you own and an accepter VPC with which to create the connection. The accepter -// VPC can belong to another AWS account and can be in a different region to -// the requester VPC. The requester VPC and accepter VPC cannot have overlapping -// CIDR blocks. -// -// Limitations and rules apply to a VPC peering connection. For more information, -// see the limitations (http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/vpc-peering-basics.html#vpc-peering-limitations) -// section in the VPC Peering Guide. -// -// The owner of the accepter VPC must accept the peering request to activate -// the peering connection. The VPC peering connection request expires after -// 7 days, after which it cannot be accepted or rejected. -// -// If you create a VPC peering connection request between VPCs with overlapping -// CIDR blocks, the VPC peering connection has a status of failed. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVpcPeeringConnection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnection -func (c *EC2) CreateVpcPeeringConnection(input *CreateVpcPeeringConnectionInput) (*CreateVpcPeeringConnectionOutput, error) { - req, out := c.CreateVpcPeeringConnectionRequest(input) - return out, req.Send() -} - -// CreateVpcPeeringConnectionWithContext is the same as CreateVpcPeeringConnection with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpcPeeringConnection for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVpcPeeringConnectionWithContext(ctx aws.Context, input *CreateVpcPeeringConnectionInput, opts ...request.Option) (*CreateVpcPeeringConnectionOutput, error) { - req, out := c.CreateVpcPeeringConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpnConnection = "CreateVpnConnection" - -// CreateVpnConnectionRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpnConnection operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVpnConnection for more information on using the CreateVpnConnection -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVpnConnectionRequest method. -// req, resp := client.CreateVpnConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnection -func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req *request.Request, output *CreateVpnConnectionOutput) { - op := &request.Operation{ - Name: opCreateVpnConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpnConnectionInput{} - } - - output = &CreateVpnConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpnConnection API operation for Amazon Elastic Compute Cloud. -// -// Creates a VPN connection between an existing virtual private gateway and -// a VPN customer gateway. The only supported connection type is ipsec.1. -// -// The response includes information that you need to give to your network administrator -// to configure your customer gateway. -// -// We strongly recommend that you use HTTPS when calling this operation because -// the response contains sensitive cryptographic information for configuring -// your customer gateway. -// -// If you decide to shut down your VPN connection for any reason and later create -// a new VPN connection, you must reconfigure your customer gateway with the -// new information returned from this call. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error. -// -// For more information, see AWS Managed VPN Connections (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVpnConnection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnection -func (c *EC2) CreateVpnConnection(input *CreateVpnConnectionInput) (*CreateVpnConnectionOutput, error) { - req, out := c.CreateVpnConnectionRequest(input) - return out, req.Send() -} - -// CreateVpnConnectionWithContext is the same as CreateVpnConnection with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpnConnection for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVpnConnectionWithContext(ctx aws.Context, input *CreateVpnConnectionInput, opts ...request.Option) (*CreateVpnConnectionOutput, error) { - req, out := c.CreateVpnConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpnConnectionRoute = "CreateVpnConnectionRoute" - -// CreateVpnConnectionRouteRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpnConnectionRoute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVpnConnectionRoute for more information on using the CreateVpnConnectionRoute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVpnConnectionRouteRequest method. -// req, resp := client.CreateVpnConnectionRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRoute -func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInput) (req *request.Request, output *CreateVpnConnectionRouteOutput) { - op := &request.Operation{ - Name: opCreateVpnConnectionRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpnConnectionRouteInput{} - } - - output = &CreateVpnConnectionRouteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateVpnConnectionRoute API operation for Amazon Elastic Compute Cloud. -// -// Creates a static route associated with a VPN connection between an existing -// virtual private gateway and a VPN customer gateway. The static route allows -// traffic to be routed from the virtual private gateway to the VPN customer -// gateway. -// -// For more information about VPN connections, see AWS Managed VPN Connections -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) in the -// Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVpnConnectionRoute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRoute -func (c *EC2) CreateVpnConnectionRoute(input *CreateVpnConnectionRouteInput) (*CreateVpnConnectionRouteOutput, error) { - req, out := c.CreateVpnConnectionRouteRequest(input) - return out, req.Send() -} - -// CreateVpnConnectionRouteWithContext is the same as CreateVpnConnectionRoute with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpnConnectionRoute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVpnConnectionRouteWithContext(ctx aws.Context, input *CreateVpnConnectionRouteInput, opts ...request.Option) (*CreateVpnConnectionRouteOutput, error) { - req, out := c.CreateVpnConnectionRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpnGateway = "CreateVpnGateway" - -// CreateVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpnGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateVpnGateway for more information on using the CreateVpnGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateVpnGatewayRequest method. -// req, resp := client.CreateVpnGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGateway -func (c *EC2) CreateVpnGatewayRequest(input *CreateVpnGatewayInput) (req *request.Request, output *CreateVpnGatewayOutput) { - op := &request.Operation{ - Name: opCreateVpnGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpnGatewayInput{} - } - - output = &CreateVpnGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpnGateway API operation for Amazon Elastic Compute Cloud. -// -// Creates a virtual private gateway. A virtual private gateway is the endpoint -// on the VPC side of your VPN connection. You can create a virtual private -// gateway before creating the VPC itself. -// -// For more information about virtual private gateways, see AWS Managed VPN -// Connections (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation CreateVpnGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGateway -func (c *EC2) CreateVpnGateway(input *CreateVpnGatewayInput) (*CreateVpnGatewayOutput, error) { - req, out := c.CreateVpnGatewayRequest(input) - return out, req.Send() -} - -// CreateVpnGatewayWithContext is the same as CreateVpnGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpnGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) CreateVpnGatewayWithContext(ctx aws.Context, input *CreateVpnGatewayInput, opts ...request.Option) (*CreateVpnGatewayOutput, error) { - req, out := c.CreateVpnGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCustomerGateway = "DeleteCustomerGateway" - -// DeleteCustomerGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCustomerGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteCustomerGateway for more information on using the DeleteCustomerGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteCustomerGatewayRequest method. -// req, resp := client.DeleteCustomerGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGateway -func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (req *request.Request, output *DeleteCustomerGatewayOutput) { - op := &request.Operation{ - Name: opDeleteCustomerGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCustomerGatewayInput{} - } - - output = &DeleteCustomerGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCustomerGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified customer gateway. You must delete the VPN connection -// before you can delete the customer gateway. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteCustomerGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGateway -func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (*DeleteCustomerGatewayOutput, error) { - req, out := c.DeleteCustomerGatewayRequest(input) - return out, req.Send() -} - -// DeleteCustomerGatewayWithContext is the same as DeleteCustomerGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCustomerGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteCustomerGatewayWithContext(ctx aws.Context, input *DeleteCustomerGatewayInput, opts ...request.Option) (*DeleteCustomerGatewayOutput, error) { - req, out := c.DeleteCustomerGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDhcpOptions = "DeleteDhcpOptions" - -// DeleteDhcpOptionsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDhcpOptions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteDhcpOptions for more information on using the DeleteDhcpOptions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteDhcpOptionsRequest method. -// req, resp := client.DeleteDhcpOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptions -func (c *EC2) DeleteDhcpOptionsRequest(input *DeleteDhcpOptionsInput) (req *request.Request, output *DeleteDhcpOptionsOutput) { - op := &request.Operation{ - Name: opDeleteDhcpOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDhcpOptionsInput{} - } - - output = &DeleteDhcpOptionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDhcpOptions API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified set of DHCP options. You must disassociate the set -// of DHCP options before you can delete it. You can disassociate the set of -// DHCP options by associating either a new set of options or the default set -// of options with the VPC. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteDhcpOptions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptions -func (c *EC2) DeleteDhcpOptions(input *DeleteDhcpOptionsInput) (*DeleteDhcpOptionsOutput, error) { - req, out := c.DeleteDhcpOptionsRequest(input) - return out, req.Send() -} - -// DeleteDhcpOptionsWithContext is the same as DeleteDhcpOptions with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDhcpOptions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteDhcpOptionsWithContext(ctx aws.Context, input *DeleteDhcpOptionsInput, opts ...request.Option) (*DeleteDhcpOptionsOutput, error) { - req, out := c.DeleteDhcpOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEgressOnlyInternetGateway = "DeleteEgressOnlyInternetGateway" - -// DeleteEgressOnlyInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEgressOnlyInternetGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteEgressOnlyInternetGateway for more information on using the DeleteEgressOnlyInternetGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteEgressOnlyInternetGatewayRequest method. -// req, resp := client.DeleteEgressOnlyInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGateway -func (c *EC2) DeleteEgressOnlyInternetGatewayRequest(input *DeleteEgressOnlyInternetGatewayInput) (req *request.Request, output *DeleteEgressOnlyInternetGatewayOutput) { - op := &request.Operation{ - Name: opDeleteEgressOnlyInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEgressOnlyInternetGatewayInput{} - } - - output = &DeleteEgressOnlyInternetGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteEgressOnlyInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes an egress-only Internet gateway. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteEgressOnlyInternetGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGateway -func (c *EC2) DeleteEgressOnlyInternetGateway(input *DeleteEgressOnlyInternetGatewayInput) (*DeleteEgressOnlyInternetGatewayOutput, error) { - req, out := c.DeleteEgressOnlyInternetGatewayRequest(input) - return out, req.Send() -} - -// DeleteEgressOnlyInternetGatewayWithContext is the same as DeleteEgressOnlyInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEgressOnlyInternetGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteEgressOnlyInternetGatewayWithContext(ctx aws.Context, input *DeleteEgressOnlyInternetGatewayInput, opts ...request.Option) (*DeleteEgressOnlyInternetGatewayOutput, error) { - req, out := c.DeleteEgressOnlyInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteFleets = "DeleteFleets" - -// DeleteFleetsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFleets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteFleets for more information on using the DeleteFleets -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteFleetsRequest method. -// req, resp := client.DeleteFleetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFleets -func (c *EC2) DeleteFleetsRequest(input *DeleteFleetsInput) (req *request.Request, output *DeleteFleetsOutput) { - op := &request.Operation{ - Name: opDeleteFleets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteFleetsInput{} - } - - output = &DeleteFleetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteFleets API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified EC2 Fleet. -// -// After you delete an EC2 Fleet, the EC2 Fleet launches no new instances. You -// must specify whether the EC2 Fleet should also terminate its instances. If -// you terminate the instances, the EC2 Fleet enters the deleted_terminating -// state. Otherwise, the EC2 Fleet enters the deleted_running state, and the -// instances continue to run until they are interrupted or you terminate them -// manually. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteFleets for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFleets -func (c *EC2) DeleteFleets(input *DeleteFleetsInput) (*DeleteFleetsOutput, error) { - req, out := c.DeleteFleetsRequest(input) - return out, req.Send() -} - -// DeleteFleetsWithContext is the same as DeleteFleets with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteFleets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteFleetsWithContext(ctx aws.Context, input *DeleteFleetsInput, opts ...request.Option) (*DeleteFleetsOutput, error) { - req, out := c.DeleteFleetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteFlowLogs = "DeleteFlowLogs" - -// DeleteFlowLogsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFlowLogs operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteFlowLogs for more information on using the DeleteFlowLogs -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteFlowLogsRequest method. -// req, resp := client.DeleteFlowLogsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogs -func (c *EC2) DeleteFlowLogsRequest(input *DeleteFlowLogsInput) (req *request.Request, output *DeleteFlowLogsOutput) { - op := &request.Operation{ - Name: opDeleteFlowLogs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteFlowLogsInput{} - } - - output = &DeleteFlowLogsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteFlowLogs API operation for Amazon Elastic Compute Cloud. -// -// Deletes one or more flow logs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteFlowLogs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogs -func (c *EC2) DeleteFlowLogs(input *DeleteFlowLogsInput) (*DeleteFlowLogsOutput, error) { - req, out := c.DeleteFlowLogsRequest(input) - return out, req.Send() -} - -// DeleteFlowLogsWithContext is the same as DeleteFlowLogs with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteFlowLogs for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteFlowLogsWithContext(ctx aws.Context, input *DeleteFlowLogsInput, opts ...request.Option) (*DeleteFlowLogsOutput, error) { - req, out := c.DeleteFlowLogsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteFpgaImage = "DeleteFpgaImage" - -// DeleteFpgaImageRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFpgaImage operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteFpgaImage for more information on using the DeleteFpgaImage -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteFpgaImageRequest method. -// req, resp := client.DeleteFpgaImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFpgaImage -func (c *EC2) DeleteFpgaImageRequest(input *DeleteFpgaImageInput) (req *request.Request, output *DeleteFpgaImageOutput) { - op := &request.Operation{ - Name: opDeleteFpgaImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteFpgaImageInput{} - } - - output = &DeleteFpgaImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteFpgaImage API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified Amazon FPGA Image (AFI). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteFpgaImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFpgaImage -func (c *EC2) DeleteFpgaImage(input *DeleteFpgaImageInput) (*DeleteFpgaImageOutput, error) { - req, out := c.DeleteFpgaImageRequest(input) - return out, req.Send() -} - -// DeleteFpgaImageWithContext is the same as DeleteFpgaImage with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteFpgaImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteFpgaImageWithContext(ctx aws.Context, input *DeleteFpgaImageInput, opts ...request.Option) (*DeleteFpgaImageOutput, error) { - req, out := c.DeleteFpgaImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteInternetGateway = "DeleteInternetGateway" - -// DeleteInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteInternetGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteInternetGateway for more information on using the DeleteInternetGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteInternetGatewayRequest method. -// req, resp := client.DeleteInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGateway -func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (req *request.Request, output *DeleteInternetGatewayOutput) { - op := &request.Operation{ - Name: opDeleteInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteInternetGatewayInput{} - } - - output = &DeleteInternetGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified Internet gateway. You must detach the Internet gateway -// from the VPC before you can delete it. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteInternetGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGateway -func (c *EC2) DeleteInternetGateway(input *DeleteInternetGatewayInput) (*DeleteInternetGatewayOutput, error) { - req, out := c.DeleteInternetGatewayRequest(input) - return out, req.Send() -} - -// DeleteInternetGatewayWithContext is the same as DeleteInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteInternetGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteInternetGatewayWithContext(ctx aws.Context, input *DeleteInternetGatewayInput, opts ...request.Option) (*DeleteInternetGatewayOutput, error) { - req, out := c.DeleteInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteKeyPair = "DeleteKeyPair" - -// DeleteKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the DeleteKeyPair operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteKeyPair for more information on using the DeleteKeyPair -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteKeyPairRequest method. -// req, resp := client.DeleteKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPair -func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *request.Request, output *DeleteKeyPairOutput) { - op := &request.Operation{ - Name: opDeleteKeyPair, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteKeyPairInput{} - } - - output = &DeleteKeyPairOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteKeyPair API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified key pair, by removing the public key from Amazon EC2. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteKeyPair for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPair -func (c *EC2) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, error) { - req, out := c.DeleteKeyPairRequest(input) - return out, req.Send() -} - -// DeleteKeyPairWithContext is the same as DeleteKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteKeyPair for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteKeyPairWithContext(ctx aws.Context, input *DeleteKeyPairInput, opts ...request.Option) (*DeleteKeyPairOutput, error) { - req, out := c.DeleteKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteLaunchTemplate = "DeleteLaunchTemplate" - -// DeleteLaunchTemplateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLaunchTemplate operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteLaunchTemplate for more information on using the DeleteLaunchTemplate -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteLaunchTemplateRequest method. -// req, resp := client.DeleteLaunchTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLaunchTemplate -func (c *EC2) DeleteLaunchTemplateRequest(input *DeleteLaunchTemplateInput) (req *request.Request, output *DeleteLaunchTemplateOutput) { - op := &request.Operation{ - Name: opDeleteLaunchTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLaunchTemplateInput{} - } - - output = &DeleteLaunchTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteLaunchTemplate API operation for Amazon Elastic Compute Cloud. -// -// Deletes a launch template. Deleting a launch template deletes all of its -// versions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteLaunchTemplate for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLaunchTemplate -func (c *EC2) DeleteLaunchTemplate(input *DeleteLaunchTemplateInput) (*DeleteLaunchTemplateOutput, error) { - req, out := c.DeleteLaunchTemplateRequest(input) - return out, req.Send() -} - -// DeleteLaunchTemplateWithContext is the same as DeleteLaunchTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteLaunchTemplate for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteLaunchTemplateWithContext(ctx aws.Context, input *DeleteLaunchTemplateInput, opts ...request.Option) (*DeleteLaunchTemplateOutput, error) { - req, out := c.DeleteLaunchTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteLaunchTemplateVersions = "DeleteLaunchTemplateVersions" - -// DeleteLaunchTemplateVersionsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLaunchTemplateVersions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteLaunchTemplateVersions for more information on using the DeleteLaunchTemplateVersions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteLaunchTemplateVersionsRequest method. -// req, resp := client.DeleteLaunchTemplateVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLaunchTemplateVersions -func (c *EC2) DeleteLaunchTemplateVersionsRequest(input *DeleteLaunchTemplateVersionsInput) (req *request.Request, output *DeleteLaunchTemplateVersionsOutput) { - op := &request.Operation{ - Name: opDeleteLaunchTemplateVersions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLaunchTemplateVersionsInput{} - } - - output = &DeleteLaunchTemplateVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteLaunchTemplateVersions API operation for Amazon Elastic Compute Cloud. -// -// Deletes one or more versions of a launch template. You cannot delete the -// default version of a launch template; you must first assign a different version -// as the default. If the default version is the only version for the launch -// template, you must delete the entire launch template using DeleteLaunchTemplate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteLaunchTemplateVersions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLaunchTemplateVersions -func (c *EC2) DeleteLaunchTemplateVersions(input *DeleteLaunchTemplateVersionsInput) (*DeleteLaunchTemplateVersionsOutput, error) { - req, out := c.DeleteLaunchTemplateVersionsRequest(input) - return out, req.Send() -} - -// DeleteLaunchTemplateVersionsWithContext is the same as DeleteLaunchTemplateVersions with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteLaunchTemplateVersions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteLaunchTemplateVersionsWithContext(ctx aws.Context, input *DeleteLaunchTemplateVersionsInput, opts ...request.Option) (*DeleteLaunchTemplateVersionsOutput, error) { - req, out := c.DeleteLaunchTemplateVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNatGateway = "DeleteNatGateway" - -// DeleteNatGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNatGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteNatGateway for more information on using the DeleteNatGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteNatGatewayRequest method. -// req, resp := client.DeleteNatGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGateway -func (c *EC2) DeleteNatGatewayRequest(input *DeleteNatGatewayInput) (req *request.Request, output *DeleteNatGatewayOutput) { - op := &request.Operation{ - Name: opDeleteNatGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNatGatewayInput{} - } - - output = &DeleteNatGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteNatGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified NAT gateway. Deleting a NAT gateway disassociates its -// Elastic IP address, but does not release the address from your account. Deleting -// a NAT gateway does not delete any NAT gateway routes in your route tables. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteNatGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGateway -func (c *EC2) DeleteNatGateway(input *DeleteNatGatewayInput) (*DeleteNatGatewayOutput, error) { - req, out := c.DeleteNatGatewayRequest(input) - return out, req.Send() -} - -// DeleteNatGatewayWithContext is the same as DeleteNatGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNatGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteNatGatewayWithContext(ctx aws.Context, input *DeleteNatGatewayInput, opts ...request.Option) (*DeleteNatGatewayOutput, error) { - req, out := c.DeleteNatGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetworkAcl = "DeleteNetworkAcl" - -// DeleteNetworkAclRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetworkAcl operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteNetworkAcl for more information on using the DeleteNetworkAcl -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteNetworkAclRequest method. -// req, resp := client.DeleteNetworkAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAcl -func (c *EC2) DeleteNetworkAclRequest(input *DeleteNetworkAclInput) (req *request.Request, output *DeleteNetworkAclOutput) { - op := &request.Operation{ - Name: opDeleteNetworkAcl, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNetworkAclInput{} - } - - output = &DeleteNetworkAclOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteNetworkAcl API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified network ACL. You can't delete the ACL if it's associated -// with any subnets. You can't delete the default network ACL. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteNetworkAcl for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAcl -func (c *EC2) DeleteNetworkAcl(input *DeleteNetworkAclInput) (*DeleteNetworkAclOutput, error) { - req, out := c.DeleteNetworkAclRequest(input) - return out, req.Send() -} - -// DeleteNetworkAclWithContext is the same as DeleteNetworkAcl with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetworkAcl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteNetworkAclWithContext(ctx aws.Context, input *DeleteNetworkAclInput, opts ...request.Option) (*DeleteNetworkAclOutput, error) { - req, out := c.DeleteNetworkAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetworkAclEntry = "DeleteNetworkAclEntry" - -// DeleteNetworkAclEntryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetworkAclEntry operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteNetworkAclEntry for more information on using the DeleteNetworkAclEntry -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteNetworkAclEntryRequest method. -// req, resp := client.DeleteNetworkAclEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntry -func (c *EC2) DeleteNetworkAclEntryRequest(input *DeleteNetworkAclEntryInput) (req *request.Request, output *DeleteNetworkAclEntryOutput) { - op := &request.Operation{ - Name: opDeleteNetworkAclEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNetworkAclEntryInput{} - } - - output = &DeleteNetworkAclEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteNetworkAclEntry API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified ingress or egress entry (rule) from the specified network -// ACL. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteNetworkAclEntry for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntry -func (c *EC2) DeleteNetworkAclEntry(input *DeleteNetworkAclEntryInput) (*DeleteNetworkAclEntryOutput, error) { - req, out := c.DeleteNetworkAclEntryRequest(input) - return out, req.Send() -} - -// DeleteNetworkAclEntryWithContext is the same as DeleteNetworkAclEntry with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetworkAclEntry for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteNetworkAclEntryWithContext(ctx aws.Context, input *DeleteNetworkAclEntryInput, opts ...request.Option) (*DeleteNetworkAclEntryOutput, error) { - req, out := c.DeleteNetworkAclEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetworkInterface = "DeleteNetworkInterface" - -// DeleteNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetworkInterface operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteNetworkInterface for more information on using the DeleteNetworkInterface -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteNetworkInterfaceRequest method. -// req, resp := client.DeleteNetworkInterfaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterface -func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) (req *request.Request, output *DeleteNetworkInterfaceOutput) { - op := &request.Operation{ - Name: opDeleteNetworkInterface, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNetworkInterfaceInput{} - } - - output = &DeleteNetworkInterfaceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteNetworkInterface API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified network interface. You must detach the network interface -// before you can delete it. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteNetworkInterface for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterface -func (c *EC2) DeleteNetworkInterface(input *DeleteNetworkInterfaceInput) (*DeleteNetworkInterfaceOutput, error) { - req, out := c.DeleteNetworkInterfaceRequest(input) - return out, req.Send() -} - -// DeleteNetworkInterfaceWithContext is the same as DeleteNetworkInterface with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetworkInterface for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteNetworkInterfaceWithContext(ctx aws.Context, input *DeleteNetworkInterfaceInput, opts ...request.Option) (*DeleteNetworkInterfaceOutput, error) { - req, out := c.DeleteNetworkInterfaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetworkInterfacePermission = "DeleteNetworkInterfacePermission" - -// DeleteNetworkInterfacePermissionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetworkInterfacePermission operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteNetworkInterfacePermission for more information on using the DeleteNetworkInterfacePermission -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteNetworkInterfacePermissionRequest method. -// req, resp := client.DeleteNetworkInterfacePermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterfacePermission -func (c *EC2) DeleteNetworkInterfacePermissionRequest(input *DeleteNetworkInterfacePermissionInput) (req *request.Request, output *DeleteNetworkInterfacePermissionOutput) { - op := &request.Operation{ - Name: opDeleteNetworkInterfacePermission, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNetworkInterfacePermissionInput{} - } - - output = &DeleteNetworkInterfacePermissionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteNetworkInterfacePermission API operation for Amazon Elastic Compute Cloud. -// -// Deletes a permission for a network interface. By default, you cannot delete -// the permission if the account for which you're removing the permission has -// attached the network interface to an instance. However, you can force delete -// the permission, regardless of any attachment. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteNetworkInterfacePermission for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterfacePermission -func (c *EC2) DeleteNetworkInterfacePermission(input *DeleteNetworkInterfacePermissionInput) (*DeleteNetworkInterfacePermissionOutput, error) { - req, out := c.DeleteNetworkInterfacePermissionRequest(input) - return out, req.Send() -} - -// DeleteNetworkInterfacePermissionWithContext is the same as DeleteNetworkInterfacePermission with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetworkInterfacePermission for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteNetworkInterfacePermissionWithContext(ctx aws.Context, input *DeleteNetworkInterfacePermissionInput, opts ...request.Option) (*DeleteNetworkInterfacePermissionOutput, error) { - req, out := c.DeleteNetworkInterfacePermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePlacementGroup = "DeletePlacementGroup" - -// DeletePlacementGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeletePlacementGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeletePlacementGroup for more information on using the DeletePlacementGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeletePlacementGroupRequest method. -// req, resp := client.DeletePlacementGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroup -func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req *request.Request, output *DeletePlacementGroupOutput) { - op := &request.Operation{ - Name: opDeletePlacementGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePlacementGroupInput{} - } - - output = &DeletePlacementGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePlacementGroup API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified placement group. You must terminate all instances in -// the placement group before you can delete the placement group. For more information, -// see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeletePlacementGroup for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroup -func (c *EC2) DeletePlacementGroup(input *DeletePlacementGroupInput) (*DeletePlacementGroupOutput, error) { - req, out := c.DeletePlacementGroupRequest(input) - return out, req.Send() -} - -// DeletePlacementGroupWithContext is the same as DeletePlacementGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePlacementGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeletePlacementGroupWithContext(ctx aws.Context, input *DeletePlacementGroupInput, opts ...request.Option) (*DeletePlacementGroupOutput, error) { - req, out := c.DeletePlacementGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRoute = "DeleteRoute" - -// DeleteRouteRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRoute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteRoute for more information on using the DeleteRoute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteRouteRequest method. -// req, resp := client.DeleteRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRoute -func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *request.Request, output *DeleteRouteOutput) { - op := &request.Operation{ - Name: opDeleteRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRouteInput{} - } - - output = &DeleteRouteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRoute API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified route from the specified route table. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteRoute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRoute -func (c *EC2) DeleteRoute(input *DeleteRouteInput) (*DeleteRouteOutput, error) { - req, out := c.DeleteRouteRequest(input) - return out, req.Send() -} - -// DeleteRouteWithContext is the same as DeleteRoute with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRoute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteRouteWithContext(ctx aws.Context, input *DeleteRouteInput, opts ...request.Option) (*DeleteRouteOutput, error) { - req, out := c.DeleteRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRouteTable = "DeleteRouteTable" - -// DeleteRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRouteTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteRouteTable for more information on using the DeleteRouteTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteRouteTableRequest method. -// req, resp := client.DeleteRouteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTable -func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *request.Request, output *DeleteRouteTableOutput) { - op := &request.Operation{ - Name: opDeleteRouteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRouteTableInput{} - } - - output = &DeleteRouteTableOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRouteTable API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified route table. You must disassociate the route table -// from any subnets before you can delete it. You can't delete the main route -// table. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteRouteTable for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTable -func (c *EC2) DeleteRouteTable(input *DeleteRouteTableInput) (*DeleteRouteTableOutput, error) { - req, out := c.DeleteRouteTableRequest(input) - return out, req.Send() -} - -// DeleteRouteTableWithContext is the same as DeleteRouteTable with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRouteTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteRouteTableWithContext(ctx aws.Context, input *DeleteRouteTableInput, opts ...request.Option) (*DeleteRouteTableOutput, error) { - req, out := c.DeleteRouteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSecurityGroup = "DeleteSecurityGroup" - -// DeleteSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSecurityGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteSecurityGroup for more information on using the DeleteSecurityGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteSecurityGroupRequest method. -// req, resp := client.DeleteSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroup -func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req *request.Request, output *DeleteSecurityGroupOutput) { - op := &request.Operation{ - Name: opDeleteSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSecurityGroupInput{} - } - - output = &DeleteSecurityGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSecurityGroup API operation for Amazon Elastic Compute Cloud. -// -// Deletes a security group. -// -// If you attempt to delete a security group that is associated with an instance, -// or is referenced by another security group, the operation fails with InvalidGroup.InUse -// in EC2-Classic or DependencyViolation in EC2-VPC. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteSecurityGroup for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroup -func (c *EC2) DeleteSecurityGroup(input *DeleteSecurityGroupInput) (*DeleteSecurityGroupOutput, error) { - req, out := c.DeleteSecurityGroupRequest(input) - return out, req.Send() -} - -// DeleteSecurityGroupWithContext is the same as DeleteSecurityGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSecurityGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteSecurityGroupWithContext(ctx aws.Context, input *DeleteSecurityGroupInput, opts ...request.Option) (*DeleteSecurityGroupOutput, error) { - req, out := c.DeleteSecurityGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSnapshot = "DeleteSnapshot" - -// DeleteSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSnapshot operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteSnapshot for more information on using the DeleteSnapshot -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteSnapshotRequest method. -// req, resp := client.DeleteSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshot -func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Request, output *DeleteSnapshotOutput) { - op := &request.Operation{ - Name: opDeleteSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSnapshotInput{} - } - - output = &DeleteSnapshotOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSnapshot API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified snapshot. -// -// When you make periodic snapshots of a volume, the snapshots are incremental, -// and only the blocks on the device that have changed since your last snapshot -// are saved in the new snapshot. When you delete a snapshot, only the data -// not needed for any other snapshot is removed. So regardless of which prior -// snapshots have been deleted, all active snapshots will have access to all -// the information needed to restore the volume. -// -// You cannot delete a snapshot of the root device of an EBS volume used by -// a registered AMI. You must first de-register the AMI before you can delete -// the snapshot. -// -// For more information, see Deleting an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteSnapshot for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshot -func (c *EC2) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { - req, out := c.DeleteSnapshotRequest(input) - return out, req.Send() -} - -// DeleteSnapshotWithContext is the same as DeleteSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSnapshot for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteSnapshotWithContext(ctx aws.Context, input *DeleteSnapshotInput, opts ...request.Option) (*DeleteSnapshotOutput, error) { - req, out := c.DeleteSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSpotDatafeedSubscription = "DeleteSpotDatafeedSubscription" - -// DeleteSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSpotDatafeedSubscription operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteSpotDatafeedSubscription for more information on using the DeleteSpotDatafeedSubscription -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteSpotDatafeedSubscriptionRequest method. -// req, resp := client.DeleteSpotDatafeedSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscription -func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSubscriptionInput) (req *request.Request, output *DeleteSpotDatafeedSubscriptionOutput) { - op := &request.Operation{ - Name: opDeleteSpotDatafeedSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSpotDatafeedSubscriptionInput{} - } - - output = &DeleteSpotDatafeedSubscriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. -// -// Deletes the data feed for Spot Instances. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteSpotDatafeedSubscription for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscription -func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscriptionInput) (*DeleteSpotDatafeedSubscriptionOutput, error) { - req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) - return out, req.Send() -} - -// DeleteSpotDatafeedSubscriptionWithContext is the same as DeleteSpotDatafeedSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSpotDatafeedSubscription for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DeleteSpotDatafeedSubscriptionInput, opts ...request.Option) (*DeleteSpotDatafeedSubscriptionOutput, error) { - req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSubnet = "DeleteSubnet" - -// DeleteSubnetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSubnet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteSubnet for more information on using the DeleteSubnet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteSubnetRequest method. -// req, resp := client.DeleteSubnetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnet -func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *request.Request, output *DeleteSubnetOutput) { - op := &request.Operation{ - Name: opDeleteSubnet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSubnetInput{} - } - - output = &DeleteSubnetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSubnet API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified subnet. You must terminate all running instances in -// the subnet before you can delete the subnet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteSubnet for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnet -func (c *EC2) DeleteSubnet(input *DeleteSubnetInput) (*DeleteSubnetOutput, error) { - req, out := c.DeleteSubnetRequest(input) - return out, req.Send() -} - -// DeleteSubnetWithContext is the same as DeleteSubnet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSubnet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteSubnetWithContext(ctx aws.Context, input *DeleteSubnetInput, opts ...request.Option) (*DeleteSubnetOutput, error) { - req, out := c.DeleteSubnetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTags = "DeleteTags" - -// DeleteTagsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTags operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteTags for more information on using the DeleteTags -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteTagsRequest method. -// req, resp := client.DeleteTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTags -func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { - op := &request.Operation{ - Name: opDeleteTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTagsInput{} - } - - output = &DeleteTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTags API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified set of tags from the specified set of resources. -// -// To list the current tags, use DescribeTags. For more information about tags, -// see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteTags for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTags -func (c *EC2) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - return out, req.Send() -} - -// DeleteTagsWithContext is the same as DeleteTags with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVolume = "DeleteVolume" - -// DeleteVolumeRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVolume operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVolume for more information on using the DeleteVolume -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVolumeRequest method. -// req, resp := client.DeleteVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolume -func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Request, output *DeleteVolumeOutput) { - op := &request.Operation{ - Name: opDeleteVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVolumeInput{} - } - - output = &DeleteVolumeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVolume API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified EBS volume. The volume must be in the available state -// (not attached to an instance). -// -// The volume may remain in the deleting state for several minutes. -// -// For more information, see Deleting an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVolume for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolume -func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (*DeleteVolumeOutput, error) { - req, out := c.DeleteVolumeRequest(input) - return out, req.Send() -} - -// DeleteVolumeWithContext is the same as DeleteVolume with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVolume for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVolumeWithContext(ctx aws.Context, input *DeleteVolumeInput, opts ...request.Option) (*DeleteVolumeOutput, error) { - req, out := c.DeleteVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpc = "DeleteVpc" - -// DeleteVpcRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpc operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVpc for more information on using the DeleteVpc -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVpcRequest method. -// req, resp := client.DeleteVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpc -func (c *EC2) DeleteVpcRequest(input *DeleteVpcInput) (req *request.Request, output *DeleteVpcOutput) { - op := &request.Operation{ - Name: opDeleteVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcInput{} - } - - output = &DeleteVpcOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVpc API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified VPC. You must detach or delete all gateways and resources -// that are associated with the VPC before you can delete it. For example, you -// must terminate all instances running in the VPC, delete all security groups -// associated with the VPC (except the default one), delete all route tables -// associated with the VPC (except the default one), and so on. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVpc for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpc -func (c *EC2) DeleteVpc(input *DeleteVpcInput) (*DeleteVpcOutput, error) { - req, out := c.DeleteVpcRequest(input) - return out, req.Send() -} - -// DeleteVpcWithContext is the same as DeleteVpc with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpc for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVpcWithContext(ctx aws.Context, input *DeleteVpcInput, opts ...request.Option) (*DeleteVpcOutput, error) { - req, out := c.DeleteVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpcEndpointConnectionNotifications = "DeleteVpcEndpointConnectionNotifications" - -// DeleteVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpcEndpointConnectionNotifications operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVpcEndpointConnectionNotifications for more information on using the DeleteVpcEndpointConnectionNotifications -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVpcEndpointConnectionNotificationsRequest method. -// req, resp := client.DeleteVpcEndpointConnectionNotificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointConnectionNotifications -func (c *EC2) DeleteVpcEndpointConnectionNotificationsRequest(input *DeleteVpcEndpointConnectionNotificationsInput) (req *request.Request, output *DeleteVpcEndpointConnectionNotificationsOutput) { - op := &request.Operation{ - Name: opDeleteVpcEndpointConnectionNotifications, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcEndpointConnectionNotificationsInput{} - } - - output = &DeleteVpcEndpointConnectionNotificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVpcEndpointConnectionNotifications API operation for Amazon Elastic Compute Cloud. -// -// Deletes one or more VPC endpoint connection notifications. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVpcEndpointConnectionNotifications for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointConnectionNotifications -func (c *EC2) DeleteVpcEndpointConnectionNotifications(input *DeleteVpcEndpointConnectionNotificationsInput) (*DeleteVpcEndpointConnectionNotificationsOutput, error) { - req, out := c.DeleteVpcEndpointConnectionNotificationsRequest(input) - return out, req.Send() -} - -// DeleteVpcEndpointConnectionNotificationsWithContext is the same as DeleteVpcEndpointConnectionNotifications with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpcEndpointConnectionNotifications for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVpcEndpointConnectionNotificationsWithContext(ctx aws.Context, input *DeleteVpcEndpointConnectionNotificationsInput, opts ...request.Option) (*DeleteVpcEndpointConnectionNotificationsOutput, error) { - req, out := c.DeleteVpcEndpointConnectionNotificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpcEndpointServiceConfigurations = "DeleteVpcEndpointServiceConfigurations" - -// DeleteVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpcEndpointServiceConfigurations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVpcEndpointServiceConfigurations for more information on using the DeleteVpcEndpointServiceConfigurations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVpcEndpointServiceConfigurationsRequest method. -// req, resp := client.DeleteVpcEndpointServiceConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointServiceConfigurations -func (c *EC2) DeleteVpcEndpointServiceConfigurationsRequest(input *DeleteVpcEndpointServiceConfigurationsInput) (req *request.Request, output *DeleteVpcEndpointServiceConfigurationsOutput) { - op := &request.Operation{ - Name: opDeleteVpcEndpointServiceConfigurations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcEndpointServiceConfigurationsInput{} - } - - output = &DeleteVpcEndpointServiceConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVpcEndpointServiceConfigurations API operation for Amazon Elastic Compute Cloud. -// -// Deletes one or more VPC endpoint service configurations in your account. -// Before you delete the endpoint service configuration, you must reject any -// Available or PendingAcceptance interface endpoint connections that are attached -// to the service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVpcEndpointServiceConfigurations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointServiceConfigurations -func (c *EC2) DeleteVpcEndpointServiceConfigurations(input *DeleteVpcEndpointServiceConfigurationsInput) (*DeleteVpcEndpointServiceConfigurationsOutput, error) { - req, out := c.DeleteVpcEndpointServiceConfigurationsRequest(input) - return out, req.Send() -} - -// DeleteVpcEndpointServiceConfigurationsWithContext is the same as DeleteVpcEndpointServiceConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpcEndpointServiceConfigurations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVpcEndpointServiceConfigurationsWithContext(ctx aws.Context, input *DeleteVpcEndpointServiceConfigurationsInput, opts ...request.Option) (*DeleteVpcEndpointServiceConfigurationsOutput, error) { - req, out := c.DeleteVpcEndpointServiceConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpcEndpoints = "DeleteVpcEndpoints" - -// DeleteVpcEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpcEndpoints operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVpcEndpoints for more information on using the DeleteVpcEndpoints -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVpcEndpointsRequest method. -// req, resp := client.DeleteVpcEndpointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpoints -func (c *EC2) DeleteVpcEndpointsRequest(input *DeleteVpcEndpointsInput) (req *request.Request, output *DeleteVpcEndpointsOutput) { - op := &request.Operation{ - Name: opDeleteVpcEndpoints, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcEndpointsInput{} - } - - output = &DeleteVpcEndpointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVpcEndpoints API operation for Amazon Elastic Compute Cloud. -// -// Deletes one or more specified VPC endpoints. Deleting a gateway endpoint -// also deletes the endpoint routes in the route tables that were associated -// with the endpoint. Deleting an interface endpoint deletes the endpoint network -// interfaces. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVpcEndpoints for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpoints -func (c *EC2) DeleteVpcEndpoints(input *DeleteVpcEndpointsInput) (*DeleteVpcEndpointsOutput, error) { - req, out := c.DeleteVpcEndpointsRequest(input) - return out, req.Send() -} - -// DeleteVpcEndpointsWithContext is the same as DeleteVpcEndpoints with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpcEndpoints for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVpcEndpointsWithContext(ctx aws.Context, input *DeleteVpcEndpointsInput, opts ...request.Option) (*DeleteVpcEndpointsOutput, error) { - req, out := c.DeleteVpcEndpointsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" - -// DeleteVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpcPeeringConnection operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVpcPeeringConnection for more information on using the DeleteVpcPeeringConnection -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVpcPeeringConnectionRequest method. -// req, resp := client.DeleteVpcPeeringConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnection -func (c *EC2) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConnectionInput) (req *request.Request, output *DeleteVpcPeeringConnectionOutput) { - op := &request.Operation{ - Name: opDeleteVpcPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcPeeringConnectionInput{} - } - - output = &DeleteVpcPeeringConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. -// -// Deletes a VPC peering connection. Either the owner of the requester VPC or -// the owner of the accepter VPC can delete the VPC peering connection if it's -// in the active state. The owner of the requester VPC can delete a VPC peering -// connection in the pending-acceptance state. You cannot delete a VPC peering -// connection that's in the failed state. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVpcPeeringConnection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnection -func (c *EC2) DeleteVpcPeeringConnection(input *DeleteVpcPeeringConnectionInput) (*DeleteVpcPeeringConnectionOutput, error) { - req, out := c.DeleteVpcPeeringConnectionRequest(input) - return out, req.Send() -} - -// DeleteVpcPeeringConnectionWithContext is the same as DeleteVpcPeeringConnection with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpcPeeringConnection for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVpcPeeringConnectionWithContext(ctx aws.Context, input *DeleteVpcPeeringConnectionInput, opts ...request.Option) (*DeleteVpcPeeringConnectionOutput, error) { - req, out := c.DeleteVpcPeeringConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpnConnection = "DeleteVpnConnection" - -// DeleteVpnConnectionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpnConnection operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVpnConnection for more information on using the DeleteVpnConnection -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVpnConnectionRequest method. -// req, resp := client.DeleteVpnConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnection -func (c *EC2) DeleteVpnConnectionRequest(input *DeleteVpnConnectionInput) (req *request.Request, output *DeleteVpnConnectionOutput) { - op := &request.Operation{ - Name: opDeleteVpnConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpnConnectionInput{} - } - - output = &DeleteVpnConnectionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVpnConnection API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified VPN connection. -// -// If you're deleting the VPC and its associated components, we recommend that -// you detach the virtual private gateway from the VPC and delete the VPC before -// deleting the VPN connection. If you believe that the tunnel credentials for -// your VPN connection have been compromised, you can delete the VPN connection -// and create a new one that has new keys, without needing to delete the VPC -// or virtual private gateway. If you create a new VPN connection, you must -// reconfigure the customer gateway using the new configuration information -// returned with the new VPN connection ID. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVpnConnection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnection -func (c *EC2) DeleteVpnConnection(input *DeleteVpnConnectionInput) (*DeleteVpnConnectionOutput, error) { - req, out := c.DeleteVpnConnectionRequest(input) - return out, req.Send() -} - -// DeleteVpnConnectionWithContext is the same as DeleteVpnConnection with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpnConnection for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVpnConnectionWithContext(ctx aws.Context, input *DeleteVpnConnectionInput, opts ...request.Option) (*DeleteVpnConnectionOutput, error) { - req, out := c.DeleteVpnConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpnConnectionRoute = "DeleteVpnConnectionRoute" - -// DeleteVpnConnectionRouteRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpnConnectionRoute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVpnConnectionRoute for more information on using the DeleteVpnConnectionRoute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVpnConnectionRouteRequest method. -// req, resp := client.DeleteVpnConnectionRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRoute -func (c *EC2) DeleteVpnConnectionRouteRequest(input *DeleteVpnConnectionRouteInput) (req *request.Request, output *DeleteVpnConnectionRouteOutput) { - op := &request.Operation{ - Name: opDeleteVpnConnectionRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpnConnectionRouteInput{} - } - - output = &DeleteVpnConnectionRouteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVpnConnectionRoute API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified static route associated with a VPN connection between -// an existing virtual private gateway and a VPN customer gateway. The static -// route allows traffic to be routed from the virtual private gateway to the -// VPN customer gateway. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVpnConnectionRoute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRoute -func (c *EC2) DeleteVpnConnectionRoute(input *DeleteVpnConnectionRouteInput) (*DeleteVpnConnectionRouteOutput, error) { - req, out := c.DeleteVpnConnectionRouteRequest(input) - return out, req.Send() -} - -// DeleteVpnConnectionRouteWithContext is the same as DeleteVpnConnectionRoute with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpnConnectionRoute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVpnConnectionRouteWithContext(ctx aws.Context, input *DeleteVpnConnectionRouteInput, opts ...request.Option) (*DeleteVpnConnectionRouteOutput, error) { - req, out := c.DeleteVpnConnectionRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpnGateway = "DeleteVpnGateway" - -// DeleteVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpnGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteVpnGateway for more information on using the DeleteVpnGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteVpnGatewayRequest method. -// req, resp := client.DeleteVpnGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGateway -func (c *EC2) DeleteVpnGatewayRequest(input *DeleteVpnGatewayInput) (req *request.Request, output *DeleteVpnGatewayOutput) { - op := &request.Operation{ - Name: opDeleteVpnGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpnGatewayInput{} - } - - output = &DeleteVpnGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVpnGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified virtual private gateway. We recommend that before you -// delete a virtual private gateway, you detach it from the VPC and delete the -// VPN connection. Note that you don't need to delete the virtual private gateway -// if you plan to delete and recreate the VPN connection between your VPC and -// your network. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeleteVpnGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGateway -func (c *EC2) DeleteVpnGateway(input *DeleteVpnGatewayInput) (*DeleteVpnGatewayOutput, error) { - req, out := c.DeleteVpnGatewayRequest(input) - return out, req.Send() -} - -// DeleteVpnGatewayWithContext is the same as DeleteVpnGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpnGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeleteVpnGatewayWithContext(ctx aws.Context, input *DeleteVpnGatewayInput, opts ...request.Option) (*DeleteVpnGatewayOutput, error) { - req, out := c.DeleteVpnGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterImage = "DeregisterImage" - -// DeregisterImageRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterImage operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeregisterImage for more information on using the DeregisterImage -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeregisterImageRequest method. -// req, resp := client.DeregisterImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImage -func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *request.Request, output *DeregisterImageOutput) { - op := &request.Operation{ - Name: opDeregisterImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterImageInput{} - } - - output = &DeregisterImageOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterImage API operation for Amazon Elastic Compute Cloud. -// -// Deregisters the specified AMI. After you deregister an AMI, it can't be used -// to launch new instances; however, it doesn't affect any instances that you've -// already launched from the AMI. You'll continue to incur usage costs for those -// instances until you terminate them. -// -// When you deregister an Amazon EBS-backed AMI, it doesn't affect the snapshot -// that was created for the root volume of the instance during the AMI creation -// process. When you deregister an instance store-backed AMI, it doesn't affect -// the files that you uploaded to Amazon S3 when you created the AMI. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DeregisterImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImage -func (c *EC2) DeregisterImage(input *DeregisterImageInput) (*DeregisterImageOutput, error) { - req, out := c.DeregisterImageRequest(input) - return out, req.Send() -} - -// DeregisterImageWithContext is the same as DeregisterImage with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DeregisterImageWithContext(ctx aws.Context, input *DeregisterImageInput, opts ...request.Option) (*DeregisterImageOutput, error) { - req, out := c.DeregisterImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAccountAttributes = "DescribeAccountAttributes" - -// DescribeAccountAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAccountAttributes operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeAccountAttributes for more information on using the DescribeAccountAttributes -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeAccountAttributesRequest method. -// req, resp := client.DescribeAccountAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributes -func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesInput) (req *request.Request, output *DescribeAccountAttributesOutput) { - op := &request.Operation{ - Name: opDescribeAccountAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAccountAttributesInput{} - } - - output = &DescribeAccountAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAccountAttributes API operation for Amazon Elastic Compute Cloud. -// -// Describes attributes of your AWS account. The following are the supported -// account attributes: -// -// * supported-platforms: Indicates whether your account can launch instances -// into EC2-Classic and EC2-VPC, or only into EC2-VPC. -// -// * default-vpc: The ID of the default VPC for your account, or none. -// -// * max-instances: The maximum number of On-Demand Instances that you can -// run. -// -// * vpc-max-security-groups-per-interface: The maximum number of security -// groups that you can assign to a network interface. -// -// * max-elastic-ips: The maximum number of Elastic IP addresses that you -// can allocate for use with EC2-Classic. -// -// * vpc-max-elastic-ips: The maximum number of Elastic IP addresses that -// you can allocate for use with EC2-VPC. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeAccountAttributes for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributes -func (c *EC2) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error) { - req, out := c.DescribeAccountAttributesRequest(input) - return out, req.Send() -} - -// DescribeAccountAttributesWithContext is the same as DescribeAccountAttributes with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAccountAttributes for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeAccountAttributesWithContext(ctx aws.Context, input *DescribeAccountAttributesInput, opts ...request.Option) (*DescribeAccountAttributesOutput, error) { - req, out := c.DescribeAccountAttributesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAddresses = "DescribeAddresses" - -// DescribeAddressesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAddresses operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeAddresses for more information on using the DescribeAddresses -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeAddressesRequest method. -// req, resp := client.DescribeAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddresses -func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *request.Request, output *DescribeAddressesOutput) { - op := &request.Operation{ - Name: opDescribeAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAddressesInput{} - } - - output = &DescribeAddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAddresses API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your Elastic IP addresses. -// -// An Elastic IP address is for use in either the EC2-Classic platform or in -// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeAddresses for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddresses -func (c *EC2) DescribeAddresses(input *DescribeAddressesInput) (*DescribeAddressesOutput, error) { - req, out := c.DescribeAddressesRequest(input) - return out, req.Send() -} - -// DescribeAddressesWithContext is the same as DescribeAddresses with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAddresses for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeAddressesWithContext(ctx aws.Context, input *DescribeAddressesInput, opts ...request.Option) (*DescribeAddressesOutput, error) { - req, out := c.DescribeAddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAggregateIdFormat = "DescribeAggregateIdFormat" - -// DescribeAggregateIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAggregateIdFormat operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeAggregateIdFormat for more information on using the DescribeAggregateIdFormat -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeAggregateIdFormatRequest method. -// req, resp := client.DescribeAggregateIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAggregateIdFormat -func (c *EC2) DescribeAggregateIdFormatRequest(input *DescribeAggregateIdFormatInput) (req *request.Request, output *DescribeAggregateIdFormatOutput) { - op := &request.Operation{ - Name: opDescribeAggregateIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAggregateIdFormatInput{} - } - - output = &DescribeAggregateIdFormatOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAggregateIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Describes the longer ID format settings for all resource types in a specific -// region. This request is useful for performing a quick audit to determine -// whether a specific region is fully opted in for longer IDs (17-character -// IDs). -// -// This request only returns information about resource types that support longer -// IDs. -// -// The following resource types support longer IDs: bundle | conversion-task -// | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway -// | network-acl | network-acl-association | network-interface | network-interface-attachment -// | prefix-list | reservation | route-table | route-table-association | security-group -// | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeAggregateIdFormat for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAggregateIdFormat -func (c *EC2) DescribeAggregateIdFormat(input *DescribeAggregateIdFormatInput) (*DescribeAggregateIdFormatOutput, error) { - req, out := c.DescribeAggregateIdFormatRequest(input) - return out, req.Send() -} - -// DescribeAggregateIdFormatWithContext is the same as DescribeAggregateIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAggregateIdFormat for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeAggregateIdFormatWithContext(ctx aws.Context, input *DescribeAggregateIdFormatInput, opts ...request.Option) (*DescribeAggregateIdFormatOutput, error) { - req, out := c.DescribeAggregateIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAvailabilityZones = "DescribeAvailabilityZones" - -// DescribeAvailabilityZonesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAvailabilityZones operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeAvailabilityZones for more information on using the DescribeAvailabilityZones -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeAvailabilityZonesRequest method. -// req, resp := client.DescribeAvailabilityZonesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZones -func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesInput) (req *request.Request, output *DescribeAvailabilityZonesOutput) { - op := &request.Operation{ - Name: opDescribeAvailabilityZones, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAvailabilityZonesInput{} - } - - output = &DescribeAvailabilityZonesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAvailabilityZones API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the Availability Zones that are available to you. -// The results include zones only for the region you're currently using. If -// there is an event impacting an Availability Zone, you can use this request -// to view the state and any provided message for that Availability Zone. -// -// For more information, see Regions and Availability Zones (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeAvailabilityZones for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZones -func (c *EC2) DescribeAvailabilityZones(input *DescribeAvailabilityZonesInput) (*DescribeAvailabilityZonesOutput, error) { - req, out := c.DescribeAvailabilityZonesRequest(input) - return out, req.Send() -} - -// DescribeAvailabilityZonesWithContext is the same as DescribeAvailabilityZones with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAvailabilityZones for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeAvailabilityZonesWithContext(ctx aws.Context, input *DescribeAvailabilityZonesInput, opts ...request.Option) (*DescribeAvailabilityZonesOutput, error) { - req, out := c.DescribeAvailabilityZonesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeBundleTasks = "DescribeBundleTasks" - -// DescribeBundleTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeBundleTasks operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeBundleTasks for more information on using the DescribeBundleTasks -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeBundleTasksRequest method. -// req, resp := client.DescribeBundleTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasks -func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *request.Request, output *DescribeBundleTasksOutput) { - op := &request.Operation{ - Name: opDescribeBundleTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeBundleTasksInput{} - } - - output = &DescribeBundleTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeBundleTasks API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your bundling tasks. -// -// Completed bundle tasks are listed for only a limited time. If your bundle -// task is no longer in the list, you can still register an AMI from it. Just -// use RegisterImage with the Amazon S3 bucket name and image manifest name -// you provided to the bundle task. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeBundleTasks for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasks -func (c *EC2) DescribeBundleTasks(input *DescribeBundleTasksInput) (*DescribeBundleTasksOutput, error) { - req, out := c.DescribeBundleTasksRequest(input) - return out, req.Send() -} - -// DescribeBundleTasksWithContext is the same as DescribeBundleTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeBundleTasks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeBundleTasksWithContext(ctx aws.Context, input *DescribeBundleTasksInput, opts ...request.Option) (*DescribeBundleTasksOutput, error) { - req, out := c.DescribeBundleTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" - -// DescribeClassicLinkInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClassicLinkInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeClassicLinkInstances for more information on using the DescribeClassicLinkInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeClassicLinkInstancesRequest method. -// req, resp := client.DescribeClassicLinkInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstances -func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInstancesInput) (req *request.Request, output *DescribeClassicLinkInstancesOutput) { - op := &request.Operation{ - Name: opDescribeClassicLinkInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeClassicLinkInstancesInput{} - } - - output = &DescribeClassicLinkInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClassicLinkInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your linked EC2-Classic instances. This request -// only returns information about EC2-Classic instances linked to a VPC through -// ClassicLink; you cannot use this request to return information about other -// instances. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeClassicLinkInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstances -func (c *EC2) DescribeClassicLinkInstances(input *DescribeClassicLinkInstancesInput) (*DescribeClassicLinkInstancesOutput, error) { - req, out := c.DescribeClassicLinkInstancesRequest(input) - return out, req.Send() -} - -// DescribeClassicLinkInstancesWithContext is the same as DescribeClassicLinkInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeClassicLinkInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeClassicLinkInstancesWithContext(ctx aws.Context, input *DescribeClassicLinkInstancesInput, opts ...request.Option) (*DescribeClassicLinkInstancesOutput, error) { - req, out := c.DescribeClassicLinkInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeConversionTasks = "DescribeConversionTasks" - -// DescribeConversionTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConversionTasks operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeConversionTasks for more information on using the DescribeConversionTasks -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeConversionTasksRequest method. -// req, resp := client.DescribeConversionTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeConversionTasks -func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput) (req *request.Request, output *DescribeConversionTasksOutput) { - op := &request.Operation{ - Name: opDescribeConversionTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConversionTasksInput{} - } - - output = &DescribeConversionTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConversionTasks API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your conversion tasks. For more information, see -// the VM Import/Export User Guide (http://docs.aws.amazon.com/vm-import/latest/userguide/). -// -// For information about the import manifest referenced by this API action, -// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeConversionTasks for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeConversionTasks -func (c *EC2) DescribeConversionTasks(input *DescribeConversionTasksInput) (*DescribeConversionTasksOutput, error) { - req, out := c.DescribeConversionTasksRequest(input) - return out, req.Send() -} - -// DescribeConversionTasksWithContext is the same as DescribeConversionTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeConversionTasks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeConversionTasksWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.Option) (*DescribeConversionTasksOutput, error) { - req, out := c.DescribeConversionTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeCustomerGateways = "DescribeCustomerGateways" - -// DescribeCustomerGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCustomerGateways operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeCustomerGateways for more information on using the DescribeCustomerGateways -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeCustomerGatewaysRequest method. -// req, resp := client.DescribeCustomerGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCustomerGateways -func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInput) (req *request.Request, output *DescribeCustomerGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeCustomerGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeCustomerGatewaysInput{} - } - - output = &DescribeCustomerGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCustomerGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPN customer gateways. -// -// For more information about VPN customer gateways, see AWS Managed VPN Connections -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) in the -// Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeCustomerGateways for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCustomerGateways -func (c *EC2) DescribeCustomerGateways(input *DescribeCustomerGatewaysInput) (*DescribeCustomerGatewaysOutput, error) { - req, out := c.DescribeCustomerGatewaysRequest(input) - return out, req.Send() -} - -// DescribeCustomerGatewaysWithContext is the same as DescribeCustomerGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeCustomerGateways for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeCustomerGatewaysWithContext(ctx aws.Context, input *DescribeCustomerGatewaysInput, opts ...request.Option) (*DescribeCustomerGatewaysOutput, error) { - req, out := c.DescribeCustomerGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeDhcpOptions = "DescribeDhcpOptions" - -// DescribeDhcpOptionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDhcpOptions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeDhcpOptions for more information on using the DescribeDhcpOptions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeDhcpOptionsRequest method. -// req, resp := client.DescribeDhcpOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeDhcpOptions -func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) (req *request.Request, output *DescribeDhcpOptionsOutput) { - op := &request.Operation{ - Name: opDescribeDhcpOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDhcpOptionsInput{} - } - - output = &DescribeDhcpOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDhcpOptions API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your DHCP options sets. -// -// For more information about DHCP options sets, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeDhcpOptions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeDhcpOptions -func (c *EC2) DescribeDhcpOptions(input *DescribeDhcpOptionsInput) (*DescribeDhcpOptionsOutput, error) { - req, out := c.DescribeDhcpOptionsRequest(input) - return out, req.Send() -} - -// DescribeDhcpOptionsWithContext is the same as DescribeDhcpOptions with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeDhcpOptions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeDhcpOptionsWithContext(ctx aws.Context, input *DescribeDhcpOptionsInput, opts ...request.Option) (*DescribeDhcpOptionsOutput, error) { - req, out := c.DescribeDhcpOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeEgressOnlyInternetGateways = "DescribeEgressOnlyInternetGateways" - -// DescribeEgressOnlyInternetGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEgressOnlyInternetGateways operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeEgressOnlyInternetGateways for more information on using the DescribeEgressOnlyInternetGateways -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeEgressOnlyInternetGatewaysRequest method. -// req, resp := client.DescribeEgressOnlyInternetGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeEgressOnlyInternetGateways -func (c *EC2) DescribeEgressOnlyInternetGatewaysRequest(input *DescribeEgressOnlyInternetGatewaysInput) (req *request.Request, output *DescribeEgressOnlyInternetGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeEgressOnlyInternetGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEgressOnlyInternetGatewaysInput{} - } - - output = &DescribeEgressOnlyInternetGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEgressOnlyInternetGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your egress-only Internet gateways. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeEgressOnlyInternetGateways for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeEgressOnlyInternetGateways -func (c *EC2) DescribeEgressOnlyInternetGateways(input *DescribeEgressOnlyInternetGatewaysInput) (*DescribeEgressOnlyInternetGatewaysOutput, error) { - req, out := c.DescribeEgressOnlyInternetGatewaysRequest(input) - return out, req.Send() -} - -// DescribeEgressOnlyInternetGatewaysWithContext is the same as DescribeEgressOnlyInternetGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeEgressOnlyInternetGateways for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeEgressOnlyInternetGatewaysWithContext(ctx aws.Context, input *DescribeEgressOnlyInternetGatewaysInput, opts ...request.Option) (*DescribeEgressOnlyInternetGatewaysOutput, error) { - req, out := c.DescribeEgressOnlyInternetGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeElasticGpus = "DescribeElasticGpus" - -// DescribeElasticGpusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeElasticGpus operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeElasticGpus for more information on using the DescribeElasticGpus -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeElasticGpusRequest method. -// req, resp := client.DescribeElasticGpusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeElasticGpus -func (c *EC2) DescribeElasticGpusRequest(input *DescribeElasticGpusInput) (req *request.Request, output *DescribeElasticGpusOutput) { - op := &request.Operation{ - Name: opDescribeElasticGpus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeElasticGpusInput{} - } - - output = &DescribeElasticGpusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeElasticGpus API operation for Amazon Elastic Compute Cloud. -// -// Describes the Elastic GPUs associated with your instances. For more information -// about Elastic GPUs, see Amazon EC2 Elastic GPUs (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-gpus.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeElasticGpus for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeElasticGpus -func (c *EC2) DescribeElasticGpus(input *DescribeElasticGpusInput) (*DescribeElasticGpusOutput, error) { - req, out := c.DescribeElasticGpusRequest(input) - return out, req.Send() -} - -// DescribeElasticGpusWithContext is the same as DescribeElasticGpus with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeElasticGpus for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeElasticGpusWithContext(ctx aws.Context, input *DescribeElasticGpusInput, opts ...request.Option) (*DescribeElasticGpusOutput, error) { - req, out := c.DescribeElasticGpusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeExportTasks = "DescribeExportTasks" - -// DescribeExportTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeExportTasks operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeExportTasks for more information on using the DescribeExportTasks -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeExportTasksRequest method. -// req, resp := client.DescribeExportTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeExportTasks -func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *request.Request, output *DescribeExportTasksOutput) { - op := &request.Operation{ - Name: opDescribeExportTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeExportTasksInput{} - } - - output = &DescribeExportTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeExportTasks API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your export tasks. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeExportTasks for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeExportTasks -func (c *EC2) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) { - req, out := c.DescribeExportTasksRequest(input) - return out, req.Send() -} - -// DescribeExportTasksWithContext is the same as DescribeExportTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeExportTasks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeExportTasksWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.Option) (*DescribeExportTasksOutput, error) { - req, out := c.DescribeExportTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeFleetHistory = "DescribeFleetHistory" - -// DescribeFleetHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFleetHistory operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeFleetHistory for more information on using the DescribeFleetHistory -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeFleetHistoryRequest method. -// req, resp := client.DescribeFleetHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFleetHistory -func (c *EC2) DescribeFleetHistoryRequest(input *DescribeFleetHistoryInput) (req *request.Request, output *DescribeFleetHistoryOutput) { - op := &request.Operation{ - Name: opDescribeFleetHistory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeFleetHistoryInput{} - } - - output = &DescribeFleetHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFleetHistory API operation for Amazon Elastic Compute Cloud. -// -// Describes the events for the specified EC2 Fleet during the specified time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeFleetHistory for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFleetHistory -func (c *EC2) DescribeFleetHistory(input *DescribeFleetHistoryInput) (*DescribeFleetHistoryOutput, error) { - req, out := c.DescribeFleetHistoryRequest(input) - return out, req.Send() -} - -// DescribeFleetHistoryWithContext is the same as DescribeFleetHistory with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeFleetHistory for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeFleetHistoryWithContext(ctx aws.Context, input *DescribeFleetHistoryInput, opts ...request.Option) (*DescribeFleetHistoryOutput, error) { - req, out := c.DescribeFleetHistoryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeFleetInstances = "DescribeFleetInstances" - -// DescribeFleetInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFleetInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeFleetInstances for more information on using the DescribeFleetInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeFleetInstancesRequest method. -// req, resp := client.DescribeFleetInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFleetInstances -func (c *EC2) DescribeFleetInstancesRequest(input *DescribeFleetInstancesInput) (req *request.Request, output *DescribeFleetInstancesOutput) { - op := &request.Operation{ - Name: opDescribeFleetInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeFleetInstancesInput{} - } - - output = &DescribeFleetInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFleetInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes the running instances for the specified EC2 Fleet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeFleetInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFleetInstances -func (c *EC2) DescribeFleetInstances(input *DescribeFleetInstancesInput) (*DescribeFleetInstancesOutput, error) { - req, out := c.DescribeFleetInstancesRequest(input) - return out, req.Send() -} - -// DescribeFleetInstancesWithContext is the same as DescribeFleetInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeFleetInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeFleetInstancesWithContext(ctx aws.Context, input *DescribeFleetInstancesInput, opts ...request.Option) (*DescribeFleetInstancesOutput, error) { - req, out := c.DescribeFleetInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeFleets = "DescribeFleets" - -// DescribeFleetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFleets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeFleets for more information on using the DescribeFleets -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeFleetsRequest method. -// req, resp := client.DescribeFleetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFleets -func (c *EC2) DescribeFleetsRequest(input *DescribeFleetsInput) (req *request.Request, output *DescribeFleetsOutput) { - op := &request.Operation{ - Name: opDescribeFleets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeFleetsInput{} - } - - output = &DescribeFleetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFleets API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified EC2 Fleet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeFleets for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFleets -func (c *EC2) DescribeFleets(input *DescribeFleetsInput) (*DescribeFleetsOutput, error) { - req, out := c.DescribeFleetsRequest(input) - return out, req.Send() -} - -// DescribeFleetsWithContext is the same as DescribeFleets with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeFleets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeFleetsWithContext(ctx aws.Context, input *DescribeFleetsInput, opts ...request.Option) (*DescribeFleetsOutput, error) { - req, out := c.DescribeFleetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeFlowLogs = "DescribeFlowLogs" - -// DescribeFlowLogsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFlowLogs operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeFlowLogs for more information on using the DescribeFlowLogs -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeFlowLogsRequest method. -// req, resp := client.DescribeFlowLogsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFlowLogs -func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *request.Request, output *DescribeFlowLogsOutput) { - op := &request.Operation{ - Name: opDescribeFlowLogs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeFlowLogsInput{} - } - - output = &DescribeFlowLogsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFlowLogs API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more flow logs. To view the information in your flow logs -// (the log streams for the network interfaces), you must use the CloudWatch -// Logs console or the CloudWatch Logs API. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeFlowLogs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFlowLogs -func (c *EC2) DescribeFlowLogs(input *DescribeFlowLogsInput) (*DescribeFlowLogsOutput, error) { - req, out := c.DescribeFlowLogsRequest(input) - return out, req.Send() -} - -// DescribeFlowLogsWithContext is the same as DescribeFlowLogs with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeFlowLogs for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeFlowLogsWithContext(ctx aws.Context, input *DescribeFlowLogsInput, opts ...request.Option) (*DescribeFlowLogsOutput, error) { - req, out := c.DescribeFlowLogsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeFpgaImageAttribute = "DescribeFpgaImageAttribute" - -// DescribeFpgaImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFpgaImageAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeFpgaImageAttribute for more information on using the DescribeFpgaImageAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeFpgaImageAttributeRequest method. -// req, resp := client.DescribeFpgaImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFpgaImageAttribute -func (c *EC2) DescribeFpgaImageAttributeRequest(input *DescribeFpgaImageAttributeInput) (req *request.Request, output *DescribeFpgaImageAttributeOutput) { - op := &request.Operation{ - Name: opDescribeFpgaImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeFpgaImageAttributeInput{} - } - - output = &DescribeFpgaImageAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFpgaImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified Amazon FPGA Image (AFI). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeFpgaImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFpgaImageAttribute -func (c *EC2) DescribeFpgaImageAttribute(input *DescribeFpgaImageAttributeInput) (*DescribeFpgaImageAttributeOutput, error) { - req, out := c.DescribeFpgaImageAttributeRequest(input) - return out, req.Send() -} - -// DescribeFpgaImageAttributeWithContext is the same as DescribeFpgaImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeFpgaImageAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeFpgaImageAttributeWithContext(ctx aws.Context, input *DescribeFpgaImageAttributeInput, opts ...request.Option) (*DescribeFpgaImageAttributeOutput, error) { - req, out := c.DescribeFpgaImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeFpgaImages = "DescribeFpgaImages" - -// DescribeFpgaImagesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFpgaImages operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeFpgaImages for more information on using the DescribeFpgaImages -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeFpgaImagesRequest method. -// req, resp := client.DescribeFpgaImagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFpgaImages -func (c *EC2) DescribeFpgaImagesRequest(input *DescribeFpgaImagesInput) (req *request.Request, output *DescribeFpgaImagesOutput) { - op := &request.Operation{ - Name: opDescribeFpgaImages, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeFpgaImagesInput{} - } - - output = &DescribeFpgaImagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFpgaImages API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more available Amazon FPGA Images (AFIs). These include -// public AFIs, private AFIs that you own, and AFIs owned by other AWS accounts -// for which you have load permissions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeFpgaImages for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFpgaImages -func (c *EC2) DescribeFpgaImages(input *DescribeFpgaImagesInput) (*DescribeFpgaImagesOutput, error) { - req, out := c.DescribeFpgaImagesRequest(input) - return out, req.Send() -} - -// DescribeFpgaImagesWithContext is the same as DescribeFpgaImages with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeFpgaImages for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeFpgaImagesWithContext(ctx aws.Context, input *DescribeFpgaImagesInput, opts ...request.Option) (*DescribeFpgaImagesOutput, error) { - req, out := c.DescribeFpgaImagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeHostReservationOfferings = "DescribeHostReservationOfferings" - -// DescribeHostReservationOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHostReservationOfferings operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeHostReservationOfferings for more information on using the DescribeHostReservationOfferings -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeHostReservationOfferingsRequest method. -// req, resp := client.DescribeHostReservationOfferingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationOfferings -func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReservationOfferingsInput) (req *request.Request, output *DescribeHostReservationOfferingsOutput) { - op := &request.Operation{ - Name: opDescribeHostReservationOfferings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeHostReservationOfferingsInput{} - } - - output = &DescribeHostReservationOfferingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHostReservationOfferings API operation for Amazon Elastic Compute Cloud. -// -// Describes the Dedicated Host Reservations that are available to purchase. -// -// The results describe all the Dedicated Host Reservation offerings, including -// offerings that may not match the instance family and region of your Dedicated -// Hosts. When purchasing an offering, ensure that the the instance family and -// region of the offering matches that of the Dedicated Host/s it will be associated -// with. For an overview of supported instance types, see Dedicated Hosts Overview -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeHostReservationOfferings for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationOfferings -func (c *EC2) DescribeHostReservationOfferings(input *DescribeHostReservationOfferingsInput) (*DescribeHostReservationOfferingsOutput, error) { - req, out := c.DescribeHostReservationOfferingsRequest(input) - return out, req.Send() -} - -// DescribeHostReservationOfferingsWithContext is the same as DescribeHostReservationOfferings with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeHostReservationOfferings for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeHostReservationOfferingsWithContext(ctx aws.Context, input *DescribeHostReservationOfferingsInput, opts ...request.Option) (*DescribeHostReservationOfferingsOutput, error) { - req, out := c.DescribeHostReservationOfferingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeHostReservations = "DescribeHostReservations" - -// DescribeHostReservationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHostReservations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeHostReservations for more information on using the DescribeHostReservations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeHostReservationsRequest method. -// req, resp := client.DescribeHostReservationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservations -func (c *EC2) DescribeHostReservationsRequest(input *DescribeHostReservationsInput) (req *request.Request, output *DescribeHostReservationsOutput) { - op := &request.Operation{ - Name: opDescribeHostReservations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeHostReservationsInput{} - } - - output = &DescribeHostReservationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHostReservations API operation for Amazon Elastic Compute Cloud. -// -// Describes Dedicated Host Reservations which are associated with Dedicated -// Hosts in your account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeHostReservations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservations -func (c *EC2) DescribeHostReservations(input *DescribeHostReservationsInput) (*DescribeHostReservationsOutput, error) { - req, out := c.DescribeHostReservationsRequest(input) - return out, req.Send() -} - -// DescribeHostReservationsWithContext is the same as DescribeHostReservations with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeHostReservations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeHostReservationsWithContext(ctx aws.Context, input *DescribeHostReservationsInput, opts ...request.Option) (*DescribeHostReservationsOutput, error) { - req, out := c.DescribeHostReservationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeHosts = "DescribeHosts" - -// DescribeHostsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHosts operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeHosts for more information on using the DescribeHosts -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeHostsRequest method. -// req, resp := client.DescribeHostsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHosts -func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) (req *request.Request, output *DescribeHostsOutput) { - op := &request.Operation{ - Name: opDescribeHosts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeHostsInput{} - } - - output = &DescribeHostsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHosts API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your Dedicated Hosts. -// -// The results describe only the Dedicated Hosts in the region you're currently -// using. All listed instances consume capacity on your Dedicated Host. Dedicated -// Hosts that have recently been released will be listed with the state released. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeHosts for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHosts -func (c *EC2) DescribeHosts(input *DescribeHostsInput) (*DescribeHostsOutput, error) { - req, out := c.DescribeHostsRequest(input) - return out, req.Send() -} - -// DescribeHostsWithContext is the same as DescribeHosts with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeHosts for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeHostsWithContext(ctx aws.Context, input *DescribeHostsInput, opts ...request.Option) (*DescribeHostsOutput, error) { - req, out := c.DescribeHostsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAssociations" - -// DescribeIamInstanceProfileAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeIamInstanceProfileAssociations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeIamInstanceProfileAssociations for more information on using the DescribeIamInstanceProfileAssociations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeIamInstanceProfileAssociationsRequest method. -// req, resp := client.DescribeIamInstanceProfileAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociations -func (c *EC2) DescribeIamInstanceProfileAssociationsRequest(input *DescribeIamInstanceProfileAssociationsInput) (req *request.Request, output *DescribeIamInstanceProfileAssociationsOutput) { - op := &request.Operation{ - Name: opDescribeIamInstanceProfileAssociations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeIamInstanceProfileAssociationsInput{} - } - - output = &DescribeIamInstanceProfileAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeIamInstanceProfileAssociations API operation for Amazon Elastic Compute Cloud. -// -// Describes your IAM instance profile associations. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeIamInstanceProfileAssociations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociations -func (c *EC2) DescribeIamInstanceProfileAssociations(input *DescribeIamInstanceProfileAssociationsInput) (*DescribeIamInstanceProfileAssociationsOutput, error) { - req, out := c.DescribeIamInstanceProfileAssociationsRequest(input) - return out, req.Send() -} - -// DescribeIamInstanceProfileAssociationsWithContext is the same as DescribeIamInstanceProfileAssociations with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeIamInstanceProfileAssociations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeIamInstanceProfileAssociationsWithContext(ctx aws.Context, input *DescribeIamInstanceProfileAssociationsInput, opts ...request.Option) (*DescribeIamInstanceProfileAssociationsOutput, error) { - req, out := c.DescribeIamInstanceProfileAssociationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeIdFormat = "DescribeIdFormat" - -// DescribeIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the DescribeIdFormat operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeIdFormat for more information on using the DescribeIdFormat -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeIdFormatRequest method. -// req, resp := client.DescribeIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdFormat -func (c *EC2) DescribeIdFormatRequest(input *DescribeIdFormatInput) (req *request.Request, output *DescribeIdFormatOutput) { - op := &request.Operation{ - Name: opDescribeIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeIdFormatInput{} - } - - output = &DescribeIdFormatOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Describes the ID format settings for your resources on a per-region basis, -// for example, to view which resource types are enabled for longer IDs. This -// request only returns information about resource types whose ID formats can -// be modified; it does not return information about other resource types. -// -// The following resource types support longer IDs: bundle | conversion-task -// | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway -// | network-acl | network-acl-association | network-interface | network-interface-attachment -// | prefix-list | reservation | route-table | route-table-association | security-group -// | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. -// -// These settings apply to the IAM user who makes the request; they do not apply -// to the entire AWS account. By default, an IAM user defaults to the same settings -// as the root user, unless they explicitly override the settings by running -// the ModifyIdFormat command. Resources created with longer IDs are visible -// to all IAM users, regardless of these settings and provided that they have -// permission to use the relevant Describe command for the resource type. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeIdFormat for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdFormat -func (c *EC2) DescribeIdFormat(input *DescribeIdFormatInput) (*DescribeIdFormatOutput, error) { - req, out := c.DescribeIdFormatRequest(input) - return out, req.Send() -} - -// DescribeIdFormatWithContext is the same as DescribeIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeIdFormat for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeIdFormatWithContext(ctx aws.Context, input *DescribeIdFormatInput, opts ...request.Option) (*DescribeIdFormatOutput, error) { - req, out := c.DescribeIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeIdentityIdFormat = "DescribeIdentityIdFormat" - -// DescribeIdentityIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the DescribeIdentityIdFormat operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeIdentityIdFormat for more information on using the DescribeIdentityIdFormat -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeIdentityIdFormatRequest method. -// req, resp := client.DescribeIdentityIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdentityIdFormat -func (c *EC2) DescribeIdentityIdFormatRequest(input *DescribeIdentityIdFormatInput) (req *request.Request, output *DescribeIdentityIdFormatOutput) { - op := &request.Operation{ - Name: opDescribeIdentityIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeIdentityIdFormatInput{} - } - - output = &DescribeIdentityIdFormatOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeIdentityIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Describes the ID format settings for resources for the specified IAM user, -// IAM role, or root user. For example, you can view the resource types that -// are enabled for longer IDs. This request only returns information about resource -// types whose ID formats can be modified; it does not return information about -// other resource types. For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// The following resource types support longer IDs: bundle | conversion-task -// | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway -// | network-acl | network-acl-association | network-interface | network-interface-attachment -// | prefix-list | reservation | route-table | route-table-association | security-group -// | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. -// -// These settings apply to the principal specified in the request. They do not -// apply to the principal that makes the request. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeIdentityIdFormat for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdentityIdFormat -func (c *EC2) DescribeIdentityIdFormat(input *DescribeIdentityIdFormatInput) (*DescribeIdentityIdFormatOutput, error) { - req, out := c.DescribeIdentityIdFormatRequest(input) - return out, req.Send() -} - -// DescribeIdentityIdFormatWithContext is the same as DescribeIdentityIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeIdentityIdFormat for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeIdentityIdFormatWithContext(ctx aws.Context, input *DescribeIdentityIdFormatInput, opts ...request.Option) (*DescribeIdentityIdFormatOutput, error) { - req, out := c.DescribeIdentityIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImageAttribute = "DescribeImageAttribute" - -// DescribeImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeImageAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeImageAttribute for more information on using the DescribeImageAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeImageAttributeRequest method. -// req, resp := client.DescribeImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImageAttribute -func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) (req *request.Request, output *DescribeImageAttributeOutput) { - op := &request.Operation{ - Name: opDescribeImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImageAttributeInput{} - } - - output = &DescribeImageAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified AMI. You can specify only -// one attribute at a time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImageAttribute -func (c *EC2) DescribeImageAttribute(input *DescribeImageAttributeInput) (*DescribeImageAttributeOutput, error) { - req, out := c.DescribeImageAttributeRequest(input) - return out, req.Send() -} - -// DescribeImageAttributeWithContext is the same as DescribeImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImageAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeImageAttributeWithContext(ctx aws.Context, input *DescribeImageAttributeInput, opts ...request.Option) (*DescribeImageAttributeOutput, error) { - req, out := c.DescribeImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImages = "DescribeImages" - -// DescribeImagesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeImages operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeImages for more information on using the DescribeImages -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeImagesRequest method. -// req, resp := client.DescribeImagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImages -func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Request, output *DescribeImagesOutput) { - op := &request.Operation{ - Name: opDescribeImages, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImagesInput{} - } - - output = &DescribeImagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImages API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the images (AMIs, AKIs, and ARIs) available to you. -// Images available to you include public images, private images that you own, -// and private images owned by other AWS accounts but for which you have explicit -// launch permissions. -// -// Deregistered images are included in the returned results for an unspecified -// interval after deregistration. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeImages for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImages -func (c *EC2) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, error) { - req, out := c.DescribeImagesRequest(input) - return out, req.Send() -} - -// DescribeImagesWithContext is the same as DescribeImages with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImages for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeImagesWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.Option) (*DescribeImagesOutput, error) { - req, out := c.DescribeImagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImportImageTasks = "DescribeImportImageTasks" - -// DescribeImportImageTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeImportImageTasks operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeImportImageTasks for more information on using the DescribeImportImageTasks -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeImportImageTasksRequest method. -// req, resp := client.DescribeImportImageTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportImageTasks -func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInput) (req *request.Request, output *DescribeImportImageTasksOutput) { - op := &request.Operation{ - Name: opDescribeImportImageTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImportImageTasksInput{} - } - - output = &DescribeImportImageTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImportImageTasks API operation for Amazon Elastic Compute Cloud. -// -// Displays details about an import virtual machine or import snapshot tasks -// that are already created. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeImportImageTasks for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportImageTasks -func (c *EC2) DescribeImportImageTasks(input *DescribeImportImageTasksInput) (*DescribeImportImageTasksOutput, error) { - req, out := c.DescribeImportImageTasksRequest(input) - return out, req.Send() -} - -// DescribeImportImageTasksWithContext is the same as DescribeImportImageTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImportImageTasks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeImportImageTasksWithContext(ctx aws.Context, input *DescribeImportImageTasksInput, opts ...request.Option) (*DescribeImportImageTasksOutput, error) { - req, out := c.DescribeImportImageTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" - -// DescribeImportSnapshotTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeImportSnapshotTasks operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeImportSnapshotTasks for more information on using the DescribeImportSnapshotTasks -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeImportSnapshotTasksRequest method. -// req, resp := client.DescribeImportSnapshotTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportSnapshotTasks -func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTasksInput) (req *request.Request, output *DescribeImportSnapshotTasksOutput) { - op := &request.Operation{ - Name: opDescribeImportSnapshotTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImportSnapshotTasksInput{} - } - - output = &DescribeImportSnapshotTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImportSnapshotTasks API operation for Amazon Elastic Compute Cloud. -// -// Describes your import snapshot tasks. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeImportSnapshotTasks for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportSnapshotTasks -func (c *EC2) DescribeImportSnapshotTasks(input *DescribeImportSnapshotTasksInput) (*DescribeImportSnapshotTasksOutput, error) { - req, out := c.DescribeImportSnapshotTasksRequest(input) - return out, req.Send() -} - -// DescribeImportSnapshotTasksWithContext is the same as DescribeImportSnapshotTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImportSnapshotTasks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeImportSnapshotTasksWithContext(ctx aws.Context, input *DescribeImportSnapshotTasksInput, opts ...request.Option) (*DescribeImportSnapshotTasksOutput, error) { - req, out := c.DescribeImportSnapshotTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceAttribute = "DescribeInstanceAttribute" - -// DescribeInstanceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstanceAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeInstanceAttribute for more information on using the DescribeInstanceAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeInstanceAttributeRequest method. -// req, resp := client.DescribeInstanceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceAttribute -func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeInput) (req *request.Request, output *DescribeInstanceAttributeOutput) { - op := &request.Operation{ - Name: opDescribeInstanceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceAttributeInput{} - } - - output = &DescribeInstanceAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstanceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified instance. You can specify -// only one attribute at a time. Valid attribute values are: instanceType | -// kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior -// | rootDeviceName | blockDeviceMapping | productCodes | sourceDestCheck | -// groupSet | ebsOptimized | sriovNetSupport -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeInstanceAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceAttribute -func (c *EC2) DescribeInstanceAttribute(input *DescribeInstanceAttributeInput) (*DescribeInstanceAttributeOutput, error) { - req, out := c.DescribeInstanceAttributeRequest(input) - return out, req.Send() -} - -// DescribeInstanceAttributeWithContext is the same as DescribeInstanceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInstanceAttributeWithContext(ctx aws.Context, input *DescribeInstanceAttributeInput, opts ...request.Option) (*DescribeInstanceAttributeOutput, error) { - req, out := c.DescribeInstanceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceCreditSpecifications = "DescribeInstanceCreditSpecifications" - -// DescribeInstanceCreditSpecificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstanceCreditSpecifications operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeInstanceCreditSpecifications for more information on using the DescribeInstanceCreditSpecifications -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeInstanceCreditSpecificationsRequest method. -// req, resp := client.DescribeInstanceCreditSpecificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceCreditSpecifications -func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanceCreditSpecificationsInput) (req *request.Request, output *DescribeInstanceCreditSpecificationsOutput) { - op := &request.Operation{ - Name: opDescribeInstanceCreditSpecifications, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceCreditSpecificationsInput{} - } - - output = &DescribeInstanceCreditSpecificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstanceCreditSpecifications API operation for Amazon Elastic Compute Cloud. -// -// Describes the credit option for CPU usage of one or more of your T2 instances. -// The credit options are standard and unlimited. -// -// If you do not specify an instance ID, Amazon EC2 returns only the T2 instances -// with the unlimited credit option. If you specify one or more instance IDs, -// Amazon EC2 returns the credit option (standard or unlimited) of those instances. -// If you specify an instance ID that is not valid, such as an instance that -// is not a T2 instance, an error is returned. -// -// Recently terminated instances might appear in the returned results. This -// interval is usually less than one hour. -// -// If an Availability Zone is experiencing a service disruption and you specify -// instance IDs in the affected zone, or do not specify any instance IDs at -// all, the call fails. If you specify only instance IDs in an unaffected zone, -// the call works normally. -// -// For more information, see T2 Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeInstanceCreditSpecifications for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceCreditSpecifications -func (c *EC2) DescribeInstanceCreditSpecifications(input *DescribeInstanceCreditSpecificationsInput) (*DescribeInstanceCreditSpecificationsOutput, error) { - req, out := c.DescribeInstanceCreditSpecificationsRequest(input) - return out, req.Send() -} - -// DescribeInstanceCreditSpecificationsWithContext is the same as DescribeInstanceCreditSpecifications with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceCreditSpecifications for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInstanceCreditSpecificationsWithContext(ctx aws.Context, input *DescribeInstanceCreditSpecificationsInput, opts ...request.Option) (*DescribeInstanceCreditSpecificationsOutput, error) { - req, out := c.DescribeInstanceCreditSpecificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceStatus = "DescribeInstanceStatus" - -// DescribeInstanceStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstanceStatus operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeInstanceStatus for more information on using the DescribeInstanceStatus -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeInstanceStatusRequest method. -// req, resp := client.DescribeInstanceStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceStatus -func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) (req *request.Request, output *DescribeInstanceStatusOutput) { - op := &request.Operation{ - Name: opDescribeInstanceStatus, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeInstanceStatusInput{} - } - - output = &DescribeInstanceStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstanceStatus API operation for Amazon Elastic Compute Cloud. -// -// Describes the status of one or more instances. By default, only running instances -// are described, unless you specifically indicate to return the status of all -// instances. -// -// Instance status includes the following components: -// -// * Status checks - Amazon EC2 performs status checks on running EC2 instances -// to identify hardware and software issues. For more information, see Status -// Checks for Your Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html) -// and Troubleshooting Instances with Failed Status Checks (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// * Scheduled events - Amazon EC2 can schedule events (such as reboot, stop, -// or terminate) for your instances related to hardware issues, software -// updates, or system maintenance. For more information, see Scheduled Events -// for Your Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// * Instance state - You can manage your instances from the moment you launch -// them through their termination. For more information, see Instance Lifecycle -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeInstanceStatus for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceStatus -func (c *EC2) DescribeInstanceStatus(input *DescribeInstanceStatusInput) (*DescribeInstanceStatusOutput, error) { - req, out := c.DescribeInstanceStatusRequest(input) - return out, req.Send() -} - -// DescribeInstanceStatusWithContext is the same as DescribeInstanceStatus with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceStatus for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInstanceStatusWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.Option) (*DescribeInstanceStatusOutput, error) { - req, out := c.DescribeInstanceStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeInstanceStatusPages iterates over the pages of a DescribeInstanceStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeInstanceStatus method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeInstanceStatus operation. -// pageNum := 0 -// err := client.DescribeInstanceStatusPages(params, -// func(page *DescribeInstanceStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn func(*DescribeInstanceStatusOutput, bool) bool) error { - return c.DescribeInstanceStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeInstanceStatusPagesWithContext same as DescribeInstanceStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInstanceStatusPagesWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, fn func(*DescribeInstanceStatusOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeInstanceStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstanceStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstanceStatusOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeInstances = "DescribeInstances" - -// DescribeInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeInstances for more information on using the DescribeInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeInstancesRequest method. -// req, resp := client.DescribeInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstances -func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *request.Request, output *DescribeInstancesOutput) { - op := &request.Operation{ - Name: opDescribeInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeInstancesInput{} - } - - output = &DescribeInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your instances. -// -// If you specify one or more instance IDs, Amazon EC2 returns information for -// those instances. If you do not specify instance IDs, Amazon EC2 returns information -// for all relevant instances. If you specify an instance ID that is not valid, -// an error is returned. If you specify an instance that you do not own, it -// is not included in the returned results. -// -// Recently terminated instances might appear in the returned results. This -// interval is usually less than one hour. -// -// If you describe instances in the rare case where an Availability Zone is -// experiencing a service disruption and you specify instance IDs that are in -// the affected zone, or do not specify any instance IDs at all, the call fails. -// If you describe instances and specify only instance IDs that are in an unaffected -// zone, the call works normally. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstances -func (c *EC2) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstancesOutput, error) { - req, out := c.DescribeInstancesRequest(input) - return out, req.Send() -} - -// DescribeInstancesWithContext is the same as DescribeInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInstancesWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.Option) (*DescribeInstancesOutput, error) { - req, out := c.DescribeInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeInstancesPages iterates over the pages of a DescribeInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeInstances method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeInstances operation. -// pageNum := 0 -// err := client.DescribeInstancesPages(params, -// func(page *DescribeInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(*DescribeInstancesOutput, bool) bool) error { - return c.DescribeInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeInstancesPagesWithContext same as DescribeInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInstancesPagesWithContext(ctx aws.Context, input *DescribeInstancesInput, fn func(*DescribeInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstancesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeInternetGateways = "DescribeInternetGateways" - -// DescribeInternetGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInternetGateways operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeInternetGateways for more information on using the DescribeInternetGateways -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeInternetGatewaysRequest method. -// req, resp := client.DescribeInternetGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInternetGateways -func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInput) (req *request.Request, output *DescribeInternetGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeInternetGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInternetGatewaysInput{} - } - - output = &DescribeInternetGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInternetGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your Internet gateways. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeInternetGateways for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInternetGateways -func (c *EC2) DescribeInternetGateways(input *DescribeInternetGatewaysInput) (*DescribeInternetGatewaysOutput, error) { - req, out := c.DescribeInternetGatewaysRequest(input) - return out, req.Send() -} - -// DescribeInternetGatewaysWithContext is the same as DescribeInternetGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInternetGateways for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeInternetGatewaysWithContext(ctx aws.Context, input *DescribeInternetGatewaysInput, opts ...request.Option) (*DescribeInternetGatewaysOutput, error) { - req, out := c.DescribeInternetGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeKeyPairs = "DescribeKeyPairs" - -// DescribeKeyPairsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeKeyPairs operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeKeyPairs for more information on using the DescribeKeyPairs -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeKeyPairsRequest method. -// req, resp := client.DescribeKeyPairsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeKeyPairs -func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *request.Request, output *DescribeKeyPairsOutput) { - op := &request.Operation{ - Name: opDescribeKeyPairs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeKeyPairsInput{} - } - - output = &DescribeKeyPairsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeKeyPairs API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your key pairs. -// -// For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeKeyPairs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeKeyPairs -func (c *EC2) DescribeKeyPairs(input *DescribeKeyPairsInput) (*DescribeKeyPairsOutput, error) { - req, out := c.DescribeKeyPairsRequest(input) - return out, req.Send() -} - -// DescribeKeyPairsWithContext is the same as DescribeKeyPairs with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeKeyPairs for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeKeyPairsWithContext(ctx aws.Context, input *DescribeKeyPairsInput, opts ...request.Option) (*DescribeKeyPairsOutput, error) { - req, out := c.DescribeKeyPairsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeLaunchTemplateVersions = "DescribeLaunchTemplateVersions" - -// DescribeLaunchTemplateVersionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLaunchTemplateVersions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeLaunchTemplateVersions for more information on using the DescribeLaunchTemplateVersions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeLaunchTemplateVersionsRequest method. -// req, resp := client.DescribeLaunchTemplateVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLaunchTemplateVersions -func (c *EC2) DescribeLaunchTemplateVersionsRequest(input *DescribeLaunchTemplateVersionsInput) (req *request.Request, output *DescribeLaunchTemplateVersionsOutput) { - op := &request.Operation{ - Name: opDescribeLaunchTemplateVersions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLaunchTemplateVersionsInput{} - } - - output = &DescribeLaunchTemplateVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLaunchTemplateVersions API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more versions of a specified launch template. You can describe -// all versions, individual versions, or a range of versions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeLaunchTemplateVersions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLaunchTemplateVersions -func (c *EC2) DescribeLaunchTemplateVersions(input *DescribeLaunchTemplateVersionsInput) (*DescribeLaunchTemplateVersionsOutput, error) { - req, out := c.DescribeLaunchTemplateVersionsRequest(input) - return out, req.Send() -} - -// DescribeLaunchTemplateVersionsWithContext is the same as DescribeLaunchTemplateVersions with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLaunchTemplateVersions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeLaunchTemplateVersionsWithContext(ctx aws.Context, input *DescribeLaunchTemplateVersionsInput, opts ...request.Option) (*DescribeLaunchTemplateVersionsOutput, error) { - req, out := c.DescribeLaunchTemplateVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeLaunchTemplates = "DescribeLaunchTemplates" - -// DescribeLaunchTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLaunchTemplates operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeLaunchTemplates for more information on using the DescribeLaunchTemplates -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeLaunchTemplatesRequest method. -// req, resp := client.DescribeLaunchTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLaunchTemplates -func (c *EC2) DescribeLaunchTemplatesRequest(input *DescribeLaunchTemplatesInput) (req *request.Request, output *DescribeLaunchTemplatesOutput) { - op := &request.Operation{ - Name: opDescribeLaunchTemplates, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLaunchTemplatesInput{} - } - - output = &DescribeLaunchTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLaunchTemplates API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more launch templates. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeLaunchTemplates for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLaunchTemplates -func (c *EC2) DescribeLaunchTemplates(input *DescribeLaunchTemplatesInput) (*DescribeLaunchTemplatesOutput, error) { - req, out := c.DescribeLaunchTemplatesRequest(input) - return out, req.Send() -} - -// DescribeLaunchTemplatesWithContext is the same as DescribeLaunchTemplates with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLaunchTemplates for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeLaunchTemplatesWithContext(ctx aws.Context, input *DescribeLaunchTemplatesInput, opts ...request.Option) (*DescribeLaunchTemplatesOutput, error) { - req, out := c.DescribeLaunchTemplatesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeMovingAddresses = "DescribeMovingAddresses" - -// DescribeMovingAddressesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMovingAddresses operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeMovingAddresses for more information on using the DescribeMovingAddresses -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeMovingAddressesRequest method. -// req, resp := client.DescribeMovingAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddresses -func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput) (req *request.Request, output *DescribeMovingAddressesOutput) { - op := &request.Operation{ - Name: opDescribeMovingAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMovingAddressesInput{} - } - - output = &DescribeMovingAddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMovingAddresses API operation for Amazon Elastic Compute Cloud. -// -// Describes your Elastic IP addresses that are being moved to the EC2-VPC platform, -// or that are being restored to the EC2-Classic platform. This request does -// not return information about any other Elastic IP addresses in your account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeMovingAddresses for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddresses -func (c *EC2) DescribeMovingAddresses(input *DescribeMovingAddressesInput) (*DescribeMovingAddressesOutput, error) { - req, out := c.DescribeMovingAddressesRequest(input) - return out, req.Send() -} - -// DescribeMovingAddressesWithContext is the same as DescribeMovingAddresses with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeMovingAddresses for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeMovingAddressesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, opts ...request.Option) (*DescribeMovingAddressesOutput, error) { - req, out := c.DescribeMovingAddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeNatGateways = "DescribeNatGateways" - -// DescribeNatGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNatGateways operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeNatGateways for more information on using the DescribeNatGateways -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeNatGatewaysRequest method. -// req, resp := client.DescribeNatGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGateways -func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) (req *request.Request, output *DescribeNatGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeNatGateways, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeNatGatewaysInput{} - } - - output = &DescribeNatGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNatGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the your NAT gateways. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeNatGateways for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGateways -func (c *EC2) DescribeNatGateways(input *DescribeNatGatewaysInput) (*DescribeNatGatewaysOutput, error) { - req, out := c.DescribeNatGatewaysRequest(input) - return out, req.Send() -} - -// DescribeNatGatewaysWithContext is the same as DescribeNatGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNatGateways for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeNatGatewaysWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.Option) (*DescribeNatGatewaysOutput, error) { - req, out := c.DescribeNatGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeNatGatewaysPages iterates over the pages of a DescribeNatGateways operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeNatGateways method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeNatGateways operation. -// pageNum := 0 -// err := client.DescribeNatGatewaysPages(params, -// func(page *DescribeNatGatewaysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeNatGatewaysPages(input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool) error { - return c.DescribeNatGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeNatGatewaysPagesWithContext same as DescribeNatGatewaysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeNatGatewaysPagesWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeNatGatewaysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeNatGatewaysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNatGatewaysOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeNetworkAcls = "DescribeNetworkAcls" - -// DescribeNetworkAclsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkAcls operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeNetworkAcls for more information on using the DescribeNetworkAcls -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeNetworkAclsRequest method. -// req, resp := client.DescribeNetworkAclsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAcls -func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *request.Request, output *DescribeNetworkAclsOutput) { - op := &request.Operation{ - Name: opDescribeNetworkAcls, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeNetworkAclsInput{} - } - - output = &DescribeNetworkAclsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNetworkAcls API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your network ACLs. -// -// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeNetworkAcls for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAcls -func (c *EC2) DescribeNetworkAcls(input *DescribeNetworkAclsInput) (*DescribeNetworkAclsOutput, error) { - req, out := c.DescribeNetworkAclsRequest(input) - return out, req.Send() -} - -// DescribeNetworkAclsWithContext is the same as DescribeNetworkAcls with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNetworkAcls for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeNetworkAclsWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, opts ...request.Option) (*DescribeNetworkAclsOutput, error) { - req, out := c.DescribeNetworkAclsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" - -// DescribeNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkInterfaceAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeNetworkInterfaceAttribute for more information on using the DescribeNetworkInterfaceAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeNetworkInterfaceAttributeRequest method. -// req, resp := client.DescribeNetworkInterfaceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttribute -func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInterfaceAttributeInput) (req *request.Request, output *DescribeNetworkInterfaceAttributeOutput) { - op := &request.Operation{ - Name: opDescribeNetworkInterfaceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeNetworkInterfaceAttributeInput{} - } - - output = &DescribeNetworkInterfaceAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes a network interface attribute. You can specify only one attribute -// at a time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeNetworkInterfaceAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttribute -func (c *EC2) DescribeNetworkInterfaceAttribute(input *DescribeNetworkInterfaceAttributeInput) (*DescribeNetworkInterfaceAttributeOutput, error) { - req, out := c.DescribeNetworkInterfaceAttributeRequest(input) - return out, req.Send() -} - -// DescribeNetworkInterfaceAttributeWithContext is the same as DescribeNetworkInterfaceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNetworkInterfaceAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeNetworkInterfaceAttributeWithContext(ctx aws.Context, input *DescribeNetworkInterfaceAttributeInput, opts ...request.Option) (*DescribeNetworkInterfaceAttributeOutput, error) { - req, out := c.DescribeNetworkInterfaceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeNetworkInterfacePermissions = "DescribeNetworkInterfacePermissions" - -// DescribeNetworkInterfacePermissionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkInterfacePermissions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeNetworkInterfacePermissions for more information on using the DescribeNetworkInterfacePermissions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeNetworkInterfacePermissionsRequest method. -// req, resp := client.DescribeNetworkInterfacePermissionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfacePermissions -func (c *EC2) DescribeNetworkInterfacePermissionsRequest(input *DescribeNetworkInterfacePermissionsInput) (req *request.Request, output *DescribeNetworkInterfacePermissionsOutput) { - op := &request.Operation{ - Name: opDescribeNetworkInterfacePermissions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeNetworkInterfacePermissionsInput{} - } - - output = &DescribeNetworkInterfacePermissionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNetworkInterfacePermissions API operation for Amazon Elastic Compute Cloud. -// -// Describes the permissions for your network interfaces. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeNetworkInterfacePermissions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfacePermissions -func (c *EC2) DescribeNetworkInterfacePermissions(input *DescribeNetworkInterfacePermissionsInput) (*DescribeNetworkInterfacePermissionsOutput, error) { - req, out := c.DescribeNetworkInterfacePermissionsRequest(input) - return out, req.Send() -} - -// DescribeNetworkInterfacePermissionsWithContext is the same as DescribeNetworkInterfacePermissions with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNetworkInterfacePermissions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeNetworkInterfacePermissionsWithContext(ctx aws.Context, input *DescribeNetworkInterfacePermissionsInput, opts ...request.Option) (*DescribeNetworkInterfacePermissionsOutput, error) { - req, out := c.DescribeNetworkInterfacePermissionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" - -// DescribeNetworkInterfacesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkInterfaces operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeNetworkInterfaces for more information on using the DescribeNetworkInterfaces -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeNetworkInterfacesRequest method. -// req, resp := client.DescribeNetworkInterfacesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaces -func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesInput) (req *request.Request, output *DescribeNetworkInterfacesOutput) { - op := &request.Operation{ - Name: opDescribeNetworkInterfaces, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeNetworkInterfacesInput{} - } - - output = &DescribeNetworkInterfacesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNetworkInterfaces API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your network interfaces. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeNetworkInterfaces for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaces -func (c *EC2) DescribeNetworkInterfaces(input *DescribeNetworkInterfacesInput) (*DescribeNetworkInterfacesOutput, error) { - req, out := c.DescribeNetworkInterfacesRequest(input) - return out, req.Send() -} - -// DescribeNetworkInterfacesWithContext is the same as DescribeNetworkInterfaces with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNetworkInterfaces for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeNetworkInterfacesWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.Option) (*DescribeNetworkInterfacesOutput, error) { - req, out := c.DescribeNetworkInterfacesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribePlacementGroups = "DescribePlacementGroups" - -// DescribePlacementGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePlacementGroups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribePlacementGroups for more information on using the DescribePlacementGroups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribePlacementGroupsRequest method. -// req, resp := client.DescribePlacementGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroups -func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput) (req *request.Request, output *DescribePlacementGroupsOutput) { - op := &request.Operation{ - Name: opDescribePlacementGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePlacementGroupsInput{} - } - - output = &DescribePlacementGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePlacementGroups API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your placement groups. For more information, see -// Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribePlacementGroups for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroups -func (c *EC2) DescribePlacementGroups(input *DescribePlacementGroupsInput) (*DescribePlacementGroupsOutput, error) { - req, out := c.DescribePlacementGroupsRequest(input) - return out, req.Send() -} - -// DescribePlacementGroupsWithContext is the same as DescribePlacementGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DescribePlacementGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribePlacementGroupsWithContext(ctx aws.Context, input *DescribePlacementGroupsInput, opts ...request.Option) (*DescribePlacementGroupsOutput, error) { - req, out := c.DescribePlacementGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribePrefixLists = "DescribePrefixLists" - -// DescribePrefixListsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePrefixLists operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribePrefixLists for more information on using the DescribePrefixLists -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribePrefixListsRequest method. -// req, resp := client.DescribePrefixListsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixLists -func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *request.Request, output *DescribePrefixListsOutput) { - op := &request.Operation{ - Name: opDescribePrefixLists, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePrefixListsInput{} - } - - output = &DescribePrefixListsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePrefixLists API operation for Amazon Elastic Compute Cloud. -// -// Describes available AWS services in a prefix list format, which includes -// the prefix list name and prefix list ID of the service and the IP address -// range for the service. A prefix list ID is required for creating an outbound -// security group rule that allows traffic from a VPC to access an AWS service -// through a gateway VPC endpoint. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribePrefixLists for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixLists -func (c *EC2) DescribePrefixLists(input *DescribePrefixListsInput) (*DescribePrefixListsOutput, error) { - req, out := c.DescribePrefixListsRequest(input) - return out, req.Send() -} - -// DescribePrefixListsWithContext is the same as DescribePrefixLists with the addition of -// the ability to pass a context and additional request options. -// -// See DescribePrefixLists for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribePrefixListsWithContext(ctx aws.Context, input *DescribePrefixListsInput, opts ...request.Option) (*DescribePrefixListsOutput, error) { - req, out := c.DescribePrefixListsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribePrincipalIdFormat = "DescribePrincipalIdFormat" - -// DescribePrincipalIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the DescribePrincipalIdFormat operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribePrincipalIdFormat for more information on using the DescribePrincipalIdFormat -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribePrincipalIdFormatRequest method. -// req, resp := client.DescribePrincipalIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrincipalIdFormat -func (c *EC2) DescribePrincipalIdFormatRequest(input *DescribePrincipalIdFormatInput) (req *request.Request, output *DescribePrincipalIdFormatOutput) { - op := &request.Operation{ - Name: opDescribePrincipalIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePrincipalIdFormatInput{} - } - - output = &DescribePrincipalIdFormatOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePrincipalIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Describes the ID format settings for the root user and all IAM roles and -// IAM users that have explicitly specified a longer ID (17-character ID) preference. -// -// By default, all IAM roles and IAM users default to the same ID settings as -// the root user, unless they explicitly override the settings. This request -// is useful for identifying those IAM users and IAM roles that have overridden -// the default ID settings. -// -// The following resource types support longer IDs: bundle | conversion-task -// | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway -// | network-acl | network-acl-association | network-interface | network-interface-attachment -// | prefix-list | reservation | route-table | route-table-association | security-group -// | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribePrincipalIdFormat for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrincipalIdFormat -func (c *EC2) DescribePrincipalIdFormat(input *DescribePrincipalIdFormatInput) (*DescribePrincipalIdFormatOutput, error) { - req, out := c.DescribePrincipalIdFormatRequest(input) - return out, req.Send() -} - -// DescribePrincipalIdFormatWithContext is the same as DescribePrincipalIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See DescribePrincipalIdFormat for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribePrincipalIdFormatWithContext(ctx aws.Context, input *DescribePrincipalIdFormatInput, opts ...request.Option) (*DescribePrincipalIdFormatOutput, error) { - req, out := c.DescribePrincipalIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeRegions = "DescribeRegions" - -// DescribeRegionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRegions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeRegions for more information on using the DescribeRegions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeRegionsRequest method. -// req, resp := client.DescribeRegionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegions -func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request.Request, output *DescribeRegionsOutput) { - op := &request.Operation{ - Name: opDescribeRegions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRegionsInput{} - } - - output = &DescribeRegionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRegions API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more regions that are currently available to you. -// -// For a list of the regions supported by Amazon EC2, see Regions and Endpoints -// (http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeRegions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegions -func (c *EC2) DescribeRegions(input *DescribeRegionsInput) (*DescribeRegionsOutput, error) { - req, out := c.DescribeRegionsRequest(input) - return out, req.Send() -} - -// DescribeRegionsWithContext is the same as DescribeRegions with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeRegions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeRegionsWithContext(ctx aws.Context, input *DescribeRegionsInput, opts ...request.Option) (*DescribeRegionsOutput, error) { - req, out := c.DescribeRegionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeReservedInstances = "DescribeReservedInstances" - -// DescribeReservedInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeReservedInstances for more information on using the DescribeReservedInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeReservedInstancesRequest method. -// req, resp := client.DescribeReservedInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstances -func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesInput) (req *request.Request, output *DescribeReservedInstancesOutput) { - op := &request.Operation{ - Name: opDescribeReservedInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReservedInstancesInput{} - } - - output = &DescribeReservedInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the Reserved Instances that you purchased. -// -// For more information about Reserved Instances, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstances -func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) (*DescribeReservedInstancesOutput, error) { - req, out := c.DescribeReservedInstancesRequest(input) - return out, req.Send() -} - -// DescribeReservedInstancesWithContext is the same as DescribeReservedInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesWithContext(ctx aws.Context, input *DescribeReservedInstancesInput, opts ...request.Option) (*DescribeReservedInstancesOutput, error) { - req, out := c.DescribeReservedInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" - -// DescribeReservedInstancesListingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesListings operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeReservedInstancesListings for more information on using the DescribeReservedInstancesListings -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeReservedInstancesListingsRequest method. -// req, resp := client.DescribeReservedInstancesListingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListings -func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedInstancesListingsInput) (req *request.Request, output *DescribeReservedInstancesListingsOutput) { - op := &request.Operation{ - Name: opDescribeReservedInstancesListings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReservedInstancesListingsInput{} - } - - output = &DescribeReservedInstancesListingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedInstancesListings API operation for Amazon Elastic Compute Cloud. -// -// Describes your account's Reserved Instance listings in the Reserved Instance -// Marketplace. -// -// The Reserved Instance Marketplace matches sellers who want to resell Reserved -// Instance capacity that they no longer need with buyers who want to purchase -// additional capacity. Reserved Instances bought and sold through the Reserved -// Instance Marketplace work like any other Reserved Instances. -// -// As a seller, you choose to list some or all of your Reserved Instances, and -// you specify the upfront price to receive for them. Your Reserved Instances -// are then listed in the Reserved Instance Marketplace and are available for -// purchase. -// -// As a buyer, you specify the configuration of the Reserved Instance to purchase, -// and the Marketplace matches what you're searching for with what's available. -// The Marketplace first sells the lowest priced Reserved Instances to you, -// and continues to sell available Reserved Instance listings to you until your -// demand is met. You are charged based on the total price of all of the listings -// that you purchase. -// -// For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstancesListings for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListings -func (c *EC2) DescribeReservedInstancesListings(input *DescribeReservedInstancesListingsInput) (*DescribeReservedInstancesListingsOutput, error) { - req, out := c.DescribeReservedInstancesListingsRequest(input) - return out, req.Send() -} - -// DescribeReservedInstancesListingsWithContext is the same as DescribeReservedInstancesListings with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstancesListings for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesListingsWithContext(ctx aws.Context, input *DescribeReservedInstancesListingsInput, opts ...request.Option) (*DescribeReservedInstancesListingsOutput, error) { - req, out := c.DescribeReservedInstancesListingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModifications" - -// DescribeReservedInstancesModificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesModifications operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeReservedInstancesModifications for more information on using the DescribeReservedInstancesModifications -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeReservedInstancesModificationsRequest method. -// req, resp := client.DescribeReservedInstancesModificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModifications -func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReservedInstancesModificationsInput) (req *request.Request, output *DescribeReservedInstancesModificationsOutput) { - op := &request.Operation{ - Name: opDescribeReservedInstancesModifications, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedInstancesModificationsInput{} - } - - output = &DescribeReservedInstancesModificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedInstancesModifications API operation for Amazon Elastic Compute Cloud. -// -// Describes the modifications made to your Reserved Instances. If no parameter -// is specified, information about all your Reserved Instances modification -// requests is returned. If a modification ID is specified, only information -// about the specific modification is returned. -// -// For more information, see Modifying Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstancesModifications for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModifications -func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInstancesModificationsInput) (*DescribeReservedInstancesModificationsOutput, error) { - req, out := c.DescribeReservedInstancesModificationsRequest(input) - return out, req.Send() -} - -// DescribeReservedInstancesModificationsWithContext is the same as DescribeReservedInstancesModifications with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstancesModifications for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesModificationsWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, opts ...request.Option) (*DescribeReservedInstancesModificationsOutput, error) { - req, out := c.DescribeReservedInstancesModificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeReservedInstancesModificationsPages iterates over the pages of a DescribeReservedInstancesModifications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedInstancesModifications method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeReservedInstancesModifications operation. -// pageNum := 0 -// err := client.DescribeReservedInstancesModificationsPages(params, -// func(page *DescribeReservedInstancesModificationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool) error { - return c.DescribeReservedInstancesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedInstancesModificationsPagesWithContext same as DescribeReservedInstancesModificationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesModificationsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeReservedInstancesModificationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeReservedInstancesModificationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedInstancesModificationsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings" - -// DescribeReservedInstancesOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesOfferings operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeReservedInstancesOfferings for more information on using the DescribeReservedInstancesOfferings -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeReservedInstancesOfferingsRequest method. -// req, resp := client.DescribeReservedInstancesOfferingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferings -func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedInstancesOfferingsInput) (req *request.Request, output *DescribeReservedInstancesOfferingsOutput) { - op := &request.Operation{ - Name: opDescribeReservedInstancesOfferings, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedInstancesOfferingsInput{} - } - - output = &DescribeReservedInstancesOfferingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedInstancesOfferings API operation for Amazon Elastic Compute Cloud. -// -// Describes Reserved Instance offerings that are available for purchase. With -// Reserved Instances, you purchase the right to launch instances for a period -// of time. During that time period, you do not receive insufficient capacity -// errors, and you pay a lower usage rate than the rate charged for On-Demand -// instances for the actual time used. -// -// If you have listed your own Reserved Instances for sale in the Reserved Instance -// Marketplace, they will be excluded from these results. This is to ensure -// that you do not purchase your own Reserved Instances. -// -// For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstancesOfferings for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferings -func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstancesOfferingsInput) (*DescribeReservedInstancesOfferingsOutput, error) { - req, out := c.DescribeReservedInstancesOfferingsRequest(input) - return out, req.Send() -} - -// DescribeReservedInstancesOfferingsWithContext is the same as DescribeReservedInstancesOfferings with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstancesOfferings for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesOfferingsWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, opts ...request.Option) (*DescribeReservedInstancesOfferingsOutput, error) { - req, out := c.DescribeReservedInstancesOfferingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeReservedInstancesOfferingsPages iterates over the pages of a DescribeReservedInstancesOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedInstancesOfferings method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeReservedInstancesOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedInstancesOfferingsPages(params, -// func(page *DescribeReservedInstancesOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool) error { - return c.DescribeReservedInstancesOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedInstancesOfferingsPagesWithContext same as DescribeReservedInstancesOfferingsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeReservedInstancesOfferingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeReservedInstancesOfferingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedInstancesOfferingsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeRouteTables = "DescribeRouteTables" - -// DescribeRouteTablesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRouteTables operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeRouteTables for more information on using the DescribeRouteTables -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeRouteTablesRequest method. -// req, resp := client.DescribeRouteTablesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTables -func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *request.Request, output *DescribeRouteTablesOutput) { - op := &request.Operation{ - Name: opDescribeRouteTables, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRouteTablesInput{} - } - - output = &DescribeRouteTablesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRouteTables API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your route tables. -// -// Each subnet in your VPC must be associated with a route table. If a subnet -// is not explicitly associated with any route table, it is implicitly associated -// with the main route table. This command does not return the subnet ID for -// implicit associations. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeRouteTables for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTables -func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (*DescribeRouteTablesOutput, error) { - req, out := c.DescribeRouteTablesRequest(input) - return out, req.Send() -} - -// DescribeRouteTablesWithContext is the same as DescribeRouteTables with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeRouteTables for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeRouteTablesWithContext(ctx aws.Context, input *DescribeRouteTablesInput, opts ...request.Option) (*DescribeRouteTablesOutput, error) { - req, out := c.DescribeRouteTablesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScheduledInstanceAvailability = "DescribeScheduledInstanceAvailability" - -// DescribeScheduledInstanceAvailabilityRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScheduledInstanceAvailability operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeScheduledInstanceAvailability for more information on using the DescribeScheduledInstanceAvailability -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeScheduledInstanceAvailabilityRequest method. -// req, resp := client.DescribeScheduledInstanceAvailabilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailability -func (c *EC2) DescribeScheduledInstanceAvailabilityRequest(input *DescribeScheduledInstanceAvailabilityInput) (req *request.Request, output *DescribeScheduledInstanceAvailabilityOutput) { - op := &request.Operation{ - Name: opDescribeScheduledInstanceAvailability, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScheduledInstanceAvailabilityInput{} - } - - output = &DescribeScheduledInstanceAvailabilityOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScheduledInstanceAvailability API operation for Amazon Elastic Compute Cloud. -// -// Finds available schedules that meet the specified criteria. -// -// You can search for an available schedule no more than 3 months in advance. -// You must meet the minimum required duration of 1,200 hours per year. For -// example, the minimum daily schedule is 4 hours, the minimum weekly schedule -// is 24 hours, and the minimum monthly schedule is 100 hours. -// -// After you find a schedule that meets your needs, call PurchaseScheduledInstances -// to purchase Scheduled Instances with that schedule. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeScheduledInstanceAvailability for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailability -func (c *EC2) DescribeScheduledInstanceAvailability(input *DescribeScheduledInstanceAvailabilityInput) (*DescribeScheduledInstanceAvailabilityOutput, error) { - req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) - return out, req.Send() -} - -// DescribeScheduledInstanceAvailabilityWithContext is the same as DescribeScheduledInstanceAvailability with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScheduledInstanceAvailability for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeScheduledInstanceAvailabilityWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, opts ...request.Option) (*DescribeScheduledInstanceAvailabilityOutput, error) { - req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScheduledInstances = "DescribeScheduledInstances" - -// DescribeScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScheduledInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeScheduledInstances for more information on using the DescribeScheduledInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeScheduledInstancesRequest method. -// req, resp := client.DescribeScheduledInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstances -func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstancesInput) (req *request.Request, output *DescribeScheduledInstancesOutput) { - op := &request.Operation{ - Name: opDescribeScheduledInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScheduledInstancesInput{} - } - - output = &DescribeScheduledInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScheduledInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your Scheduled Instances. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeScheduledInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstances -func (c *EC2) DescribeScheduledInstances(input *DescribeScheduledInstancesInput) (*DescribeScheduledInstancesOutput, error) { - req, out := c.DescribeScheduledInstancesRequest(input) - return out, req.Send() -} - -// DescribeScheduledInstancesWithContext is the same as DescribeScheduledInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScheduledInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeScheduledInstancesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, opts ...request.Option) (*DescribeScheduledInstancesOutput, error) { - req, out := c.DescribeScheduledInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" - -// DescribeSecurityGroupReferencesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSecurityGroupReferences operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSecurityGroupReferences for more information on using the DescribeSecurityGroupReferences -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSecurityGroupReferencesRequest method. -// req, resp := client.DescribeSecurityGroupReferencesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferences -func (c *EC2) DescribeSecurityGroupReferencesRequest(input *DescribeSecurityGroupReferencesInput) (req *request.Request, output *DescribeSecurityGroupReferencesOutput) { - op := &request.Operation{ - Name: opDescribeSecurityGroupReferences, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSecurityGroupReferencesInput{} - } - - output = &DescribeSecurityGroupReferencesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSecurityGroupReferences API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Describes the VPCs on the other side of a VPC peering connection -// that are referencing the security groups you've specified in this request. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSecurityGroupReferences for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferences -func (c *EC2) DescribeSecurityGroupReferences(input *DescribeSecurityGroupReferencesInput) (*DescribeSecurityGroupReferencesOutput, error) { - req, out := c.DescribeSecurityGroupReferencesRequest(input) - return out, req.Send() -} - -// DescribeSecurityGroupReferencesWithContext is the same as DescribeSecurityGroupReferences with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSecurityGroupReferences for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSecurityGroupReferencesWithContext(ctx aws.Context, input *DescribeSecurityGroupReferencesInput, opts ...request.Option) (*DescribeSecurityGroupReferencesOutput, error) { - req, out := c.DescribeSecurityGroupReferencesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSecurityGroups = "DescribeSecurityGroups" - -// DescribeSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSecurityGroups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSecurityGroups for more information on using the DescribeSecurityGroups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSecurityGroupsRequest method. -// req, resp := client.DescribeSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroups -func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) (req *request.Request, output *DescribeSecurityGroupsOutput) { - op := &request.Operation{ - Name: opDescribeSecurityGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSecurityGroupsInput{} - } - - output = &DescribeSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSecurityGroups API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your security groups. -// -// A security group is for use with instances either in the EC2-Classic platform -// or in a specific VPC. For more information, see Amazon EC2 Security Groups -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) -// in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your -// VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSecurityGroups for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroups -func (c *EC2) DescribeSecurityGroups(input *DescribeSecurityGroupsInput) (*DescribeSecurityGroupsOutput, error) { - req, out := c.DescribeSecurityGroupsRequest(input) - return out, req.Send() -} - -// DescribeSecurityGroupsWithContext is the same as DescribeSecurityGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSecurityGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSecurityGroupsWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, opts ...request.Option) (*DescribeSecurityGroupsOutput, error) { - req, out := c.DescribeSecurityGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" - -// DescribeSnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshotAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSnapshotAttribute for more information on using the DescribeSnapshotAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSnapshotAttributeRequest method. -// req, resp := client.DescribeSnapshotAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttribute -func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeInput) (req *request.Request, output *DescribeSnapshotAttributeOutput) { - op := &request.Operation{ - Name: opDescribeSnapshotAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSnapshotAttributeInput{} - } - - output = &DescribeSnapshotAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSnapshotAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified snapshot. You can specify -// only one attribute at a time. -// -// For more information about EBS snapshots, see Amazon EBS Snapshots (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSnapshotAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttribute -func (c *EC2) DescribeSnapshotAttribute(input *DescribeSnapshotAttributeInput) (*DescribeSnapshotAttributeOutput, error) { - req, out := c.DescribeSnapshotAttributeRequest(input) - return out, req.Send() -} - -// DescribeSnapshotAttributeWithContext is the same as DescribeSnapshotAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSnapshotAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSnapshotAttributeWithContext(ctx aws.Context, input *DescribeSnapshotAttributeInput, opts ...request.Option) (*DescribeSnapshotAttributeOutput, error) { - req, out := c.DescribeSnapshotAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSnapshots = "DescribeSnapshots" - -// DescribeSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshots operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSnapshots for more information on using the DescribeSnapshots -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSnapshotsRequest method. -// req, resp := client.DescribeSnapshotsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshots -func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *request.Request, output *DescribeSnapshotsOutput) { - op := &request.Operation{ - Name: opDescribeSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeSnapshotsInput{} - } - - output = &DescribeSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSnapshots API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the EBS snapshots available to you. Available snapshots -// include public snapshots available for any AWS account to launch, private -// snapshots that you own, and private snapshots owned by another AWS account -// but for which you've been given explicit create volume permissions. -// -// The create volume permissions fall into the following categories: -// -// * public: The owner of the snapshot granted create volume permissions -// for the snapshot to the all group. All AWS accounts have create volume -// permissions for these snapshots. -// -// * explicit: The owner of the snapshot granted create volume permissions -// to a specific AWS account. -// -// * implicit: An AWS account has implicit create volume permissions for -// all snapshots it owns. -// -// The list of snapshots returned can be modified by specifying snapshot IDs, -// snapshot owners, or AWS accounts with create volume permissions. If no options -// are specified, Amazon EC2 returns all snapshots for which you have create -// volume permissions. -// -// If you specify one or more snapshot IDs, only snapshots that have the specified -// IDs are returned. If you specify an invalid snapshot ID, an error is returned. -// If you specify a snapshot ID for which you do not have access, it is not -// included in the returned results. -// -// If you specify one or more snapshot owners using the OwnerIds option, only -// snapshots from the specified owners and for which you have access are returned. -// The results can include the AWS account IDs of the specified owners, amazon -// for snapshots owned by Amazon, or self for snapshots that you own. -// -// If you specify a list of restorable users, only snapshots with create snapshot -// permissions for those users are returned. You can specify AWS account IDs -// (if you own the snapshots), self for snapshots for which you own or have -// explicit permissions, or all for public snapshots. -// -// If you are describing a long list of snapshots, you can paginate the output -// to make the list more manageable. The MaxResults parameter sets the maximum -// number of results returned in a single page. If the list of results exceeds -// your MaxResults value, then that number of results is returned along with -// a NextToken value that can be passed to a subsequent DescribeSnapshots request -// to retrieve the remaining results. -// -// For more information about EBS snapshots, see Amazon EBS Snapshots (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSnapshots for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshots -func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { - req, out := c.DescribeSnapshotsRequest(input) - return out, req.Send() -} - -// DescribeSnapshotsWithContext is the same as DescribeSnapshots with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSnapshots for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.Option) (*DescribeSnapshotsOutput, error) { - req, out := c.DescribeSnapshotsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeSnapshotsPages iterates over the pages of a DescribeSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSnapshots method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeSnapshots operation. -// pageNum := 0 -// err := client.DescribeSnapshotsPages(params, -// func(page *DescribeSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool) error { - return c.DescribeSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSnapshotsPagesWithContext same as DescribeSnapshotsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSnapshotsPagesWithContext(ctx aws.Context, input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" - -// DescribeSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotDatafeedSubscription operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSpotDatafeedSubscription for more information on using the DescribeSpotDatafeedSubscription -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSpotDatafeedSubscriptionRequest method. -// req, resp := client.DescribeSpotDatafeedSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscription -func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafeedSubscriptionInput) (req *request.Request, output *DescribeSpotDatafeedSubscriptionOutput) { - op := &request.Operation{ - Name: opDescribeSpotDatafeedSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSpotDatafeedSubscriptionInput{} - } - - output = &DescribeSpotDatafeedSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. -// -// Describes the data feed for Spot Instances. For more information, see Spot -// Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) -// in the Amazon EC2 User Guide for Linux Instances. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSpotDatafeedSubscription for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscription -func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscriptionInput) (*DescribeSpotDatafeedSubscriptionOutput, error) { - req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) - return out, req.Send() -} - -// DescribeSpotDatafeedSubscriptionWithContext is the same as DescribeSpotDatafeedSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotDatafeedSubscription for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DescribeSpotDatafeedSubscriptionInput, opts ...request.Option) (*DescribeSpotDatafeedSubscriptionOutput, error) { - req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" - -// DescribeSpotFleetInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSpotFleetInstances for more information on using the DescribeSpotFleetInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSpotFleetInstancesRequest method. -// req, resp := client.DescribeSpotFleetInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstances -func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstancesInput) (req *request.Request, output *DescribeSpotFleetInstancesOutput) { - op := &request.Operation{ - Name: opDescribeSpotFleetInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSpotFleetInstancesInput{} - } - - output = &DescribeSpotFleetInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotFleetInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes the running instances for the specified Spot Fleet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSpotFleetInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstances -func (c *EC2) DescribeSpotFleetInstances(input *DescribeSpotFleetInstancesInput) (*DescribeSpotFleetInstancesOutput, error) { - req, out := c.DescribeSpotFleetInstancesRequest(input) - return out, req.Send() -} - -// DescribeSpotFleetInstancesWithContext is the same as DescribeSpotFleetInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotFleetInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotFleetInstancesWithContext(ctx aws.Context, input *DescribeSpotFleetInstancesInput, opts ...request.Option) (*DescribeSpotFleetInstancesOutput, error) { - req, out := c.DescribeSpotFleetInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" - -// DescribeSpotFleetRequestHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetRequestHistory operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSpotFleetRequestHistory for more information on using the DescribeSpotFleetRequestHistory -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSpotFleetRequestHistoryRequest method. -// req, resp := client.DescribeSpotFleetRequestHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistory -func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetRequestHistoryInput) (req *request.Request, output *DescribeSpotFleetRequestHistoryOutput) { - op := &request.Operation{ - Name: opDescribeSpotFleetRequestHistory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSpotFleetRequestHistoryInput{} - } - - output = &DescribeSpotFleetRequestHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotFleetRequestHistory API operation for Amazon Elastic Compute Cloud. -// -// Describes the events for the specified Spot Fleet request during the specified -// time. -// -// Spot Fleet events are delayed by up to 30 seconds before they can be described. -// This ensures that you can query by the last evaluated time and not miss a -// recorded event. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSpotFleetRequestHistory for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistory -func (c *EC2) DescribeSpotFleetRequestHistory(input *DescribeSpotFleetRequestHistoryInput) (*DescribeSpotFleetRequestHistoryOutput, error) { - req, out := c.DescribeSpotFleetRequestHistoryRequest(input) - return out, req.Send() -} - -// DescribeSpotFleetRequestHistoryWithContext is the same as DescribeSpotFleetRequestHistory with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotFleetRequestHistory for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotFleetRequestHistoryWithContext(ctx aws.Context, input *DescribeSpotFleetRequestHistoryInput, opts ...request.Option) (*DescribeSpotFleetRequestHistoryOutput, error) { - req, out := c.DescribeSpotFleetRequestHistoryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" - -// DescribeSpotFleetRequestsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetRequests operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSpotFleetRequests for more information on using the DescribeSpotFleetRequests -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSpotFleetRequestsRequest method. -// req, resp := client.DescribeSpotFleetRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequests -func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsInput) (req *request.Request, output *DescribeSpotFleetRequestsOutput) { - op := &request.Operation{ - Name: opDescribeSpotFleetRequests, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeSpotFleetRequestsInput{} - } - - output = &DescribeSpotFleetRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotFleetRequests API operation for Amazon Elastic Compute Cloud. -// -// Describes your Spot Fleet requests. -// -// Spot Fleet requests are deleted 48 hours after they are canceled and their -// instances are terminated. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSpotFleetRequests for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequests -func (c *EC2) DescribeSpotFleetRequests(input *DescribeSpotFleetRequestsInput) (*DescribeSpotFleetRequestsOutput, error) { - req, out := c.DescribeSpotFleetRequestsRequest(input) - return out, req.Send() -} - -// DescribeSpotFleetRequestsWithContext is the same as DescribeSpotFleetRequests with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotFleetRequests for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotFleetRequestsWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, opts ...request.Option) (*DescribeSpotFleetRequestsOutput, error) { - req, out := c.DescribeSpotFleetRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeSpotFleetRequestsPages iterates over the pages of a DescribeSpotFleetRequests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSpotFleetRequests method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeSpotFleetRequests operation. -// pageNum := 0 -// err := client.DescribeSpotFleetRequestsPages(params, -// func(page *DescribeSpotFleetRequestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSpotFleetRequestsPages(input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool) error { - return c.DescribeSpotFleetRequestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSpotFleetRequestsPagesWithContext same as DescribeSpotFleetRequestsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotFleetRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSpotFleetRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSpotFleetRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotFleetRequestsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" - -// DescribeSpotInstanceRequestsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotInstanceRequests operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSpotInstanceRequests for more information on using the DescribeSpotInstanceRequests -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSpotInstanceRequestsRequest method. -// req, resp := client.DescribeSpotInstanceRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequests -func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceRequestsInput) (req *request.Request, output *DescribeSpotInstanceRequestsOutput) { - op := &request.Operation{ - Name: opDescribeSpotInstanceRequests, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSpotInstanceRequestsInput{} - } - - output = &DescribeSpotInstanceRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotInstanceRequests API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified Spot Instance requests. -// -// You can use DescribeSpotInstanceRequests to find a running Spot Instance -// by examining the response. If the status of the Spot Instance is fulfilled, -// the instance ID appears in the response and contains the identifier of the -// instance. Alternatively, you can use DescribeInstances with a filter to look -// for instances where the instance lifecycle is spot. -// -// Spot Instance requests are deleted four hours after they are canceled and -// their instances are terminated. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSpotInstanceRequests for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequests -func (c *EC2) DescribeSpotInstanceRequests(input *DescribeSpotInstanceRequestsInput) (*DescribeSpotInstanceRequestsOutput, error) { - req, out := c.DescribeSpotInstanceRequestsRequest(input) - return out, req.Send() -} - -// DescribeSpotInstanceRequestsWithContext is the same as DescribeSpotInstanceRequests with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotInstanceRequests for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotInstanceRequestsWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.Option) (*DescribeSpotInstanceRequestsOutput, error) { - req, out := c.DescribeSpotInstanceRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" - -// DescribeSpotPriceHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotPriceHistory operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSpotPriceHistory for more information on using the DescribeSpotPriceHistory -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSpotPriceHistoryRequest method. -// req, resp := client.DescribeSpotPriceHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistory -func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInput) (req *request.Request, output *DescribeSpotPriceHistoryOutput) { - op := &request.Operation{ - Name: opDescribeSpotPriceHistory, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeSpotPriceHistoryInput{} - } - - output = &DescribeSpotPriceHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotPriceHistory API operation for Amazon Elastic Compute Cloud. -// -// Describes the Spot price history. For more information, see Spot Instance -// Pricing History (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) -// in the Amazon EC2 User Guide for Linux Instances. -// -// When you specify a start and end time, this operation returns the prices -// of the instance types within the time range that you specified and the time -// when the price changed. The price is valid within the time period that you -// specified; the response merely indicates the last time that the price changed. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSpotPriceHistory for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistory -func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (*DescribeSpotPriceHistoryOutput, error) { - req, out := c.DescribeSpotPriceHistoryRequest(input) - return out, req.Send() -} - -// DescribeSpotPriceHistoryWithContext is the same as DescribeSpotPriceHistory with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotPriceHistory for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotPriceHistoryWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, opts ...request.Option) (*DescribeSpotPriceHistoryOutput, error) { - req, out := c.DescribeSpotPriceHistoryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeSpotPriceHistoryPages iterates over the pages of a DescribeSpotPriceHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSpotPriceHistory method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeSpotPriceHistory operation. -// pageNum := 0 -// err := client.DescribeSpotPriceHistoryPages(params, -// func(page *DescribeSpotPriceHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool) error { - return c.DescribeSpotPriceHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSpotPriceHistoryPagesWithContext same as DescribeSpotPriceHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotPriceHistoryPagesWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSpotPriceHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSpotPriceHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotPriceHistoryOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeStaleSecurityGroups = "DescribeStaleSecurityGroups" - -// DescribeStaleSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStaleSecurityGroups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeStaleSecurityGroups for more information on using the DescribeStaleSecurityGroups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeStaleSecurityGroupsRequest method. -// req, resp := client.DescribeStaleSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroups -func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGroupsInput) (req *request.Request, output *DescribeStaleSecurityGroupsOutput) { - op := &request.Operation{ - Name: opDescribeStaleSecurityGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStaleSecurityGroupsInput{} - } - - output = &DescribeStaleSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStaleSecurityGroups API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Describes the stale security group rules for security groups -// in a specified VPC. Rules are stale when they reference a deleted security -// group in a peer VPC, or a security group in a peer VPC for which the VPC -// peering connection has been deleted. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeStaleSecurityGroups for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroups -func (c *EC2) DescribeStaleSecurityGroups(input *DescribeStaleSecurityGroupsInput) (*DescribeStaleSecurityGroupsOutput, error) { - req, out := c.DescribeStaleSecurityGroupsRequest(input) - return out, req.Send() -} - -// DescribeStaleSecurityGroupsWithContext is the same as DescribeStaleSecurityGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeStaleSecurityGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeStaleSecurityGroupsWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, opts ...request.Option) (*DescribeStaleSecurityGroupsOutput, error) { - req, out := c.DescribeStaleSecurityGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSubnets = "DescribeSubnets" - -// DescribeSubnetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSubnets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeSubnets for more information on using the DescribeSubnets -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeSubnetsRequest method. -// req, resp := client.DescribeSubnetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnets -func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request.Request, output *DescribeSubnetsOutput) { - op := &request.Operation{ - Name: opDescribeSubnets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSubnetsInput{} - } - - output = &DescribeSubnetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSubnets API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your subnets. -// -// For more information about subnets, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSubnets for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnets -func (c *EC2) DescribeSubnets(input *DescribeSubnetsInput) (*DescribeSubnetsOutput, error) { - req, out := c.DescribeSubnetsRequest(input) - return out, req.Send() -} - -// DescribeSubnetsWithContext is the same as DescribeSubnets with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSubnets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSubnetsWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.Option) (*DescribeSubnetsOutput, error) { - req, out := c.DescribeSubnetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTags = "DescribeTags" - -// DescribeTagsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTags operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeTags for more information on using the DescribeTags -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeTagsRequest method. -// req, resp := client.DescribeTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTags -func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { - op := &request.Operation{ - Name: opDescribeTags, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeTagsInput{} - } - - output = &DescribeTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTags API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the tags for your EC2 resources. -// -// For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeTags for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTags -func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - return out, req.Send() -} - -// DescribeTagsWithContext is the same as DescribeTags with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeTagsPages iterates over the pages of a DescribeTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTags method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeTags operation. -// pageNum := 0 -// err := client.DescribeTagsPages(params, -// func(page *DescribeTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeTagsPages(input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool) error { - return c.DescribeTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTagsPagesWithContext same as DescribeTagsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeVolumeAttribute = "DescribeVolumeAttribute" - -// DescribeVolumeAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumeAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVolumeAttribute for more information on using the DescribeVolumeAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVolumeAttributeRequest method. -// req, resp := client.DescribeVolumeAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttribute -func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput) (req *request.Request, output *DescribeVolumeAttributeOutput) { - op := &request.Operation{ - Name: opDescribeVolumeAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVolumeAttributeInput{} - } - - output = &DescribeVolumeAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumeAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified volume. You can specify -// only one attribute at a time. -// -// For more information about EBS volumes, see Amazon EBS Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVolumeAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttribute -func (c *EC2) DescribeVolumeAttribute(input *DescribeVolumeAttributeInput) (*DescribeVolumeAttributeOutput, error) { - req, out := c.DescribeVolumeAttributeRequest(input) - return out, req.Send() -} - -// DescribeVolumeAttributeWithContext is the same as DescribeVolumeAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVolumeAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVolumeAttributeWithContext(ctx aws.Context, input *DescribeVolumeAttributeInput, opts ...request.Option) (*DescribeVolumeAttributeOutput, error) { - req, out := c.DescribeVolumeAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVolumeStatus = "DescribeVolumeStatus" - -// DescribeVolumeStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumeStatus operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVolumeStatus for more information on using the DescribeVolumeStatus -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVolumeStatusRequest method. -// req, resp := client.DescribeVolumeStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatus -func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req *request.Request, output *DescribeVolumeStatusOutput) { - op := &request.Operation{ - Name: opDescribeVolumeStatus, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeVolumeStatusInput{} - } - - output = &DescribeVolumeStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumeStatus API operation for Amazon Elastic Compute Cloud. -// -// Describes the status of the specified volumes. Volume status provides the -// result of the checks performed on your volumes to determine events that can -// impair the performance of your volumes. The performance of a volume can be -// affected if an issue occurs on the volume's underlying host. If the volume's -// underlying host experiences a power outage or system issue, after the system -// is restored, there could be data inconsistencies on the volume. Volume events -// notify you if this occurs. Volume actions notify you if any action needs -// to be taken in response to the event. -// -// The DescribeVolumeStatus operation provides the following information about -// the specified volumes: -// -// Status: Reflects the current status of the volume. The possible values are -// ok, impaired , warning, or insufficient-data. If all checks pass, the overall -// status of the volume is ok. If the check fails, the overall status is impaired. -// If the status is insufficient-data, then the checks may still be taking place -// on your volume at the time. We recommend that you retry the request. For -// more information on volume status, see Monitoring the Status of Your Volumes -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html). -// -// Events: Reflect the cause of a volume status and may require you to take -// action. For example, if your volume returns an impaired status, then the -// volume event might be potential-data-inconsistency. This means that your -// volume has been affected by an issue with the underlying host, has all I/O -// operations disabled, and may have inconsistent data. -// -// Actions: Reflect the actions you may have to take in response to an event. -// For example, if the status of the volume is impaired and the volume event -// shows potential-data-inconsistency, then the action shows enable-volume-io. -// This means that you may want to enable the I/O operations for the volume -// by calling the EnableVolumeIO action and then check the volume for data consistency. -// -// Volume status is based on the volume status checks, and does not reflect -// the volume state. Therefore, volume status does not indicate volumes in the -// error state (for example, when a volume is incapable of accepting I/O.) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVolumeStatus for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatus -func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (*DescribeVolumeStatusOutput, error) { - req, out := c.DescribeVolumeStatusRequest(input) - return out, req.Send() -} - -// DescribeVolumeStatusWithContext is the same as DescribeVolumeStatus with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVolumeStatus for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVolumeStatusWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, opts ...request.Option) (*DescribeVolumeStatusOutput, error) { - req, out := c.DescribeVolumeStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeVolumeStatusPages iterates over the pages of a DescribeVolumeStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeVolumeStatus method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeVolumeStatus operation. -// pageNum := 0 -// err := client.DescribeVolumeStatusPages(params, -// func(page *DescribeVolumeStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool) error { - return c.DescribeVolumeStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeVolumeStatusPagesWithContext same as DescribeVolumeStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVolumeStatusPagesWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVolumeStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumeStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumeStatusOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeVolumes = "DescribeVolumes" - -// DescribeVolumesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumes operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVolumes for more information on using the DescribeVolumes -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVolumesRequest method. -// req, resp := client.DescribeVolumesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumes -func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.Request, output *DescribeVolumesOutput) { - op := &request.Operation{ - Name: opDescribeVolumes, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeVolumesInput{} - } - - output = &DescribeVolumesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumes API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified EBS volumes. -// -// If you are describing a long list of volumes, you can paginate the output -// to make the list more manageable. The MaxResults parameter sets the maximum -// number of results returned in a single page. If the list of results exceeds -// your MaxResults value, then that number of results is returned along with -// a NextToken value that can be passed to a subsequent DescribeVolumes request -// to retrieve the remaining results. -// -// For more information about EBS volumes, see Amazon EBS Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVolumes for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumes -func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutput, error) { - req, out := c.DescribeVolumesRequest(input) - return out, req.Send() -} - -// DescribeVolumesWithContext is the same as DescribeVolumes with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVolumes for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVolumesWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.Option) (*DescribeVolumesOutput, error) { - req, out := c.DescribeVolumesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeVolumesPages iterates over the pages of a DescribeVolumes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeVolumes method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeVolumes operation. -// pageNum := 0 -// err := client.DescribeVolumesPages(params, -// func(page *DescribeVolumesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool) error { - return c.DescribeVolumesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeVolumesPagesWithContext same as DescribeVolumesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVolumesPagesWithContext(ctx aws.Context, input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeVolumesModifications = "DescribeVolumesModifications" - -// DescribeVolumesModificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumesModifications operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVolumesModifications for more information on using the DescribeVolumesModifications -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVolumesModificationsRequest method. -// req, resp := client.DescribeVolumesModificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications -func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModificationsInput) (req *request.Request, output *DescribeVolumesModificationsOutput) { - op := &request.Operation{ - Name: opDescribeVolumesModifications, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVolumesModificationsInput{} - } - - output = &DescribeVolumesModificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumesModifications API operation for Amazon Elastic Compute Cloud. -// -// Reports the current modification status of EBS volumes. -// -// Current-generation EBS volumes support modification of attributes including -// type, size, and (for io1 volumes) IOPS provisioning while either attached -// to or detached from an instance. Following an action from the API or the -// console to modify a volume, the status of the modification may be modifying, -// optimizing, completed, or failed. If a volume has never been modified, then -// certain elements of the returned VolumeModification objects are null. -// -// You can also use CloudWatch Events to check the status of a modification -// to an EBS volume. For information about CloudWatch Events, see the Amazon -// CloudWatch Events User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). -// For more information, see Monitoring Volume Modifications" (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVolumesModifications for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications -func (c *EC2) DescribeVolumesModifications(input *DescribeVolumesModificationsInput) (*DescribeVolumesModificationsOutput, error) { - req, out := c.DescribeVolumesModificationsRequest(input) - return out, req.Send() -} - -// DescribeVolumesModificationsWithContext is the same as DescribeVolumesModifications with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVolumesModifications for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, opts ...request.Option) (*DescribeVolumesModificationsOutput, error) { - req, out := c.DescribeVolumesModificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcAttribute = "DescribeVpcAttribute" - -// DescribeVpcAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcAttribute for more information on using the DescribeVpcAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcAttributeRequest method. -// req, resp := client.DescribeVpcAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttribute -func (c *EC2) DescribeVpcAttributeRequest(input *DescribeVpcAttributeInput) (req *request.Request, output *DescribeVpcAttributeOutput) { - op := &request.Operation{ - Name: opDescribeVpcAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcAttributeInput{} - } - - output = &DescribeVpcAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified VPC. You can specify only -// one attribute at a time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttribute -func (c *EC2) DescribeVpcAttribute(input *DescribeVpcAttributeInput) (*DescribeVpcAttributeOutput, error) { - req, out := c.DescribeVpcAttributeRequest(input) - return out, req.Send() -} - -// DescribeVpcAttributeWithContext is the same as DescribeVpcAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcAttributeWithContext(ctx aws.Context, input *DescribeVpcAttributeInput, opts ...request.Option) (*DescribeVpcAttributeOutput, error) { - req, out := c.DescribeVpcAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcClassicLink = "DescribeVpcClassicLink" - -// DescribeVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcClassicLink operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcClassicLink for more information on using the DescribeVpcClassicLink -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcClassicLinkRequest method. -// req, resp := client.DescribeVpcClassicLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLink -func (c *EC2) DescribeVpcClassicLinkRequest(input *DescribeVpcClassicLinkInput) (req *request.Request, output *DescribeVpcClassicLinkOutput) { - op := &request.Operation{ - Name: opDescribeVpcClassicLink, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcClassicLinkInput{} - } - - output = &DescribeVpcClassicLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcClassicLink API operation for Amazon Elastic Compute Cloud. -// -// Describes the ClassicLink status of one or more VPCs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcClassicLink for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLink -func (c *EC2) DescribeVpcClassicLink(input *DescribeVpcClassicLinkInput) (*DescribeVpcClassicLinkOutput, error) { - req, out := c.DescribeVpcClassicLinkRequest(input) - return out, req.Send() -} - -// DescribeVpcClassicLinkWithContext is the same as DescribeVpcClassicLink with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcClassicLink for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcClassicLinkWithContext(ctx aws.Context, input *DescribeVpcClassicLinkInput, opts ...request.Option) (*DescribeVpcClassicLinkOutput, error) { - req, out := c.DescribeVpcClassicLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcClassicLinkDnsSupport = "DescribeVpcClassicLinkDnsSupport" - -// DescribeVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcClassicLinkDnsSupport operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcClassicLinkDnsSupport for more information on using the DescribeVpcClassicLinkDnsSupport -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcClassicLinkDnsSupportRequest method. -// req, resp := client.DescribeVpcClassicLinkDnsSupportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupport -func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicLinkDnsSupportInput) (req *request.Request, output *DescribeVpcClassicLinkDnsSupportOutput) { - op := &request.Operation{ - Name: opDescribeVpcClassicLinkDnsSupport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcClassicLinkDnsSupportInput{} - } - - output = &DescribeVpcClassicLinkDnsSupportOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. -// -// Describes the ClassicLink DNS support status of one or more VPCs. If enabled, -// the DNS hostname of a linked EC2-Classic instance resolves to its private -// IP address when addressed from an instance in the VPC to which it's linked. -// Similarly, the DNS hostname of an instance in a VPC resolves to its private -// IP address when addressed from a linked EC2-Classic instance. For more information, -// see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcClassicLinkDnsSupport for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupport -func (c *EC2) DescribeVpcClassicLinkDnsSupport(input *DescribeVpcClassicLinkDnsSupportInput) (*DescribeVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) - return out, req.Send() -} - -// DescribeVpcClassicLinkDnsSupportWithContext is the same as DescribeVpcClassicLinkDnsSupport with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcClassicLinkDnsSupport for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DescribeVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcEndpointConnectionNotifications = "DescribeVpcEndpointConnectionNotifications" - -// DescribeVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointConnectionNotifications operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcEndpointConnectionNotifications for more information on using the DescribeVpcEndpointConnectionNotifications -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcEndpointConnectionNotificationsRequest method. -// req, resp := client.DescribeVpcEndpointConnectionNotificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnectionNotifications -func (c *EC2) DescribeVpcEndpointConnectionNotificationsRequest(input *DescribeVpcEndpointConnectionNotificationsInput) (req *request.Request, output *DescribeVpcEndpointConnectionNotificationsOutput) { - op := &request.Operation{ - Name: opDescribeVpcEndpointConnectionNotifications, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcEndpointConnectionNotificationsInput{} - } - - output = &DescribeVpcEndpointConnectionNotificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcEndpointConnectionNotifications API operation for Amazon Elastic Compute Cloud. -// -// Describes the connection notifications for VPC endpoints and VPC endpoint -// services. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcEndpointConnectionNotifications for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnectionNotifications -func (c *EC2) DescribeVpcEndpointConnectionNotifications(input *DescribeVpcEndpointConnectionNotificationsInput) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { - req, out := c.DescribeVpcEndpointConnectionNotificationsRequest(input) - return out, req.Send() -} - -// DescribeVpcEndpointConnectionNotificationsWithContext is the same as DescribeVpcEndpointConnectionNotifications with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcEndpointConnectionNotifications for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointConnectionNotificationsWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionNotificationsInput, opts ...request.Option) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { - req, out := c.DescribeVpcEndpointConnectionNotificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcEndpointConnections = "DescribeVpcEndpointConnections" - -// DescribeVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointConnections operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcEndpointConnections for more information on using the DescribeVpcEndpointConnections -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcEndpointConnectionsRequest method. -// req, resp := client.DescribeVpcEndpointConnectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnections -func (c *EC2) DescribeVpcEndpointConnectionsRequest(input *DescribeVpcEndpointConnectionsInput) (req *request.Request, output *DescribeVpcEndpointConnectionsOutput) { - op := &request.Operation{ - Name: opDescribeVpcEndpointConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcEndpointConnectionsInput{} - } - - output = &DescribeVpcEndpointConnectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcEndpointConnections API operation for Amazon Elastic Compute Cloud. -// -// Describes the VPC endpoint connections to your VPC endpoint services, including -// any endpoints that are pending your acceptance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcEndpointConnections for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnections -func (c *EC2) DescribeVpcEndpointConnections(input *DescribeVpcEndpointConnectionsInput) (*DescribeVpcEndpointConnectionsOutput, error) { - req, out := c.DescribeVpcEndpointConnectionsRequest(input) - return out, req.Send() -} - -// DescribeVpcEndpointConnectionsWithContext is the same as DescribeVpcEndpointConnections with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcEndpointConnections for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointConnectionsWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionsInput, opts ...request.Option) (*DescribeVpcEndpointConnectionsOutput, error) { - req, out := c.DescribeVpcEndpointConnectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcEndpointServiceConfigurations = "DescribeVpcEndpointServiceConfigurations" - -// DescribeVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointServiceConfigurations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcEndpointServiceConfigurations for more information on using the DescribeVpcEndpointServiceConfigurations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcEndpointServiceConfigurationsRequest method. -// req, resp := client.DescribeVpcEndpointServiceConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServiceConfigurations -func (c *EC2) DescribeVpcEndpointServiceConfigurationsRequest(input *DescribeVpcEndpointServiceConfigurationsInput) (req *request.Request, output *DescribeVpcEndpointServiceConfigurationsOutput) { - op := &request.Operation{ - Name: opDescribeVpcEndpointServiceConfigurations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcEndpointServiceConfigurationsInput{} - } - - output = &DescribeVpcEndpointServiceConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcEndpointServiceConfigurations API operation for Amazon Elastic Compute Cloud. -// -// Describes the VPC endpoint service configurations in your account (your services). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcEndpointServiceConfigurations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServiceConfigurations -func (c *EC2) DescribeVpcEndpointServiceConfigurations(input *DescribeVpcEndpointServiceConfigurationsInput) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { - req, out := c.DescribeVpcEndpointServiceConfigurationsRequest(input) - return out, req.Send() -} - -// DescribeVpcEndpointServiceConfigurationsWithContext is the same as DescribeVpcEndpointServiceConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcEndpointServiceConfigurations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointServiceConfigurationsWithContext(ctx aws.Context, input *DescribeVpcEndpointServiceConfigurationsInput, opts ...request.Option) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { - req, out := c.DescribeVpcEndpointServiceConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcEndpointServicePermissions = "DescribeVpcEndpointServicePermissions" - -// DescribeVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointServicePermissions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcEndpointServicePermissions for more information on using the DescribeVpcEndpointServicePermissions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcEndpointServicePermissionsRequest method. -// req, resp := client.DescribeVpcEndpointServicePermissionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServicePermissions -func (c *EC2) DescribeVpcEndpointServicePermissionsRequest(input *DescribeVpcEndpointServicePermissionsInput) (req *request.Request, output *DescribeVpcEndpointServicePermissionsOutput) { - op := &request.Operation{ - Name: opDescribeVpcEndpointServicePermissions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcEndpointServicePermissionsInput{} - } - - output = &DescribeVpcEndpointServicePermissionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcEndpointServicePermissions API operation for Amazon Elastic Compute Cloud. -// -// Describes the principals (service consumers) that are permitted to discover -// your VPC endpoint service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcEndpointServicePermissions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServicePermissions -func (c *EC2) DescribeVpcEndpointServicePermissions(input *DescribeVpcEndpointServicePermissionsInput) (*DescribeVpcEndpointServicePermissionsOutput, error) { - req, out := c.DescribeVpcEndpointServicePermissionsRequest(input) - return out, req.Send() -} - -// DescribeVpcEndpointServicePermissionsWithContext is the same as DescribeVpcEndpointServicePermissions with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcEndpointServicePermissions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointServicePermissionsWithContext(ctx aws.Context, input *DescribeVpcEndpointServicePermissionsInput, opts ...request.Option) (*DescribeVpcEndpointServicePermissionsOutput, error) { - req, out := c.DescribeVpcEndpointServicePermissionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" - -// DescribeVpcEndpointServicesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointServices operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcEndpointServices for more information on using the DescribeVpcEndpointServices -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcEndpointServicesRequest method. -// req, resp := client.DescribeVpcEndpointServicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServices -func (c *EC2) DescribeVpcEndpointServicesRequest(input *DescribeVpcEndpointServicesInput) (req *request.Request, output *DescribeVpcEndpointServicesOutput) { - op := &request.Operation{ - Name: opDescribeVpcEndpointServices, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcEndpointServicesInput{} - } - - output = &DescribeVpcEndpointServicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcEndpointServices API operation for Amazon Elastic Compute Cloud. -// -// Describes available services to which you can create a VPC endpoint. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcEndpointServices for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServices -func (c *EC2) DescribeVpcEndpointServices(input *DescribeVpcEndpointServicesInput) (*DescribeVpcEndpointServicesOutput, error) { - req, out := c.DescribeVpcEndpointServicesRequest(input) - return out, req.Send() -} - -// DescribeVpcEndpointServicesWithContext is the same as DescribeVpcEndpointServices with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcEndpointServices for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointServicesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicesInput, opts ...request.Option) (*DescribeVpcEndpointServicesOutput, error) { - req, out := c.DescribeVpcEndpointServicesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcEndpoints = "DescribeVpcEndpoints" - -// DescribeVpcEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpoints operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcEndpoints for more information on using the DescribeVpcEndpoints -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcEndpointsRequest method. -// req, resp := client.DescribeVpcEndpointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpoints -func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req *request.Request, output *DescribeVpcEndpointsOutput) { - op := &request.Operation{ - Name: opDescribeVpcEndpoints, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcEndpointsInput{} - } - - output = &DescribeVpcEndpointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcEndpoints API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPC endpoints. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcEndpoints for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpoints -func (c *EC2) DescribeVpcEndpoints(input *DescribeVpcEndpointsInput) (*DescribeVpcEndpointsOutput, error) { - req, out := c.DescribeVpcEndpointsRequest(input) - return out, req.Send() -} - -// DescribeVpcEndpointsWithContext is the same as DescribeVpcEndpoints with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcEndpoints for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointsWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, opts ...request.Option) (*DescribeVpcEndpointsOutput, error) { - req, out := c.DescribeVpcEndpointsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" - -// DescribeVpcPeeringConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcPeeringConnections operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcPeeringConnections for more information on using the DescribeVpcPeeringConnections -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcPeeringConnectionsRequest method. -// req, resp := client.DescribeVpcPeeringConnectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnections -func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConnectionsInput) (req *request.Request, output *DescribeVpcPeeringConnectionsOutput) { - op := &request.Operation{ - Name: opDescribeVpcPeeringConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcPeeringConnectionsInput{} - } - - output = &DescribeVpcPeeringConnectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcPeeringConnections API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPC peering connections. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcPeeringConnections for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnections -func (c *EC2) DescribeVpcPeeringConnections(input *DescribeVpcPeeringConnectionsInput) (*DescribeVpcPeeringConnectionsOutput, error) { - req, out := c.DescribeVpcPeeringConnectionsRequest(input) - return out, req.Send() -} - -// DescribeVpcPeeringConnectionsWithContext is the same as DescribeVpcPeeringConnections with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcPeeringConnections for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcPeeringConnectionsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.Option) (*DescribeVpcPeeringConnectionsOutput, error) { - req, out := c.DescribeVpcPeeringConnectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcs = "DescribeVpcs" - -// DescribeVpcsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcs operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpcs for more information on using the DescribeVpcs -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpcsRequest method. -// req, resp := client.DescribeVpcsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcs -func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Request, output *DescribeVpcsOutput) { - op := &request.Operation{ - Name: opDescribeVpcs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcsInput{} - } - - output = &DescribeVpcsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcs API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPCs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpcs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcs -func (c *EC2) DescribeVpcs(input *DescribeVpcsInput) (*DescribeVpcsOutput, error) { - req, out := c.DescribeVpcsRequest(input) - return out, req.Send() -} - -// DescribeVpcsWithContext is the same as DescribeVpcs with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcs for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.Option) (*DescribeVpcsOutput, error) { - req, out := c.DescribeVpcsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpnConnections = "DescribeVpnConnections" - -// DescribeVpnConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpnConnections operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpnConnections for more information on using the DescribeVpnConnections -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpnConnectionsRequest method. -// req, resp := client.DescribeVpnConnectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnections -func (c *EC2) DescribeVpnConnectionsRequest(input *DescribeVpnConnectionsInput) (req *request.Request, output *DescribeVpnConnectionsOutput) { - op := &request.Operation{ - Name: opDescribeVpnConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpnConnectionsInput{} - } - - output = &DescribeVpnConnectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpnConnections API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPN connections. -// -// For more information about VPN connections, see AWS Managed VPN Connections -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) in the -// Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpnConnections for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnections -func (c *EC2) DescribeVpnConnections(input *DescribeVpnConnectionsInput) (*DescribeVpnConnectionsOutput, error) { - req, out := c.DescribeVpnConnectionsRequest(input) - return out, req.Send() -} - -// DescribeVpnConnectionsWithContext is the same as DescribeVpnConnections with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpnConnections for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpnConnectionsWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.Option) (*DescribeVpnConnectionsOutput, error) { - req, out := c.DescribeVpnConnectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpnGateways = "DescribeVpnGateways" - -// DescribeVpnGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpnGateways operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeVpnGateways for more information on using the DescribeVpnGateways -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeVpnGatewaysRequest method. -// req, resp := client.DescribeVpnGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGateways -func (c *EC2) DescribeVpnGatewaysRequest(input *DescribeVpnGatewaysInput) (req *request.Request, output *DescribeVpnGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeVpnGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpnGatewaysInput{} - } - - output = &DescribeVpnGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpnGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your virtual private gateways. -// -// For more information about virtual private gateways, see AWS Managed VPN -// Connections (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVpnGateways for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGateways -func (c *EC2) DescribeVpnGateways(input *DescribeVpnGatewaysInput) (*DescribeVpnGatewaysOutput, error) { - req, out := c.DescribeVpnGatewaysRequest(input) - return out, req.Send() -} - -// DescribeVpnGatewaysWithContext is the same as DescribeVpnGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpnGateways for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpnGatewaysWithContext(ctx aws.Context, input *DescribeVpnGatewaysInput, opts ...request.Option) (*DescribeVpnGatewaysOutput, error) { - req, out := c.DescribeVpnGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachClassicLinkVpc = "DetachClassicLinkVpc" - -// DetachClassicLinkVpcRequest generates a "aws/request.Request" representing the -// client's request for the DetachClassicLinkVpc operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DetachClassicLinkVpc for more information on using the DetachClassicLinkVpc -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DetachClassicLinkVpcRequest method. -// req, resp := client.DetachClassicLinkVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpc -func (c *EC2) DetachClassicLinkVpcRequest(input *DetachClassicLinkVpcInput) (req *request.Request, output *DetachClassicLinkVpcOutput) { - op := &request.Operation{ - Name: opDetachClassicLinkVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachClassicLinkVpcInput{} - } - - output = &DetachClassicLinkVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// DetachClassicLinkVpc API operation for Amazon Elastic Compute Cloud. -// -// Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance -// has been unlinked, the VPC security groups are no longer associated with -// it. An instance is automatically unlinked from a VPC when it's stopped. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DetachClassicLinkVpc for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpc -func (c *EC2) DetachClassicLinkVpc(input *DetachClassicLinkVpcInput) (*DetachClassicLinkVpcOutput, error) { - req, out := c.DetachClassicLinkVpcRequest(input) - return out, req.Send() -} - -// DetachClassicLinkVpcWithContext is the same as DetachClassicLinkVpc with the addition of -// the ability to pass a context and additional request options. -// -// See DetachClassicLinkVpc for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DetachClassicLinkVpcWithContext(ctx aws.Context, input *DetachClassicLinkVpcInput, opts ...request.Option) (*DetachClassicLinkVpcOutput, error) { - req, out := c.DetachClassicLinkVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachInternetGateway = "DetachInternetGateway" - -// DetachInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DetachInternetGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DetachInternetGateway for more information on using the DetachInternetGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DetachInternetGatewayRequest method. -// req, resp := client.DetachInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGateway -func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (req *request.Request, output *DetachInternetGatewayOutput) { - op := &request.Operation{ - Name: opDetachInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachInternetGatewayInput{} - } - - output = &DetachInternetGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Detaches an Internet gateway from a VPC, disabling connectivity between the -// Internet and the VPC. The VPC must not contain any running instances with -// Elastic IP addresses or public IPv4 addresses. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DetachInternetGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGateway -func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (*DetachInternetGatewayOutput, error) { - req, out := c.DetachInternetGatewayRequest(input) - return out, req.Send() -} - -// DetachInternetGatewayWithContext is the same as DetachInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DetachInternetGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DetachInternetGatewayWithContext(ctx aws.Context, input *DetachInternetGatewayInput, opts ...request.Option) (*DetachInternetGatewayOutput, error) { - req, out := c.DetachInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachNetworkInterface = "DetachNetworkInterface" - -// DetachNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the DetachNetworkInterface operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DetachNetworkInterface for more information on using the DetachNetworkInterface -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DetachNetworkInterfaceRequest method. -// req, resp := client.DetachNetworkInterfaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterface -func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) (req *request.Request, output *DetachNetworkInterfaceOutput) { - op := &request.Operation{ - Name: opDetachNetworkInterface, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachNetworkInterfaceInput{} - } - - output = &DetachNetworkInterfaceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachNetworkInterface API operation for Amazon Elastic Compute Cloud. -// -// Detaches a network interface from an instance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DetachNetworkInterface for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterface -func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (*DetachNetworkInterfaceOutput, error) { - req, out := c.DetachNetworkInterfaceRequest(input) - return out, req.Send() -} - -// DetachNetworkInterfaceWithContext is the same as DetachNetworkInterface with the addition of -// the ability to pass a context and additional request options. -// -// See DetachNetworkInterface for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DetachNetworkInterfaceWithContext(ctx aws.Context, input *DetachNetworkInterfaceInput, opts ...request.Option) (*DetachNetworkInterfaceOutput, error) { - req, out := c.DetachNetworkInterfaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachVolume = "DetachVolume" - -// DetachVolumeRequest generates a "aws/request.Request" representing the -// client's request for the DetachVolume operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DetachVolume for more information on using the DetachVolume -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DetachVolumeRequest method. -// req, resp := client.DetachVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVolume -func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Request, output *VolumeAttachment) { - op := &request.Operation{ - Name: opDetachVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachVolumeInput{} - } - - output = &VolumeAttachment{} - req = c.newRequest(op, input, output) - return -} - -// DetachVolume API operation for Amazon Elastic Compute Cloud. -// -// Detaches an EBS volume from an instance. Make sure to unmount any file systems -// on the device within your operating system before detaching the volume. Failure -// to do so can result in the volume becoming stuck in the busy state while -// detaching. If this happens, detachment can be delayed indefinitely until -// you unmount the volume, force detachment, reboot the instance, or all three. -// If an EBS volume is the root device of an instance, it can't be detached -// while the instance is running. To detach the root volume, stop the instance -// first. -// -// When a volume with an AWS Marketplace product code is detached from an instance, -// the product code is no longer associated with the instance. -// -// For more information, see Detaching an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DetachVolume for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVolume -func (c *EC2) DetachVolume(input *DetachVolumeInput) (*VolumeAttachment, error) { - req, out := c.DetachVolumeRequest(input) - return out, req.Send() -} - -// DetachVolumeWithContext is the same as DetachVolume with the addition of -// the ability to pass a context and additional request options. -// -// See DetachVolume for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DetachVolumeWithContext(ctx aws.Context, input *DetachVolumeInput, opts ...request.Option) (*VolumeAttachment, error) { - req, out := c.DetachVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachVpnGateway = "DetachVpnGateway" - -// DetachVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DetachVpnGateway operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DetachVpnGateway for more information on using the DetachVpnGateway -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DetachVpnGatewayRequest method. -// req, resp := client.DetachVpnGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGateway -func (c *EC2) DetachVpnGatewayRequest(input *DetachVpnGatewayInput) (req *request.Request, output *DetachVpnGatewayOutput) { - op := &request.Operation{ - Name: opDetachVpnGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachVpnGatewayInput{} - } - - output = &DetachVpnGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachVpnGateway API operation for Amazon Elastic Compute Cloud. -// -// Detaches a virtual private gateway from a VPC. You do this if you're planning -// to turn off the VPC and not use it anymore. You can confirm a virtual private -// gateway has been completely detached from a VPC by describing the virtual -// private gateway (any attachments to the virtual private gateway are also -// described). -// -// You must wait for the attachment's state to switch to detached before you -// can delete the VPC or attach a different VPC to the virtual private gateway. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DetachVpnGateway for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGateway -func (c *EC2) DetachVpnGateway(input *DetachVpnGatewayInput) (*DetachVpnGatewayOutput, error) { - req, out := c.DetachVpnGatewayRequest(input) - return out, req.Send() -} - -// DetachVpnGatewayWithContext is the same as DetachVpnGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DetachVpnGateway for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DetachVpnGatewayWithContext(ctx aws.Context, input *DetachVpnGatewayInput, opts ...request.Option) (*DetachVpnGatewayOutput, error) { - req, out := c.DetachVpnGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" - -// DisableVgwRoutePropagationRequest generates a "aws/request.Request" representing the -// client's request for the DisableVgwRoutePropagation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisableVgwRoutePropagation for more information on using the DisableVgwRoutePropagation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DisableVgwRoutePropagationRequest method. -// req, resp := client.DisableVgwRoutePropagationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagation -func (c *EC2) DisableVgwRoutePropagationRequest(input *DisableVgwRoutePropagationInput) (req *request.Request, output *DisableVgwRoutePropagationOutput) { - op := &request.Operation{ - Name: opDisableVgwRoutePropagation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableVgwRoutePropagationInput{} - } - - output = &DisableVgwRoutePropagationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableVgwRoutePropagation API operation for Amazon Elastic Compute Cloud. -// -// Disables a virtual private gateway (VGW) from propagating routes to a specified -// route table of a VPC. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisableVgwRoutePropagation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagation -func (c *EC2) DisableVgwRoutePropagation(input *DisableVgwRoutePropagationInput) (*DisableVgwRoutePropagationOutput, error) { - req, out := c.DisableVgwRoutePropagationRequest(input) - return out, req.Send() -} - -// DisableVgwRoutePropagationWithContext is the same as DisableVgwRoutePropagation with the addition of -// the ability to pass a context and additional request options. -// -// See DisableVgwRoutePropagation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DisableVgwRoutePropagationWithContext(ctx aws.Context, input *DisableVgwRoutePropagationInput, opts ...request.Option) (*DisableVgwRoutePropagationOutput, error) { - req, out := c.DisableVgwRoutePropagationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableVpcClassicLink = "DisableVpcClassicLink" - -// DisableVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the DisableVpcClassicLink operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisableVpcClassicLink for more information on using the DisableVpcClassicLink -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DisableVpcClassicLinkRequest method. -// req, resp := client.DisableVpcClassicLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLink -func (c *EC2) DisableVpcClassicLinkRequest(input *DisableVpcClassicLinkInput) (req *request.Request, output *DisableVpcClassicLinkOutput) { - op := &request.Operation{ - Name: opDisableVpcClassicLink, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableVpcClassicLinkInput{} - } - - output = &DisableVpcClassicLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableVpcClassicLink API operation for Amazon Elastic Compute Cloud. -// -// Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC -// that has EC2-Classic instances linked to it. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisableVpcClassicLink for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLink -func (c *EC2) DisableVpcClassicLink(input *DisableVpcClassicLinkInput) (*DisableVpcClassicLinkOutput, error) { - req, out := c.DisableVpcClassicLinkRequest(input) - return out, req.Send() -} - -// DisableVpcClassicLinkWithContext is the same as DisableVpcClassicLink with the addition of -// the ability to pass a context and additional request options. -// -// See DisableVpcClassicLink for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DisableVpcClassicLinkWithContext(ctx aws.Context, input *DisableVpcClassicLinkInput, opts ...request.Option) (*DisableVpcClassicLinkOutput, error) { - req, out := c.DisableVpcClassicLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableVpcClassicLinkDnsSupport = "DisableVpcClassicLinkDnsSupport" - -// DisableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the DisableVpcClassicLinkDnsSupport operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisableVpcClassicLinkDnsSupport for more information on using the DisableVpcClassicLinkDnsSupport -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DisableVpcClassicLinkDnsSupportRequest method. -// req, resp := client.DisableVpcClassicLinkDnsSupportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupport -func (c *EC2) DisableVpcClassicLinkDnsSupportRequest(input *DisableVpcClassicLinkDnsSupportInput) (req *request.Request, output *DisableVpcClassicLinkDnsSupportOutput) { - op := &request.Operation{ - Name: opDisableVpcClassicLinkDnsSupport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableVpcClassicLinkDnsSupportInput{} - } - - output = &DisableVpcClassicLinkDnsSupportOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. -// -// Disables ClassicLink DNS support for a VPC. If disabled, DNS hostnames resolve -// to public IP addresses when addressed between a linked EC2-Classic instance -// and instances in the VPC to which it's linked. For more information about -// ClassicLink, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisableVpcClassicLinkDnsSupport for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupport -func (c *EC2) DisableVpcClassicLinkDnsSupport(input *DisableVpcClassicLinkDnsSupportInput) (*DisableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) - return out, req.Send() -} - -// DisableVpcClassicLinkDnsSupportWithContext is the same as DisableVpcClassicLinkDnsSupport with the addition of -// the ability to pass a context and additional request options. -// -// See DisableVpcClassicLinkDnsSupport for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DisableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DisableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DisableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateAddress = "DisassociateAddress" - -// DisassociateAddressRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateAddress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisassociateAddress for more information on using the DisassociateAddress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DisassociateAddressRequest method. -// req, resp := client.DisassociateAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddress -func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *request.Request, output *DisassociateAddressOutput) { - op := &request.Operation{ - Name: opDisassociateAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateAddressInput{} - } - - output = &DisassociateAddressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateAddress API operation for Amazon Elastic Compute Cloud. -// -// Disassociates an Elastic IP address from the instance or network interface -// it's associated with. -// -// An Elastic IP address is for use in either the EC2-Classic platform or in -// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisassociateAddress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddress -func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (*DisassociateAddressOutput, error) { - req, out := c.DisassociateAddressRequest(input) - return out, req.Send() -} - -// DisassociateAddressWithContext is the same as DisassociateAddress with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateAddress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DisassociateAddressWithContext(ctx aws.Context, input *DisassociateAddressInput, opts ...request.Option) (*DisassociateAddressOutput, error) { - req, out := c.DisassociateAddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile" - -// DisassociateIamInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateIamInstanceProfile operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisassociateIamInstanceProfile for more information on using the DisassociateIamInstanceProfile -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DisassociateIamInstanceProfileRequest method. -// req, resp := client.DisassociateIamInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile -func (c *EC2) DisassociateIamInstanceProfileRequest(input *DisassociateIamInstanceProfileInput) (req *request.Request, output *DisassociateIamInstanceProfileOutput) { - op := &request.Operation{ - Name: opDisassociateIamInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateIamInstanceProfileInput{} - } - - output = &DisassociateIamInstanceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociateIamInstanceProfile API operation for Amazon Elastic Compute Cloud. -// -// Disassociates an IAM instance profile from a running or stopped instance. -// -// Use DescribeIamInstanceProfileAssociations to get the association ID. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisassociateIamInstanceProfile for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile -func (c *EC2) DisassociateIamInstanceProfile(input *DisassociateIamInstanceProfileInput) (*DisassociateIamInstanceProfileOutput, error) { - req, out := c.DisassociateIamInstanceProfileRequest(input) - return out, req.Send() -} - -// DisassociateIamInstanceProfileWithContext is the same as DisassociateIamInstanceProfile with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateIamInstanceProfile for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DisassociateIamInstanceProfileWithContext(ctx aws.Context, input *DisassociateIamInstanceProfileInput, opts ...request.Option) (*DisassociateIamInstanceProfileOutput, error) { - req, out := c.DisassociateIamInstanceProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateRouteTable = "DisassociateRouteTable" - -// DisassociateRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateRouteTable operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisassociateRouteTable for more information on using the DisassociateRouteTable -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DisassociateRouteTableRequest method. -// req, resp := client.DisassociateRouteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTable -func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) (req *request.Request, output *DisassociateRouteTableOutput) { - op := &request.Operation{ - Name: opDisassociateRouteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateRouteTableInput{} - } - - output = &DisassociateRouteTableOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateRouteTable API operation for Amazon Elastic Compute Cloud. -// -// Disassociates a subnet from a route table. -// -// After you perform this action, the subnet no longer uses the routes in the -// route table. Instead, it uses the routes in the VPC's main route table. For -// more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisassociateRouteTable for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTable -func (c *EC2) DisassociateRouteTable(input *DisassociateRouteTableInput) (*DisassociateRouteTableOutput, error) { - req, out := c.DisassociateRouteTableRequest(input) - return out, req.Send() -} - -// DisassociateRouteTableWithContext is the same as DisassociateRouteTable with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateRouteTable for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DisassociateRouteTableWithContext(ctx aws.Context, input *DisassociateRouteTableInput, opts ...request.Option) (*DisassociateRouteTableOutput, error) { - req, out := c.DisassociateRouteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateSubnetCidrBlock = "DisassociateSubnetCidrBlock" - -// DisassociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateSubnetCidrBlock operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisassociateSubnetCidrBlock for more information on using the DisassociateSubnetCidrBlock -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DisassociateSubnetCidrBlockRequest method. -// req, resp := client.DisassociateSubnetCidrBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlock -func (c *EC2) DisassociateSubnetCidrBlockRequest(input *DisassociateSubnetCidrBlockInput) (req *request.Request, output *DisassociateSubnetCidrBlockOutput) { - op := &request.Operation{ - Name: opDisassociateSubnetCidrBlock, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateSubnetCidrBlockInput{} - } - - output = &DisassociateSubnetCidrBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociateSubnetCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Disassociates a CIDR block from a subnet. Currently, you can disassociate -// an IPv6 CIDR block only. You must detach or delete all gateways and resources -// that are associated with the CIDR block before you can disassociate it. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisassociateSubnetCidrBlock for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlock -func (c *EC2) DisassociateSubnetCidrBlock(input *DisassociateSubnetCidrBlockInput) (*DisassociateSubnetCidrBlockOutput, error) { - req, out := c.DisassociateSubnetCidrBlockRequest(input) - return out, req.Send() -} - -// DisassociateSubnetCidrBlockWithContext is the same as DisassociateSubnetCidrBlock with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateSubnetCidrBlock for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DisassociateSubnetCidrBlockWithContext(ctx aws.Context, input *DisassociateSubnetCidrBlockInput, opts ...request.Option) (*DisassociateSubnetCidrBlockOutput, error) { - req, out := c.DisassociateSubnetCidrBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateVpcCidrBlock = "DisassociateVpcCidrBlock" - -// DisassociateVpcCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateVpcCidrBlock operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisassociateVpcCidrBlock for more information on using the DisassociateVpcCidrBlock -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DisassociateVpcCidrBlockRequest method. -// req, resp := client.DisassociateVpcCidrBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlock -func (c *EC2) DisassociateVpcCidrBlockRequest(input *DisassociateVpcCidrBlockInput) (req *request.Request, output *DisassociateVpcCidrBlockOutput) { - op := &request.Operation{ - Name: opDisassociateVpcCidrBlock, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateVpcCidrBlockInput{} - } - - output = &DisassociateVpcCidrBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociateVpcCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Disassociates a CIDR block from a VPC. To disassociate the CIDR block, you -// must specify its association ID. You can get the association ID by using -// DescribeVpcs. You must detach or delete all gateways and resources that are -// associated with the CIDR block before you can disassociate it. -// -// You cannot disassociate the CIDR block with which you originally created -// the VPC (the primary CIDR block). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisassociateVpcCidrBlock for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlock -func (c *EC2) DisassociateVpcCidrBlock(input *DisassociateVpcCidrBlockInput) (*DisassociateVpcCidrBlockOutput, error) { - req, out := c.DisassociateVpcCidrBlockRequest(input) - return out, req.Send() -} - -// DisassociateVpcCidrBlockWithContext is the same as DisassociateVpcCidrBlock with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateVpcCidrBlock for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DisassociateVpcCidrBlockWithContext(ctx aws.Context, input *DisassociateVpcCidrBlockInput, opts ...request.Option) (*DisassociateVpcCidrBlockOutput, error) { - req, out := c.DisassociateVpcCidrBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" - -// EnableVgwRoutePropagationRequest generates a "aws/request.Request" representing the -// client's request for the EnableVgwRoutePropagation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See EnableVgwRoutePropagation for more information on using the EnableVgwRoutePropagation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the EnableVgwRoutePropagationRequest method. -// req, resp := client.EnableVgwRoutePropagationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagation -func (c *EC2) EnableVgwRoutePropagationRequest(input *EnableVgwRoutePropagationInput) (req *request.Request, output *EnableVgwRoutePropagationOutput) { - op := &request.Operation{ - Name: opEnableVgwRoutePropagation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVgwRoutePropagationInput{} - } - - output = &EnableVgwRoutePropagationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableVgwRoutePropagation API operation for Amazon Elastic Compute Cloud. -// -// Enables a virtual private gateway (VGW) to propagate routes to the specified -// route table of a VPC. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation EnableVgwRoutePropagation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagation -func (c *EC2) EnableVgwRoutePropagation(input *EnableVgwRoutePropagationInput) (*EnableVgwRoutePropagationOutput, error) { - req, out := c.EnableVgwRoutePropagationRequest(input) - return out, req.Send() -} - -// EnableVgwRoutePropagationWithContext is the same as EnableVgwRoutePropagation with the addition of -// the ability to pass a context and additional request options. -// -// See EnableVgwRoutePropagation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) EnableVgwRoutePropagationWithContext(ctx aws.Context, input *EnableVgwRoutePropagationInput, opts ...request.Option) (*EnableVgwRoutePropagationOutput, error) { - req, out := c.EnableVgwRoutePropagationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableVolumeIO = "EnableVolumeIO" - -// EnableVolumeIORequest generates a "aws/request.Request" representing the -// client's request for the EnableVolumeIO operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See EnableVolumeIO for more information on using the EnableVolumeIO -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the EnableVolumeIORequest method. -// req, resp := client.EnableVolumeIORequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIO -func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *request.Request, output *EnableVolumeIOOutput) { - op := &request.Operation{ - Name: opEnableVolumeIO, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVolumeIOInput{} - } - - output = &EnableVolumeIOOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableVolumeIO API operation for Amazon Elastic Compute Cloud. -// -// Enables I/O operations for a volume that had I/O operations disabled because -// the data on the volume was potentially inconsistent. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation EnableVolumeIO for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIO -func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (*EnableVolumeIOOutput, error) { - req, out := c.EnableVolumeIORequest(input) - return out, req.Send() -} - -// EnableVolumeIOWithContext is the same as EnableVolumeIO with the addition of -// the ability to pass a context and additional request options. -// -// See EnableVolumeIO for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) EnableVolumeIOWithContext(ctx aws.Context, input *EnableVolumeIOInput, opts ...request.Option) (*EnableVolumeIOOutput, error) { - req, out := c.EnableVolumeIORequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableVpcClassicLink = "EnableVpcClassicLink" - -// EnableVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the EnableVpcClassicLink operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See EnableVpcClassicLink for more information on using the EnableVpcClassicLink -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the EnableVpcClassicLinkRequest method. -// req, resp := client.EnableVpcClassicLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLink -func (c *EC2) EnableVpcClassicLinkRequest(input *EnableVpcClassicLinkInput) (req *request.Request, output *EnableVpcClassicLinkOutput) { - op := &request.Operation{ - Name: opEnableVpcClassicLink, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVpcClassicLinkInput{} - } - - output = &EnableVpcClassicLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableVpcClassicLink API operation for Amazon Elastic Compute Cloud. -// -// Enables a VPC for ClassicLink. You can then link EC2-Classic instances to -// your ClassicLink-enabled VPC to allow communication over private IP addresses. -// You cannot enable your VPC for ClassicLink if any of your VPC's route tables -// have existing routes for address ranges within the 10.0.0.0/8 IP address -// range, excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 -// IP address ranges. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation EnableVpcClassicLink for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLink -func (c *EC2) EnableVpcClassicLink(input *EnableVpcClassicLinkInput) (*EnableVpcClassicLinkOutput, error) { - req, out := c.EnableVpcClassicLinkRequest(input) - return out, req.Send() -} - -// EnableVpcClassicLinkWithContext is the same as EnableVpcClassicLink with the addition of -// the ability to pass a context and additional request options. -// -// See EnableVpcClassicLink for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) EnableVpcClassicLinkWithContext(ctx aws.Context, input *EnableVpcClassicLinkInput, opts ...request.Option) (*EnableVpcClassicLinkOutput, error) { - req, out := c.EnableVpcClassicLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableVpcClassicLinkDnsSupport = "EnableVpcClassicLinkDnsSupport" - -// EnableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the EnableVpcClassicLinkDnsSupport operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See EnableVpcClassicLinkDnsSupport for more information on using the EnableVpcClassicLinkDnsSupport -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the EnableVpcClassicLinkDnsSupportRequest method. -// req, resp := client.EnableVpcClassicLinkDnsSupportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupport -func (c *EC2) EnableVpcClassicLinkDnsSupportRequest(input *EnableVpcClassicLinkDnsSupportInput) (req *request.Request, output *EnableVpcClassicLinkDnsSupportOutput) { - op := &request.Operation{ - Name: opEnableVpcClassicLinkDnsSupport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVpcClassicLinkDnsSupportInput{} - } - - output = &EnableVpcClassicLinkDnsSupportOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. -// -// Enables a VPC to support DNS hostname resolution for ClassicLink. If enabled, -// the DNS hostname of a linked EC2-Classic instance resolves to its private -// IP address when addressed from an instance in the VPC to which it's linked. -// Similarly, the DNS hostname of an instance in a VPC resolves to its private -// IP address when addressed from a linked EC2-Classic instance. For more information -// about ClassicLink, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation EnableVpcClassicLinkDnsSupport for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupport -func (c *EC2) EnableVpcClassicLinkDnsSupport(input *EnableVpcClassicLinkDnsSupportInput) (*EnableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) - return out, req.Send() -} - -// EnableVpcClassicLinkDnsSupportWithContext is the same as EnableVpcClassicLinkDnsSupport with the addition of -// the ability to pass a context and additional request options. -// -// See EnableVpcClassicLinkDnsSupport for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) EnableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *EnableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*EnableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConsoleOutput = "GetConsoleOutput" - -// GetConsoleOutputRequest generates a "aws/request.Request" representing the -// client's request for the GetConsoleOutput operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetConsoleOutput for more information on using the GetConsoleOutput -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetConsoleOutputRequest method. -// req, resp := client.GetConsoleOutputRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutput -func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *request.Request, output *GetConsoleOutputOutput) { - op := &request.Operation{ - Name: opGetConsoleOutput, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetConsoleOutputInput{} - } - - output = &GetConsoleOutputOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConsoleOutput API operation for Amazon Elastic Compute Cloud. -// -// Gets the console output for the specified instance. For Linux instances, -// the instance console output displays the exact console output that would -// normally be displayed on a physical monitor attached to a computer. For Windows -// instances, the instance console output includes output from the EC2Config -// service. -// -// GetConsoleOutput returns up to 64 KB of console output shortly after it's -// generated by the instance. -// -// By default, the console output returns buffered information that was posted -// shortly after an instance transition state (start, stop, reboot, or terminate). -// This information is available for at least one hour after the most recent -// post. -// -// You can optionally retrieve the latest serial console output at any time -// during the instance lifecycle. This option is only supported on C5, M5, and -// i3.metal instances. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetConsoleOutput for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutput -func (c *EC2) GetConsoleOutput(input *GetConsoleOutputInput) (*GetConsoleOutputOutput, error) { - req, out := c.GetConsoleOutputRequest(input) - return out, req.Send() -} - -// GetConsoleOutputWithContext is the same as GetConsoleOutput with the addition of -// the ability to pass a context and additional request options. -// -// See GetConsoleOutput for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) GetConsoleOutputWithContext(ctx aws.Context, input *GetConsoleOutputInput, opts ...request.Option) (*GetConsoleOutputOutput, error) { - req, out := c.GetConsoleOutputRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConsoleScreenshot = "GetConsoleScreenshot" - -// GetConsoleScreenshotRequest generates a "aws/request.Request" representing the -// client's request for the GetConsoleScreenshot operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetConsoleScreenshot for more information on using the GetConsoleScreenshot -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetConsoleScreenshotRequest method. -// req, resp := client.GetConsoleScreenshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshot -func (c *EC2) GetConsoleScreenshotRequest(input *GetConsoleScreenshotInput) (req *request.Request, output *GetConsoleScreenshotOutput) { - op := &request.Operation{ - Name: opGetConsoleScreenshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetConsoleScreenshotInput{} - } - - output = &GetConsoleScreenshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConsoleScreenshot API operation for Amazon Elastic Compute Cloud. -// -// Retrieve a JPG-format screenshot of a running instance to help with troubleshooting. -// -// The returned content is Base64-encoded. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetConsoleScreenshot for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshot -func (c *EC2) GetConsoleScreenshot(input *GetConsoleScreenshotInput) (*GetConsoleScreenshotOutput, error) { - req, out := c.GetConsoleScreenshotRequest(input) - return out, req.Send() -} - -// GetConsoleScreenshotWithContext is the same as GetConsoleScreenshot with the addition of -// the ability to pass a context and additional request options. -// -// See GetConsoleScreenshot for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) GetConsoleScreenshotWithContext(ctx aws.Context, input *GetConsoleScreenshotInput, opts ...request.Option) (*GetConsoleScreenshotOutput, error) { - req, out := c.GetConsoleScreenshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview" - -// GetHostReservationPurchasePreviewRequest generates a "aws/request.Request" representing the -// client's request for the GetHostReservationPurchasePreview operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetHostReservationPurchasePreview for more information on using the GetHostReservationPurchasePreview -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetHostReservationPurchasePreviewRequest method. -// req, resp := client.GetHostReservationPurchasePreviewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreview -func (c *EC2) GetHostReservationPurchasePreviewRequest(input *GetHostReservationPurchasePreviewInput) (req *request.Request, output *GetHostReservationPurchasePreviewOutput) { - op := &request.Operation{ - Name: opGetHostReservationPurchasePreview, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetHostReservationPurchasePreviewInput{} - } - - output = &GetHostReservationPurchasePreviewOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHostReservationPurchasePreview API operation for Amazon Elastic Compute Cloud. -// -// Preview a reservation purchase with configurations that match those of your -// Dedicated Host. You must have active Dedicated Hosts in your account before -// you purchase a reservation. -// -// This is a preview of the PurchaseHostReservation action and does not result -// in the offering being purchased. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetHostReservationPurchasePreview for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreview -func (c *EC2) GetHostReservationPurchasePreview(input *GetHostReservationPurchasePreviewInput) (*GetHostReservationPurchasePreviewOutput, error) { - req, out := c.GetHostReservationPurchasePreviewRequest(input) - return out, req.Send() -} - -// GetHostReservationPurchasePreviewWithContext is the same as GetHostReservationPurchasePreview with the addition of -// the ability to pass a context and additional request options. -// -// See GetHostReservationPurchasePreview for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) GetHostReservationPurchasePreviewWithContext(ctx aws.Context, input *GetHostReservationPurchasePreviewInput, opts ...request.Option) (*GetHostReservationPurchasePreviewOutput, error) { - req, out := c.GetHostReservationPurchasePreviewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetLaunchTemplateData = "GetLaunchTemplateData" - -// GetLaunchTemplateDataRequest generates a "aws/request.Request" representing the -// client's request for the GetLaunchTemplateData operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetLaunchTemplateData for more information on using the GetLaunchTemplateData -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetLaunchTemplateDataRequest method. -// req, resp := client.GetLaunchTemplateDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetLaunchTemplateData -func (c *EC2) GetLaunchTemplateDataRequest(input *GetLaunchTemplateDataInput) (req *request.Request, output *GetLaunchTemplateDataOutput) { - op := &request.Operation{ - Name: opGetLaunchTemplateData, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetLaunchTemplateDataInput{} - } - - output = &GetLaunchTemplateDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetLaunchTemplateData API operation for Amazon Elastic Compute Cloud. -// -// Retrieves the configuration data of the specified instance. You can use this -// data to create a launch template. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetLaunchTemplateData for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetLaunchTemplateData -func (c *EC2) GetLaunchTemplateData(input *GetLaunchTemplateDataInput) (*GetLaunchTemplateDataOutput, error) { - req, out := c.GetLaunchTemplateDataRequest(input) - return out, req.Send() -} - -// GetLaunchTemplateDataWithContext is the same as GetLaunchTemplateData with the addition of -// the ability to pass a context and additional request options. -// -// See GetLaunchTemplateData for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) GetLaunchTemplateDataWithContext(ctx aws.Context, input *GetLaunchTemplateDataInput, opts ...request.Option) (*GetLaunchTemplateDataOutput, error) { - req, out := c.GetLaunchTemplateDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPasswordData = "GetPasswordData" - -// GetPasswordDataRequest generates a "aws/request.Request" representing the -// client's request for the GetPasswordData operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetPasswordData for more information on using the GetPasswordData -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetPasswordDataRequest method. -// req, resp := client.GetPasswordDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordData -func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *request.Request, output *GetPasswordDataOutput) { - op := &request.Operation{ - Name: opGetPasswordData, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPasswordDataInput{} - } - - output = &GetPasswordDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPasswordData API operation for Amazon Elastic Compute Cloud. -// -// Retrieves the encrypted administrator password for a running Windows instance. -// -// The Windows password is generated at boot by the EC2Config service or EC2Launch -// scripts (Windows Server 2016 and later). This usually only happens the first -// time an instance is launched. For more information, see EC2Config (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html) -// and EC2Launch (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For the EC2Config service, the password is not generated for rebundled AMIs -// unless Ec2SetPassword is enabled before bundling. -// -// The password is encrypted using the key pair that you specified when you -// launched the instance. You must provide the corresponding key pair file. -// -// When you launch an instance, password generation and encryption may take -// a few minutes. If you try to retrieve the password before it's available, -// the output returns an empty string. We recommend that you wait up to 15 minutes -// after launching an instance before trying to retrieve the generated password. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetPasswordData for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordData -func (c *EC2) GetPasswordData(input *GetPasswordDataInput) (*GetPasswordDataOutput, error) { - req, out := c.GetPasswordDataRequest(input) - return out, req.Send() -} - -// GetPasswordDataWithContext is the same as GetPasswordData with the addition of -// the ability to pass a context and additional request options. -// -// See GetPasswordData for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) GetPasswordDataWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.Option) (*GetPasswordDataOutput, error) { - req, out := c.GetPasswordDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReservedInstancesExchangeQuote = "GetReservedInstancesExchangeQuote" - -// GetReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the -// client's request for the GetReservedInstancesExchangeQuote operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetReservedInstancesExchangeQuote for more information on using the GetReservedInstancesExchangeQuote -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the GetReservedInstancesExchangeQuoteRequest method. -// req, resp := client.GetReservedInstancesExchangeQuoteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuote -func (c *EC2) GetReservedInstancesExchangeQuoteRequest(input *GetReservedInstancesExchangeQuoteInput) (req *request.Request, output *GetReservedInstancesExchangeQuoteOutput) { - op := &request.Operation{ - Name: opGetReservedInstancesExchangeQuote, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetReservedInstancesExchangeQuoteInput{} - } - - output = &GetReservedInstancesExchangeQuoteOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetReservedInstancesExchangeQuote API operation for Amazon Elastic Compute Cloud. -// -// Returns a quote and exchange information for exchanging one or more specified -// Convertible Reserved Instances for a new Convertible Reserved Instance. If -// the exchange cannot be performed, the reason is returned in the response. -// Use AcceptReservedInstancesExchangeQuote to perform the exchange. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetReservedInstancesExchangeQuote for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuote -func (c *EC2) GetReservedInstancesExchangeQuote(input *GetReservedInstancesExchangeQuoteInput) (*GetReservedInstancesExchangeQuoteOutput, error) { - req, out := c.GetReservedInstancesExchangeQuoteRequest(input) - return out, req.Send() -} - -// GetReservedInstancesExchangeQuoteWithContext is the same as GetReservedInstancesExchangeQuote with the addition of -// the ability to pass a context and additional request options. -// -// See GetReservedInstancesExchangeQuote for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) GetReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *GetReservedInstancesExchangeQuoteInput, opts ...request.Option) (*GetReservedInstancesExchangeQuoteOutput, error) { - req, out := c.GetReservedInstancesExchangeQuoteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportImage = "ImportImage" - -// ImportImageRequest generates a "aws/request.Request" representing the -// client's request for the ImportImage operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ImportImage for more information on using the ImportImage -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ImportImageRequest method. -// req, resp := client.ImportImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImage -func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *request.Request, output *ImportImageOutput) { - op := &request.Operation{ - Name: opImportImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportImageInput{} - } - - output = &ImportImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportImage API operation for Amazon Elastic Compute Cloud. -// -// Import single or multi-volume disk images or EBS snapshots into an Amazon -// Machine Image (AMI). For more information, see Importing a VM as an Image -// Using VM Import/Export (http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html) -// in the VM Import/Export User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ImportImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImage -func (c *EC2) ImportImage(input *ImportImageInput) (*ImportImageOutput, error) { - req, out := c.ImportImageRequest(input) - return out, req.Send() -} - -// ImportImageWithContext is the same as ImportImage with the addition of -// the ability to pass a context and additional request options. -// -// See ImportImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ImportImageWithContext(ctx aws.Context, input *ImportImageInput, opts ...request.Option) (*ImportImageOutput, error) { - req, out := c.ImportImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportInstance = "ImportInstance" - -// ImportInstanceRequest generates a "aws/request.Request" representing the -// client's request for the ImportInstance operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ImportInstance for more information on using the ImportInstance -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ImportInstanceRequest method. -// req, resp := client.ImportInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstance -func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *request.Request, output *ImportInstanceOutput) { - op := &request.Operation{ - Name: opImportInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportInstanceInput{} - } - - output = &ImportInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportInstance API operation for Amazon Elastic Compute Cloud. -// -// Creates an import instance task using metadata from the specified disk image. -// ImportInstance only supports single-volume VMs. To import multi-volume VMs, -// use ImportImage. For more information, see Importing a Virtual Machine Using -// the Amazon EC2 CLI (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html). -// -// For information about the import manifest referenced by this API action, -// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ImportInstance for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstance -func (c *EC2) ImportInstance(input *ImportInstanceInput) (*ImportInstanceOutput, error) { - req, out := c.ImportInstanceRequest(input) - return out, req.Send() -} - -// ImportInstanceWithContext is the same as ImportInstance with the addition of -// the ability to pass a context and additional request options. -// -// See ImportInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ImportInstanceWithContext(ctx aws.Context, input *ImportInstanceInput, opts ...request.Option) (*ImportInstanceOutput, error) { - req, out := c.ImportInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportKeyPair = "ImportKeyPair" - -// ImportKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the ImportKeyPair operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ImportKeyPair for more information on using the ImportKeyPair -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ImportKeyPairRequest method. -// req, resp := client.ImportKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPair -func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *request.Request, output *ImportKeyPairOutput) { - op := &request.Operation{ - Name: opImportKeyPair, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportKeyPairInput{} - } - - output = &ImportKeyPairOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportKeyPair API operation for Amazon Elastic Compute Cloud. -// -// Imports the public key from an RSA key pair that you created with a third-party -// tool. Compare this with CreateKeyPair, in which AWS creates the key pair -// and gives the keys to you (AWS keeps a copy of the public key). With ImportKeyPair, -// you create the key pair and give AWS just the public key. The private key -// is never transferred between you and AWS. -// -// For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ImportKeyPair for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPair -func (c *EC2) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, error) { - req, out := c.ImportKeyPairRequest(input) - return out, req.Send() -} - -// ImportKeyPairWithContext is the same as ImportKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See ImportKeyPair for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ImportKeyPairWithContext(ctx aws.Context, input *ImportKeyPairInput, opts ...request.Option) (*ImportKeyPairOutput, error) { - req, out := c.ImportKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportSnapshot = "ImportSnapshot" - -// ImportSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the ImportSnapshot operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ImportSnapshot for more information on using the ImportSnapshot -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ImportSnapshotRequest method. -// req, resp := client.ImportSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshot -func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *request.Request, output *ImportSnapshotOutput) { - op := &request.Operation{ - Name: opImportSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportSnapshotInput{} - } - - output = &ImportSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportSnapshot API operation for Amazon Elastic Compute Cloud. -// -// Imports a disk into an EBS snapshot. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ImportSnapshot for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshot -func (c *EC2) ImportSnapshot(input *ImportSnapshotInput) (*ImportSnapshotOutput, error) { - req, out := c.ImportSnapshotRequest(input) - return out, req.Send() -} - -// ImportSnapshotWithContext is the same as ImportSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See ImportSnapshot for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ImportSnapshotWithContext(ctx aws.Context, input *ImportSnapshotInput, opts ...request.Option) (*ImportSnapshotOutput, error) { - req, out := c.ImportSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportVolume = "ImportVolume" - -// ImportVolumeRequest generates a "aws/request.Request" representing the -// client's request for the ImportVolume operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ImportVolume for more information on using the ImportVolume -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ImportVolumeRequest method. -// req, resp := client.ImportVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolume -func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *request.Request, output *ImportVolumeOutput) { - op := &request.Operation{ - Name: opImportVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportVolumeInput{} - } - - output = &ImportVolumeOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportVolume API operation for Amazon Elastic Compute Cloud. -// -// Creates an import volume task using metadata from the specified disk image.For -// more information, see Importing Disks to Amazon EBS (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/importing-your-volumes-into-amazon-ebs.html). -// -// For information about the import manifest referenced by this API action, -// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ImportVolume for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolume -func (c *EC2) ImportVolume(input *ImportVolumeInput) (*ImportVolumeOutput, error) { - req, out := c.ImportVolumeRequest(input) - return out, req.Send() -} - -// ImportVolumeWithContext is the same as ImportVolume with the addition of -// the ability to pass a context and additional request options. -// -// See ImportVolume for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ImportVolumeWithContext(ctx aws.Context, input *ImportVolumeInput, opts ...request.Option) (*ImportVolumeOutput, error) { - req, out := c.ImportVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyFleet = "ModifyFleet" - -// ModifyFleetRequest generates a "aws/request.Request" representing the -// client's request for the ModifyFleet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyFleet for more information on using the ModifyFleet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyFleetRequest method. -// req, resp := client.ModifyFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFleet -func (c *EC2) ModifyFleetRequest(input *ModifyFleetInput) (req *request.Request, output *ModifyFleetOutput) { - op := &request.Operation{ - Name: opModifyFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyFleetInput{} - } - - output = &ModifyFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyFleet API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified EC2 Fleet. -// -// While the EC2 Fleet is being modified, it is in the modifying state. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyFleet for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFleet -func (c *EC2) ModifyFleet(input *ModifyFleetInput) (*ModifyFleetOutput, error) { - req, out := c.ModifyFleetRequest(input) - return out, req.Send() -} - -// ModifyFleetWithContext is the same as ModifyFleet with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyFleet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyFleetWithContext(ctx aws.Context, input *ModifyFleetInput, opts ...request.Option) (*ModifyFleetOutput, error) { - req, out := c.ModifyFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyFpgaImageAttribute = "ModifyFpgaImageAttribute" - -// ModifyFpgaImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyFpgaImageAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyFpgaImageAttribute for more information on using the ModifyFpgaImageAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyFpgaImageAttributeRequest method. -// req, resp := client.ModifyFpgaImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFpgaImageAttribute -func (c *EC2) ModifyFpgaImageAttributeRequest(input *ModifyFpgaImageAttributeInput) (req *request.Request, output *ModifyFpgaImageAttributeOutput) { - op := &request.Operation{ - Name: opModifyFpgaImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyFpgaImageAttributeInput{} - } - - output = &ModifyFpgaImageAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyFpgaImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified attribute of the specified Amazon FPGA Image (AFI). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyFpgaImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFpgaImageAttribute -func (c *EC2) ModifyFpgaImageAttribute(input *ModifyFpgaImageAttributeInput) (*ModifyFpgaImageAttributeOutput, error) { - req, out := c.ModifyFpgaImageAttributeRequest(input) - return out, req.Send() -} - -// ModifyFpgaImageAttributeWithContext is the same as ModifyFpgaImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyFpgaImageAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyFpgaImageAttributeWithContext(ctx aws.Context, input *ModifyFpgaImageAttributeInput, opts ...request.Option) (*ModifyFpgaImageAttributeOutput, error) { - req, out := c.ModifyFpgaImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyHosts = "ModifyHosts" - -// ModifyHostsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyHosts operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyHosts for more information on using the ModifyHosts -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyHostsRequest method. -// req, resp := client.ModifyHostsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHosts -func (c *EC2) ModifyHostsRequest(input *ModifyHostsInput) (req *request.Request, output *ModifyHostsOutput) { - op := &request.Operation{ - Name: opModifyHosts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyHostsInput{} - } - - output = &ModifyHostsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyHosts API operation for Amazon Elastic Compute Cloud. -// -// Modify the auto-placement setting of a Dedicated Host. When auto-placement -// is enabled, AWS will place instances that you launch with a tenancy of host, -// but without targeting a specific host ID, onto any available Dedicated Host -// in your account which has auto-placement enabled. When auto-placement is -// disabled, you need to provide a host ID if you want the instance to launch -// onto a specific host. If no host ID is provided, the instance will be launched -// onto a suitable host which has auto-placement enabled. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyHosts for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHosts -func (c *EC2) ModifyHosts(input *ModifyHostsInput) (*ModifyHostsOutput, error) { - req, out := c.ModifyHostsRequest(input) - return out, req.Send() -} - -// ModifyHostsWithContext is the same as ModifyHosts with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyHosts for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyHostsWithContext(ctx aws.Context, input *ModifyHostsInput, opts ...request.Option) (*ModifyHostsOutput, error) { - req, out := c.ModifyHostsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyIdFormat = "ModifyIdFormat" - -// ModifyIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the ModifyIdFormat operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyIdFormat for more information on using the ModifyIdFormat -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyIdFormatRequest method. -// req, resp := client.ModifyIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormat -func (c *EC2) ModifyIdFormatRequest(input *ModifyIdFormatInput) (req *request.Request, output *ModifyIdFormatOutput) { - op := &request.Operation{ - Name: opModifyIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyIdFormatInput{} - } - - output = &ModifyIdFormatOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Modifies the ID format for the specified resource on a per-region basis. -// You can specify that resources should receive longer IDs (17-character IDs) -// when they are created. -// -// This request can only be used to modify longer ID settings for resource types -// that are within the opt-in period. Resources currently in their opt-in period -// include: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation -// | elastic-ip-association | export-task | flow-log | image | import-task | -// internet-gateway | network-acl | network-acl-association | network-interface -// | network-interface-attachment | prefix-list | route-table | route-table-association -// | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. -// -// This setting applies to the IAM user who makes the request; it does not apply -// to the entire AWS account. By default, an IAM user defaults to the same settings -// as the root user. If you're using this action as the root user, then these -// settings apply to the entire account, unless an IAM user explicitly overrides -// these settings for themselves. For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Resources created with longer IDs are visible to all IAM roles and users, -// regardless of these settings and provided that they have permission to use -// the relevant Describe command for the resource type. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyIdFormat for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormat -func (c *EC2) ModifyIdFormat(input *ModifyIdFormatInput) (*ModifyIdFormatOutput, error) { - req, out := c.ModifyIdFormatRequest(input) - return out, req.Send() -} - -// ModifyIdFormatWithContext is the same as ModifyIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyIdFormat for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyIdFormatWithContext(ctx aws.Context, input *ModifyIdFormatInput, opts ...request.Option) (*ModifyIdFormatOutput, error) { - req, out := c.ModifyIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyIdentityIdFormat = "ModifyIdentityIdFormat" - -// ModifyIdentityIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the ModifyIdentityIdFormat operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyIdentityIdFormat for more information on using the ModifyIdentityIdFormat -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyIdentityIdFormatRequest method. -// req, resp := client.ModifyIdentityIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormat -func (c *EC2) ModifyIdentityIdFormatRequest(input *ModifyIdentityIdFormatInput) (req *request.Request, output *ModifyIdentityIdFormatOutput) { - op := &request.Operation{ - Name: opModifyIdentityIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyIdentityIdFormatInput{} - } - - output = &ModifyIdentityIdFormatOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyIdentityIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Modifies the ID format of a resource for a specified IAM user, IAM role, -// or the root user for an account; or all IAM users, IAM roles, and the root -// user for an account. You can specify that resources should receive longer -// IDs (17-character IDs) when they are created. -// -// This request can only be used to modify longer ID settings for resource types -// that are within the opt-in period. Resources currently in their opt-in period -// include: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation -// | elastic-ip-association | export-task | flow-log | image | import-task | -// internet-gateway | network-acl | network-acl-association | network-interface -// | network-interface-attachment | prefix-list | route-table | route-table-association -// | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. -// -// For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// This setting applies to the principal specified in the request; it does not -// apply to the principal that makes the request. -// -// Resources created with longer IDs are visible to all IAM roles and users, -// regardless of these settings and provided that they have permission to use -// the relevant Describe command for the resource type. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyIdentityIdFormat for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormat -func (c *EC2) ModifyIdentityIdFormat(input *ModifyIdentityIdFormatInput) (*ModifyIdentityIdFormatOutput, error) { - req, out := c.ModifyIdentityIdFormatRequest(input) - return out, req.Send() -} - -// ModifyIdentityIdFormatWithContext is the same as ModifyIdentityIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyIdentityIdFormat for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyIdentityIdFormatWithContext(ctx aws.Context, input *ModifyIdentityIdFormatInput, opts ...request.Option) (*ModifyIdentityIdFormatOutput, error) { - req, out := c.ModifyIdentityIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyImageAttribute = "ModifyImageAttribute" - -// ModifyImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyImageAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyImageAttribute for more information on using the ModifyImageAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyImageAttributeRequest method. -// req, resp := client.ModifyImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttribute -func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req *request.Request, output *ModifyImageAttributeOutput) { - op := &request.Operation{ - Name: opModifyImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyImageAttributeInput{} - } - - output = &ModifyImageAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified attribute of the specified AMI. You can specify only -// one attribute at a time. You can use the Attribute parameter to specify the -// attribute or one of the following parameters: Description, LaunchPermission, -// or ProductCode. -// -// AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace -// product code cannot be made public. -// -// To enable the SriovNetSupport enhanced networking attribute of an image, -// enable SriovNetSupport on an instance and create an AMI from the instance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttribute -func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) { - req, out := c.ModifyImageAttributeRequest(input) - return out, req.Send() -} - -// ModifyImageAttributeWithContext is the same as ModifyImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyImageAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyImageAttributeWithContext(ctx aws.Context, input *ModifyImageAttributeInput, opts ...request.Option) (*ModifyImageAttributeOutput, error) { - req, out := c.ModifyImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstanceAttribute = "ModifyInstanceAttribute" - -// ModifyInstanceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyInstanceAttribute for more information on using the ModifyInstanceAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyInstanceAttributeRequest method. -// req, resp := client.ModifyInstanceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttribute -func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput) (req *request.Request, output *ModifyInstanceAttributeOutput) { - op := &request.Operation{ - Name: opModifyInstanceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceAttributeInput{} - } - - output = &ModifyInstanceAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyInstanceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified attribute of the specified instance. You can specify -// only one attribute at a time. -// -// Note: Using this action to change the security groups associated with an -// elastic network interface (ENI) attached to an instance in a VPC can result -// in an error if the instance has more than one ENI. To change the security -// groups associated with an ENI attached to an instance that has multiple ENIs, -// we recommend that you use the ModifyNetworkInterfaceAttribute action. -// -// To modify some attributes, the instance must be stopped. For more information, -// see Modifying Attributes of a Stopped Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyInstanceAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttribute -func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*ModifyInstanceAttributeOutput, error) { - req, out := c.ModifyInstanceAttributeRequest(input) - return out, req.Send() -} - -// ModifyInstanceAttributeWithContext is the same as ModifyInstanceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyInstanceAttributeWithContext(ctx aws.Context, input *ModifyInstanceAttributeInput, opts ...request.Option) (*ModifyInstanceAttributeOutput, error) { - req, out := c.ModifyInstanceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstanceCreditSpecification = "ModifyInstanceCreditSpecification" - -// ModifyInstanceCreditSpecificationRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceCreditSpecification operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyInstanceCreditSpecification for more information on using the ModifyInstanceCreditSpecification -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyInstanceCreditSpecificationRequest method. -// req, resp := client.ModifyInstanceCreditSpecificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCreditSpecification -func (c *EC2) ModifyInstanceCreditSpecificationRequest(input *ModifyInstanceCreditSpecificationInput) (req *request.Request, output *ModifyInstanceCreditSpecificationOutput) { - op := &request.Operation{ - Name: opModifyInstanceCreditSpecification, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceCreditSpecificationInput{} - } - - output = &ModifyInstanceCreditSpecificationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyInstanceCreditSpecification API operation for Amazon Elastic Compute Cloud. -// -// Modifies the credit option for CPU usage on a running or stopped T2 instance. -// The credit options are standard and unlimited. -// -// For more information, see T2 Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyInstanceCreditSpecification for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCreditSpecification -func (c *EC2) ModifyInstanceCreditSpecification(input *ModifyInstanceCreditSpecificationInput) (*ModifyInstanceCreditSpecificationOutput, error) { - req, out := c.ModifyInstanceCreditSpecificationRequest(input) - return out, req.Send() -} - -// ModifyInstanceCreditSpecificationWithContext is the same as ModifyInstanceCreditSpecification with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceCreditSpecification for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyInstanceCreditSpecificationWithContext(ctx aws.Context, input *ModifyInstanceCreditSpecificationInput, opts ...request.Option) (*ModifyInstanceCreditSpecificationOutput, error) { - req, out := c.ModifyInstanceCreditSpecificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstancePlacement = "ModifyInstancePlacement" - -// ModifyInstancePlacementRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstancePlacement operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyInstancePlacement for more information on using the ModifyInstancePlacement -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyInstancePlacementRequest method. -// req, resp := client.ModifyInstancePlacementRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacement -func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput) (req *request.Request, output *ModifyInstancePlacementOutput) { - op := &request.Operation{ - Name: opModifyInstancePlacement, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstancePlacementInput{} - } - - output = &ModifyInstancePlacementOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyInstancePlacement API operation for Amazon Elastic Compute Cloud. -// -// Modifies the placement attributes for a specified instance. You can do the -// following: -// -// * Modify the affinity between an instance and a Dedicated Host (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html). -// When affinity is set to host and the instance is not associated with a -// specific Dedicated Host, the next time the instance is launched, it is -// automatically associated with the host on which it lands. If the instance -// is restarted or rebooted, this relationship persists. -// -// * Change the Dedicated Host with which an instance is associated. -// -// * Change the instance tenancy of an instance from host to dedicated, or -// from dedicated to host. -// -// * Move an instance to or from a placement group (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html). -// -// At least one attribute for affinity, host ID, tenancy, or placement group -// name must be specified in the request. Affinity and tenancy can be modified -// in the same request. -// -// To modify the host ID, tenancy, or placement group for an instance, the instance -// must be in the stopped state. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyInstancePlacement for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacement -func (c *EC2) ModifyInstancePlacement(input *ModifyInstancePlacementInput) (*ModifyInstancePlacementOutput, error) { - req, out := c.ModifyInstancePlacementRequest(input) - return out, req.Send() -} - -// ModifyInstancePlacementWithContext is the same as ModifyInstancePlacement with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstancePlacement for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyInstancePlacementWithContext(ctx aws.Context, input *ModifyInstancePlacementInput, opts ...request.Option) (*ModifyInstancePlacementOutput, error) { - req, out := c.ModifyInstancePlacementRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyLaunchTemplate = "ModifyLaunchTemplate" - -// ModifyLaunchTemplateRequest generates a "aws/request.Request" representing the -// client's request for the ModifyLaunchTemplate operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyLaunchTemplate for more information on using the ModifyLaunchTemplate -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyLaunchTemplateRequest method. -// req, resp := client.ModifyLaunchTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyLaunchTemplate -func (c *EC2) ModifyLaunchTemplateRequest(input *ModifyLaunchTemplateInput) (req *request.Request, output *ModifyLaunchTemplateOutput) { - op := &request.Operation{ - Name: opModifyLaunchTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyLaunchTemplateInput{} - } - - output = &ModifyLaunchTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyLaunchTemplate API operation for Amazon Elastic Compute Cloud. -// -// Modifies a launch template. You can specify which version of the launch template -// to set as the default version. When launching an instance, the default version -// applies when a launch template version is not specified. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyLaunchTemplate for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyLaunchTemplate -func (c *EC2) ModifyLaunchTemplate(input *ModifyLaunchTemplateInput) (*ModifyLaunchTemplateOutput, error) { - req, out := c.ModifyLaunchTemplateRequest(input) - return out, req.Send() -} - -// ModifyLaunchTemplateWithContext is the same as ModifyLaunchTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyLaunchTemplate for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyLaunchTemplateWithContext(ctx aws.Context, input *ModifyLaunchTemplateInput, opts ...request.Option) (*ModifyLaunchTemplateOutput, error) { - req, out := c.ModifyLaunchTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" - -// ModifyNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyNetworkInterfaceAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyNetworkInterfaceAttribute for more information on using the ModifyNetworkInterfaceAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyNetworkInterfaceAttributeRequest method. -// req, resp := client.ModifyNetworkInterfaceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttribute -func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfaceAttributeInput) (req *request.Request, output *ModifyNetworkInterfaceAttributeOutput) { - op := &request.Operation{ - Name: opModifyNetworkInterfaceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyNetworkInterfaceAttributeInput{} - } - - output = &ModifyNetworkInterfaceAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified network interface attribute. You can specify only -// one attribute at a time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyNetworkInterfaceAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttribute -func (c *EC2) ModifyNetworkInterfaceAttribute(input *ModifyNetworkInterfaceAttributeInput) (*ModifyNetworkInterfaceAttributeOutput, error) { - req, out := c.ModifyNetworkInterfaceAttributeRequest(input) - return out, req.Send() -} - -// ModifyNetworkInterfaceAttributeWithContext is the same as ModifyNetworkInterfaceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyNetworkInterfaceAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ModifyNetworkInterfaceAttributeInput, opts ...request.Option) (*ModifyNetworkInterfaceAttributeOutput, error) { - req, out := c.ModifyNetworkInterfaceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyReservedInstances = "ModifyReservedInstances" - -// ModifyReservedInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyReservedInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyReservedInstances for more information on using the ModifyReservedInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyReservedInstancesRequest method. -// req, resp := client.ModifyReservedInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstances -func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput) (req *request.Request, output *ModifyReservedInstancesOutput) { - op := &request.Operation{ - Name: opModifyReservedInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyReservedInstancesInput{} - } - - output = &ModifyReservedInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyReservedInstances API operation for Amazon Elastic Compute Cloud. -// -// Modifies the Availability Zone, instance count, instance type, or network -// platform (EC2-Classic or EC2-VPC) of your Reserved Instances. The Reserved -// Instances to be modified must be identical, except for Availability Zone, -// network platform, and instance type. -// -// For more information, see Modifying Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyReservedInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstances -func (c *EC2) ModifyReservedInstances(input *ModifyReservedInstancesInput) (*ModifyReservedInstancesOutput, error) { - req, out := c.ModifyReservedInstancesRequest(input) - return out, req.Send() -} - -// ModifyReservedInstancesWithContext is the same as ModifyReservedInstances with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyReservedInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyReservedInstancesWithContext(ctx aws.Context, input *ModifyReservedInstancesInput, opts ...request.Option) (*ModifyReservedInstancesOutput, error) { - req, out := c.ModifyReservedInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifySnapshotAttribute = "ModifySnapshotAttribute" - -// ModifySnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifySnapshotAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifySnapshotAttribute for more information on using the ModifySnapshotAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifySnapshotAttributeRequest method. -// req, resp := client.ModifySnapshotAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttribute -func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput) (req *request.Request, output *ModifySnapshotAttributeOutput) { - op := &request.Operation{ - Name: opModifySnapshotAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifySnapshotAttributeInput{} - } - - output = &ModifySnapshotAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifySnapshotAttribute API operation for Amazon Elastic Compute Cloud. -// -// Adds or removes permission settings for the specified snapshot. You may add -// or remove specified AWS account IDs from a snapshot's list of create volume -// permissions, but you cannot do both in a single API call. If you need to -// both add and remove account IDs for a snapshot, you must use multiple API -// calls. -// -// Encrypted snapshots and snapshots with AWS Marketplace product codes cannot -// be made public. Snapshots encrypted with your default CMK cannot be shared -// with other accounts. -// -// For more information on modifying snapshot permissions, see Sharing Snapshots -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifySnapshotAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttribute -func (c *EC2) ModifySnapshotAttribute(input *ModifySnapshotAttributeInput) (*ModifySnapshotAttributeOutput, error) { - req, out := c.ModifySnapshotAttributeRequest(input) - return out, req.Send() -} - -// ModifySnapshotAttributeWithContext is the same as ModifySnapshotAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifySnapshotAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifySnapshotAttributeWithContext(ctx aws.Context, input *ModifySnapshotAttributeInput, opts ...request.Option) (*ModifySnapshotAttributeOutput, error) { - req, out := c.ModifySnapshotAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifySpotFleetRequest = "ModifySpotFleetRequest" - -// ModifySpotFleetRequestRequest generates a "aws/request.Request" representing the -// client's request for the ModifySpotFleetRequest operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifySpotFleetRequest for more information on using the ModifySpotFleetRequest -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifySpotFleetRequestRequest method. -// req, resp := client.ModifySpotFleetRequestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequest -func (c *EC2) ModifySpotFleetRequestRequest(input *ModifySpotFleetRequestInput) (req *request.Request, output *ModifySpotFleetRequestOutput) { - op := &request.Operation{ - Name: opModifySpotFleetRequest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifySpotFleetRequestInput{} - } - - output = &ModifySpotFleetRequestOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifySpotFleetRequest API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified Spot Fleet request. -// -// While the Spot Fleet request is being modified, it is in the modifying state. -// -// To scale up your Spot Fleet, increase its target capacity. The Spot Fleet -// launches the additional Spot Instances according to the allocation strategy -// for the Spot Fleet request. If the allocation strategy is lowestPrice, the -// Spot Fleet launches instances using the Spot pool with the lowest price. -// If the allocation strategy is diversified, the Spot Fleet distributes the -// instances across the Spot pools. -// -// To scale down your Spot Fleet, decrease its target capacity. First, the Spot -// Fleet cancels any open requests that exceed the new target capacity. You -// can request that the Spot Fleet terminate Spot Instances until the size of -// the fleet no longer exceeds the new target capacity. If the allocation strategy -// is lowestPrice, the Spot Fleet terminates the instances with the highest -// price per unit. If the allocation strategy is diversified, the Spot Fleet -// terminates instances across the Spot pools. Alternatively, you can request -// that the Spot Fleet keep the fleet at its current size, but not replace any -// Spot Instances that are interrupted or that you terminate manually. -// -// If you are finished with your Spot Fleet for now, but will use it again later, -// you can set the target capacity to 0. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifySpotFleetRequest for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequest -func (c *EC2) ModifySpotFleetRequest(input *ModifySpotFleetRequestInput) (*ModifySpotFleetRequestOutput, error) { - req, out := c.ModifySpotFleetRequestRequest(input) - return out, req.Send() -} - -// ModifySpotFleetRequestWithContext is the same as ModifySpotFleetRequest with the addition of -// the ability to pass a context and additional request options. -// -// See ModifySpotFleetRequest for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifySpotFleetRequestWithContext(ctx aws.Context, input *ModifySpotFleetRequestInput, opts ...request.Option) (*ModifySpotFleetRequestOutput, error) { - req, out := c.ModifySpotFleetRequestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifySubnetAttribute = "ModifySubnetAttribute" - -// ModifySubnetAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifySubnetAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifySubnetAttribute for more information on using the ModifySubnetAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifySubnetAttributeRequest method. -// req, resp := client.ModifySubnetAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttribute -func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (req *request.Request, output *ModifySubnetAttributeOutput) { - op := &request.Operation{ - Name: opModifySubnetAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifySubnetAttributeInput{} - } - - output = &ModifySubnetAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifySubnetAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies a subnet attribute. You can only modify one attribute at a time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifySubnetAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttribute -func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (*ModifySubnetAttributeOutput, error) { - req, out := c.ModifySubnetAttributeRequest(input) - return out, req.Send() -} - -// ModifySubnetAttributeWithContext is the same as ModifySubnetAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifySubnetAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifySubnetAttributeWithContext(ctx aws.Context, input *ModifySubnetAttributeInput, opts ...request.Option) (*ModifySubnetAttributeOutput, error) { - req, out := c.ModifySubnetAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVolume = "ModifyVolume" - -// ModifyVolumeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVolume operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVolume for more information on using the ModifyVolume -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVolumeRequest method. -// req, resp := client.ModifyVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume -func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Request, output *ModifyVolumeOutput) { - op := &request.Operation{ - Name: opModifyVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVolumeInput{} - } - - output = &ModifyVolumeOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVolume API operation for Amazon Elastic Compute Cloud. -// -// You can modify several parameters of an existing EBS volume, including volume -// size, volume type, and IOPS capacity. If your EBS volume is attached to a -// current-generation EC2 instance type, you may be able to apply these changes -// without stopping the instance or detaching the volume from it. For more information -// about modifying an EBS volume running Linux, see Modifying the Size, IOPS, -// or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). -// For more information about modifying an EBS volume running Windows, see Modifying -// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). -// -// When you complete a resize operation on your volume, you need to extend the -// volume's file-system size to take advantage of the new storage capacity. -// For information about extending a Linux file system, see Extending a Linux -// File System (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux). -// For information about extending a Windows file system, see Extending a Windows -// File System (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows). -// -// You can use CloudWatch Events to check the status of a modification to an -// EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch -// Events User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). -// You can also track the status of a modification using the DescribeVolumesModifications -// API. For information about tracking status changes using either method, see -// Monitoring Volume Modifications (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). -// -// With previous-generation instance types, resizing an EBS volume may require -// detaching and reattaching the volume or stopping and restarting the instance. -// For more information about modifying an EBS volume running Linux, see Modifying -// the Size, IOPS, or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). -// For more information about modifying an EBS volume running Windows, see Modifying -// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). -// -// If you reach the maximum volume modification rate per volume limit, you will -// need to wait at least six hours before applying further modifications to -// the affected EBS volume. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVolume for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume -func (c *EC2) ModifyVolume(input *ModifyVolumeInput) (*ModifyVolumeOutput, error) { - req, out := c.ModifyVolumeRequest(input) - return out, req.Send() -} - -// ModifyVolumeWithContext is the same as ModifyVolume with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVolume for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVolumeWithContext(ctx aws.Context, input *ModifyVolumeInput, opts ...request.Option) (*ModifyVolumeOutput, error) { - req, out := c.ModifyVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVolumeAttribute = "ModifyVolumeAttribute" - -// ModifyVolumeAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVolumeAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVolumeAttribute for more information on using the ModifyVolumeAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVolumeAttributeRequest method. -// req, resp := client.ModifyVolumeAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttribute -func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (req *request.Request, output *ModifyVolumeAttributeOutput) { - op := &request.Operation{ - Name: opModifyVolumeAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVolumeAttributeInput{} - } - - output = &ModifyVolumeAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyVolumeAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies a volume attribute. -// -// By default, all I/O operations for the volume are suspended when the data -// on the volume is determined to be potentially inconsistent, to prevent undetectable, -// latent data corruption. The I/O access to the volume can be resumed by first -// enabling I/O access and then checking the data consistency on your volume. -// -// You can change the default behavior to resume I/O operations. We recommend -// that you change this only for boot volumes or for volumes that are stateless -// or disposable. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVolumeAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttribute -func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (*ModifyVolumeAttributeOutput, error) { - req, out := c.ModifyVolumeAttributeRequest(input) - return out, req.Send() -} - -// ModifyVolumeAttributeWithContext is the same as ModifyVolumeAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVolumeAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVolumeAttributeWithContext(ctx aws.Context, input *ModifyVolumeAttributeInput, opts ...request.Option) (*ModifyVolumeAttributeOutput, error) { - req, out := c.ModifyVolumeAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcAttribute = "ModifyVpcAttribute" - -// ModifyVpcAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVpcAttribute for more information on using the ModifyVpcAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVpcAttributeRequest method. -// req, resp := client.ModifyVpcAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttribute -func (c *EC2) ModifyVpcAttributeRequest(input *ModifyVpcAttributeInput) (req *request.Request, output *ModifyVpcAttributeOutput) { - op := &request.Operation{ - Name: opModifyVpcAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcAttributeInput{} - } - - output = &ModifyVpcAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyVpcAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified attribute of the specified VPC. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVpcAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttribute -func (c *EC2) ModifyVpcAttribute(input *ModifyVpcAttributeInput) (*ModifyVpcAttributeOutput, error) { - req, out := c.ModifyVpcAttributeRequest(input) - return out, req.Send() -} - -// ModifyVpcAttributeWithContext is the same as ModifyVpcAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVpcAttributeWithContext(ctx aws.Context, input *ModifyVpcAttributeInput, opts ...request.Option) (*ModifyVpcAttributeOutput, error) { - req, out := c.ModifyVpcAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcEndpoint = "ModifyVpcEndpoint" - -// ModifyVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpoint operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVpcEndpoint for more information on using the ModifyVpcEndpoint -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVpcEndpointRequest method. -// req, resp := client.ModifyVpcEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpoint -func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) (req *request.Request, output *ModifyVpcEndpointOutput) { - op := &request.Operation{ - Name: opModifyVpcEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcEndpointInput{} - } - - output = &ModifyVpcEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVpcEndpoint API operation for Amazon Elastic Compute Cloud. -// -// Modifies attributes of a specified VPC endpoint. The attributes that you -// can modify depend on the type of VPC endpoint (interface or gateway). For -// more information, see VPC Endpoints (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVpcEndpoint for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpoint -func (c *EC2) ModifyVpcEndpoint(input *ModifyVpcEndpointInput) (*ModifyVpcEndpointOutput, error) { - req, out := c.ModifyVpcEndpointRequest(input) - return out, req.Send() -} - -// ModifyVpcEndpointWithContext is the same as ModifyVpcEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcEndpoint for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVpcEndpointWithContext(ctx aws.Context, input *ModifyVpcEndpointInput, opts ...request.Option) (*ModifyVpcEndpointOutput, error) { - req, out := c.ModifyVpcEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcEndpointConnectionNotification = "ModifyVpcEndpointConnectionNotification" - -// ModifyVpcEndpointConnectionNotificationRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpointConnectionNotification operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVpcEndpointConnectionNotification for more information on using the ModifyVpcEndpointConnectionNotification -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVpcEndpointConnectionNotificationRequest method. -// req, resp := client.ModifyVpcEndpointConnectionNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointConnectionNotification -func (c *EC2) ModifyVpcEndpointConnectionNotificationRequest(input *ModifyVpcEndpointConnectionNotificationInput) (req *request.Request, output *ModifyVpcEndpointConnectionNotificationOutput) { - op := &request.Operation{ - Name: opModifyVpcEndpointConnectionNotification, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcEndpointConnectionNotificationInput{} - } - - output = &ModifyVpcEndpointConnectionNotificationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVpcEndpointConnectionNotification API operation for Amazon Elastic Compute Cloud. -// -// Modifies a connection notification for VPC endpoint or VPC endpoint service. -// You can change the SNS topic for the notification, or the events for which -// to be notified. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVpcEndpointConnectionNotification for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointConnectionNotification -func (c *EC2) ModifyVpcEndpointConnectionNotification(input *ModifyVpcEndpointConnectionNotificationInput) (*ModifyVpcEndpointConnectionNotificationOutput, error) { - req, out := c.ModifyVpcEndpointConnectionNotificationRequest(input) - return out, req.Send() -} - -// ModifyVpcEndpointConnectionNotificationWithContext is the same as ModifyVpcEndpointConnectionNotification with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcEndpointConnectionNotification for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVpcEndpointConnectionNotificationWithContext(ctx aws.Context, input *ModifyVpcEndpointConnectionNotificationInput, opts ...request.Option) (*ModifyVpcEndpointConnectionNotificationOutput, error) { - req, out := c.ModifyVpcEndpointConnectionNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcEndpointServiceConfiguration = "ModifyVpcEndpointServiceConfiguration" - -// ModifyVpcEndpointServiceConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpointServiceConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVpcEndpointServiceConfiguration for more information on using the ModifyVpcEndpointServiceConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVpcEndpointServiceConfigurationRequest method. -// req, resp := client.ModifyVpcEndpointServiceConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServiceConfiguration -func (c *EC2) ModifyVpcEndpointServiceConfigurationRequest(input *ModifyVpcEndpointServiceConfigurationInput) (req *request.Request, output *ModifyVpcEndpointServiceConfigurationOutput) { - op := &request.Operation{ - Name: opModifyVpcEndpointServiceConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcEndpointServiceConfigurationInput{} - } - - output = &ModifyVpcEndpointServiceConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVpcEndpointServiceConfiguration API operation for Amazon Elastic Compute Cloud. -// -// Modifies the attributes of your VPC endpoint service configuration. You can -// change the Network Load Balancers for your service, and you can specify whether -// acceptance is required for requests to connect to your endpoint service through -// an interface VPC endpoint. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVpcEndpointServiceConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServiceConfiguration -func (c *EC2) ModifyVpcEndpointServiceConfiguration(input *ModifyVpcEndpointServiceConfigurationInput) (*ModifyVpcEndpointServiceConfigurationOutput, error) { - req, out := c.ModifyVpcEndpointServiceConfigurationRequest(input) - return out, req.Send() -} - -// ModifyVpcEndpointServiceConfigurationWithContext is the same as ModifyVpcEndpointServiceConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcEndpointServiceConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVpcEndpointServiceConfigurationWithContext(ctx aws.Context, input *ModifyVpcEndpointServiceConfigurationInput, opts ...request.Option) (*ModifyVpcEndpointServiceConfigurationOutput, error) { - req, out := c.ModifyVpcEndpointServiceConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcEndpointServicePermissions = "ModifyVpcEndpointServicePermissions" - -// ModifyVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpointServicePermissions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVpcEndpointServicePermissions for more information on using the ModifyVpcEndpointServicePermissions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVpcEndpointServicePermissionsRequest method. -// req, resp := client.ModifyVpcEndpointServicePermissionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServicePermissions -func (c *EC2) ModifyVpcEndpointServicePermissionsRequest(input *ModifyVpcEndpointServicePermissionsInput) (req *request.Request, output *ModifyVpcEndpointServicePermissionsOutput) { - op := &request.Operation{ - Name: opModifyVpcEndpointServicePermissions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcEndpointServicePermissionsInput{} - } - - output = &ModifyVpcEndpointServicePermissionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVpcEndpointServicePermissions API operation for Amazon Elastic Compute Cloud. -// -// Modifies the permissions for your VPC endpoint service (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/endpoint-service.html). -// You can add or remove permissions for service consumers (IAM users, IAM roles, -// and AWS accounts) to connect to your endpoint service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVpcEndpointServicePermissions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServicePermissions -func (c *EC2) ModifyVpcEndpointServicePermissions(input *ModifyVpcEndpointServicePermissionsInput) (*ModifyVpcEndpointServicePermissionsOutput, error) { - req, out := c.ModifyVpcEndpointServicePermissionsRequest(input) - return out, req.Send() -} - -// ModifyVpcEndpointServicePermissionsWithContext is the same as ModifyVpcEndpointServicePermissions with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcEndpointServicePermissions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVpcEndpointServicePermissionsWithContext(ctx aws.Context, input *ModifyVpcEndpointServicePermissionsInput, opts ...request.Option) (*ModifyVpcEndpointServicePermissionsOutput, error) { - req, out := c.ModifyVpcEndpointServicePermissionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcPeeringConnectionOptions = "ModifyVpcPeeringConnectionOptions" - -// ModifyVpcPeeringConnectionOptionsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcPeeringConnectionOptions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVpcPeeringConnectionOptions for more information on using the ModifyVpcPeeringConnectionOptions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVpcPeeringConnectionOptionsRequest method. -// req, resp := client.ModifyVpcPeeringConnectionOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptions -func (c *EC2) ModifyVpcPeeringConnectionOptionsRequest(input *ModifyVpcPeeringConnectionOptionsInput) (req *request.Request, output *ModifyVpcPeeringConnectionOptionsOutput) { - op := &request.Operation{ - Name: opModifyVpcPeeringConnectionOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcPeeringConnectionOptionsInput{} - } - - output = &ModifyVpcPeeringConnectionOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVpcPeeringConnectionOptions API operation for Amazon Elastic Compute Cloud. -// -// Modifies the VPC peering connection options on one side of a VPC peering -// connection. You can do the following: -// -// * Enable/disable communication over the peering connection between an -// EC2-Classic instance that's linked to your VPC (using ClassicLink) and -// instances in the peer VPC. -// -// * Enable/disable communication over the peering connection between instances -// in your VPC and an EC2-Classic instance that's linked to the peer VPC. -// -// * Enable/disable the ability to resolve public DNS hostnames to private -// IP addresses when queried from instances in the peer VPC. -// -// If the peered VPCs are in different accounts, each owner must initiate a -// separate request to modify the peering connection options, depending on whether -// their VPC was the requester or accepter for the VPC peering connection. If -// the peered VPCs are in the same account, you can modify the requester and -// accepter options in the same request. To confirm which VPC is the accepter -// and requester for a VPC peering connection, use the DescribeVpcPeeringConnections -// command. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVpcPeeringConnectionOptions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptions -func (c *EC2) ModifyVpcPeeringConnectionOptions(input *ModifyVpcPeeringConnectionOptionsInput) (*ModifyVpcPeeringConnectionOptionsOutput, error) { - req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) - return out, req.Send() -} - -// ModifyVpcPeeringConnectionOptionsWithContext is the same as ModifyVpcPeeringConnectionOptions with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcPeeringConnectionOptions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVpcPeeringConnectionOptionsWithContext(ctx aws.Context, input *ModifyVpcPeeringConnectionOptionsInput, opts ...request.Option) (*ModifyVpcPeeringConnectionOptionsOutput, error) { - req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcTenancy = "ModifyVpcTenancy" - -// ModifyVpcTenancyRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcTenancy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ModifyVpcTenancy for more information on using the ModifyVpcTenancy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ModifyVpcTenancyRequest method. -// req, resp := client.ModifyVpcTenancyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcTenancy -func (c *EC2) ModifyVpcTenancyRequest(input *ModifyVpcTenancyInput) (req *request.Request, output *ModifyVpcTenancyOutput) { - op := &request.Operation{ - Name: opModifyVpcTenancy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcTenancyInput{} - } - - output = &ModifyVpcTenancyOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVpcTenancy API operation for Amazon Elastic Compute Cloud. -// -// Modifies the instance tenancy attribute of the specified VPC. You can change -// the instance tenancy attribute of a VPC to default only. You cannot change -// the instance tenancy attribute to dedicated. -// -// After you modify the tenancy of the VPC, any new instances that you launch -// into the VPC have a tenancy of default, unless you specify otherwise during -// launch. The tenancy of any existing instances in the VPC is not affected. -// -// For more information about Dedicated Instances, see Dedicated Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyVpcTenancy for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcTenancy -func (c *EC2) ModifyVpcTenancy(input *ModifyVpcTenancyInput) (*ModifyVpcTenancyOutput, error) { - req, out := c.ModifyVpcTenancyRequest(input) - return out, req.Send() -} - -// ModifyVpcTenancyWithContext is the same as ModifyVpcTenancy with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcTenancy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ModifyVpcTenancyWithContext(ctx aws.Context, input *ModifyVpcTenancyInput, opts ...request.Option) (*ModifyVpcTenancyOutput, error) { - req, out := c.ModifyVpcTenancyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opMonitorInstances = "MonitorInstances" - -// MonitorInstancesRequest generates a "aws/request.Request" representing the -// client's request for the MonitorInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See MonitorInstances for more information on using the MonitorInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the MonitorInstancesRequest method. -// req, resp := client.MonitorInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstances -func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *request.Request, output *MonitorInstancesOutput) { - op := &request.Operation{ - Name: opMonitorInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &MonitorInstancesInput{} - } - - output = &MonitorInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// MonitorInstances API operation for Amazon Elastic Compute Cloud. -// -// Enables detailed monitoring for a running instance. Otherwise, basic monitoring -// is enabled. For more information, see Monitoring Your Instances and Volumes -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// To disable detailed monitoring, see . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation MonitorInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstances -func (c *EC2) MonitorInstances(input *MonitorInstancesInput) (*MonitorInstancesOutput, error) { - req, out := c.MonitorInstancesRequest(input) - return out, req.Send() -} - -// MonitorInstancesWithContext is the same as MonitorInstances with the addition of -// the ability to pass a context and additional request options. -// -// See MonitorInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) MonitorInstancesWithContext(ctx aws.Context, input *MonitorInstancesInput, opts ...request.Option) (*MonitorInstancesOutput, error) { - req, out := c.MonitorInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opMoveAddressToVpc = "MoveAddressToVpc" - -// MoveAddressToVpcRequest generates a "aws/request.Request" representing the -// client's request for the MoveAddressToVpc operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See MoveAddressToVpc for more information on using the MoveAddressToVpc -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the MoveAddressToVpcRequest method. -// req, resp := client.MoveAddressToVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpc -func (c *EC2) MoveAddressToVpcRequest(input *MoveAddressToVpcInput) (req *request.Request, output *MoveAddressToVpcOutput) { - op := &request.Operation{ - Name: opMoveAddressToVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &MoveAddressToVpcInput{} - } - - output = &MoveAddressToVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// MoveAddressToVpc API operation for Amazon Elastic Compute Cloud. -// -// Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC -// platform. The Elastic IP address must be allocated to your account for more -// than 24 hours, and it must not be associated with an instance. After the -// Elastic IP address is moved, it is no longer available for use in the EC2-Classic -// platform, unless you move it back using the RestoreAddressToClassic request. -// You cannot move an Elastic IP address that was originally allocated for use -// in the EC2-VPC platform to the EC2-Classic platform. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation MoveAddressToVpc for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpc -func (c *EC2) MoveAddressToVpc(input *MoveAddressToVpcInput) (*MoveAddressToVpcOutput, error) { - req, out := c.MoveAddressToVpcRequest(input) - return out, req.Send() -} - -// MoveAddressToVpcWithContext is the same as MoveAddressToVpc with the addition of -// the ability to pass a context and additional request options. -// -// See MoveAddressToVpc for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) MoveAddressToVpcWithContext(ctx aws.Context, input *MoveAddressToVpcInput, opts ...request.Option) (*MoveAddressToVpcOutput, error) { - req, out := c.MoveAddressToVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPurchaseHostReservation = "PurchaseHostReservation" - -// PurchaseHostReservationRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseHostReservation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PurchaseHostReservation for more information on using the PurchaseHostReservation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the PurchaseHostReservationRequest method. -// req, resp := client.PurchaseHostReservationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservation -func (c *EC2) PurchaseHostReservationRequest(input *PurchaseHostReservationInput) (req *request.Request, output *PurchaseHostReservationOutput) { - op := &request.Operation{ - Name: opPurchaseHostReservation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseHostReservationInput{} - } - - output = &PurchaseHostReservationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseHostReservation API operation for Amazon Elastic Compute Cloud. -// -// Purchase a reservation with configurations that match those of your Dedicated -// Host. You must have active Dedicated Hosts in your account before you purchase -// a reservation. This action results in the specified reservation being purchased -// and charged to your account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation PurchaseHostReservation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservation -func (c *EC2) PurchaseHostReservation(input *PurchaseHostReservationInput) (*PurchaseHostReservationOutput, error) { - req, out := c.PurchaseHostReservationRequest(input) - return out, req.Send() -} - -// PurchaseHostReservationWithContext is the same as PurchaseHostReservation with the addition of -// the ability to pass a context and additional request options. -// -// See PurchaseHostReservation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) PurchaseHostReservationWithContext(ctx aws.Context, input *PurchaseHostReservationInput, opts ...request.Option) (*PurchaseHostReservationOutput, error) { - req, out := c.PurchaseHostReservationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" - -// PurchaseReservedInstancesOfferingRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseReservedInstancesOffering operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PurchaseReservedInstancesOffering for more information on using the PurchaseReservedInstancesOffering -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the PurchaseReservedInstancesOfferingRequest method. -// req, resp := client.PurchaseReservedInstancesOfferingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOffering -func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedInstancesOfferingInput) (req *request.Request, output *PurchaseReservedInstancesOfferingOutput) { - op := &request.Operation{ - Name: opPurchaseReservedInstancesOffering, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseReservedInstancesOfferingInput{} - } - - output = &PurchaseReservedInstancesOfferingOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseReservedInstancesOffering API operation for Amazon Elastic Compute Cloud. -// -// Purchases a Reserved Instance for use with your account. With Reserved Instances, -// you pay a lower hourly rate compared to On-Demand instance pricing. -// -// Use DescribeReservedInstancesOfferings to get a list of Reserved Instance -// offerings that match your specifications. After you've purchased a Reserved -// Instance, you can check for your new Reserved Instance with DescribeReservedInstances. -// -// For more information, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) -// and Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation PurchaseReservedInstancesOffering for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOffering -func (c *EC2) PurchaseReservedInstancesOffering(input *PurchaseReservedInstancesOfferingInput) (*PurchaseReservedInstancesOfferingOutput, error) { - req, out := c.PurchaseReservedInstancesOfferingRequest(input) - return out, req.Send() -} - -// PurchaseReservedInstancesOfferingWithContext is the same as PurchaseReservedInstancesOffering with the addition of -// the ability to pass a context and additional request options. -// -// See PurchaseReservedInstancesOffering for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) PurchaseReservedInstancesOfferingWithContext(ctx aws.Context, input *PurchaseReservedInstancesOfferingInput, opts ...request.Option) (*PurchaseReservedInstancesOfferingOutput, error) { - req, out := c.PurchaseReservedInstancesOfferingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPurchaseScheduledInstances = "PurchaseScheduledInstances" - -// PurchaseScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseScheduledInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PurchaseScheduledInstances for more information on using the PurchaseScheduledInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the PurchaseScheduledInstancesRequest method. -// req, resp := client.PurchaseScheduledInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstances -func (c *EC2) PurchaseScheduledInstancesRequest(input *PurchaseScheduledInstancesInput) (req *request.Request, output *PurchaseScheduledInstancesOutput) { - op := &request.Operation{ - Name: opPurchaseScheduledInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseScheduledInstancesInput{} - } - - output = &PurchaseScheduledInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseScheduledInstances API operation for Amazon Elastic Compute Cloud. -// -// Purchases one or more Scheduled Instances with the specified schedule. -// -// Scheduled Instances enable you to purchase Amazon EC2 compute capacity by -// the hour for a one-year term. Before you can purchase a Scheduled Instance, -// you must call DescribeScheduledInstanceAvailability to check for available -// schedules and obtain a purchase token. After you purchase a Scheduled Instance, -// you must call RunScheduledInstances during each scheduled time period. -// -// After you purchase a Scheduled Instance, you can't cancel, modify, or resell -// your purchase. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation PurchaseScheduledInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstances -func (c *EC2) PurchaseScheduledInstances(input *PurchaseScheduledInstancesInput) (*PurchaseScheduledInstancesOutput, error) { - req, out := c.PurchaseScheduledInstancesRequest(input) - return out, req.Send() -} - -// PurchaseScheduledInstancesWithContext is the same as PurchaseScheduledInstances with the addition of -// the ability to pass a context and additional request options. -// -// See PurchaseScheduledInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) PurchaseScheduledInstancesWithContext(ctx aws.Context, input *PurchaseScheduledInstancesInput, opts ...request.Option) (*PurchaseScheduledInstancesOutput, error) { - req, out := c.PurchaseScheduledInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRebootInstances = "RebootInstances" - -// RebootInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RebootInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RebootInstances for more information on using the RebootInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RebootInstancesRequest method. -// req, resp := client.RebootInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstances -func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request.Request, output *RebootInstancesOutput) { - op := &request.Operation{ - Name: opRebootInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RebootInstancesInput{} - } - - output = &RebootInstancesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RebootInstances API operation for Amazon Elastic Compute Cloud. -// -// Requests a reboot of one or more instances. This operation is asynchronous; -// it only queues a request to reboot the specified instances. The operation -// succeeds if the instances are valid and belong to you. Requests to reboot -// terminated instances are ignored. -// -// If an instance does not cleanly shut down within four minutes, Amazon EC2 -// performs a hard reboot. -// -// For more information about troubleshooting, see Getting Console Output and -// Rebooting Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RebootInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstances -func (c *EC2) RebootInstances(input *RebootInstancesInput) (*RebootInstancesOutput, error) { - req, out := c.RebootInstancesRequest(input) - return out, req.Send() -} - -// RebootInstancesWithContext is the same as RebootInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RebootInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RebootInstancesWithContext(ctx aws.Context, input *RebootInstancesInput, opts ...request.Option) (*RebootInstancesOutput, error) { - req, out := c.RebootInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterImage = "RegisterImage" - -// RegisterImageRequest generates a "aws/request.Request" representing the -// client's request for the RegisterImage operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RegisterImage for more information on using the RegisterImage -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RegisterImageRequest method. -// req, resp := client.RegisterImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImage -func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Request, output *RegisterImageOutput) { - op := &request.Operation{ - Name: opRegisterImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterImageInput{} - } - - output = &RegisterImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterImage API operation for Amazon Elastic Compute Cloud. -// -// Registers an AMI. When you're creating an AMI, this is the final step you -// must complete before you can launch an instance from the AMI. For more information -// about creating AMIs, see Creating Your Own AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For Amazon EBS-backed instances, CreateImage creates and registers the AMI -// in a single request, so you don't have to register the AMI yourself. -// -// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from -// a snapshot of a root device volume. You specify the snapshot using the block -// device mapping. For more information, see Launching a Linux Instance from -// a Backup (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// You can't register an image where a secondary (non-root) snapshot has AWS -// Marketplace product codes. -// -// Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE -// Linux Enterprise Server (SLES), use the EC2 billing product code associated -// with an AMI to verify the subscription status for package updates. Creating -// an AMI from an EBS snapshot does not maintain this billing code, and subsequent -// instances launched from such an AMI will not be able to connect to package -// update infrastructure. To create an AMI that must retain billing codes, see -// CreateImage. -// -// If needed, you can deregister an AMI at any time. Any modifications you make -// to an AMI backed by an instance store volume invalidates its registration. -// If you make changes to an image, deregister the previous image and register -// the new image. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RegisterImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImage -func (c *EC2) RegisterImage(input *RegisterImageInput) (*RegisterImageOutput, error) { - req, out := c.RegisterImageRequest(input) - return out, req.Send() -} - -// RegisterImageWithContext is the same as RegisterImage with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RegisterImageWithContext(ctx aws.Context, input *RegisterImageInput, opts ...request.Option) (*RegisterImageOutput, error) { - req, out := c.RegisterImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRejectVpcEndpointConnections = "RejectVpcEndpointConnections" - -// RejectVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the RejectVpcEndpointConnections operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RejectVpcEndpointConnections for more information on using the RejectVpcEndpointConnections -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RejectVpcEndpointConnectionsRequest method. -// req, resp := client.RejectVpcEndpointConnectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcEndpointConnections -func (c *EC2) RejectVpcEndpointConnectionsRequest(input *RejectVpcEndpointConnectionsInput) (req *request.Request, output *RejectVpcEndpointConnectionsOutput) { - op := &request.Operation{ - Name: opRejectVpcEndpointConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RejectVpcEndpointConnectionsInput{} - } - - output = &RejectVpcEndpointConnectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RejectVpcEndpointConnections API operation for Amazon Elastic Compute Cloud. -// -// Rejects one or more VPC endpoint connection requests to your VPC endpoint -// service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RejectVpcEndpointConnections for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcEndpointConnections -func (c *EC2) RejectVpcEndpointConnections(input *RejectVpcEndpointConnectionsInput) (*RejectVpcEndpointConnectionsOutput, error) { - req, out := c.RejectVpcEndpointConnectionsRequest(input) - return out, req.Send() -} - -// RejectVpcEndpointConnectionsWithContext is the same as RejectVpcEndpointConnections with the addition of -// the ability to pass a context and additional request options. -// -// See RejectVpcEndpointConnections for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RejectVpcEndpointConnectionsWithContext(ctx aws.Context, input *RejectVpcEndpointConnectionsInput, opts ...request.Option) (*RejectVpcEndpointConnectionsOutput, error) { - req, out := c.RejectVpcEndpointConnectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" - -// RejectVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the RejectVpcPeeringConnection operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RejectVpcPeeringConnection for more information on using the RejectVpcPeeringConnection -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RejectVpcPeeringConnectionRequest method. -// req, resp := client.RejectVpcPeeringConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnection -func (c *EC2) RejectVpcPeeringConnectionRequest(input *RejectVpcPeeringConnectionInput) (req *request.Request, output *RejectVpcPeeringConnectionOutput) { - op := &request.Operation{ - Name: opRejectVpcPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RejectVpcPeeringConnectionInput{} - } - - output = &RejectVpcPeeringConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// RejectVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. -// -// Rejects a VPC peering connection request. The VPC peering connection must -// be in the pending-acceptance state. Use the DescribeVpcPeeringConnections -// request to view your outstanding VPC peering connection requests. To delete -// an active VPC peering connection, or to delete a VPC peering connection request -// that you initiated, use DeleteVpcPeeringConnection. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RejectVpcPeeringConnection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnection -func (c *EC2) RejectVpcPeeringConnection(input *RejectVpcPeeringConnectionInput) (*RejectVpcPeeringConnectionOutput, error) { - req, out := c.RejectVpcPeeringConnectionRequest(input) - return out, req.Send() -} - -// RejectVpcPeeringConnectionWithContext is the same as RejectVpcPeeringConnection with the addition of -// the ability to pass a context and additional request options. -// -// See RejectVpcPeeringConnection for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RejectVpcPeeringConnectionWithContext(ctx aws.Context, input *RejectVpcPeeringConnectionInput, opts ...request.Option) (*RejectVpcPeeringConnectionOutput, error) { - req, out := c.RejectVpcPeeringConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReleaseAddress = "ReleaseAddress" - -// ReleaseAddressRequest generates a "aws/request.Request" representing the -// client's request for the ReleaseAddress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ReleaseAddress for more information on using the ReleaseAddress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ReleaseAddressRequest method. -// req, resp := client.ReleaseAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddress -func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *request.Request, output *ReleaseAddressOutput) { - op := &request.Operation{ - Name: opReleaseAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReleaseAddressInput{} - } - - output = &ReleaseAddressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ReleaseAddress API operation for Amazon Elastic Compute Cloud. -// -// Releases the specified Elastic IP address. -// -// [EC2-Classic, default VPC] Releasing an Elastic IP address automatically -// disassociates it from any instance that it's associated with. To disassociate -// an Elastic IP address without releasing it, use DisassociateAddress. -// -// [Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic -// IP address before you can release it. Otherwise, Amazon EC2 returns an error -// (InvalidIPAddress.InUse). -// -// After releasing an Elastic IP address, it is released to the IP address pool. -// Be sure to update your DNS records and any servers or devices that communicate -// with the address. If you attempt to release an Elastic IP address that you -// already released, you'll get an AuthFailure error if the address is already -// allocated to another AWS account. -// -// [EC2-VPC] After you release an Elastic IP address for use in a VPC, you might -// be able to recover it. For more information, see AllocateAddress. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ReleaseAddress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddress -func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (*ReleaseAddressOutput, error) { - req, out := c.ReleaseAddressRequest(input) - return out, req.Send() -} - -// ReleaseAddressWithContext is the same as ReleaseAddress with the addition of -// the ability to pass a context and additional request options. -// -// See ReleaseAddress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ReleaseAddressWithContext(ctx aws.Context, input *ReleaseAddressInput, opts ...request.Option) (*ReleaseAddressOutput, error) { - req, out := c.ReleaseAddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReleaseHosts = "ReleaseHosts" - -// ReleaseHostsRequest generates a "aws/request.Request" representing the -// client's request for the ReleaseHosts operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ReleaseHosts for more information on using the ReleaseHosts -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ReleaseHostsRequest method. -// req, resp := client.ReleaseHostsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHosts -func (c *EC2) ReleaseHostsRequest(input *ReleaseHostsInput) (req *request.Request, output *ReleaseHostsOutput) { - op := &request.Operation{ - Name: opReleaseHosts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReleaseHostsInput{} - } - - output = &ReleaseHostsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReleaseHosts API operation for Amazon Elastic Compute Cloud. -// -// When you no longer want to use an On-Demand Dedicated Host it can be released. -// On-Demand billing is stopped and the host goes into released state. The host -// ID of Dedicated Hosts that have been released can no longer be specified -// in another request, e.g., ModifyHosts. You must stop or terminate all instances -// on a host before it can be released. -// -// When Dedicated Hosts are released, it make take some time for them to stop -// counting toward your limit and you may receive capacity errors when trying -// to allocate new Dedicated hosts. Try waiting a few minutes, and then try -// again. -// -// Released hosts will still appear in a DescribeHosts response. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ReleaseHosts for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHosts -func (c *EC2) ReleaseHosts(input *ReleaseHostsInput) (*ReleaseHostsOutput, error) { - req, out := c.ReleaseHostsRequest(input) - return out, req.Send() -} - -// ReleaseHostsWithContext is the same as ReleaseHosts with the addition of -// the ability to pass a context and additional request options. -// -// See ReleaseHosts for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ReleaseHostsWithContext(ctx aws.Context, input *ReleaseHostsInput, opts ...request.Option) (*ReleaseHostsOutput, error) { - req, out := c.ReleaseHostsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssociation" - -// ReplaceIamInstanceProfileAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceIamInstanceProfileAssociation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ReplaceIamInstanceProfileAssociation for more information on using the ReplaceIamInstanceProfileAssociation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ReplaceIamInstanceProfileAssociationRequest method. -// req, resp := client.ReplaceIamInstanceProfileAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation -func (c *EC2) ReplaceIamInstanceProfileAssociationRequest(input *ReplaceIamInstanceProfileAssociationInput) (req *request.Request, output *ReplaceIamInstanceProfileAssociationOutput) { - op := &request.Operation{ - Name: opReplaceIamInstanceProfileAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceIamInstanceProfileAssociationInput{} - } - - output = &ReplaceIamInstanceProfileAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReplaceIamInstanceProfileAssociation API operation for Amazon Elastic Compute Cloud. -// -// Replaces an IAM instance profile for the specified running instance. You -// can use this action to change the IAM instance profile that's associated -// with an instance without having to disassociate the existing IAM instance -// profile first. -// -// Use DescribeIamInstanceProfileAssociations to get the association ID. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ReplaceIamInstanceProfileAssociation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation -func (c *EC2) ReplaceIamInstanceProfileAssociation(input *ReplaceIamInstanceProfileAssociationInput) (*ReplaceIamInstanceProfileAssociationOutput, error) { - req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) - return out, req.Send() -} - -// ReplaceIamInstanceProfileAssociationWithContext is the same as ReplaceIamInstanceProfileAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceIamInstanceProfileAssociation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ReplaceIamInstanceProfileAssociationWithContext(ctx aws.Context, input *ReplaceIamInstanceProfileAssociationInput, opts ...request.Option) (*ReplaceIamInstanceProfileAssociationOutput, error) { - req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" - -// ReplaceNetworkAclAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceNetworkAclAssociation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ReplaceNetworkAclAssociation for more information on using the ReplaceNetworkAclAssociation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ReplaceNetworkAclAssociationRequest method. -// req, resp := client.ReplaceNetworkAclAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociation -func (c *EC2) ReplaceNetworkAclAssociationRequest(input *ReplaceNetworkAclAssociationInput) (req *request.Request, output *ReplaceNetworkAclAssociationOutput) { - op := &request.Operation{ - Name: opReplaceNetworkAclAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceNetworkAclAssociationInput{} - } - - output = &ReplaceNetworkAclAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReplaceNetworkAclAssociation API operation for Amazon Elastic Compute Cloud. -// -// Changes which network ACL a subnet is associated with. By default when you -// create a subnet, it's automatically associated with the default network ACL. -// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// This is an idempotent operation. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ReplaceNetworkAclAssociation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociation -func (c *EC2) ReplaceNetworkAclAssociation(input *ReplaceNetworkAclAssociationInput) (*ReplaceNetworkAclAssociationOutput, error) { - req, out := c.ReplaceNetworkAclAssociationRequest(input) - return out, req.Send() -} - -// ReplaceNetworkAclAssociationWithContext is the same as ReplaceNetworkAclAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceNetworkAclAssociation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ReplaceNetworkAclAssociationWithContext(ctx aws.Context, input *ReplaceNetworkAclAssociationInput, opts ...request.Option) (*ReplaceNetworkAclAssociationOutput, error) { - req, out := c.ReplaceNetworkAclAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" - -// ReplaceNetworkAclEntryRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceNetworkAclEntry operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ReplaceNetworkAclEntry for more information on using the ReplaceNetworkAclEntry -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ReplaceNetworkAclEntryRequest method. -// req, resp := client.ReplaceNetworkAclEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntry -func (c *EC2) ReplaceNetworkAclEntryRequest(input *ReplaceNetworkAclEntryInput) (req *request.Request, output *ReplaceNetworkAclEntryOutput) { - op := &request.Operation{ - Name: opReplaceNetworkAclEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceNetworkAclEntryInput{} - } - - output = &ReplaceNetworkAclEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ReplaceNetworkAclEntry API operation for Amazon Elastic Compute Cloud. -// -// Replaces an entry (rule) in a network ACL. For more information about network -// ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ReplaceNetworkAclEntry for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntry -func (c *EC2) ReplaceNetworkAclEntry(input *ReplaceNetworkAclEntryInput) (*ReplaceNetworkAclEntryOutput, error) { - req, out := c.ReplaceNetworkAclEntryRequest(input) - return out, req.Send() -} - -// ReplaceNetworkAclEntryWithContext is the same as ReplaceNetworkAclEntry with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceNetworkAclEntry for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ReplaceNetworkAclEntryWithContext(ctx aws.Context, input *ReplaceNetworkAclEntryInput, opts ...request.Option) (*ReplaceNetworkAclEntryOutput, error) { - req, out := c.ReplaceNetworkAclEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceRoute = "ReplaceRoute" - -// ReplaceRouteRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceRoute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ReplaceRoute for more information on using the ReplaceRoute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ReplaceRouteRequest method. -// req, resp := client.ReplaceRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRoute -func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *request.Request, output *ReplaceRouteOutput) { - op := &request.Operation{ - Name: opReplaceRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceRouteInput{} - } - - output = &ReplaceRouteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ReplaceRoute API operation for Amazon Elastic Compute Cloud. -// -// Replaces an existing route within a route table in a VPC. You must provide -// only one of the following: Internet gateway or virtual private gateway, NAT -// instance, NAT gateway, VPC peering connection, network interface, or egress-only -// Internet gateway. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ReplaceRoute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRoute -func (c *EC2) ReplaceRoute(input *ReplaceRouteInput) (*ReplaceRouteOutput, error) { - req, out := c.ReplaceRouteRequest(input) - return out, req.Send() -} - -// ReplaceRouteWithContext is the same as ReplaceRoute with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceRoute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ReplaceRouteWithContext(ctx aws.Context, input *ReplaceRouteInput, opts ...request.Option) (*ReplaceRouteOutput, error) { - req, out := c.ReplaceRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" - -// ReplaceRouteTableAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceRouteTableAssociation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ReplaceRouteTableAssociation for more information on using the ReplaceRouteTableAssociation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ReplaceRouteTableAssociationRequest method. -// req, resp := client.ReplaceRouteTableAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociation -func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssociationInput) (req *request.Request, output *ReplaceRouteTableAssociationOutput) { - op := &request.Operation{ - Name: opReplaceRouteTableAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceRouteTableAssociationInput{} - } - - output = &ReplaceRouteTableAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReplaceRouteTableAssociation API operation for Amazon Elastic Compute Cloud. -// -// Changes the route table associated with a given subnet in a VPC. After the -// operation completes, the subnet uses the routes in the new route table it's -// associated with. For more information about route tables, see Route Tables -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// You can also use ReplaceRouteTableAssociation to change which table is the -// main route table in the VPC. You just specify the main route table's association -// ID and the route table to be the new main route table. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ReplaceRouteTableAssociation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociation -func (c *EC2) ReplaceRouteTableAssociation(input *ReplaceRouteTableAssociationInput) (*ReplaceRouteTableAssociationOutput, error) { - req, out := c.ReplaceRouteTableAssociationRequest(input) - return out, req.Send() -} - -// ReplaceRouteTableAssociationWithContext is the same as ReplaceRouteTableAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceRouteTableAssociation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ReplaceRouteTableAssociationWithContext(ctx aws.Context, input *ReplaceRouteTableAssociationInput, opts ...request.Option) (*ReplaceRouteTableAssociationOutput, error) { - req, out := c.ReplaceRouteTableAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReportInstanceStatus = "ReportInstanceStatus" - -// ReportInstanceStatusRequest generates a "aws/request.Request" representing the -// client's request for the ReportInstanceStatus operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ReportInstanceStatus for more information on using the ReportInstanceStatus -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ReportInstanceStatusRequest method. -// req, resp := client.ReportInstanceStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatus -func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req *request.Request, output *ReportInstanceStatusOutput) { - op := &request.Operation{ - Name: opReportInstanceStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReportInstanceStatusInput{} - } - - output = &ReportInstanceStatusOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ReportInstanceStatus API operation for Amazon Elastic Compute Cloud. -// -// Submits feedback about the status of an instance. The instance must be in -// the running state. If your experience with the instance differs from the -// instance status returned by DescribeInstanceStatus, use ReportInstanceStatus -// to report your experience with the instance. Amazon EC2 collects this information -// to improve the accuracy of status checks. -// -// Use of this action does not change the value returned by DescribeInstanceStatus. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ReportInstanceStatus for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatus -func (c *EC2) ReportInstanceStatus(input *ReportInstanceStatusInput) (*ReportInstanceStatusOutput, error) { - req, out := c.ReportInstanceStatusRequest(input) - return out, req.Send() -} - -// ReportInstanceStatusWithContext is the same as ReportInstanceStatus with the addition of -// the ability to pass a context and additional request options. -// -// See ReportInstanceStatus for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ReportInstanceStatusWithContext(ctx aws.Context, input *ReportInstanceStatusInput, opts ...request.Option) (*ReportInstanceStatusOutput, error) { - req, out := c.ReportInstanceStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRequestSpotFleet = "RequestSpotFleet" - -// RequestSpotFleetRequest generates a "aws/request.Request" representing the -// client's request for the RequestSpotFleet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RequestSpotFleet for more information on using the RequestSpotFleet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RequestSpotFleetRequest method. -// req, resp := client.RequestSpotFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleet -func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *request.Request, output *RequestSpotFleetOutput) { - op := &request.Operation{ - Name: opRequestSpotFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RequestSpotFleetInput{} - } - - output = &RequestSpotFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// RequestSpotFleet API operation for Amazon Elastic Compute Cloud. -// -// Creates a Spot Fleet request. -// -// The Spot Fleet request specifies the total target capacity and the On-Demand -// target capacity. Amazon EC2 calculates the difference between the total capacity -// and On-Demand capacity, and launches the difference as Spot capacity. -// -// You can submit a single request that includes multiple launch specifications -// that vary by instance type, AMI, Availability Zone, or subnet. -// -// By default, the Spot Fleet requests Spot Instances in the Spot pool where -// the price per unit is the lowest. Each launch specification can include its -// own instance weighting that reflects the value of the instance type to your -// application workload. -// -// Alternatively, you can specify that the Spot Fleet distribute the target -// capacity across the Spot pools included in its launch specifications. By -// ensuring that the Spot Instances in your Spot Fleet are in different Spot -// pools, you can improve the availability of your fleet. -// -// You can specify tags for the Spot Instances. You cannot tag other resource -// types in a Spot Fleet request because only the instance resource type is -// supported. -// -// For more information, see Spot Fleet Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html) -// in the Amazon EC2 User Guide for Linux Instances. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RequestSpotFleet for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleet -func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetOutput, error) { - req, out := c.RequestSpotFleetRequest(input) - return out, req.Send() -} - -// RequestSpotFleetWithContext is the same as RequestSpotFleet with the addition of -// the ability to pass a context and additional request options. -// -// See RequestSpotFleet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RequestSpotFleetWithContext(ctx aws.Context, input *RequestSpotFleetInput, opts ...request.Option) (*RequestSpotFleetOutput, error) { - req, out := c.RequestSpotFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRequestSpotInstances = "RequestSpotInstances" - -// RequestSpotInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RequestSpotInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RequestSpotInstances for more information on using the RequestSpotInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RequestSpotInstancesRequest method. -// req, resp := client.RequestSpotInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstances -func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req *request.Request, output *RequestSpotInstancesOutput) { - op := &request.Operation{ - Name: opRequestSpotInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RequestSpotInstancesInput{} - } - - output = &RequestSpotInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// RequestSpotInstances API operation for Amazon Elastic Compute Cloud. -// -// Creates a Spot Instance request. -// -// For more information, see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) -// in the Amazon EC2 User Guide for Linux Instances. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RequestSpotInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstances -func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (*RequestSpotInstancesOutput, error) { - req, out := c.RequestSpotInstancesRequest(input) - return out, req.Send() -} - -// RequestSpotInstancesWithContext is the same as RequestSpotInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RequestSpotInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RequestSpotInstancesWithContext(ctx aws.Context, input *RequestSpotInstancesInput, opts ...request.Option) (*RequestSpotInstancesOutput, error) { - req, out := c.RequestSpotInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetFpgaImageAttribute = "ResetFpgaImageAttribute" - -// ResetFpgaImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetFpgaImageAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ResetFpgaImageAttribute for more information on using the ResetFpgaImageAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ResetFpgaImageAttributeRequest method. -// req, resp := client.ResetFpgaImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetFpgaImageAttribute -func (c *EC2) ResetFpgaImageAttributeRequest(input *ResetFpgaImageAttributeInput) (req *request.Request, output *ResetFpgaImageAttributeOutput) { - op := &request.Operation{ - Name: opResetFpgaImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetFpgaImageAttributeInput{} - } - - output = &ResetFpgaImageAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// ResetFpgaImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets the specified attribute of the specified Amazon FPGA Image (AFI) to -// its default value. You can only reset the load permission attribute. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ResetFpgaImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetFpgaImageAttribute -func (c *EC2) ResetFpgaImageAttribute(input *ResetFpgaImageAttributeInput) (*ResetFpgaImageAttributeOutput, error) { - req, out := c.ResetFpgaImageAttributeRequest(input) - return out, req.Send() -} - -// ResetFpgaImageAttributeWithContext is the same as ResetFpgaImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetFpgaImageAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ResetFpgaImageAttributeWithContext(ctx aws.Context, input *ResetFpgaImageAttributeInput, opts ...request.Option) (*ResetFpgaImageAttributeOutput, error) { - req, out := c.ResetFpgaImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetImageAttribute = "ResetImageAttribute" - -// ResetImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetImageAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ResetImageAttribute for more information on using the ResetImageAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ResetImageAttributeRequest method. -// req, resp := client.ResetImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttribute -func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req *request.Request, output *ResetImageAttributeOutput) { - op := &request.Operation{ - Name: opResetImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetImageAttributeInput{} - } - - output = &ResetImageAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResetImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets an attribute of an AMI to its default value. -// -// The productCodes attribute can't be reset. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ResetImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttribute -func (c *EC2) ResetImageAttribute(input *ResetImageAttributeInput) (*ResetImageAttributeOutput, error) { - req, out := c.ResetImageAttributeRequest(input) - return out, req.Send() -} - -// ResetImageAttributeWithContext is the same as ResetImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetImageAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ResetImageAttributeWithContext(ctx aws.Context, input *ResetImageAttributeInput, opts ...request.Option) (*ResetImageAttributeOutput, error) { - req, out := c.ResetImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetInstanceAttribute = "ResetInstanceAttribute" - -// ResetInstanceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetInstanceAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ResetInstanceAttribute for more information on using the ResetInstanceAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ResetInstanceAttributeRequest method. -// req, resp := client.ResetInstanceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttribute -func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) (req *request.Request, output *ResetInstanceAttributeOutput) { - op := &request.Operation{ - Name: opResetInstanceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetInstanceAttributeInput{} - } - - output = &ResetInstanceAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResetInstanceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets an attribute of an instance to its default value. To reset the kernel -// or ramdisk, the instance must be in a stopped state. To reset the sourceDestCheck, -// the instance can be either running or stopped. -// -// The sourceDestCheck attribute controls whether source/destination checking -// is enabled. The default value is true, which means checking is enabled. This -// value must be false for a NAT instance to perform NAT. For more information, -// see NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ResetInstanceAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttribute -func (c *EC2) ResetInstanceAttribute(input *ResetInstanceAttributeInput) (*ResetInstanceAttributeOutput, error) { - req, out := c.ResetInstanceAttributeRequest(input) - return out, req.Send() -} - -// ResetInstanceAttributeWithContext is the same as ResetInstanceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetInstanceAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ResetInstanceAttributeWithContext(ctx aws.Context, input *ResetInstanceAttributeInput, opts ...request.Option) (*ResetInstanceAttributeOutput, error) { - req, out := c.ResetInstanceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" - -// ResetNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetNetworkInterfaceAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ResetNetworkInterfaceAttribute for more information on using the ResetNetworkInterfaceAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ResetNetworkInterfaceAttributeRequest method. -// req, resp := client.ResetNetworkInterfaceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttribute -func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterfaceAttributeInput) (req *request.Request, output *ResetNetworkInterfaceAttributeOutput) { - op := &request.Operation{ - Name: opResetNetworkInterfaceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetNetworkInterfaceAttributeInput{} - } - - output = &ResetNetworkInterfaceAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResetNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets a network interface attribute. You can specify only one attribute -// at a time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ResetNetworkInterfaceAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttribute -func (c *EC2) ResetNetworkInterfaceAttribute(input *ResetNetworkInterfaceAttributeInput) (*ResetNetworkInterfaceAttributeOutput, error) { - req, out := c.ResetNetworkInterfaceAttributeRequest(input) - return out, req.Send() -} - -// ResetNetworkInterfaceAttributeWithContext is the same as ResetNetworkInterfaceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetNetworkInterfaceAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ResetNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ResetNetworkInterfaceAttributeInput, opts ...request.Option) (*ResetNetworkInterfaceAttributeOutput, error) { - req, out := c.ResetNetworkInterfaceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetSnapshotAttribute = "ResetSnapshotAttribute" - -// ResetSnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetSnapshotAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ResetSnapshotAttribute for more information on using the ResetSnapshotAttribute -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ResetSnapshotAttributeRequest method. -// req, resp := client.ResetSnapshotAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttribute -func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) (req *request.Request, output *ResetSnapshotAttributeOutput) { - op := &request.Operation{ - Name: opResetSnapshotAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetSnapshotAttributeInput{} - } - - output = &ResetSnapshotAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResetSnapshotAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets permission settings for the specified snapshot. -// -// For more information on modifying snapshot permissions, see Sharing Snapshots -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ResetSnapshotAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttribute -func (c *EC2) ResetSnapshotAttribute(input *ResetSnapshotAttributeInput) (*ResetSnapshotAttributeOutput, error) { - req, out := c.ResetSnapshotAttributeRequest(input) - return out, req.Send() -} - -// ResetSnapshotAttributeWithContext is the same as ResetSnapshotAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetSnapshotAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) ResetSnapshotAttributeWithContext(ctx aws.Context, input *ResetSnapshotAttributeInput, opts ...request.Option) (*ResetSnapshotAttributeOutput, error) { - req, out := c.ResetSnapshotAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreAddressToClassic = "RestoreAddressToClassic" - -// RestoreAddressToClassicRequest generates a "aws/request.Request" representing the -// client's request for the RestoreAddressToClassic operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RestoreAddressToClassic for more information on using the RestoreAddressToClassic -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RestoreAddressToClassicRequest method. -// req, resp := client.RestoreAddressToClassicRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassic -func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput) (req *request.Request, output *RestoreAddressToClassicOutput) { - op := &request.Operation{ - Name: opRestoreAddressToClassic, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreAddressToClassicInput{} - } - - output = &RestoreAddressToClassicOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreAddressToClassic API operation for Amazon Elastic Compute Cloud. -// -// Restores an Elastic IP address that was previously moved to the EC2-VPC platform -// back to the EC2-Classic platform. You cannot move an Elastic IP address that -// was originally allocated for use in EC2-VPC. The Elastic IP address must -// not be associated with an instance or network interface. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RestoreAddressToClassic for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassic -func (c *EC2) RestoreAddressToClassic(input *RestoreAddressToClassicInput) (*RestoreAddressToClassicOutput, error) { - req, out := c.RestoreAddressToClassicRequest(input) - return out, req.Send() -} - -// RestoreAddressToClassicWithContext is the same as RestoreAddressToClassic with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreAddressToClassic for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RestoreAddressToClassicWithContext(ctx aws.Context, input *RestoreAddressToClassicInput, opts ...request.Option) (*RestoreAddressToClassicOutput, error) { - req, out := c.RestoreAddressToClassicRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" - -// RevokeSecurityGroupEgressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeSecurityGroupEgress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RevokeSecurityGroupEgress for more information on using the RevokeSecurityGroupEgress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RevokeSecurityGroupEgressRequest method. -// req, resp := client.RevokeSecurityGroupEgressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgress -func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressInput) (req *request.Request, output *RevokeSecurityGroupEgressOutput) { - op := &request.Operation{ - Name: opRevokeSecurityGroupEgress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeSecurityGroupEgressInput{} - } - - output = &RevokeSecurityGroupEgressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RevokeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Removes one or more egress rules from a security group for -// EC2-VPC. This action doesn't apply to security groups for use in EC2-Classic. -// To remove a rule, the values that you specify (for example, ports) must match -// the existing rule's values exactly. -// -// Each rule consists of the protocol and the IPv4 or IPv6 CIDR range or source -// security group. For the TCP and UDP protocols, you must also specify the -// destination port or range of ports. For the ICMP protocol, you must also -// specify the ICMP type and code. If the security group rule has a description, -// you do not have to specify the description to revoke the rule. -// -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RevokeSecurityGroupEgress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgress -func (c *EC2) RevokeSecurityGroupEgress(input *RevokeSecurityGroupEgressInput) (*RevokeSecurityGroupEgressOutput, error) { - req, out := c.RevokeSecurityGroupEgressRequest(input) - return out, req.Send() -} - -// RevokeSecurityGroupEgressWithContext is the same as RevokeSecurityGroupEgress with the addition of -// the ability to pass a context and additional request options. -// -// See RevokeSecurityGroupEgress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RevokeSecurityGroupEgressWithContext(ctx aws.Context, input *RevokeSecurityGroupEgressInput, opts ...request.Option) (*RevokeSecurityGroupEgressOutput, error) { - req, out := c.RevokeSecurityGroupEgressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" - -// RevokeSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeSecurityGroupIngress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RevokeSecurityGroupIngress for more information on using the RevokeSecurityGroupIngress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RevokeSecurityGroupIngressRequest method. -// req, resp := client.RevokeSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngress -func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngressInput) (req *request.Request, output *RevokeSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opRevokeSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeSecurityGroupIngressInput{} - } - - output = &RevokeSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RevokeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud. -// -// Removes one or more ingress rules from a security group. To remove a rule, -// the values that you specify (for example, ports) must match the existing -// rule's values exactly. -// -// [EC2-Classic security groups only] If the values you specify do not match -// the existing rule's values, no error is returned. Use DescribeSecurityGroups -// to verify that the rule has been removed. -// -// Each rule consists of the protocol and the CIDR range or source security -// group. For the TCP and UDP protocols, you must also specify the destination -// port or range of ports. For the ICMP protocol, you must also specify the -// ICMP type and code. If the security group rule has a description, you do -// not have to specify the description to revoke the rule. -// -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RevokeSecurityGroupIngress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngress -func (c *EC2) RevokeSecurityGroupIngress(input *RevokeSecurityGroupIngressInput) (*RevokeSecurityGroupIngressOutput, error) { - req, out := c.RevokeSecurityGroupIngressRequest(input) - return out, req.Send() -} - -// RevokeSecurityGroupIngressWithContext is the same as RevokeSecurityGroupIngress with the addition of -// the ability to pass a context and additional request options. -// -// See RevokeSecurityGroupIngress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RevokeSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeSecurityGroupIngressInput, opts ...request.Option) (*RevokeSecurityGroupIngressOutput, error) { - req, out := c.RevokeSecurityGroupIngressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRunInstances = "RunInstances" - -// RunInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RunInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RunInstances for more information on using the RunInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RunInstancesRequest method. -// req, resp := client.RunInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstances -func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Request, output *Reservation) { - op := &request.Operation{ - Name: opRunInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RunInstancesInput{} - } - - output = &Reservation{} - req = c.newRequest(op, input, output) - return -} - -// RunInstances API operation for Amazon Elastic Compute Cloud. -// -// Launches the specified number of instances using an AMI for which you have -// permissions. -// -// You can specify a number of options, or leave the default options. The following -// rules apply: -// -// * [EC2-VPC] If you don't specify a subnet ID, we choose a default subnet -// from your default VPC for you. If you don't have a default VPC, you must -// specify a subnet ID in the request. -// -// * [EC2-Classic] If don't specify an Availability Zone, we choose one for -// you. -// -// * Some instance types must be launched into a VPC. If you do not have -// a default VPC, or if you do not specify a subnet ID, the request fails. -// For more information, see Instance Types Available Only in a VPC (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html#vpc-only-instance-types). -// -// * [EC2-VPC] All instances have a network interface with a primary private -// IPv4 address. If you don't specify this address, we choose one from the -// IPv4 range of your subnet. -// -// * Not all instance types support IPv6 addresses. For more information, -// see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). -// -// * If you don't specify a security group ID, we use the default security -// group. For more information, see Security Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html). -// -// * If any of the AMIs have a product code attached for which the user has -// not subscribed, the request fails. -// -// You can create a launch template (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html), -// which is a resource that contains the parameters to launch an instance. When -// you launch an instance using RunInstances, you can specify the launch template -// instead of specifying the launch parameters. -// -// To ensure faster instance launches, break up large requests into smaller -// batches. For example, create five separate launch requests for 100 instances -// each instead of one launch request for 500 instances. -// -// An instance is ready for you to use when it's in the running state. You can -// check the state of your instance using DescribeInstances. You can tag instances -// and EBS volumes during launch, after launch, or both. For more information, -// see CreateTags and Tagging Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). -// -// Linux instances have access to the public key of the key pair at boot. You -// can use this key to provide secure access to the instance. Amazon EC2 public -// images use this feature to provide secure access without passwords. For more -// information, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For troubleshooting, see What To Do If An Instance Immediately Terminates -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html), -// and Troubleshooting Connecting to Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RunInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstances -func (c *EC2) RunInstances(input *RunInstancesInput) (*Reservation, error) { - req, out := c.RunInstancesRequest(input) - return out, req.Send() -} - -// RunInstancesWithContext is the same as RunInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RunInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RunInstancesWithContext(ctx aws.Context, input *RunInstancesInput, opts ...request.Option) (*Reservation, error) { - req, out := c.RunInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRunScheduledInstances = "RunScheduledInstances" - -// RunScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RunScheduledInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RunScheduledInstances for more information on using the RunScheduledInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RunScheduledInstancesRequest method. -// req, resp := client.RunScheduledInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstances -func (c *EC2) RunScheduledInstancesRequest(input *RunScheduledInstancesInput) (req *request.Request, output *RunScheduledInstancesOutput) { - op := &request.Operation{ - Name: opRunScheduledInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RunScheduledInstancesInput{} - } - - output = &RunScheduledInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// RunScheduledInstances API operation for Amazon Elastic Compute Cloud. -// -// Launches the specified Scheduled Instances. -// -// Before you can launch a Scheduled Instance, you must purchase it and obtain -// an identifier using PurchaseScheduledInstances. -// -// You must launch a Scheduled Instance during its scheduled time period. You -// can't stop or reboot a Scheduled Instance, but you can terminate it as needed. -// If you terminate a Scheduled Instance before the current scheduled time period -// ends, you can launch it again after a few minutes. For more information, -// see Scheduled Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-scheduled-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation RunScheduledInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstances -func (c *EC2) RunScheduledInstances(input *RunScheduledInstancesInput) (*RunScheduledInstancesOutput, error) { - req, out := c.RunScheduledInstancesRequest(input) - return out, req.Send() -} - -// RunScheduledInstancesWithContext is the same as RunScheduledInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RunScheduledInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) RunScheduledInstancesWithContext(ctx aws.Context, input *RunScheduledInstancesInput, opts ...request.Option) (*RunScheduledInstancesOutput, error) { - req, out := c.RunScheduledInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartInstances = "StartInstances" - -// StartInstancesRequest generates a "aws/request.Request" representing the -// client's request for the StartInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StartInstances for more information on using the StartInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the StartInstancesRequest method. -// req, resp := client.StartInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstances -func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Request, output *StartInstancesOutput) { - op := &request.Operation{ - Name: opStartInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartInstancesInput{} - } - - output = &StartInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartInstances API operation for Amazon Elastic Compute Cloud. -// -// Starts an Amazon EBS-backed instance that you've previously stopped. -// -// Instances that use Amazon EBS volumes as their root devices can be quickly -// stopped and started. When an instance is stopped, the compute resources are -// released and you are not billed for instance usage. However, your root partition -// Amazon EBS volume remains and continues to persist your data, and you are -// charged for Amazon EBS volume usage. You can restart your instance at any -// time. Every time you start your Windows instance, Amazon EC2 charges you -// for a full instance hour. If you stop and restart your Windows instance, -// a new instance hour begins and Amazon EC2 charges you for another full instance -// hour even if you are still within the same 60-minute period when it was stopped. -// Every time you start your Linux instance, Amazon EC2 charges a one-minute -// minimum for instance usage, and thereafter charges per second for instance -// usage. -// -// Before stopping an instance, make sure it is in a state from which it can -// be restarted. Stopping an instance does not preserve data stored in RAM. -// -// Performing this operation on an instance that uses an instance store as its -// root device returns an error. -// -// For more information, see Stopping Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation StartInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstances -func (c *EC2) StartInstances(input *StartInstancesInput) (*StartInstancesOutput, error) { - req, out := c.StartInstancesRequest(input) - return out, req.Send() -} - -// StartInstancesWithContext is the same as StartInstances with the addition of -// the ability to pass a context and additional request options. -// -// See StartInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) StartInstancesWithContext(ctx aws.Context, input *StartInstancesInput, opts ...request.Option) (*StartInstancesOutput, error) { - req, out := c.StartInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopInstances = "StopInstances" - -// StopInstancesRequest generates a "aws/request.Request" representing the -// client's request for the StopInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StopInstances for more information on using the StopInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the StopInstancesRequest method. -// req, resp := client.StopInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstances -func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Request, output *StopInstancesOutput) { - op := &request.Operation{ - Name: opStopInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopInstancesInput{} - } - - output = &StopInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopInstances API operation for Amazon Elastic Compute Cloud. -// -// Stops an Amazon EBS-backed instance. -// -// We don't charge usage for a stopped instance, or data transfer fees; however, -// your root partition Amazon EBS volume remains and continues to persist your -// data, and you are charged for Amazon EBS volume usage. Every time you start -// your Windows instance, Amazon EC2 charges you for a full instance hour. If -// you stop and restart your Windows instance, a new instance hour begins and -// Amazon EC2 charges you for another full instance hour even if you are still -// within the same 60-minute period when it was stopped. Every time you start -// your Linux instance, Amazon EC2 charges a one-minute minimum for instance -// usage, and thereafter charges per second for instance usage. -// -// You can't start or stop Spot Instances, and you can't stop instance store-backed -// instances. -// -// When you stop an instance, we shut it down. You can restart your instance -// at any time. Before stopping an instance, make sure it is in a state from -// which it can be restarted. Stopping an instance does not preserve data stored -// in RAM. -// -// Stopping an instance is different to rebooting or terminating it. For example, -// when you stop an instance, the root device and any other devices attached -// to the instance persist. When you terminate an instance, the root device -// and any other devices attached during the instance launch are automatically -// deleted. For more information about the differences between rebooting, stopping, -// and terminating instances, see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// When you stop an instance, we attempt to shut it down forcibly after a short -// while. If your instance appears stuck in the stopping state after a period -// of time, there may be an issue with the underlying host computer. For more -// information, see Troubleshooting Stopping Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation StopInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstances -func (c *EC2) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, error) { - req, out := c.StopInstancesRequest(input) - return out, req.Send() -} - -// StopInstancesWithContext is the same as StopInstances with the addition of -// the ability to pass a context and additional request options. -// -// See StopInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) StopInstancesWithContext(ctx aws.Context, input *StopInstancesInput, opts ...request.Option) (*StopInstancesOutput, error) { - req, out := c.StopInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTerminateInstances = "TerminateInstances" - -// TerminateInstancesRequest generates a "aws/request.Request" representing the -// client's request for the TerminateInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See TerminateInstances for more information on using the TerminateInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the TerminateInstancesRequest method. -// req, resp := client.TerminateInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstances -func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *request.Request, output *TerminateInstancesOutput) { - op := &request.Operation{ - Name: opTerminateInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TerminateInstancesInput{} - } - - output = &TerminateInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// TerminateInstances API operation for Amazon Elastic Compute Cloud. -// -// Shuts down one or more instances. This operation is idempotent; if you terminate -// an instance more than once, each call succeeds. -// -// If you specify multiple instances and the request fails (for example, because -// of a single incorrect instance ID), none of the instances are terminated. -// -// Terminated instances remain visible after termination (for approximately -// one hour). -// -// By default, Amazon EC2 deletes all EBS volumes that were attached when the -// instance launched. Volumes attached after instance launch continue running. -// -// You can stop, start, and terminate EBS-backed instances. You can only terminate -// instance store-backed instances. What happens to an instance differs if you -// stop it or terminate it. For example, when you stop an instance, the root -// device and any other devices attached to the instance persist. When you terminate -// an instance, any attached EBS volumes with the DeleteOnTermination block -// device mapping parameter set to true are automatically deleted. For more -// information about the differences between stopping and terminating instances, -// see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For more information about troubleshooting, see Troubleshooting Terminating -// Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation TerminateInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstances -func (c *EC2) TerminateInstances(input *TerminateInstancesInput) (*TerminateInstancesOutput, error) { - req, out := c.TerminateInstancesRequest(input) - return out, req.Send() -} - -// TerminateInstancesWithContext is the same as TerminateInstances with the addition of -// the ability to pass a context and additional request options. -// -// See TerminateInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) TerminateInstancesWithContext(ctx aws.Context, input *TerminateInstancesInput, opts ...request.Option) (*TerminateInstancesOutput, error) { - req, out := c.TerminateInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUnassignIpv6Addresses = "UnassignIpv6Addresses" - -// UnassignIpv6AddressesRequest generates a "aws/request.Request" representing the -// client's request for the UnassignIpv6Addresses operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UnassignIpv6Addresses for more information on using the UnassignIpv6Addresses -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UnassignIpv6AddressesRequest method. -// req, resp := client.UnassignIpv6AddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6Addresses -func (c *EC2) UnassignIpv6AddressesRequest(input *UnassignIpv6AddressesInput) (req *request.Request, output *UnassignIpv6AddressesOutput) { - op := &request.Operation{ - Name: opUnassignIpv6Addresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnassignIpv6AddressesInput{} - } - - output = &UnassignIpv6AddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// UnassignIpv6Addresses API operation for Amazon Elastic Compute Cloud. -// -// Unassigns one or more IPv6 addresses from a network interface. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation UnassignIpv6Addresses for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6Addresses -func (c *EC2) UnassignIpv6Addresses(input *UnassignIpv6AddressesInput) (*UnassignIpv6AddressesOutput, error) { - req, out := c.UnassignIpv6AddressesRequest(input) - return out, req.Send() -} - -// UnassignIpv6AddressesWithContext is the same as UnassignIpv6Addresses with the addition of -// the ability to pass a context and additional request options. -// -// See UnassignIpv6Addresses for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) UnassignIpv6AddressesWithContext(ctx aws.Context, input *UnassignIpv6AddressesInput, opts ...request.Option) (*UnassignIpv6AddressesOutput, error) { - req, out := c.UnassignIpv6AddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" - -// UnassignPrivateIpAddressesRequest generates a "aws/request.Request" representing the -// client's request for the UnassignPrivateIpAddresses operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UnassignPrivateIpAddresses for more information on using the UnassignPrivateIpAddresses -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UnassignPrivateIpAddressesRequest method. -// req, resp := client.UnassignPrivateIpAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddresses -func (c *EC2) UnassignPrivateIpAddressesRequest(input *UnassignPrivateIpAddressesInput) (req *request.Request, output *UnassignPrivateIpAddressesOutput) { - op := &request.Operation{ - Name: opUnassignPrivateIpAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnassignPrivateIpAddressesInput{} - } - - output = &UnassignPrivateIpAddressesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UnassignPrivateIpAddresses API operation for Amazon Elastic Compute Cloud. -// -// Unassigns one or more secondary private IP addresses from a network interface. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation UnassignPrivateIpAddresses for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddresses -func (c *EC2) UnassignPrivateIpAddresses(input *UnassignPrivateIpAddressesInput) (*UnassignPrivateIpAddressesOutput, error) { - req, out := c.UnassignPrivateIpAddressesRequest(input) - return out, req.Send() -} - -// UnassignPrivateIpAddressesWithContext is the same as UnassignPrivateIpAddresses with the addition of -// the ability to pass a context and additional request options. -// -// See UnassignPrivateIpAddresses for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) UnassignPrivateIpAddressesWithContext(ctx aws.Context, input *UnassignPrivateIpAddressesInput, opts ...request.Option) (*UnassignPrivateIpAddressesOutput, error) { - req, out := c.UnassignPrivateIpAddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUnmonitorInstances = "UnmonitorInstances" - -// UnmonitorInstancesRequest generates a "aws/request.Request" representing the -// client's request for the UnmonitorInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UnmonitorInstances for more information on using the UnmonitorInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UnmonitorInstancesRequest method. -// req, resp := client.UnmonitorInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstances -func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *request.Request, output *UnmonitorInstancesOutput) { - op := &request.Operation{ - Name: opUnmonitorInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnmonitorInstancesInput{} - } - - output = &UnmonitorInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// UnmonitorInstances API operation for Amazon Elastic Compute Cloud. -// -// Disables detailed monitoring for a running instance. For more information, -// see Monitoring Your Instances and Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation UnmonitorInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstances -func (c *EC2) UnmonitorInstances(input *UnmonitorInstancesInput) (*UnmonitorInstancesOutput, error) { - req, out := c.UnmonitorInstancesRequest(input) - return out, req.Send() -} - -// UnmonitorInstancesWithContext is the same as UnmonitorInstances with the addition of -// the ability to pass a context and additional request options. -// -// See UnmonitorInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) UnmonitorInstancesWithContext(ctx aws.Context, input *UnmonitorInstancesInput, opts ...request.Option) (*UnmonitorInstancesOutput, error) { - req, out := c.UnmonitorInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSecurityGroupRuleDescriptionsEgress = "UpdateSecurityGroupRuleDescriptionsEgress" - -// UpdateSecurityGroupRuleDescriptionsEgressRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSecurityGroupRuleDescriptionsEgress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateSecurityGroupRuleDescriptionsEgress for more information on using the UpdateSecurityGroupRuleDescriptionsEgress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateSecurityGroupRuleDescriptionsEgressRequest method. -// req, resp := client.UpdateSecurityGroupRuleDescriptionsEgressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsEgress -func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgressRequest(input *UpdateSecurityGroupRuleDescriptionsEgressInput) (req *request.Request, output *UpdateSecurityGroupRuleDescriptionsEgressOutput) { - op := &request.Operation{ - Name: opUpdateSecurityGroupRuleDescriptionsEgress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSecurityGroupRuleDescriptionsEgressInput{} - } - - output = &UpdateSecurityGroupRuleDescriptionsEgressOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSecurityGroupRuleDescriptionsEgress API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Updates the description of an egress (outbound) security group -// rule. You can replace an existing description, or add a description to a -// rule that did not have one previously. -// -// You specify the description as part of the IP permissions structure. You -// can remove a description for a security group rule by omitting the description -// parameter in the request. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation UpdateSecurityGroupRuleDescriptionsEgress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsEgress -func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgress(input *UpdateSecurityGroupRuleDescriptionsEgressInput) (*UpdateSecurityGroupRuleDescriptionsEgressOutput, error) { - req, out := c.UpdateSecurityGroupRuleDescriptionsEgressRequest(input) - return out, req.Send() -} - -// UpdateSecurityGroupRuleDescriptionsEgressWithContext is the same as UpdateSecurityGroupRuleDescriptionsEgress with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSecurityGroupRuleDescriptionsEgress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgressWithContext(ctx aws.Context, input *UpdateSecurityGroupRuleDescriptionsEgressInput, opts ...request.Option) (*UpdateSecurityGroupRuleDescriptionsEgressOutput, error) { - req, out := c.UpdateSecurityGroupRuleDescriptionsEgressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSecurityGroupRuleDescriptionsIngress = "UpdateSecurityGroupRuleDescriptionsIngress" - -// UpdateSecurityGroupRuleDescriptionsIngressRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSecurityGroupRuleDescriptionsIngress operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateSecurityGroupRuleDescriptionsIngress for more information on using the UpdateSecurityGroupRuleDescriptionsIngress -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateSecurityGroupRuleDescriptionsIngressRequest method. -// req, resp := client.UpdateSecurityGroupRuleDescriptionsIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsIngress -func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngressRequest(input *UpdateSecurityGroupRuleDescriptionsIngressInput) (req *request.Request, output *UpdateSecurityGroupRuleDescriptionsIngressOutput) { - op := &request.Operation{ - Name: opUpdateSecurityGroupRuleDescriptionsIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSecurityGroupRuleDescriptionsIngressInput{} - } - - output = &UpdateSecurityGroupRuleDescriptionsIngressOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSecurityGroupRuleDescriptionsIngress API operation for Amazon Elastic Compute Cloud. -// -// Updates the description of an ingress (inbound) security group rule. You -// can replace an existing description, or add a description to a rule that -// did not have one previously. -// -// You specify the description as part of the IP permissions structure. You -// can remove a description for a security group rule by omitting the description -// parameter in the request. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation UpdateSecurityGroupRuleDescriptionsIngress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsIngress -func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngress(input *UpdateSecurityGroupRuleDescriptionsIngressInput) (*UpdateSecurityGroupRuleDescriptionsIngressOutput, error) { - req, out := c.UpdateSecurityGroupRuleDescriptionsIngressRequest(input) - return out, req.Send() -} - -// UpdateSecurityGroupRuleDescriptionsIngressWithContext is the same as UpdateSecurityGroupRuleDescriptionsIngress with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSecurityGroupRuleDescriptionsIngress for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngressWithContext(ctx aws.Context, input *UpdateSecurityGroupRuleDescriptionsIngressInput, opts ...request.Option) (*UpdateSecurityGroupRuleDescriptionsIngressOutput, error) { - req, out := c.UpdateSecurityGroupRuleDescriptionsIngressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Contains the parameters for accepting the quote. -type AcceptReservedInstancesExchangeQuoteInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The IDs of the Convertible Reserved Instances to exchange for another Convertible - // Reserved Instance of the same or higher value. - // - // ReservedInstanceIds is a required field - ReservedInstanceIds []*string `locationName:"ReservedInstanceId" locationNameList:"ReservedInstanceId" type:"list" required:"true"` - - // The configuration of the target Convertible Reserved Instance to exchange - // for your current Convertible Reserved Instances. - TargetConfigurations []*TargetConfigurationRequest `locationName:"TargetConfiguration" locationNameList:"TargetConfigurationRequest" type:"list"` -} - -// String returns the string representation -func (s AcceptReservedInstancesExchangeQuoteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptReservedInstancesExchangeQuoteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptReservedInstancesExchangeQuoteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptReservedInstancesExchangeQuoteInput"} - if s.ReservedInstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstanceIds")) - } - if s.TargetConfigurations != nil { - for i, v := range s.TargetConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetDryRun(v bool) *AcceptReservedInstancesExchangeQuoteInput { - s.DryRun = &v - return s -} - -// SetReservedInstanceIds sets the ReservedInstanceIds field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetReservedInstanceIds(v []*string) *AcceptReservedInstancesExchangeQuoteInput { - s.ReservedInstanceIds = v - return s -} - -// SetTargetConfigurations sets the TargetConfigurations field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetTargetConfigurations(v []*TargetConfigurationRequest) *AcceptReservedInstancesExchangeQuoteInput { - s.TargetConfigurations = v - return s -} - -// The result of the exchange and whether it was successful. -type AcceptReservedInstancesExchangeQuoteOutput struct { - _ struct{} `type:"structure"` - - // The ID of the successful exchange. - ExchangeId *string `locationName:"exchangeId" type:"string"` -} - -// String returns the string representation -func (s AcceptReservedInstancesExchangeQuoteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptReservedInstancesExchangeQuoteOutput) GoString() string { - return s.String() -} - -// SetExchangeId sets the ExchangeId field's value. -func (s *AcceptReservedInstancesExchangeQuoteOutput) SetExchangeId(v string) *AcceptReservedInstancesExchangeQuoteOutput { - s.ExchangeId = &v - return s -} - -type AcceptVpcEndpointConnectionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the endpoint service. - // - // ServiceId is a required field - ServiceId *string `type:"string" required:"true"` - - // The IDs of one or more interface VPC endpoints. - // - // VpcEndpointIds is a required field - VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s AcceptVpcEndpointConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptVpcEndpointConnectionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptVpcEndpointConnectionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptVpcEndpointConnectionsInput"} - if s.ServiceId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceId")) - } - if s.VpcEndpointIds == nil { - invalidParams.Add(request.NewErrParamRequired("VpcEndpointIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AcceptVpcEndpointConnectionsInput) SetDryRun(v bool) *AcceptVpcEndpointConnectionsInput { - s.DryRun = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *AcceptVpcEndpointConnectionsInput) SetServiceId(v string) *AcceptVpcEndpointConnectionsInput { - s.ServiceId = &v - return s -} - -// SetVpcEndpointIds sets the VpcEndpointIds field's value. -func (s *AcceptVpcEndpointConnectionsInput) SetVpcEndpointIds(v []*string) *AcceptVpcEndpointConnectionsInput { - s.VpcEndpointIds = v - return s -} - -type AcceptVpcEndpointConnectionsOutput struct { - _ struct{} `type:"structure"` - - // Information about the interface endpoints that were not accepted, if applicable. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s AcceptVpcEndpointConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptVpcEndpointConnectionsOutput) GoString() string { - return s.String() -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *AcceptVpcEndpointConnectionsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *AcceptVpcEndpointConnectionsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters for AcceptVpcPeeringConnection. -type AcceptVpcPeeringConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC peering connection. You must specify this parameter in - // the request. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s AcceptVpcPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptVpcPeeringConnectionInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *AcceptVpcPeeringConnectionInput) SetDryRun(v bool) *AcceptVpcPeeringConnectionInput { - s.DryRun = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *AcceptVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *AcceptVpcPeeringConnectionInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Contains the output of AcceptVpcPeeringConnection. -type AcceptVpcPeeringConnectionOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC peering connection. - VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` -} - -// String returns the string representation -func (s AcceptVpcPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptVpcPeeringConnectionOutput) GoString() string { - return s.String() -} - -// SetVpcPeeringConnection sets the VpcPeeringConnection field's value. -func (s *AcceptVpcPeeringConnectionOutput) SetVpcPeeringConnection(v *VpcPeeringConnection) *AcceptVpcPeeringConnectionOutput { - s.VpcPeeringConnection = v - return s -} - -// Describes an account attribute. -type AccountAttribute struct { - _ struct{} `type:"structure"` - - // The name of the account attribute. - AttributeName *string `locationName:"attributeName" type:"string"` - - // One or more values for the account attribute. - AttributeValues []*AccountAttributeValue `locationName:"attributeValueSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s AccountAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountAttribute) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *AccountAttribute) SetAttributeName(v string) *AccountAttribute { - s.AttributeName = &v - return s -} - -// SetAttributeValues sets the AttributeValues field's value. -func (s *AccountAttribute) SetAttributeValues(v []*AccountAttributeValue) *AccountAttribute { - s.AttributeValues = v - return s -} - -// Describes a value of an account attribute. -type AccountAttributeValue struct { - _ struct{} `type:"structure"` - - // The value of the attribute. - AttributeValue *string `locationName:"attributeValue" type:"string"` -} - -// String returns the string representation -func (s AccountAttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountAttributeValue) GoString() string { - return s.String() -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *AccountAttributeValue) SetAttributeValue(v string) *AccountAttributeValue { - s.AttributeValue = &v - return s -} - -// Describes a running instance in a Spot Fleet. -type ActiveInstance struct { - _ struct{} `type:"structure"` - - // The health status of the instance. If the status of either the instance status - // check or the system status check is impaired, the health status of the instance - // is unhealthy. Otherwise, the health status is healthy. - InstanceHealth *string `locationName:"instanceHealth" type:"string" enum:"InstanceHealthStatus"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The ID of the Spot Instance request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` -} - -// String returns the string representation -func (s ActiveInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActiveInstance) GoString() string { - return s.String() -} - -// SetInstanceHealth sets the InstanceHealth field's value. -func (s *ActiveInstance) SetInstanceHealth(v string) *ActiveInstance { - s.InstanceHealth = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ActiveInstance) SetInstanceId(v string) *ActiveInstance { - s.InstanceId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ActiveInstance) SetInstanceType(v string) *ActiveInstance { - s.InstanceType = &v - return s -} - -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *ActiveInstance) SetSpotInstanceRequestId(v string) *ActiveInstance { - s.SpotInstanceRequestId = &v - return s -} - -// Describes an Elastic IP address. -type Address struct { - _ struct{} `type:"structure"` - - // The ID representing the allocation of the address for use with EC2-VPC. - AllocationId *string `locationName:"allocationId" type:"string"` - - // The ID representing the association of the address with an instance in a - // VPC. - AssociationId *string `locationName:"associationId" type:"string"` - - // Indicates whether this Elastic IP address is for use with instances in EC2-Classic - // (standard) or instances in a VPC (vpc). - Domain *string `locationName:"domain" type:"string" enum:"DomainType"` - - // The ID of the instance that the address is associated with (if any). - InstanceId *string `locationName:"instanceId" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the AWS account that owns the network interface. - NetworkInterfaceOwnerId *string `locationName:"networkInterfaceOwnerId" type:"string"` - - // The private IP address associated with the Elastic IP address. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` - - // Any tags assigned to the Elastic IP address. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s Address) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Address) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *Address) SetAllocationId(v string) *Address { - s.AllocationId = &v - return s -} - -// SetAssociationId sets the AssociationId field's value. -func (s *Address) SetAssociationId(v string) *Address { - s.AssociationId = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *Address) SetDomain(v string) *Address { - s.Domain = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Address) SetInstanceId(v string) *Address { - s.InstanceId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *Address) SetNetworkInterfaceId(v string) *Address { - s.NetworkInterfaceId = &v - return s -} - -// SetNetworkInterfaceOwnerId sets the NetworkInterfaceOwnerId field's value. -func (s *Address) SetNetworkInterfaceOwnerId(v string) *Address { - s.NetworkInterfaceOwnerId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *Address) SetPrivateIpAddress(v string) *Address { - s.PrivateIpAddress = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *Address) SetPublicIp(v string) *Address { - s.PublicIp = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Address) SetTags(v []*Tag) *Address { - s.Tags = v - return s -} - -// Contains the parameters for AllocateAddress. -type AllocateAddressInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The Elastic IP address to recover. - Address *string `type:"string"` - - // Set to vpc to allocate the address for use with instances in a VPC. - // - // Default: The address is for use with instances in EC2-Classic. - Domain *string `type:"string" enum:"DomainType"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s AllocateAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateAddressInput) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *AllocateAddressInput) SetAddress(v string) *AllocateAddressInput { - s.Address = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *AllocateAddressInput) SetDomain(v string) *AllocateAddressInput { - s.Domain = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AllocateAddressInput) SetDryRun(v bool) *AllocateAddressInput { - s.DryRun = &v - return s -} - -// Contains the output of AllocateAddress. -type AllocateAddressOutput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The ID that AWS assigns to represent the allocation of the Elastic - // IP address for use with instances in a VPC. - AllocationId *string `locationName:"allocationId" type:"string"` - - // Indicates whether this Elastic IP address is for use with instances in EC2-Classic - // (standard) or instances in a VPC (vpc). - Domain *string `locationName:"domain" type:"string" enum:"DomainType"` - - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s AllocateAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateAddressOutput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *AllocateAddressOutput) SetAllocationId(v string) *AllocateAddressOutput { - s.AllocationId = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *AllocateAddressOutput) SetDomain(v string) *AllocateAddressOutput { - s.Domain = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *AllocateAddressOutput) SetPublicIp(v string) *AllocateAddressOutput { - s.PublicIp = &v - return s -} - -// Contains the parameters for AllocateHosts. -type AllocateHostsInput struct { - _ struct{} `type:"structure"` - - // This is enabled by default. This property allows instances to be automatically - // placed onto available Dedicated Hosts, when you are launching instances without - // specifying a host ID. - // - // Default: Enabled - AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` - - // The Availability Zone for the Dedicated Hosts. - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Specify the instance type that you want your Dedicated Hosts to be configured - // for. When you specify the instance type, that is the only instance type that - // you can launch onto that host. - // - // InstanceType is a required field - InstanceType *string `locationName:"instanceType" type:"string" required:"true"` - - // The number of Dedicated Hosts you want to allocate to your account with these - // parameters. - // - // Quantity is a required field - Quantity *int64 `locationName:"quantity" type:"integer" required:"true"` -} - -// String returns the string representation -func (s AllocateHostsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateHostsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AllocateHostsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AllocateHostsInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoPlacement sets the AutoPlacement field's value. -func (s *AllocateHostsInput) SetAutoPlacement(v string) *AllocateHostsInput { - s.AutoPlacement = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *AllocateHostsInput) SetAvailabilityZone(v string) *AllocateHostsInput { - s.AvailabilityZone = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *AllocateHostsInput) SetClientToken(v string) *AllocateHostsInput { - s.ClientToken = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *AllocateHostsInput) SetInstanceType(v string) *AllocateHostsInput { - s.InstanceType = &v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *AllocateHostsInput) SetQuantity(v int64) *AllocateHostsInput { - s.Quantity = &v - return s -} - -// Contains the output of AllocateHosts. -type AllocateHostsOutput struct { - _ struct{} `type:"structure"` - - // The ID of the allocated Dedicated Host. This is used when you want to launch - // an instance onto a specific host. - HostIds []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s AllocateHostsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateHostsOutput) GoString() string { - return s.String() -} - -// SetHostIds sets the HostIds field's value. -func (s *AllocateHostsOutput) SetHostIds(v []*string) *AllocateHostsOutput { - s.HostIds = v - return s -} - -// Describes a principal. -type AllowedPrincipal struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the principal. - Principal *string `locationName:"principal" type:"string"` - - // The type of principal. - PrincipalType *string `locationName:"principalType" type:"string" enum:"PrincipalType"` -} - -// String returns the string representation -func (s AllowedPrincipal) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllowedPrincipal) GoString() string { - return s.String() -} - -// SetPrincipal sets the Principal field's value. -func (s *AllowedPrincipal) SetPrincipal(v string) *AllowedPrincipal { - s.Principal = &v - return s -} - -// SetPrincipalType sets the PrincipalType field's value. -func (s *AllowedPrincipal) SetPrincipalType(v string) *AllowedPrincipal { - s.PrincipalType = &v - return s -} - -type AssignIpv6AddressesInput struct { - _ struct{} `type:"structure"` - - // The number of IPv6 addresses to assign to the network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. You can't - // use this option if specifying specific IPv6 addresses. - Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"` - - // One or more specific IPv6 addresses to be assigned to the network interface. - // You can't use this option if you're specifying a number of IPv6 addresses. - Ipv6Addresses []*string `locationName:"ipv6Addresses" locationNameList:"item" type:"list"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssignIpv6AddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignIpv6AddressesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssignIpv6AddressesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssignIpv6AddressesInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *AssignIpv6AddressesInput) SetIpv6AddressCount(v int64) *AssignIpv6AddressesInput { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *AssignIpv6AddressesInput) SetIpv6Addresses(v []*string) *AssignIpv6AddressesInput { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignIpv6AddressesInput) SetNetworkInterfaceId(v string) *AssignIpv6AddressesInput { - s.NetworkInterfaceId = &v - return s -} - -type AssignIpv6AddressesOutput struct { - _ struct{} `type:"structure"` - - // The IPv6 addresses assigned to the network interface. - AssignedIpv6Addresses []*string `locationName:"assignedIpv6Addresses" locationNameList:"item" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` -} - -// String returns the string representation -func (s AssignIpv6AddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignIpv6AddressesOutput) GoString() string { - return s.String() -} - -// SetAssignedIpv6Addresses sets the AssignedIpv6Addresses field's value. -func (s *AssignIpv6AddressesOutput) SetAssignedIpv6Addresses(v []*string) *AssignIpv6AddressesOutput { - s.AssignedIpv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignIpv6AddressesOutput) SetNetworkInterfaceId(v string) *AssignIpv6AddressesOutput { - s.NetworkInterfaceId = &v - return s -} - -// Contains the parameters for AssignPrivateIpAddresses. -type AssignPrivateIpAddressesInput struct { - _ struct{} `type:"structure"` - - // Indicates whether to allow an IP address that is already assigned to another - // network interface or instance to be reassigned to the specified network interface. - AllowReassignment *bool `locationName:"allowReassignment" type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - - // One or more IP addresses to be assigned as a secondary private IP address - // to the network interface. You can't specify this parameter when also specifying - // a number of secondary IP addresses. - // - // If you don't specify an IP address, Amazon EC2 automatically selects an IP - // address within the subnet range. - PrivateIpAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list"` - - // The number of secondary IP addresses to assign to the network interface. - // You can't specify this parameter when also specifying private IP addresses. - SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` -} - -// String returns the string representation -func (s AssignPrivateIpAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignPrivateIpAddressesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssignPrivateIpAddressesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssignPrivateIpAddressesInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowReassignment sets the AllowReassignment field's value. -func (s *AssignPrivateIpAddressesInput) SetAllowReassignment(v bool) *AssignPrivateIpAddressesInput { - s.AllowReassignment = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignPrivateIpAddressesInput) SetNetworkInterfaceId(v string) *AssignPrivateIpAddressesInput { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *AssignPrivateIpAddressesInput) SetPrivateIpAddresses(v []*string) *AssignPrivateIpAddressesInput { - s.PrivateIpAddresses = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *AssignPrivateIpAddressesInput) SetSecondaryPrivateIpAddressCount(v int64) *AssignPrivateIpAddressesInput { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -type AssignPrivateIpAddressesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AssignPrivateIpAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignPrivateIpAddressesOutput) GoString() string { - return s.String() -} - -// Contains the parameters for AssociateAddress. -type AssociateAddressInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The allocation ID. This is required for EC2-VPC. - AllocationId *string `type:"string"` - - // [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic - // IP address that is already associated with an instance or network interface - // to be reassociated with the specified instance or network interface. Otherwise, - // the operation fails. In a VPC in an EC2-VPC-only account, reassociation is - // automatic, therefore you can specify false to ensure the operation fails - // if the Elastic IP address is already associated with another resource. - AllowReassociation *bool `locationName:"allowReassociation" type:"boolean"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you - // can specify either the instance ID or the network interface ID, but not both. - // The operation fails if you specify an instance ID unless exactly one network - // interface is attached. - InstanceId *string `type:"string"` - - // [EC2-VPC] The ID of the network interface. If the instance has more than - // one network interface, you must specify a network interface ID. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // [EC2-VPC] The primary or secondary private IP address to associate with the - // Elastic IP address. If no private IP address is specified, the Elastic IP - // address is associated with the primary private IP address. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The Elastic IP address. This is required for EC2-Classic. - PublicIp *string `type:"string"` -} - -// String returns the string representation -func (s AssociateAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateAddressInput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *AssociateAddressInput) SetAllocationId(v string) *AssociateAddressInput { - s.AllocationId = &v - return s -} - -// SetAllowReassociation sets the AllowReassociation field's value. -func (s *AssociateAddressInput) SetAllowReassociation(v bool) *AssociateAddressInput { - s.AllowReassociation = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AssociateAddressInput) SetDryRun(v bool) *AssociateAddressInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssociateAddressInput) SetInstanceId(v string) *AssociateAddressInput { - s.InstanceId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssociateAddressInput) SetNetworkInterfaceId(v string) *AssociateAddressInput { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *AssociateAddressInput) SetPrivateIpAddress(v string) *AssociateAddressInput { - s.PrivateIpAddress = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *AssociateAddressInput) SetPublicIp(v string) *AssociateAddressInput { - s.PublicIp = &v - return s -} - -// Contains the output of AssociateAddress. -type AssociateAddressOutput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The ID that represents the association of the Elastic IP address - // with an instance. - AssociationId *string `locationName:"associationId" type:"string"` -} - -// String returns the string representation -func (s AssociateAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateAddressOutput) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *AssociateAddressOutput) SetAssociationId(v string) *AssociateAddressOutput { - s.AssociationId = &v - return s -} - -// Contains the parameters for AssociateDhcpOptions. -type AssociateDhcpOptionsInput struct { - _ struct{} `type:"structure"` - - // The ID of the DHCP options set, or default to associate no DHCP options with - // the VPC. - // - // DhcpOptionsId is a required field - DhcpOptionsId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateDhcpOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateDhcpOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateDhcpOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateDhcpOptionsInput"} - if s.DhcpOptionsId == nil { - invalidParams.Add(request.NewErrParamRequired("DhcpOptionsId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *AssociateDhcpOptionsInput) SetDhcpOptionsId(v string) *AssociateDhcpOptionsInput { - s.DhcpOptionsId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AssociateDhcpOptionsInput) SetDryRun(v bool) *AssociateDhcpOptionsInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AssociateDhcpOptionsInput) SetVpcId(v string) *AssociateDhcpOptionsInput { - s.VpcId = &v - return s -} - -type AssociateDhcpOptionsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AssociateDhcpOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateDhcpOptionsOutput) GoString() string { - return s.String() -} - -type AssociateIamInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The IAM instance profile. - // - // IamInstanceProfile is a required field - IamInstanceProfile *IamInstanceProfileSpecification `type:"structure" required:"true"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateIamInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateIamInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateIamInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateIamInstanceProfileInput"} - if s.IamInstanceProfile == nil { - invalidParams.Add(request.NewErrParamRequired("IamInstanceProfile")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *AssociateIamInstanceProfileInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *AssociateIamInstanceProfileInput { - s.IamInstanceProfile = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssociateIamInstanceProfileInput) SetInstanceId(v string) *AssociateIamInstanceProfileInput { - s.InstanceId = &v - return s -} - -type AssociateIamInstanceProfileOutput struct { - _ struct{} `type:"structure"` - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` -} - -// String returns the string representation -func (s AssociateIamInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateIamInstanceProfileOutput) GoString() string { - return s.String() -} - -// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. -func (s *AssociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *AssociateIamInstanceProfileOutput { - s.IamInstanceProfileAssociation = v - return s -} - -// Contains the parameters for AssociateRouteTable. -type AssociateRouteTableInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` - - // The ID of the subnet. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateRouteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateRouteTableInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AssociateRouteTableInput) SetDryRun(v bool) *AssociateRouteTableInput { - s.DryRun = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *AssociateRouteTableInput) SetRouteTableId(v string) *AssociateRouteTableInput { - s.RouteTableId = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateRouteTableInput) SetSubnetId(v string) *AssociateRouteTableInput { - s.SubnetId = &v - return s -} - -// Contains the output of AssociateRouteTable. -type AssociateRouteTableOutput struct { - _ struct{} `type:"structure"` - - // The route table association ID (needed to disassociate the route table). - AssociationId *string `locationName:"associationId" type:"string"` -} - -// String returns the string representation -func (s AssociateRouteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateRouteTableOutput) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *AssociateRouteTableOutput) SetAssociationId(v string) *AssociateRouteTableOutput { - s.AssociationId = &v - return s -} - -type AssociateSubnetCidrBlockInput struct { - _ struct{} `type:"structure"` - - // The IPv6 CIDR block for your subnet. The subnet must have a /64 prefix length. - // - // Ipv6CidrBlock is a required field - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string" required:"true"` - - // The ID of your subnet. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateSubnetCidrBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateSubnetCidrBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateSubnetCidrBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateSubnetCidrBlockInput"} - if s.Ipv6CidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("Ipv6CidrBlock")) - } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *AssociateSubnetCidrBlockInput) SetIpv6CidrBlock(v string) *AssociateSubnetCidrBlockInput { - s.Ipv6CidrBlock = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateSubnetCidrBlockInput) SetSubnetId(v string) *AssociateSubnetCidrBlockInput { - s.SubnetId = &v - return s -} - -type AssociateSubnetCidrBlockOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *SubnetIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s AssociateSubnetCidrBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateSubnetCidrBlockOutput) GoString() string { - return s.String() -} - -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *AssociateSubnetCidrBlockOutput) SetIpv6CidrBlockAssociation(v *SubnetIpv6CidrBlockAssociation) *AssociateSubnetCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateSubnetCidrBlockOutput) SetSubnetId(v string) *AssociateSubnetCidrBlockOutput { - s.SubnetId = &v - return s -} - -type AssociateVpcCidrBlockInput struct { - _ struct{} `type:"structure"` - - // Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for - // the VPC. You cannot specify the range of IPv6 addresses, or the size of the - // CIDR block. - AmazonProvidedIpv6CidrBlock *bool `locationName:"amazonProvidedIpv6CidrBlock" type:"boolean"` - - // An IPv4 CIDR block to associate with the VPC. - CidrBlock *string `type:"string"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateVpcCidrBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateVpcCidrBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateVpcCidrBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateVpcCidrBlockInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmazonProvidedIpv6CidrBlock sets the AmazonProvidedIpv6CidrBlock field's value. -func (s *AssociateVpcCidrBlockInput) SetAmazonProvidedIpv6CidrBlock(v bool) *AssociateVpcCidrBlockInput { - s.AmazonProvidedIpv6CidrBlock = &v - return s -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *AssociateVpcCidrBlockInput) SetCidrBlock(v string) *AssociateVpcCidrBlockInput { - s.CidrBlock = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AssociateVpcCidrBlockInput) SetVpcId(v string) *AssociateVpcCidrBlockInput { - s.VpcId = &v - return s -} - -type AssociateVpcCidrBlockOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPv4 CIDR block association. - CidrBlockAssociation *VpcCidrBlockAssociation `locationName:"cidrBlockAssociation" type:"structure"` - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *VpcIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s AssociateVpcCidrBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateVpcCidrBlockOutput) GoString() string { - return s.String() -} - -// SetCidrBlockAssociation sets the CidrBlockAssociation field's value. -func (s *AssociateVpcCidrBlockOutput) SetCidrBlockAssociation(v *VpcCidrBlockAssociation) *AssociateVpcCidrBlockOutput { - s.CidrBlockAssociation = v - return s -} - -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *AssociateVpcCidrBlockOutput) SetIpv6CidrBlockAssociation(v *VpcIpv6CidrBlockAssociation) *AssociateVpcCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AssociateVpcCidrBlockOutput) SetVpcId(v string) *AssociateVpcCidrBlockOutput { - s.VpcId = &v - return s -} - -// Contains the parameters for AttachClassicLinkVpc. -type AttachClassicLinkVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of one or more of the VPC's security groups. You cannot specify security - // groups from a different VPC. - // - // Groups is a required field - Groups []*string `locationName:"SecurityGroupId" locationNameList:"groupId" type:"list" required:"true"` - - // The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The ID of a ClassicLink-enabled VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachClassicLinkVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachClassicLinkVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachClassicLinkVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachClassicLinkVpcInput"} - if s.Groups == nil { - invalidParams.Add(request.NewErrParamRequired("Groups")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachClassicLinkVpcInput) SetDryRun(v bool) *AttachClassicLinkVpcInput { - s.DryRun = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *AttachClassicLinkVpcInput) SetGroups(v []*string) *AttachClassicLinkVpcInput { - s.Groups = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AttachClassicLinkVpcInput) SetInstanceId(v string) *AttachClassicLinkVpcInput { - s.InstanceId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AttachClassicLinkVpcInput) SetVpcId(v string) *AttachClassicLinkVpcInput { - s.VpcId = &v - return s -} - -// Contains the output of AttachClassicLinkVpc. -type AttachClassicLinkVpcOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s AttachClassicLinkVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachClassicLinkVpcOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *AttachClassicLinkVpcOutput) SetReturn(v bool) *AttachClassicLinkVpcOutput { - s.Return = &v - return s -} - -// Contains the parameters for AttachInternetGateway. -type AttachInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the Internet gateway. - // - // InternetGatewayId is a required field - InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachInternetGatewayInput"} - if s.InternetGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("InternetGatewayId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachInternetGatewayInput) SetDryRun(v bool) *AttachInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *AttachInternetGatewayInput) SetInternetGatewayId(v string) *AttachInternetGatewayInput { - s.InternetGatewayId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AttachInternetGatewayInput) SetVpcId(v string) *AttachInternetGatewayInput { - s.VpcId = &v - return s -} - -type AttachInternetGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachInternetGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for AttachNetworkInterface. -type AttachNetworkInterfaceInput struct { - _ struct{} `type:"structure"` - - // The index of the device for the network interface attachment. - // - // DeviceIndex is a required field - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachNetworkInterfaceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachNetworkInterfaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachNetworkInterfaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachNetworkInterfaceInput"} - if s.DeviceIndex == nil { - invalidParams.Add(request.NewErrParamRequired("DeviceIndex")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *AttachNetworkInterfaceInput) SetDeviceIndex(v int64) *AttachNetworkInterfaceInput { - s.DeviceIndex = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachNetworkInterfaceInput) SetDryRun(v bool) *AttachNetworkInterfaceInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AttachNetworkInterfaceInput) SetInstanceId(v string) *AttachNetworkInterfaceInput { - s.InstanceId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AttachNetworkInterfaceInput) SetNetworkInterfaceId(v string) *AttachNetworkInterfaceInput { - s.NetworkInterfaceId = &v - return s -} - -// Contains the output of AttachNetworkInterface. -type AttachNetworkInterfaceOutput struct { - _ struct{} `type:"structure"` - - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` -} - -// String returns the string representation -func (s AttachNetworkInterfaceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachNetworkInterfaceOutput) GoString() string { - return s.String() -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *AttachNetworkInterfaceOutput) SetAttachmentId(v string) *AttachNetworkInterfaceOutput { - s.AttachmentId = &v - return s -} - -// Contains the parameters for AttachVolume. -type AttachVolumeInput struct { - _ struct{} `type:"structure"` - - // The device name (for example, /dev/sdh or xvdh). - // - // Device is a required field - Device *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The ID of the EBS volume. The volume and instance must be within the same - // Availability Zone. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachVolumeInput"} - if s.Device == nil { - invalidParams.Add(request.NewErrParamRequired("Device")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDevice sets the Device field's value. -func (s *AttachVolumeInput) SetDevice(v string) *AttachVolumeInput { - s.Device = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachVolumeInput) SetDryRun(v bool) *AttachVolumeInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AttachVolumeInput) SetInstanceId(v string) *AttachVolumeInput { - s.InstanceId = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *AttachVolumeInput) SetVolumeId(v string) *AttachVolumeInput { - s.VolumeId = &v - return s -} - -// Contains the parameters for AttachVpnGateway. -type AttachVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` - - // The ID of the virtual private gateway. - // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachVpnGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachVpnGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachVpnGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachVpnGatewayInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - if s.VpnGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachVpnGatewayInput) SetDryRun(v bool) *AttachVpnGatewayInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AttachVpnGatewayInput) SetVpcId(v string) *AttachVpnGatewayInput { - s.VpcId = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *AttachVpnGatewayInput) SetVpnGatewayId(v string) *AttachVpnGatewayInput { - s.VpnGatewayId = &v - return s -} - -// Contains the output of AttachVpnGateway. -type AttachVpnGatewayOutput struct { - _ struct{} `type:"structure"` - - // Information about the attachment. - VpcAttachment *VpcAttachment `locationName:"attachment" type:"structure"` -} - -// String returns the string representation -func (s AttachVpnGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachVpnGatewayOutput) GoString() string { - return s.String() -} - -// SetVpcAttachment sets the VpcAttachment field's value. -func (s *AttachVpnGatewayOutput) SetVpcAttachment(v *VpcAttachment) *AttachVpnGatewayOutput { - s.VpcAttachment = v - return s -} - -// Describes a value for a resource attribute that is a Boolean value. -type AttributeBooleanValue struct { - _ struct{} `type:"structure"` - - // The attribute value. The valid values are true or false. - Value *bool `locationName:"value" type:"boolean"` -} - -// String returns the string representation -func (s AttributeBooleanValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeBooleanValue) GoString() string { - return s.String() -} - -// SetValue sets the Value field's value. -func (s *AttributeBooleanValue) SetValue(v bool) *AttributeBooleanValue { - s.Value = &v - return s -} - -// Describes a value for a resource attribute that is a String. -type AttributeValue struct { - _ struct{} `type:"structure"` - - // The attribute value. The value is case-sensitive. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s AttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeValue) GoString() string { - return s.String() -} - -// SetValue sets the Value field's value. -func (s *AttributeValue) SetValue(v string) *AttributeValue { - s.Value = &v - return s -} - -// Contains the parameters for AuthorizeSecurityGroupEgress. -type AuthorizeSecurityGroupEgressInput struct { - _ struct{} `type:"structure"` - - // Not supported. Use a set of IP permissions to specify the CIDR. - CidrIp *string `locationName:"cidrIp" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Not supported. Use a set of IP permissions to specify the port. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The ID of the security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` - - // One or more sets of IP permissions. You can't specify a destination security - // group and a CIDR IP address range in the same set of permissions. - IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` - - // Not supported. Use a set of IP permissions to specify the protocol name or - // number. - IpProtocol *string `locationName:"ipProtocol" type:"string"` - - // Not supported. Use a set of IP permissions to specify a destination security - // group. - SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"` - - // Not supported. Use a set of IP permissions to specify a destination security - // group. - SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` - - // Not supported. Use a set of IP permissions to specify the port. - ToPort *int64 `locationName:"toPort" type:"integer"` -} - -// String returns the string representation -func (s AuthorizeSecurityGroupEgressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSecurityGroupEgressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuthorizeSecurityGroupEgressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthorizeSecurityGroupEgressInput"} - if s.GroupId == nil { - invalidParams.Add(request.NewErrParamRequired("GroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrIp sets the CidrIp field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetCidrIp(v string) *AuthorizeSecurityGroupEgressInput { - s.CidrIp = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetDryRun(v bool) *AuthorizeSecurityGroupEgressInput { - s.DryRun = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetFromPort(v int64) *AuthorizeSecurityGroupEgressInput { - s.FromPort = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetGroupId(v string) *AuthorizeSecurityGroupEgressInput { - s.GroupId = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetIpPermissions(v []*IpPermission) *AuthorizeSecurityGroupEgressInput { - s.IpPermissions = v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetIpProtocol(v string) *AuthorizeSecurityGroupEgressInput { - s.IpProtocol = &v - return s -} - -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetSourceSecurityGroupName(v string) *AuthorizeSecurityGroupEgressInput { - s.SourceSecurityGroupName = &v - return s -} - -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetSourceSecurityGroupOwnerId(v string) *AuthorizeSecurityGroupEgressInput { - s.SourceSecurityGroupOwnerId = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetToPort(v int64) *AuthorizeSecurityGroupEgressInput { - s.ToPort = &v - return s -} - -type AuthorizeSecurityGroupEgressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AuthorizeSecurityGroupEgressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSecurityGroupEgressOutput) GoString() string { - return s.String() -} - -// Contains the parameters for AuthorizeSecurityGroupIngress. -type AuthorizeSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The CIDR IPv4 address range. You can't specify this parameter when specifying - // a source security group. - CidrIp *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 - // type number. For the ICMP/ICMPv6 type number, use -1 to specify all types. - // If you specify all ICMP/ICMPv6 types, you must specify all codes. - FromPort *int64 `type:"integer"` - - // The ID of the security group. You must specify either the security group - // ID or the security group name in the request. For security groups in a nondefault - // VPC, you must specify the security group ID. - GroupId *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the security group. You must specify - // either the security group ID or the security group name in the request. - GroupName *string `type:"string"` - - // One or more sets of IP permissions. Can be used to specify multiple rules - // in a single command. - IpPermissions []*IpPermission `locationNameList:"item" type:"list"` - - // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). - // (VPC only) Use -1 to specify all protocols. If you specify -1, or a protocol - // number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is - // allowed, regardless of any ports you specify. For tcp, udp, and icmp, you - // must specify a port range. For protocol 58 (ICMPv6), you can optionally specify - // a port range; if you don't, traffic for all types and codes is allowed. - IpProtocol *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the source security group. You can't - // specify this parameter in combination with the following parameters: the - // CIDR IP address range, the start of the port range, the IP protocol, and - // the end of the port range. Creates rules that grant full ICMP, UDP, and TCP - // access. To create a rule with a specific IP protocol and port range, use - // a set of IP permissions instead. For EC2-VPC, the source security group must - // be in the same VPC. - SourceSecurityGroupName *string `type:"string"` - - // [EC2-Classic] The AWS account ID for the source security group, if the source - // security group is in a different account. You can't specify this parameter - // in combination with the following parameters: the CIDR IP address range, - // the IP protocol, the start of the port range, and the end of the port range. - // Creates rules that grant full ICMP, UDP, and TCP access. To create a rule - // with a specific IP protocol and port range, use a set of IP permissions instead. - SourceSecurityGroupOwnerId *string `type:"string"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code - // number. For the ICMP/ICMPv6 code number, use -1 to specify all codes. If - // you specify all ICMP/ICMPv6 types, you must specify all codes. - ToPort *int64 `type:"integer"` -} - -// String returns the string representation -func (s AuthorizeSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// SetCidrIp sets the CidrIp field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetCidrIp(v string) *AuthorizeSecurityGroupIngressInput { - s.CidrIp = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetDryRun(v bool) *AuthorizeSecurityGroupIngressInput { - s.DryRun = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetFromPort(v int64) *AuthorizeSecurityGroupIngressInput { - s.FromPort = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetGroupId(v string) *AuthorizeSecurityGroupIngressInput { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetGroupName(v string) *AuthorizeSecurityGroupIngressInput { - s.GroupName = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetIpPermissions(v []*IpPermission) *AuthorizeSecurityGroupIngressInput { - s.IpPermissions = v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetIpProtocol(v string) *AuthorizeSecurityGroupIngressInput { - s.IpProtocol = &v - return s -} - -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetSourceSecurityGroupName(v string) *AuthorizeSecurityGroupIngressInput { - s.SourceSecurityGroupName = &v - return s -} - -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetSourceSecurityGroupOwnerId(v string) *AuthorizeSecurityGroupIngressInput { - s.SourceSecurityGroupOwnerId = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetToPort(v int64) *AuthorizeSecurityGroupIngressInput { - s.ToPort = &v - return s -} - -type AuthorizeSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AuthorizeSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// Describes an Availability Zone. -type AvailabilityZone struct { - _ struct{} `type:"structure"` - - // Any messages about the Availability Zone. - Messages []*AvailabilityZoneMessage `locationName:"messageSet" locationNameList:"item" type:"list"` - - // The name of the region. - RegionName *string `locationName:"regionName" type:"string"` - - // The state of the Availability Zone. - State *string `locationName:"zoneState" type:"string" enum:"AvailabilityZoneState"` - - // The name of the Availability Zone. - ZoneName *string `locationName:"zoneName" type:"string"` -} - -// String returns the string representation -func (s AvailabilityZone) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailabilityZone) GoString() string { - return s.String() -} - -// SetMessages sets the Messages field's value. -func (s *AvailabilityZone) SetMessages(v []*AvailabilityZoneMessage) *AvailabilityZone { - s.Messages = v - return s -} - -// SetRegionName sets the RegionName field's value. -func (s *AvailabilityZone) SetRegionName(v string) *AvailabilityZone { - s.RegionName = &v - return s -} - -// SetState sets the State field's value. -func (s *AvailabilityZone) SetState(v string) *AvailabilityZone { - s.State = &v - return s -} - -// SetZoneName sets the ZoneName field's value. -func (s *AvailabilityZone) SetZoneName(v string) *AvailabilityZone { - s.ZoneName = &v - return s -} - -// Describes a message about an Availability Zone. -type AvailabilityZoneMessage struct { - _ struct{} `type:"structure"` - - // The message about the Availability Zone. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s AvailabilityZoneMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailabilityZoneMessage) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *AvailabilityZoneMessage) SetMessage(v string) *AvailabilityZoneMessage { - s.Message = &v - return s -} - -// The capacity information for instances launched onto the Dedicated Host. -type AvailableCapacity struct { - _ struct{} `type:"structure"` - - // The total number of instances that the Dedicated Host supports. - AvailableInstanceCapacity []*InstanceCapacity `locationName:"availableInstanceCapacity" locationNameList:"item" type:"list"` - - // The number of vCPUs available on the Dedicated Host. - AvailableVCpus *int64 `locationName:"availableVCpus" type:"integer"` -} - -// String returns the string representation -func (s AvailableCapacity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailableCapacity) GoString() string { - return s.String() -} - -// SetAvailableInstanceCapacity sets the AvailableInstanceCapacity field's value. -func (s *AvailableCapacity) SetAvailableInstanceCapacity(v []*InstanceCapacity) *AvailableCapacity { - s.AvailableInstanceCapacity = v - return s -} - -// SetAvailableVCpus sets the AvailableVCpus field's value. -func (s *AvailableCapacity) SetAvailableVCpus(v int64) *AvailableCapacity { - s.AvailableVCpus = &v - return s -} - -type BlobAttributeValue struct { - _ struct{} `type:"structure"` - - // Value is automatically base64 encoded/decoded by the SDK. - Value []byte `locationName:"value" type:"blob"` -} - -// String returns the string representation -func (s BlobAttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BlobAttributeValue) GoString() string { - return s.String() -} - -// SetValue sets the Value field's value. -func (s *BlobAttributeValue) SetValue(v []byte) *BlobAttributeValue { - s.Value = v - return s -} - -// Describes a block device mapping. -type BlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name (for example, /dev/sdh or xvdh). - DeviceName *string `locationName:"deviceName" type:"string"` - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsBlockDevice `locationName:"ebs" type:"structure"` - - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice *string `locationName:"noDevice" type:"string"` - - // The virtual device name (ephemeralN). Instance store volumes are numbered - // starting from 0. An instance type with 2 available instance store volumes - // can specify mappings for ephemeral0 and ephemeral1.The number of available - // instance store volumes depends on the instance type. After you connect to - // the instance, you must mount the volume. - // - // Constraints: For M3 instances, you must specify instance store volumes in - // the block device mapping for the instance. When you launch an M3 instance, - // we ignore any instance store volumes specified in the block device mapping - // for the AMI. - VirtualName *string `locationName:"virtualName" type:"string"` -} - -// String returns the string representation -func (s BlockDeviceMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BlockDeviceMapping) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *BlockDeviceMapping) SetDeviceName(v string) *BlockDeviceMapping { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *BlockDeviceMapping) SetEbs(v *EbsBlockDevice) *BlockDeviceMapping { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *BlockDeviceMapping) SetNoDevice(v string) *BlockDeviceMapping { - s.NoDevice = &v - return s -} - -// SetVirtualName sets the VirtualName field's value. -func (s *BlockDeviceMapping) SetVirtualName(v string) *BlockDeviceMapping { - s.VirtualName = &v - return s -} - -// Contains the parameters for BundleInstance. -type BundleInstanceInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance to bundle. - // - // Type: String - // - // Default: None - // - // Required: Yes - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The bucket in which to store the AMI. You can specify a bucket that you already - // own or a new bucket that Amazon EC2 creates on your behalf. If you specify - // a bucket that belongs to someone else, Amazon EC2 returns an error. - // - // Storage is a required field - Storage *Storage `type:"structure" required:"true"` -} - -// String returns the string representation -func (s BundleInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BundleInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BundleInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BundleInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.Storage == nil { - invalidParams.Add(request.NewErrParamRequired("Storage")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *BundleInstanceInput) SetDryRun(v bool) *BundleInstanceInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *BundleInstanceInput) SetInstanceId(v string) *BundleInstanceInput { - s.InstanceId = &v - return s -} - -// SetStorage sets the Storage field's value. -func (s *BundleInstanceInput) SetStorage(v *Storage) *BundleInstanceInput { - s.Storage = v - return s -} - -// Contains the output of BundleInstance. -type BundleInstanceOutput struct { - _ struct{} `type:"structure"` - - // Information about the bundle task. - BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` -} - -// String returns the string representation -func (s BundleInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BundleInstanceOutput) GoString() string { - return s.String() -} - -// SetBundleTask sets the BundleTask field's value. -func (s *BundleInstanceOutput) SetBundleTask(v *BundleTask) *BundleInstanceOutput { - s.BundleTask = v - return s -} - -// Describes a bundle task. -type BundleTask struct { - _ struct{} `type:"structure"` - - // The ID of the bundle task. - BundleId *string `locationName:"bundleId" type:"string"` - - // If the task fails, a description of the error. - BundleTaskError *BundleTaskError `locationName:"error" type:"structure"` - - // The ID of the instance associated with this bundle task. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The level of task completion, as a percent (for example, 20%). - Progress *string `locationName:"progress" type:"string"` - - // The time this task started. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The state of the task. - State *string `locationName:"state" type:"string" enum:"BundleTaskState"` - - // The Amazon S3 storage locations. - Storage *Storage `locationName:"storage" type:"structure"` - - // The time of the most recent update for the task. - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s BundleTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BundleTask) GoString() string { - return s.String() -} - -// SetBundleId sets the BundleId field's value. -func (s *BundleTask) SetBundleId(v string) *BundleTask { - s.BundleId = &v - return s -} - -// SetBundleTaskError sets the BundleTaskError field's value. -func (s *BundleTask) SetBundleTaskError(v *BundleTaskError) *BundleTask { - s.BundleTaskError = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *BundleTask) SetInstanceId(v string) *BundleTask { - s.InstanceId = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *BundleTask) SetProgress(v string) *BundleTask { - s.Progress = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *BundleTask) SetStartTime(v time.Time) *BundleTask { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *BundleTask) SetState(v string) *BundleTask { - s.State = &v - return s -} - -// SetStorage sets the Storage field's value. -func (s *BundleTask) SetStorage(v *Storage) *BundleTask { - s.Storage = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *BundleTask) SetUpdateTime(v time.Time) *BundleTask { - s.UpdateTime = &v - return s -} - -// Describes an error for BundleInstance. -type BundleTaskError struct { - _ struct{} `type:"structure"` - - // The error code. - Code *string `locationName:"code" type:"string"` - - // The error message. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s BundleTaskError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BundleTaskError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *BundleTaskError) SetCode(v string) *BundleTaskError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *BundleTaskError) SetMessage(v string) *BundleTaskError { - s.Message = &v - return s -} - -// Contains the parameters for CancelBundleTask. -type CancelBundleTaskInput struct { - _ struct{} `type:"structure"` - - // The ID of the bundle task. - // - // BundleId is a required field - BundleId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s CancelBundleTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelBundleTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelBundleTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelBundleTaskInput"} - if s.BundleId == nil { - invalidParams.Add(request.NewErrParamRequired("BundleId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBundleId sets the BundleId field's value. -func (s *CancelBundleTaskInput) SetBundleId(v string) *CancelBundleTaskInput { - s.BundleId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelBundleTaskInput) SetDryRun(v bool) *CancelBundleTaskInput { - s.DryRun = &v - return s -} - -// Contains the output of CancelBundleTask. -type CancelBundleTaskOutput struct { - _ struct{} `type:"structure"` - - // Information about the bundle task. - BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` -} - -// String returns the string representation -func (s CancelBundleTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelBundleTaskOutput) GoString() string { - return s.String() -} - -// SetBundleTask sets the BundleTask field's value. -func (s *CancelBundleTaskOutput) SetBundleTask(v *BundleTask) *CancelBundleTaskOutput { - s.BundleTask = v - return s -} - -// Contains the parameters for CancelConversionTask. -type CancelConversionTaskInput struct { - _ struct{} `type:"structure"` - - // The ID of the conversion task. - // - // ConversionTaskId is a required field - ConversionTaskId *string `locationName:"conversionTaskId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The reason for canceling the conversion task. - ReasonMessage *string `locationName:"reasonMessage" type:"string"` -} - -// String returns the string representation -func (s CancelConversionTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelConversionTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelConversionTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelConversionTaskInput"} - if s.ConversionTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("ConversionTaskId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConversionTaskId sets the ConversionTaskId field's value. -func (s *CancelConversionTaskInput) SetConversionTaskId(v string) *CancelConversionTaskInput { - s.ConversionTaskId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelConversionTaskInput) SetDryRun(v bool) *CancelConversionTaskInput { - s.DryRun = &v - return s -} - -// SetReasonMessage sets the ReasonMessage field's value. -func (s *CancelConversionTaskInput) SetReasonMessage(v string) *CancelConversionTaskInput { - s.ReasonMessage = &v - return s -} - -type CancelConversionTaskOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CancelConversionTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelConversionTaskOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CancelExportTask. -type CancelExportTaskInput struct { - _ struct{} `type:"structure"` - - // The ID of the export task. This is the ID returned by CreateInstanceExportTask. - // - // ExportTaskId is a required field - ExportTaskId *string `locationName:"exportTaskId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelExportTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelExportTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelExportTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelExportTaskInput"} - if s.ExportTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("ExportTaskId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExportTaskId sets the ExportTaskId field's value. -func (s *CancelExportTaskInput) SetExportTaskId(v string) *CancelExportTaskInput { - s.ExportTaskId = &v - return s -} - -type CancelExportTaskOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CancelExportTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelExportTaskOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CancelImportTask. -type CancelImportTaskInput struct { - _ struct{} `type:"structure"` - - // The reason for canceling the task. - CancelReason *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the import image or import snapshot task to be canceled. - ImportTaskId *string `type:"string"` -} - -// String returns the string representation -func (s CancelImportTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelImportTaskInput) GoString() string { - return s.String() -} - -// SetCancelReason sets the CancelReason field's value. -func (s *CancelImportTaskInput) SetCancelReason(v string) *CancelImportTaskInput { - s.CancelReason = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelImportTaskInput) SetDryRun(v bool) *CancelImportTaskInput { - s.DryRun = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *CancelImportTaskInput) SetImportTaskId(v string) *CancelImportTaskInput { - s.ImportTaskId = &v - return s -} - -// Contains the output for CancelImportTask. -type CancelImportTaskOutput struct { - _ struct{} `type:"structure"` - - // The ID of the task being canceled. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // The current state of the task being canceled. - PreviousState *string `locationName:"previousState" type:"string"` - - // The current state of the task being canceled. - State *string `locationName:"state" type:"string"` -} - -// String returns the string representation -func (s CancelImportTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelImportTaskOutput) GoString() string { - return s.String() -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *CancelImportTaskOutput) SetImportTaskId(v string) *CancelImportTaskOutput { - s.ImportTaskId = &v - return s -} - -// SetPreviousState sets the PreviousState field's value. -func (s *CancelImportTaskOutput) SetPreviousState(v string) *CancelImportTaskOutput { - s.PreviousState = &v - return s -} - -// SetState sets the State field's value. -func (s *CancelImportTaskOutput) SetState(v string) *CancelImportTaskOutput { - s.State = &v - return s -} - -// Contains the parameters for CancelReservedInstancesListing. -type CancelReservedInstancesListingInput struct { - _ struct{} `type:"structure"` - - // The ID of the Reserved Instance listing. - // - // ReservedInstancesListingId is a required field - ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelReservedInstancesListingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelReservedInstancesListingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelReservedInstancesListingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelReservedInstancesListingInput"} - if s.ReservedInstancesListingId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesListingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReservedInstancesListingId sets the ReservedInstancesListingId field's value. -func (s *CancelReservedInstancesListingInput) SetReservedInstancesListingId(v string) *CancelReservedInstancesListingInput { - s.ReservedInstancesListingId = &v - return s -} - -// Contains the output of CancelReservedInstancesListing. -type CancelReservedInstancesListingOutput struct { - _ struct{} `type:"structure"` - - // The Reserved Instance listing. - ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CancelReservedInstancesListingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelReservedInstancesListingOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesListings sets the ReservedInstancesListings field's value. -func (s *CancelReservedInstancesListingOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *CancelReservedInstancesListingOutput { - s.ReservedInstancesListings = v - return s -} - -// Describes a Spot Fleet error. -type CancelSpotFleetRequestsError struct { - _ struct{} `type:"structure"` - - // The error code. - // - // Code is a required field - Code *string `locationName:"code" type:"string" required:"true" enum:"CancelBatchErrorCode"` - - // The description for the error code. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *CancelSpotFleetRequestsError) SetCode(v string) *CancelSpotFleetRequestsError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *CancelSpotFleetRequestsError) SetMessage(v string) *CancelSpotFleetRequestsError { - s.Message = &v - return s -} - -// Describes a Spot Fleet request that was not successfully canceled. -type CancelSpotFleetRequestsErrorItem struct { - _ struct{} `type:"structure"` - - // The error. - // - // Error is a required field - Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure" required:"true"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsErrorItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsErrorItem) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *CancelSpotFleetRequestsErrorItem) SetError(v *CancelSpotFleetRequestsError) *CancelSpotFleetRequestsErrorItem { - s.Error = v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *CancelSpotFleetRequestsErrorItem) SetSpotFleetRequestId(v string) *CancelSpotFleetRequestsErrorItem { - s.SpotFleetRequestId = &v - return s -} - -// Contains the parameters for CancelSpotFleetRequests. -type CancelSpotFleetRequestsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IDs of the Spot Fleet requests. - // - // SpotFleetRequestIds is a required field - SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list" required:"true"` - - // Indicates whether to terminate instances for a Spot Fleet request if it is - // canceled successfully. - // - // TerminateInstances is a required field - TerminateInstances *bool `locationName:"terminateInstances" type:"boolean" required:"true"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelSpotFleetRequestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelSpotFleetRequestsInput"} - if s.SpotFleetRequestIds == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestIds")) - } - if s.TerminateInstances == nil { - invalidParams.Add(request.NewErrParamRequired("TerminateInstances")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelSpotFleetRequestsInput) SetDryRun(v bool) *CancelSpotFleetRequestsInput { - s.DryRun = &v - return s -} - -// SetSpotFleetRequestIds sets the SpotFleetRequestIds field's value. -func (s *CancelSpotFleetRequestsInput) SetSpotFleetRequestIds(v []*string) *CancelSpotFleetRequestsInput { - s.SpotFleetRequestIds = v - return s -} - -// SetTerminateInstances sets the TerminateInstances field's value. -func (s *CancelSpotFleetRequestsInput) SetTerminateInstances(v bool) *CancelSpotFleetRequestsInput { - s.TerminateInstances = &v - return s -} - -// Contains the output of CancelSpotFleetRequests. -type CancelSpotFleetRequestsOutput struct { - _ struct{} `type:"structure"` - - // Information about the Spot Fleet requests that are successfully canceled. - SuccessfulFleetRequests []*CancelSpotFleetRequestsSuccessItem `locationName:"successfulFleetRequestSet" locationNameList:"item" type:"list"` - - // Information about the Spot Fleet requests that are not successfully canceled. - UnsuccessfulFleetRequests []*CancelSpotFleetRequestsErrorItem `locationName:"unsuccessfulFleetRequestSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsOutput) GoString() string { - return s.String() -} - -// SetSuccessfulFleetRequests sets the SuccessfulFleetRequests field's value. -func (s *CancelSpotFleetRequestsOutput) SetSuccessfulFleetRequests(v []*CancelSpotFleetRequestsSuccessItem) *CancelSpotFleetRequestsOutput { - s.SuccessfulFleetRequests = v - return s -} - -// SetUnsuccessfulFleetRequests sets the UnsuccessfulFleetRequests field's value. -func (s *CancelSpotFleetRequestsOutput) SetUnsuccessfulFleetRequests(v []*CancelSpotFleetRequestsErrorItem) *CancelSpotFleetRequestsOutput { - s.UnsuccessfulFleetRequests = v - return s -} - -// Describes a Spot Fleet request that was successfully canceled. -type CancelSpotFleetRequestsSuccessItem struct { - _ struct{} `type:"structure"` - - // The current state of the Spot Fleet request. - // - // CurrentSpotFleetRequestState is a required field - CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"` - - // The previous state of the Spot Fleet request. - // - // PreviousSpotFleetRequestState is a required field - PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsSuccessItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsSuccessItem) GoString() string { - return s.String() -} - -// SetCurrentSpotFleetRequestState sets the CurrentSpotFleetRequestState field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetCurrentSpotFleetRequestState(v string) *CancelSpotFleetRequestsSuccessItem { - s.CurrentSpotFleetRequestState = &v - return s -} - -// SetPreviousSpotFleetRequestState sets the PreviousSpotFleetRequestState field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetPreviousSpotFleetRequestState(v string) *CancelSpotFleetRequestsSuccessItem { - s.PreviousSpotFleetRequestState = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetSpotFleetRequestId(v string) *CancelSpotFleetRequestsSuccessItem { - s.SpotFleetRequestId = &v - return s -} - -// Contains the parameters for CancelSpotInstanceRequests. -type CancelSpotInstanceRequestsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more Spot Instance request IDs. - // - // SpotInstanceRequestIds is a required field - SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list" required:"true"` -} - -// String returns the string representation -func (s CancelSpotInstanceRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotInstanceRequestsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelSpotInstanceRequestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelSpotInstanceRequestsInput"} - if s.SpotInstanceRequestIds == nil { - invalidParams.Add(request.NewErrParamRequired("SpotInstanceRequestIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelSpotInstanceRequestsInput) SetDryRun(v bool) *CancelSpotInstanceRequestsInput { - s.DryRun = &v - return s -} - -// SetSpotInstanceRequestIds sets the SpotInstanceRequestIds field's value. -func (s *CancelSpotInstanceRequestsInput) SetSpotInstanceRequestIds(v []*string) *CancelSpotInstanceRequestsInput { - s.SpotInstanceRequestIds = v - return s -} - -// Contains the output of CancelSpotInstanceRequests. -type CancelSpotInstanceRequestsOutput struct { - _ struct{} `type:"structure"` - - // One or more Spot Instance requests. - CancelledSpotInstanceRequests []*CancelledSpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CancelSpotInstanceRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotInstanceRequestsOutput) GoString() string { - return s.String() -} - -// SetCancelledSpotInstanceRequests sets the CancelledSpotInstanceRequests field's value. -func (s *CancelSpotInstanceRequestsOutput) SetCancelledSpotInstanceRequests(v []*CancelledSpotInstanceRequest) *CancelSpotInstanceRequestsOutput { - s.CancelledSpotInstanceRequests = v - return s -} - -// Describes a request to cancel a Spot Instance. -type CancelledSpotInstanceRequest struct { - _ struct{} `type:"structure"` - - // The ID of the Spot Instance request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - - // The state of the Spot Instance request. - State *string `locationName:"state" type:"string" enum:"CancelSpotInstanceRequestState"` -} - -// String returns the string representation -func (s CancelledSpotInstanceRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelledSpotInstanceRequest) GoString() string { - return s.String() -} - -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *CancelledSpotInstanceRequest) SetSpotInstanceRequestId(v string) *CancelledSpotInstanceRequest { - s.SpotInstanceRequestId = &v - return s -} - -// SetState sets the State field's value. -func (s *CancelledSpotInstanceRequest) SetState(v string) *CancelledSpotInstanceRequest { - s.State = &v - return s -} - -// Describes an IPv4 CIDR block. -type CidrBlock struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR block. - CidrBlock *string `locationName:"cidrBlock" type:"string"` -} - -// String returns the string representation -func (s CidrBlock) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CidrBlock) GoString() string { - return s.String() -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *CidrBlock) SetCidrBlock(v string) *CidrBlock { - s.CidrBlock = &v - return s -} - -// Describes the ClassicLink DNS support status of a VPC. -type ClassicLinkDnsSupport struct { - _ struct{} `type:"structure"` - - // Indicates whether ClassicLink DNS support is enabled for the VPC. - ClassicLinkDnsSupported *bool `locationName:"classicLinkDnsSupported" type:"boolean"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s ClassicLinkDnsSupport) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClassicLinkDnsSupport) GoString() string { - return s.String() -} - -// SetClassicLinkDnsSupported sets the ClassicLinkDnsSupported field's value. -func (s *ClassicLinkDnsSupport) SetClassicLinkDnsSupported(v bool) *ClassicLinkDnsSupport { - s.ClassicLinkDnsSupported = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ClassicLinkDnsSupport) SetVpcId(v string) *ClassicLinkDnsSupport { - s.VpcId = &v - return s -} - -// Describes a linked EC2-Classic instance. -type ClassicLinkInstance struct { - _ struct{} `type:"structure"` - - // A list of security groups. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // Any tags assigned to the instance. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s ClassicLinkInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClassicLinkInstance) GoString() string { - return s.String() -} - -// SetGroups sets the Groups field's value. -func (s *ClassicLinkInstance) SetGroups(v []*GroupIdentifier) *ClassicLinkInstance { - s.Groups = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ClassicLinkInstance) SetInstanceId(v string) *ClassicLinkInstance { - s.InstanceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ClassicLinkInstance) SetTags(v []*Tag) *ClassicLinkInstance { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ClassicLinkInstance) SetVpcId(v string) *ClassicLinkInstance { - s.VpcId = &v - return s -} - -// Describes a Classic Load Balancer. -type ClassicLoadBalancer struct { - _ struct{} `type:"structure"` - - // The name of the load balancer. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` -} - -// String returns the string representation -func (s ClassicLoadBalancer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClassicLoadBalancer) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ClassicLoadBalancer) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ClassicLoadBalancer"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *ClassicLoadBalancer) SetName(v string) *ClassicLoadBalancer { - s.Name = &v - return s -} - -// Describes the Classic Load Balancers to attach to a Spot Fleet. Spot Fleet -// registers the running Spot Instances with these Classic Load Balancers. -type ClassicLoadBalancersConfig struct { - _ struct{} `type:"structure"` - - // One or more Classic Load Balancers. - // - // ClassicLoadBalancers is a required field - ClassicLoadBalancers []*ClassicLoadBalancer `locationName:"classicLoadBalancers" locationNameList:"item" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s ClassicLoadBalancersConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClassicLoadBalancersConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ClassicLoadBalancersConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ClassicLoadBalancersConfig"} - if s.ClassicLoadBalancers == nil { - invalidParams.Add(request.NewErrParamRequired("ClassicLoadBalancers")) - } - if s.ClassicLoadBalancers != nil && len(s.ClassicLoadBalancers) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClassicLoadBalancers", 1)) - } - if s.ClassicLoadBalancers != nil { - for i, v := range s.ClassicLoadBalancers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ClassicLoadBalancers", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClassicLoadBalancers sets the ClassicLoadBalancers field's value. -func (s *ClassicLoadBalancersConfig) SetClassicLoadBalancers(v []*ClassicLoadBalancer) *ClassicLoadBalancersConfig { - s.ClassicLoadBalancers = v - return s -} - -// Describes the client-specific data. -type ClientData struct { - _ struct{} `type:"structure"` - - // A user-defined comment about the disk upload. - Comment *string `type:"string"` - - // The time that the disk upload ends. - UploadEnd *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The size of the uploaded disk image, in GiB. - UploadSize *float64 `type:"double"` - - // The time that the disk upload starts. - UploadStart *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ClientData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClientData) GoString() string { - return s.String() -} - -// SetComment sets the Comment field's value. -func (s *ClientData) SetComment(v string) *ClientData { - s.Comment = &v - return s -} - -// SetUploadEnd sets the UploadEnd field's value. -func (s *ClientData) SetUploadEnd(v time.Time) *ClientData { - s.UploadEnd = &v - return s -} - -// SetUploadSize sets the UploadSize field's value. -func (s *ClientData) SetUploadSize(v float64) *ClientData { - s.UploadSize = &v - return s -} - -// SetUploadStart sets the UploadStart field's value. -func (s *ClientData) SetUploadStart(v time.Time) *ClientData { - s.UploadStart = &v - return s -} - -// Contains the parameters for ConfirmProductInstance. -type ConfirmProductInstanceInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The product code. This must be a product code that you own. - // - // ProductCode is a required field - ProductCode *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ConfirmProductInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfirmProductInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfirmProductInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfirmProductInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.ProductCode == nil { - invalidParams.Add(request.NewErrParamRequired("ProductCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ConfirmProductInstanceInput) SetDryRun(v bool) *ConfirmProductInstanceInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ConfirmProductInstanceInput) SetInstanceId(v string) *ConfirmProductInstanceInput { - s.InstanceId = &v - return s -} - -// SetProductCode sets the ProductCode field's value. -func (s *ConfirmProductInstanceInput) SetProductCode(v string) *ConfirmProductInstanceInput { - s.ProductCode = &v - return s -} - -// Contains the output of ConfirmProductInstance. -type ConfirmProductInstanceOutput struct { - _ struct{} `type:"structure"` - - // The AWS account ID of the instance owner. This is only present if the product - // code is attached to the instance. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The return value of the request. Returns true if the specified product code - // is owned by the requester and associated with the specified instance. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ConfirmProductInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfirmProductInstanceOutput) GoString() string { - return s.String() -} - -// SetOwnerId sets the OwnerId field's value. -func (s *ConfirmProductInstanceOutput) SetOwnerId(v string) *ConfirmProductInstanceOutput { - s.OwnerId = &v - return s -} - -// SetReturn sets the Return field's value. -func (s *ConfirmProductInstanceOutput) SetReturn(v bool) *ConfirmProductInstanceOutput { - s.Return = &v - return s -} - -// Describes a connection notification for a VPC endpoint or VPC endpoint service. -type ConnectionNotification struct { - _ struct{} `type:"structure"` - - // The events for the notification. Valid values are Accept, Connect, Delete, - // and Reject. - ConnectionEvents []*string `locationName:"connectionEvents" locationNameList:"item" type:"list"` - - // The ARN of the SNS topic for the notification. - ConnectionNotificationArn *string `locationName:"connectionNotificationArn" type:"string"` - - // The ID of the notification. - ConnectionNotificationId *string `locationName:"connectionNotificationId" type:"string"` - - // The state of the notification. - ConnectionNotificationState *string `locationName:"connectionNotificationState" type:"string" enum:"ConnectionNotificationState"` - - // The type of notification. - ConnectionNotificationType *string `locationName:"connectionNotificationType" type:"string" enum:"ConnectionNotificationType"` - - // The ID of the endpoint service. - ServiceId *string `locationName:"serviceId" type:"string"` - - // The ID of the VPC endpoint. - VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"` -} - -// String returns the string representation -func (s ConnectionNotification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConnectionNotification) GoString() string { - return s.String() -} - -// SetConnectionEvents sets the ConnectionEvents field's value. -func (s *ConnectionNotification) SetConnectionEvents(v []*string) *ConnectionNotification { - s.ConnectionEvents = v - return s -} - -// SetConnectionNotificationArn sets the ConnectionNotificationArn field's value. -func (s *ConnectionNotification) SetConnectionNotificationArn(v string) *ConnectionNotification { - s.ConnectionNotificationArn = &v - return s -} - -// SetConnectionNotificationId sets the ConnectionNotificationId field's value. -func (s *ConnectionNotification) SetConnectionNotificationId(v string) *ConnectionNotification { - s.ConnectionNotificationId = &v - return s -} - -// SetConnectionNotificationState sets the ConnectionNotificationState field's value. -func (s *ConnectionNotification) SetConnectionNotificationState(v string) *ConnectionNotification { - s.ConnectionNotificationState = &v - return s -} - -// SetConnectionNotificationType sets the ConnectionNotificationType field's value. -func (s *ConnectionNotification) SetConnectionNotificationType(v string) *ConnectionNotification { - s.ConnectionNotificationType = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *ConnectionNotification) SetServiceId(v string) *ConnectionNotification { - s.ServiceId = &v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *ConnectionNotification) SetVpcEndpointId(v string) *ConnectionNotification { - s.VpcEndpointId = &v - return s -} - -// Describes a conversion task. -type ConversionTask struct { - _ struct{} `type:"structure"` - - // The ID of the conversion task. - ConversionTaskId *string `locationName:"conversionTaskId" type:"string"` - - // The time when the task expires. If the upload isn't complete before the expiration - // time, we automatically cancel the task. - ExpirationTime *string `locationName:"expirationTime" type:"string"` - - // If the task is for importing an instance, this contains information about - // the import instance task. - ImportInstance *ImportInstanceTaskDetails `locationName:"importInstance" type:"structure"` - - // If the task is for importing a volume, this contains information about the - // import volume task. - ImportVolume *ImportVolumeTaskDetails `locationName:"importVolume" type:"structure"` - - // The state of the conversion task. - State *string `locationName:"state" type:"string" enum:"ConversionTaskState"` - - // The status message related to the conversion task. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // Any tags assigned to the task. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ConversionTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConversionTask) GoString() string { - return s.String() -} - -// SetConversionTaskId sets the ConversionTaskId field's value. -func (s *ConversionTask) SetConversionTaskId(v string) *ConversionTask { - s.ConversionTaskId = &v - return s -} - -// SetExpirationTime sets the ExpirationTime field's value. -func (s *ConversionTask) SetExpirationTime(v string) *ConversionTask { - s.ExpirationTime = &v - return s -} - -// SetImportInstance sets the ImportInstance field's value. -func (s *ConversionTask) SetImportInstance(v *ImportInstanceTaskDetails) *ConversionTask { - s.ImportInstance = v - return s -} - -// SetImportVolume sets the ImportVolume field's value. -func (s *ConversionTask) SetImportVolume(v *ImportVolumeTaskDetails) *ConversionTask { - s.ImportVolume = v - return s -} - -// SetState sets the State field's value. -func (s *ConversionTask) SetState(v string) *ConversionTask { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ConversionTask) SetStatusMessage(v string) *ConversionTask { - s.StatusMessage = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ConversionTask) SetTags(v []*Tag) *ConversionTask { - s.Tags = v - return s -} - -type CopyFpgaImageInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // The description for the new AFI. - Description *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The name for the new AFI. The default is the name of the source AFI. - Name *string `type:"string"` - - // The ID of the source AFI. - // - // SourceFpgaImageId is a required field - SourceFpgaImageId *string `type:"string" required:"true"` - - // The region that contains the source AFI. - // - // SourceRegion is a required field - SourceRegion *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyFpgaImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyFpgaImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyFpgaImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyFpgaImageInput"} - if s.SourceFpgaImageId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceFpgaImageId")) - } - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CopyFpgaImageInput) SetClientToken(v string) *CopyFpgaImageInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CopyFpgaImageInput) SetDescription(v string) *CopyFpgaImageInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CopyFpgaImageInput) SetDryRun(v bool) *CopyFpgaImageInput { - s.DryRun = &v - return s -} - -// SetName sets the Name field's value. -func (s *CopyFpgaImageInput) SetName(v string) *CopyFpgaImageInput { - s.Name = &v - return s -} - -// SetSourceFpgaImageId sets the SourceFpgaImageId field's value. -func (s *CopyFpgaImageInput) SetSourceFpgaImageId(v string) *CopyFpgaImageInput { - s.SourceFpgaImageId = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopyFpgaImageInput) SetSourceRegion(v string) *CopyFpgaImageInput { - s.SourceRegion = &v - return s -} - -type CopyFpgaImageOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new AFI. - FpgaImageId *string `locationName:"fpgaImageId" type:"string"` -} - -// String returns the string representation -func (s CopyFpgaImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyFpgaImageOutput) GoString() string { - return s.String() -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *CopyFpgaImageOutput) SetFpgaImageId(v string) *CopyFpgaImageOutput { - s.FpgaImageId = &v - return s -} - -// Contains the parameters for CopyImage. -type CopyImageInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `type:"string"` - - // A description for the new AMI in the destination region. - Description *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether the destination snapshots of the copied image should be - // encrypted. The default CMK for EBS is used unless a non-default AWS Key Management - // Service (AWS KMS) CMK is specified with KmsKeyId. For more information, see - // Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) - // in the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // An identifier for the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use when creating the encrypted volume. This parameter is only - // required if you want to use a non-default CMK; if this parameter is not specified, - // the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted - // flag must also be set. - // - // The CMK identifier may be provided in any of the following formats: - // - // * Key ID - // - // * Key alias, in the form alias/ExampleAlias - // - // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed - // by the region of the CMK, the AWS account ID of the CMK owner, the key - // namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // - // - // * ARN using key alias. The alias ARN contains the arn:aws:kms namespace, - // followed by the region of the CMK, the AWS account ID of the CMK owner, - // the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // - // AWS parses KmsKeyId asynchronously, meaning that the action you call may - // appear to complete even though you provided an invalid identifier. This action - // will eventually report failure. - // - // The specified CMK must exist in the region that the snapshot is being copied - // to. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The name of the new AMI in the destination region. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The ID of the AMI to copy. - // - // SourceImageId is a required field - SourceImageId *string `type:"string" required:"true"` - - // The name of the region that contains the AMI to copy. - // - // SourceRegion is a required field - SourceRegion *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyImageInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.SourceImageId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceImageId")) - } - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CopyImageInput) SetClientToken(v string) *CopyImageInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CopyImageInput) SetDescription(v string) *CopyImageInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CopyImageInput) SetDryRun(v bool) *CopyImageInput { - s.DryRun = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *CopyImageInput) SetEncrypted(v bool) *CopyImageInput { - s.Encrypted = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CopyImageInput) SetKmsKeyId(v string) *CopyImageInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CopyImageInput) SetName(v string) *CopyImageInput { - s.Name = &v - return s -} - -// SetSourceImageId sets the SourceImageId field's value. -func (s *CopyImageInput) SetSourceImageId(v string) *CopyImageInput { - s.SourceImageId = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopyImageInput) SetSourceRegion(v string) *CopyImageInput { - s.SourceRegion = &v - return s -} - -// Contains the output of CopyImage. -type CopyImageOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new AMI. - ImageId *string `locationName:"imageId" type:"string"` -} - -// String returns the string representation -func (s CopyImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyImageOutput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *CopyImageOutput) SetImageId(v string) *CopyImageOutput { - s.ImageId = &v - return s -} - -// Contains the parameters for CopySnapshot. -type CopySnapshotInput struct { - _ struct{} `type:"structure"` - - // A description for the EBS snapshot. - Description *string `type:"string"` - - // The destination region to use in the PresignedUrl parameter of a snapshot - // copy operation. This parameter is only valid for specifying the destination - // region in a PresignedUrl parameter, where it is required. - // - // CopySnapshot sends the snapshot copy to the regional endpoint that you send - // the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, - // this is specified with the --region parameter or the default region in your - // AWS configuration file). - DestinationRegion *string `locationName:"destinationRegion" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether the destination snapshot should be encrypted. You can encrypt - // a copy of an unencrypted snapshot using this flag, but you cannot use it - // to create an unencrypted copy from an encrypted snapshot. Your default CMK - // for EBS is used unless a non-default AWS Key Management Service (AWS KMS) - // CMK is specified with KmsKeyId. For more information, see Amazon EBS Encryption - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) in - // the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // An identifier for the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use when creating the encrypted volume. This parameter is only - // required if you want to use a non-default CMK; if this parameter is not specified, - // the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted - // flag must also be set. - // - // The CMK identifier may be provided in any of the following formats: - // - // * Key ID - // - // * Key alias - // - // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed - // by the region of the CMK, the AWS account ID of the CMK owner, the key - // namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // - // - // * ARN using key alias. The alias ARN contains the arn:aws:kms namespace, - // followed by the region of the CMK, the AWS account ID of the CMK owner, - // the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // - // AWS parses KmsKeyId asynchronously, meaning that the action you call may - // appear to complete even though you provided an invalid identifier. The action - // will eventually fail. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // When you copy an encrypted source snapshot using the Amazon EC2 Query API, - // you must supply a pre-signed URL. This parameter is optional for unencrypted - // snapshots. For more information, see Query Requests (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html). - // - // The PresignedUrl should use the snapshot source endpoint, the CopySnapshot - // action, and include the SourceRegion, SourceSnapshotId, and DestinationRegion - // parameters. The PresignedUrl must be signed using AWS Signature Version 4. - // Because EBS snapshots are stored in Amazon S3, the signing algorithm for - // this parameter uses the same logic that is described in Authenticating Requests - // by Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) - // in the Amazon Simple Storage Service API Reference. An invalid or improperly - // signed PresignedUrl will cause the copy operation to fail asynchronously, - // and the snapshot will move to an error state. - PresignedUrl *string `locationName:"presignedUrl" type:"string"` - - // The ID of the region that contains the snapshot to be copied. - // - // SourceRegion is a required field - SourceRegion *string `type:"string" required:"true"` - - // The ID of the EBS snapshot to copy. - // - // SourceSnapshotId is a required field - SourceSnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopySnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopySnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopySnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopySnapshotInput"} - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) - } - if s.SourceSnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceSnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CopySnapshotInput) SetDescription(v string) *CopySnapshotInput { - s.Description = &v - return s -} - -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *CopySnapshotInput) SetDestinationRegion(v string) *CopySnapshotInput { - s.DestinationRegion = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CopySnapshotInput) SetDryRun(v bool) *CopySnapshotInput { - s.DryRun = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *CopySnapshotInput) SetEncrypted(v bool) *CopySnapshotInput { - s.Encrypted = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CopySnapshotInput) SetKmsKeyId(v string) *CopySnapshotInput { - s.KmsKeyId = &v - return s -} - -// SetPresignedUrl sets the PresignedUrl field's value. -func (s *CopySnapshotInput) SetPresignedUrl(v string) *CopySnapshotInput { - s.PresignedUrl = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopySnapshotInput) SetSourceRegion(v string) *CopySnapshotInput { - s.SourceRegion = &v - return s -} - -// SetSourceSnapshotId sets the SourceSnapshotId field's value. -func (s *CopySnapshotInput) SetSourceSnapshotId(v string) *CopySnapshotInput { - s.SourceSnapshotId = &v - return s -} - -// Contains the output of CopySnapshot. -type CopySnapshotOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new snapshot. - SnapshotId *string `locationName:"snapshotId" type:"string"` -} - -// String returns the string representation -func (s CopySnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopySnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *CopySnapshotOutput) SetSnapshotId(v string) *CopySnapshotOutput { - s.SnapshotId = &v - return s -} - -// The CPU options for the instance. -type CpuOptions struct { - _ struct{} `type:"structure"` - - // The number of CPU cores for the instance. - CoreCount *int64 `locationName:"coreCount" type:"integer"` - - // The number of threads per CPU core. - ThreadsPerCore *int64 `locationName:"threadsPerCore" type:"integer"` -} - -// String returns the string representation -func (s CpuOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CpuOptions) GoString() string { - return s.String() -} - -// SetCoreCount sets the CoreCount field's value. -func (s *CpuOptions) SetCoreCount(v int64) *CpuOptions { - s.CoreCount = &v - return s -} - -// SetThreadsPerCore sets the ThreadsPerCore field's value. -func (s *CpuOptions) SetThreadsPerCore(v int64) *CpuOptions { - s.ThreadsPerCore = &v - return s -} - -// The CPU options for the instance. Both the core count and threads per core -// must be specified in the request. -type CpuOptionsRequest struct { - _ struct{} `type:"structure"` - - // The number of CPU cores for the instance. - CoreCount *int64 `type:"integer"` - - // The number of threads per CPU core. To disable Intel Hyper-Threading Technology - // for the instance, specify a value of 1. Otherwise, specify the default value - // of 2. - ThreadsPerCore *int64 `type:"integer"` -} - -// String returns the string representation -func (s CpuOptionsRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CpuOptionsRequest) GoString() string { - return s.String() -} - -// SetCoreCount sets the CoreCount field's value. -func (s *CpuOptionsRequest) SetCoreCount(v int64) *CpuOptionsRequest { - s.CoreCount = &v - return s -} - -// SetThreadsPerCore sets the ThreadsPerCore field's value. -func (s *CpuOptionsRequest) SetThreadsPerCore(v int64) *CpuOptionsRequest { - s.ThreadsPerCore = &v - return s -} - -// Contains the parameters for CreateCustomerGateway. -type CreateCustomerGatewayInput struct { - _ struct{} `type:"structure"` - - // For devices that support BGP, the customer gateway's BGP ASN. - // - // Default: 65000 - // - // BgpAsn is a required field - BgpAsn *int64 `type:"integer" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The Internet-routable IP address for the customer gateway's outside interface. - // The address must be static. - // - // PublicIp is a required field - PublicIp *string `locationName:"IpAddress" type:"string" required:"true"` - - // The type of VPN connection that this customer gateway supports (ipsec.1). - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"GatewayType"` -} - -// String returns the string representation -func (s CreateCustomerGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCustomerGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCustomerGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCustomerGatewayInput"} - if s.BgpAsn == nil { - invalidParams.Add(request.NewErrParamRequired("BgpAsn")) - } - if s.PublicIp == nil { - invalidParams.Add(request.NewErrParamRequired("PublicIp")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBgpAsn sets the BgpAsn field's value. -func (s *CreateCustomerGatewayInput) SetBgpAsn(v int64) *CreateCustomerGatewayInput { - s.BgpAsn = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateCustomerGatewayInput) SetDryRun(v bool) *CreateCustomerGatewayInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *CreateCustomerGatewayInput) SetPublicIp(v string) *CreateCustomerGatewayInput { - s.PublicIp = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateCustomerGatewayInput) SetType(v string) *CreateCustomerGatewayInput { - s.Type = &v - return s -} - -// Contains the output of CreateCustomerGateway. -type CreateCustomerGatewayOutput struct { - _ struct{} `type:"structure"` - - // Information about the customer gateway. - CustomerGateway *CustomerGateway `locationName:"customerGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateCustomerGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCustomerGatewayOutput) GoString() string { - return s.String() -} - -// SetCustomerGateway sets the CustomerGateway field's value. -func (s *CreateCustomerGatewayOutput) SetCustomerGateway(v *CustomerGateway) *CreateCustomerGatewayOutput { - s.CustomerGateway = v - return s -} - -type CreateDefaultSubnetInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which to create the default subnet. - // - // AvailabilityZone is a required field - AvailabilityZone *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` -} - -// String returns the string representation -func (s CreateDefaultSubnetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDefaultSubnetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDefaultSubnetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDefaultSubnetInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateDefaultSubnetInput) SetAvailabilityZone(v string) *CreateDefaultSubnetInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateDefaultSubnetInput) SetDryRun(v bool) *CreateDefaultSubnetInput { - s.DryRun = &v - return s -} - -type CreateDefaultSubnetOutput struct { - _ struct{} `type:"structure"` - - // Information about the subnet. - Subnet *Subnet `locationName:"subnet" type:"structure"` -} - -// String returns the string representation -func (s CreateDefaultSubnetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDefaultSubnetOutput) GoString() string { - return s.String() -} - -// SetSubnet sets the Subnet field's value. -func (s *CreateDefaultSubnetOutput) SetSubnet(v *Subnet) *CreateDefaultSubnetOutput { - s.Subnet = v - return s -} - -// Contains the parameters for CreateDefaultVpc. -type CreateDefaultVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` -} - -// String returns the string representation -func (s CreateDefaultVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDefaultVpcInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateDefaultVpcInput) SetDryRun(v bool) *CreateDefaultVpcInput { - s.DryRun = &v - return s -} - -// Contains the output of CreateDefaultVpc. -type CreateDefaultVpcOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC. - Vpc *Vpc `locationName:"vpc" type:"structure"` -} - -// String returns the string representation -func (s CreateDefaultVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDefaultVpcOutput) GoString() string { - return s.String() -} - -// SetVpc sets the Vpc field's value. -func (s *CreateDefaultVpcOutput) SetVpc(v *Vpc) *CreateDefaultVpcOutput { - s.Vpc = v - return s -} - -// Contains the parameters for CreateDhcpOptions. -type CreateDhcpOptionsInput struct { - _ struct{} `type:"structure"` - - // A DHCP configuration option. - // - // DhcpConfigurations is a required field - DhcpConfigurations []*NewDhcpConfiguration `locationName:"dhcpConfiguration" locationNameList:"item" type:"list" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s CreateDhcpOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDhcpOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDhcpOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDhcpOptionsInput"} - if s.DhcpConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("DhcpConfigurations")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDhcpConfigurations sets the DhcpConfigurations field's value. -func (s *CreateDhcpOptionsInput) SetDhcpConfigurations(v []*NewDhcpConfiguration) *CreateDhcpOptionsInput { - s.DhcpConfigurations = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateDhcpOptionsInput) SetDryRun(v bool) *CreateDhcpOptionsInput { - s.DryRun = &v - return s -} - -// Contains the output of CreateDhcpOptions. -type CreateDhcpOptionsOutput struct { - _ struct{} `type:"structure"` - - // A set of DHCP options. - DhcpOptions *DhcpOptions `locationName:"dhcpOptions" type:"structure"` -} - -// String returns the string representation -func (s CreateDhcpOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDhcpOptionsOutput) GoString() string { - return s.String() -} - -// SetDhcpOptions sets the DhcpOptions field's value. -func (s *CreateDhcpOptionsOutput) SetDhcpOptions(v *DhcpOptions) *CreateDhcpOptionsOutput { - s.DhcpOptions = v - return s -} - -type CreateEgressOnlyInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the VPC for which to create the egress-only Internet gateway. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateEgressOnlyInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEgressOnlyInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEgressOnlyInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEgressOnlyInternetGatewayInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateEgressOnlyInternetGatewayInput) SetClientToken(v string) *CreateEgressOnlyInternetGatewayInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateEgressOnlyInternetGatewayInput) SetDryRun(v bool) *CreateEgressOnlyInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateEgressOnlyInternetGatewayInput) SetVpcId(v string) *CreateEgressOnlyInternetGatewayInput { - s.VpcId = &v - return s -} - -type CreateEgressOnlyInternetGatewayOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the egress-only Internet gateway. - EgressOnlyInternetGateway *EgressOnlyInternetGateway `locationName:"egressOnlyInternetGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateEgressOnlyInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEgressOnlyInternetGatewayOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateEgressOnlyInternetGatewayOutput) SetClientToken(v string) *CreateEgressOnlyInternetGatewayOutput { - s.ClientToken = &v - return s -} - -// SetEgressOnlyInternetGateway sets the EgressOnlyInternetGateway field's value. -func (s *CreateEgressOnlyInternetGatewayOutput) SetEgressOnlyInternetGateway(v *EgressOnlyInternetGateway) *CreateEgressOnlyInternetGatewayOutput { - s.EgressOnlyInternetGateway = v - return s -} - -type CreateFleetInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // Indicates whether running instances should be terminated if the total target - // capacity of the EC2 Fleet is decreased below the current size of the EC2 - // Fleet. - ExcessCapacityTerminationPolicy *string `type:"string" enum:"FleetExcessCapacityTerminationPolicy"` - - // The configuration for the EC2 Fleet. - // - // LaunchTemplateConfigs is a required field - LaunchTemplateConfigs []*FleetLaunchTemplateConfigRequest `locationNameList:"item" type:"list" required:"true"` - - // Indicates whether EC2 Fleet should replace unhealthy instances. - ReplaceUnhealthyInstances *bool `type:"boolean"` - - // Includes SpotAllocationStrategy and SpotInstanceInterruptionBehavior inside - // this structure. - SpotOptions *SpotOptionsRequest `type:"structure"` - - // The tags for an EC2 Fleet resource. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // The TotalTargetCapacity, OnDemandTargetCapacity, SpotTargetCapacity, and - // DefaultCapacityType structure. - // - // TargetCapacitySpecification is a required field - TargetCapacitySpecification *TargetCapacitySpecificationRequest `type:"structure" required:"true"` - - // Indicates whether running instances should be terminated when the EC2 Fleet - // expires. - TerminateInstancesWithExpiration *bool `type:"boolean"` - - // The type of request. Indicates whether the EC2 Fleet only requests the target - // capacity, or also attempts to maintain it. If you request a certain target - // capacity, EC2 Fleet only places the required requests. It does not attempt - // to replenish instances if capacity is diminished, and does not submit requests - // in alternative capacity pools if capacity is unavailable. To maintain a certain - // target capacity, EC2 Fleet places the required requests to meet this target - // capacity. It also automatically replenishes any interrupted Spot Instances. - // Default: maintain. - Type *string `type:"string" enum:"FleetType"` - - // The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // The default is to start fulfilling the request immediately. - ValidFrom *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // At this point, no new EC2 Fleet requests are placed or able to fulfill the - // request. The default end date is 7 days from the current date. - ValidUntil *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s CreateFleetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFleetInput"} - if s.LaunchTemplateConfigs == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchTemplateConfigs")) - } - if s.TargetCapacitySpecification == nil { - invalidParams.Add(request.NewErrParamRequired("TargetCapacitySpecification")) - } - if s.LaunchTemplateConfigs != nil { - for i, v := range s.LaunchTemplateConfigs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchTemplateConfigs", i), err.(request.ErrInvalidParams)) - } - } - } - if s.TargetCapacitySpecification != nil { - if err := s.TargetCapacitySpecification.Validate(); err != nil { - invalidParams.AddNested("TargetCapacitySpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateFleetInput) SetClientToken(v string) *CreateFleetInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateFleetInput) SetDryRun(v bool) *CreateFleetInput { - s.DryRun = &v - return s -} - -// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. -func (s *CreateFleetInput) SetExcessCapacityTerminationPolicy(v string) *CreateFleetInput { - s.ExcessCapacityTerminationPolicy = &v - return s -} - -// SetLaunchTemplateConfigs sets the LaunchTemplateConfigs field's value. -func (s *CreateFleetInput) SetLaunchTemplateConfigs(v []*FleetLaunchTemplateConfigRequest) *CreateFleetInput { - s.LaunchTemplateConfigs = v - return s -} - -// SetReplaceUnhealthyInstances sets the ReplaceUnhealthyInstances field's value. -func (s *CreateFleetInput) SetReplaceUnhealthyInstances(v bool) *CreateFleetInput { - s.ReplaceUnhealthyInstances = &v - return s -} - -// SetSpotOptions sets the SpotOptions field's value. -func (s *CreateFleetInput) SetSpotOptions(v *SpotOptionsRequest) *CreateFleetInput { - s.SpotOptions = v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateFleetInput) SetTagSpecifications(v []*TagSpecification) *CreateFleetInput { - s.TagSpecifications = v - return s -} - -// SetTargetCapacitySpecification sets the TargetCapacitySpecification field's value. -func (s *CreateFleetInput) SetTargetCapacitySpecification(v *TargetCapacitySpecificationRequest) *CreateFleetInput { - s.TargetCapacitySpecification = v - return s -} - -// SetTerminateInstancesWithExpiration sets the TerminateInstancesWithExpiration field's value. -func (s *CreateFleetInput) SetTerminateInstancesWithExpiration(v bool) *CreateFleetInput { - s.TerminateInstancesWithExpiration = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateFleetInput) SetType(v string) *CreateFleetInput { - s.Type = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *CreateFleetInput) SetValidFrom(v time.Time) *CreateFleetInput { - s.ValidFrom = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *CreateFleetInput) SetValidUntil(v time.Time) *CreateFleetInput { - s.ValidUntil = &v - return s -} - -type CreateFleetOutput struct { - _ struct{} `type:"structure"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` -} - -// String returns the string representation -func (s CreateFleetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFleetOutput) GoString() string { - return s.String() -} - -// SetFleetId sets the FleetId field's value. -func (s *CreateFleetOutput) SetFleetId(v string) *CreateFleetOutput { - s.FleetId = &v - return s -} - -// Contains the parameters for CreateFlowLogs. -type CreateFlowLogsInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs - // log group. - // - // DeliverLogsPermissionArn is a required field - DeliverLogsPermissionArn *string `type:"string" required:"true"` - - // The name of the CloudWatch log group. - // - // LogGroupName is a required field - LogGroupName *string `type:"string" required:"true"` - - // One or more subnet, network interface, or VPC IDs. - // - // Constraints: Maximum of 1000 resources - // - // ResourceIds is a required field - ResourceIds []*string `locationName:"ResourceId" locationNameList:"item" type:"list" required:"true"` - - // The type of resource on which to create the flow log. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"FlowLogsResourceType"` - - // The type of traffic to log. - // - // TrafficType is a required field - TrafficType *string `type:"string" required:"true" enum:"TrafficType"` -} - -// String returns the string representation -func (s CreateFlowLogsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFlowLogsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFlowLogsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFlowLogsInput"} - if s.DeliverLogsPermissionArn == nil { - invalidParams.Add(request.NewErrParamRequired("DeliverLogsPermissionArn")) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.ResourceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIds")) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - if s.TrafficType == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateFlowLogsInput) SetClientToken(v string) *CreateFlowLogsInput { - s.ClientToken = &v - return s -} - -// SetDeliverLogsPermissionArn sets the DeliverLogsPermissionArn field's value. -func (s *CreateFlowLogsInput) SetDeliverLogsPermissionArn(v string) *CreateFlowLogsInput { - s.DeliverLogsPermissionArn = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CreateFlowLogsInput) SetLogGroupName(v string) *CreateFlowLogsInput { - s.LogGroupName = &v - return s -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *CreateFlowLogsInput) SetResourceIds(v []*string) *CreateFlowLogsInput { - s.ResourceIds = v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *CreateFlowLogsInput) SetResourceType(v string) *CreateFlowLogsInput { - s.ResourceType = &v - return s -} - -// SetTrafficType sets the TrafficType field's value. -func (s *CreateFlowLogsInput) SetTrafficType(v string) *CreateFlowLogsInput { - s.TrafficType = &v - return s -} - -// Contains the output of CreateFlowLogs. -type CreateFlowLogsOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // The IDs of the flow logs. - FlowLogIds []*string `locationName:"flowLogIdSet" locationNameList:"item" type:"list"` - - // Information about the flow logs that could not be created successfully. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CreateFlowLogsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFlowLogsOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateFlowLogsOutput) SetClientToken(v string) *CreateFlowLogsOutput { - s.ClientToken = &v - return s -} - -// SetFlowLogIds sets the FlowLogIds field's value. -func (s *CreateFlowLogsOutput) SetFlowLogIds(v []*string) *CreateFlowLogsOutput { - s.FlowLogIds = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *CreateFlowLogsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *CreateFlowLogsOutput { - s.Unsuccessful = v - return s -} - -type CreateFpgaImageInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // A description for the AFI. - Description *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The location of the encrypted design checkpoint in Amazon S3. The input must - // be a tarball. - // - // InputStorageLocation is a required field - InputStorageLocation *StorageLocation `type:"structure" required:"true"` - - // The location in Amazon S3 for the output logs. - LogsStorageLocation *StorageLocation `type:"structure"` - - // A name for the AFI. - Name *string `type:"string"` -} - -// String returns the string representation -func (s CreateFpgaImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFpgaImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFpgaImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFpgaImageInput"} - if s.InputStorageLocation == nil { - invalidParams.Add(request.NewErrParamRequired("InputStorageLocation")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateFpgaImageInput) SetClientToken(v string) *CreateFpgaImageInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateFpgaImageInput) SetDescription(v string) *CreateFpgaImageInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateFpgaImageInput) SetDryRun(v bool) *CreateFpgaImageInput { - s.DryRun = &v - return s -} - -// SetInputStorageLocation sets the InputStorageLocation field's value. -func (s *CreateFpgaImageInput) SetInputStorageLocation(v *StorageLocation) *CreateFpgaImageInput { - s.InputStorageLocation = v - return s -} - -// SetLogsStorageLocation sets the LogsStorageLocation field's value. -func (s *CreateFpgaImageInput) SetLogsStorageLocation(v *StorageLocation) *CreateFpgaImageInput { - s.LogsStorageLocation = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateFpgaImageInput) SetName(v string) *CreateFpgaImageInput { - s.Name = &v - return s -} - -type CreateFpgaImageOutput struct { - _ struct{} `type:"structure"` - - // The global FPGA image identifier (AGFI ID). - FpgaImageGlobalId *string `locationName:"fpgaImageGlobalId" type:"string"` - - // The FPGA image identifier (AFI ID). - FpgaImageId *string `locationName:"fpgaImageId" type:"string"` -} - -// String returns the string representation -func (s CreateFpgaImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFpgaImageOutput) GoString() string { - return s.String() -} - -// SetFpgaImageGlobalId sets the FpgaImageGlobalId field's value. -func (s *CreateFpgaImageOutput) SetFpgaImageGlobalId(v string) *CreateFpgaImageOutput { - s.FpgaImageGlobalId = &v - return s -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *CreateFpgaImageOutput) SetFpgaImageId(v string) *CreateFpgaImageOutput { - s.FpgaImageId = &v - return s -} - -// Contains the parameters for CreateImage. -type CreateImageInput struct { - _ struct{} `type:"structure"` - - // Information about one or more block device mappings. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // A description for the new image. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // A name for the new image. - // - // Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets - // ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), - // at-signs (@), or underscores(_) - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // By default, Amazon EC2 attempts to shut down and reboot the instance before - // creating the image. If the 'No Reboot' option is set, Amazon EC2 doesn't - // shut down the instance before creating the image. When this option is used, - // file system integrity on the created image can't be guaranteed. - NoReboot *bool `locationName:"noReboot" type:"boolean"` -} - -// String returns the string representation -func (s CreateImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateImageInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *CreateImageInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *CreateImageInput { - s.BlockDeviceMappings = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateImageInput) SetDescription(v string) *CreateImageInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateImageInput) SetDryRun(v bool) *CreateImageInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateImageInput) SetInstanceId(v string) *CreateImageInput { - s.InstanceId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateImageInput) SetName(v string) *CreateImageInput { - s.Name = &v - return s -} - -// SetNoReboot sets the NoReboot field's value. -func (s *CreateImageInput) SetNoReboot(v bool) *CreateImageInput { - s.NoReboot = &v - return s -} - -// Contains the output of CreateImage. -type CreateImageOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new AMI. - ImageId *string `locationName:"imageId" type:"string"` -} - -// String returns the string representation -func (s CreateImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateImageOutput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *CreateImageOutput) SetImageId(v string) *CreateImageOutput { - s.ImageId = &v - return s -} - -// Contains the parameters for CreateInstanceExportTask. -type CreateInstanceExportTaskInput struct { - _ struct{} `type:"structure"` - - // A description for the conversion task or the resource being exported. The - // maximum length is 255 bytes. - Description *string `locationName:"description" type:"string"` - - // The format and location for an instance export task. - ExportToS3Task *ExportToS3TaskSpecification `locationName:"exportToS3" type:"structure"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The target virtualization environment. - TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` -} - -// String returns the string representation -func (s CreateInstanceExportTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceExportTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInstanceExportTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInstanceExportTaskInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateInstanceExportTaskInput) SetDescription(v string) *CreateInstanceExportTaskInput { - s.Description = &v - return s -} - -// SetExportToS3Task sets the ExportToS3Task field's value. -func (s *CreateInstanceExportTaskInput) SetExportToS3Task(v *ExportToS3TaskSpecification) *CreateInstanceExportTaskInput { - s.ExportToS3Task = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateInstanceExportTaskInput) SetInstanceId(v string) *CreateInstanceExportTaskInput { - s.InstanceId = &v - return s -} - -// SetTargetEnvironment sets the TargetEnvironment field's value. -func (s *CreateInstanceExportTaskInput) SetTargetEnvironment(v string) *CreateInstanceExportTaskInput { - s.TargetEnvironment = &v - return s -} - -// Contains the output for CreateInstanceExportTask. -type CreateInstanceExportTaskOutput struct { - _ struct{} `type:"structure"` - - // Information about the instance export task. - ExportTask *ExportTask `locationName:"exportTask" type:"structure"` -} - -// String returns the string representation -func (s CreateInstanceExportTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceExportTaskOutput) GoString() string { - return s.String() -} - -// SetExportTask sets the ExportTask field's value. -func (s *CreateInstanceExportTaskOutput) SetExportTask(v *ExportTask) *CreateInstanceExportTaskOutput { - s.ExportTask = v - return s -} - -// Contains the parameters for CreateInternetGateway. -type CreateInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s CreateInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInternetGatewayInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateInternetGatewayInput) SetDryRun(v bool) *CreateInternetGatewayInput { - s.DryRun = &v - return s -} - -// Contains the output of CreateInternetGateway. -type CreateInternetGatewayOutput struct { - _ struct{} `type:"structure"` - - // Information about the Internet gateway. - InternetGateway *InternetGateway `locationName:"internetGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInternetGatewayOutput) GoString() string { - return s.String() -} - -// SetInternetGateway sets the InternetGateway field's value. -func (s *CreateInternetGatewayOutput) SetInternetGateway(v *InternetGateway) *CreateInternetGatewayOutput { - s.InternetGateway = v - return s -} - -// Contains the parameters for CreateKeyPair. -type CreateKeyPairInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // A unique name for the key pair. - // - // Constraints: Up to 255 ASCII characters - // - // KeyName is a required field - KeyName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateKeyPairInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateKeyPairInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateKeyPairInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateKeyPairInput"} - if s.KeyName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateKeyPairInput) SetDryRun(v bool) *CreateKeyPairInput { - s.DryRun = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *CreateKeyPairInput) SetKeyName(v string) *CreateKeyPairInput { - s.KeyName = &v - return s -} - -// Describes a key pair. -type CreateKeyPairOutput struct { - _ struct{} `type:"structure"` - - // The SHA-1 digest of the DER encoded private key. - KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` - - // An unencrypted PEM encoded RSA private key. - KeyMaterial *string `locationName:"keyMaterial" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` -} - -// String returns the string representation -func (s CreateKeyPairOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateKeyPairOutput) GoString() string { - return s.String() -} - -// SetKeyFingerprint sets the KeyFingerprint field's value. -func (s *CreateKeyPairOutput) SetKeyFingerprint(v string) *CreateKeyPairOutput { - s.KeyFingerprint = &v - return s -} - -// SetKeyMaterial sets the KeyMaterial field's value. -func (s *CreateKeyPairOutput) SetKeyMaterial(v string) *CreateKeyPairOutput { - s.KeyMaterial = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *CreateKeyPairOutput) SetKeyName(v string) *CreateKeyPairOutput { - s.KeyName = &v - return s -} - -type CreateLaunchTemplateInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The information for the launch template. - // - // LaunchTemplateData is a required field - LaunchTemplateData *RequestLaunchTemplateData `type:"structure" required:"true"` - - // A name for the launch template. - // - // LaunchTemplateName is a required field - LaunchTemplateName *string `min:"3" type:"string" required:"true"` - - // A description for the first version of the launch template. - VersionDescription *string `type:"string"` -} - -// String returns the string representation -func (s CreateLaunchTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLaunchTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLaunchTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLaunchTemplateInput"} - if s.LaunchTemplateData == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchTemplateData")) - } - if s.LaunchTemplateName == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchTemplateName")) - } - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - if s.LaunchTemplateData != nil { - if err := s.LaunchTemplateData.Validate(); err != nil { - invalidParams.AddNested("LaunchTemplateData", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateLaunchTemplateInput) SetClientToken(v string) *CreateLaunchTemplateInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateLaunchTemplateInput) SetDryRun(v bool) *CreateLaunchTemplateInput { - s.DryRun = &v - return s -} - -// SetLaunchTemplateData sets the LaunchTemplateData field's value. -func (s *CreateLaunchTemplateInput) SetLaunchTemplateData(v *RequestLaunchTemplateData) *CreateLaunchTemplateInput { - s.LaunchTemplateData = v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *CreateLaunchTemplateInput) SetLaunchTemplateName(v string) *CreateLaunchTemplateInput { - s.LaunchTemplateName = &v - return s -} - -// SetVersionDescription sets the VersionDescription field's value. -func (s *CreateLaunchTemplateInput) SetVersionDescription(v string) *CreateLaunchTemplateInput { - s.VersionDescription = &v - return s -} - -type CreateLaunchTemplateOutput struct { - _ struct{} `type:"structure"` - - // Information about the launch template. - LaunchTemplate *LaunchTemplate `locationName:"launchTemplate" type:"structure"` -} - -// String returns the string representation -func (s CreateLaunchTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLaunchTemplateOutput) GoString() string { - return s.String() -} - -// SetLaunchTemplate sets the LaunchTemplate field's value. -func (s *CreateLaunchTemplateOutput) SetLaunchTemplate(v *LaunchTemplate) *CreateLaunchTemplateOutput { - s.LaunchTemplate = v - return s -} - -type CreateLaunchTemplateVersionInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The information for the launch template. - // - // LaunchTemplateData is a required field - LaunchTemplateData *RequestLaunchTemplateData `type:"structure" required:"true"` - - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` - - // The version number of the launch template version on which to base the new - // version. The new version inherits the same launch parameters as the source - // version, except for parameters that you specify in LaunchTemplateData. - SourceVersion *string `type:"string"` - - // A description for the version of the launch template. - VersionDescription *string `type:"string"` -} - -// String returns the string representation -func (s CreateLaunchTemplateVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLaunchTemplateVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLaunchTemplateVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLaunchTemplateVersionInput"} - if s.LaunchTemplateData == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchTemplateData")) - } - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - if s.LaunchTemplateData != nil { - if err := s.LaunchTemplateData.Validate(); err != nil { - invalidParams.AddNested("LaunchTemplateData", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateLaunchTemplateVersionInput) SetClientToken(v string) *CreateLaunchTemplateVersionInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateLaunchTemplateVersionInput) SetDryRun(v bool) *CreateLaunchTemplateVersionInput { - s.DryRun = &v - return s -} - -// SetLaunchTemplateData sets the LaunchTemplateData field's value. -func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateData(v *RequestLaunchTemplateData) *CreateLaunchTemplateVersionInput { - s.LaunchTemplateData = v - return s -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateId(v string) *CreateLaunchTemplateVersionInput { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateName(v string) *CreateLaunchTemplateVersionInput { - s.LaunchTemplateName = &v - return s -} - -// SetSourceVersion sets the SourceVersion field's value. -func (s *CreateLaunchTemplateVersionInput) SetSourceVersion(v string) *CreateLaunchTemplateVersionInput { - s.SourceVersion = &v - return s -} - -// SetVersionDescription sets the VersionDescription field's value. -func (s *CreateLaunchTemplateVersionInput) SetVersionDescription(v string) *CreateLaunchTemplateVersionInput { - s.VersionDescription = &v - return s -} - -type CreateLaunchTemplateVersionOutput struct { - _ struct{} `type:"structure"` - - // Information about the launch template version. - LaunchTemplateVersion *LaunchTemplateVersion `locationName:"launchTemplateVersion" type:"structure"` -} - -// String returns the string representation -func (s CreateLaunchTemplateVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLaunchTemplateVersionOutput) GoString() string { - return s.String() -} - -// SetLaunchTemplateVersion sets the LaunchTemplateVersion field's value. -func (s *CreateLaunchTemplateVersionOutput) SetLaunchTemplateVersion(v *LaunchTemplateVersion) *CreateLaunchTemplateVersionOutput { - s.LaunchTemplateVersion = v - return s -} - -// Contains the parameters for CreateNatGateway. -type CreateNatGatewayInput struct { - _ struct{} `type:"structure"` - - // The allocation ID of an Elastic IP address to associate with the NAT gateway. - // If the Elastic IP address is associated with another resource, you must first - // disassociate it. - // - // AllocationId is a required field - AllocationId *string `type:"string" required:"true"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraint: Maximum 64 ASCII characters. - ClientToken *string `type:"string"` - - // The subnet in which to create the NAT gateway. - // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateNatGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNatGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNatGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNatGatewayInput"} - if s.AllocationId == nil { - invalidParams.Add(request.NewErrParamRequired("AllocationId")) - } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllocationId sets the AllocationId field's value. -func (s *CreateNatGatewayInput) SetAllocationId(v string) *CreateNatGatewayInput { - s.AllocationId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateNatGatewayInput) SetClientToken(v string) *CreateNatGatewayInput { - s.ClientToken = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *CreateNatGatewayInput) SetSubnetId(v string) *CreateNatGatewayInput { - s.SubnetId = &v - return s -} - -// Contains the output of CreateNatGateway. -type CreateNatGatewayOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure the idempotency of the request. - // Only returned if a client token was provided in the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the NAT gateway. - NatGateway *NatGateway `locationName:"natGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateNatGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNatGatewayOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateNatGatewayOutput) SetClientToken(v string) *CreateNatGatewayOutput { - s.ClientToken = &v - return s -} - -// SetNatGateway sets the NatGateway field's value. -func (s *CreateNatGatewayOutput) SetNatGateway(v *NatGateway) *CreateNatGatewayOutput { - s.NatGateway = v - return s -} - -// Contains the parameters for CreateNetworkAclEntry. -type CreateNetworkAclEntryInput struct { - _ struct{} `type:"structure"` - - // The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether this is an egress rule (rule is applied to traffic leaving - // the subnet). - // - // Egress is a required field - Egress *bool `locationName:"egress" type:"boolean" required:"true"` - - // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying the - // ICMP protocol, or protocol 58 (ICMPv6) with an IPv6 CIDR block. - IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` - - // The IPv6 network range to allow or deny, in CIDR notation (for example 2001:db8:1234:1a00::/64). - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // The ID of the network ACL. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - - // TCP or UDP protocols: The range of ports the rule applies to. - PortRange *PortRange `locationName:"portRange" type:"structure"` - - // The protocol. A value of -1 or all means all protocols. If you specify all, - // -1, or a protocol number other than 6 (tcp), 17 (udp), or 1 (icmp), traffic - // on all ports is allowed, regardless of any ports or ICMP types or codes you - // specify. If you specify protocol 58 (ICMPv6) and specify an IPv4 CIDR block, - // traffic for all ICMP types and codes allowed, regardless of any that you - // specify. If you specify protocol 58 (ICMPv6) and specify an IPv6 CIDR block, - // you must specify an ICMP type and code. - // - // Protocol is a required field - Protocol *string `locationName:"protocol" type:"string" required:"true"` - - // Indicates whether to allow or deny the traffic that matches the rule. - // - // RuleAction is a required field - RuleAction *string `locationName:"ruleAction" type:"string" required:"true" enum:"RuleAction"` - - // The rule number for the entry (for example, 100). ACL entries are processed - // in ascending order by rule number. - // - // Constraints: Positive integer from 1 to 32766. The range 32767 to 65535 is - // reserved for internal use. - // - // RuleNumber is a required field - RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` -} - -// String returns the string representation -func (s CreateNetworkAclEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkAclEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkAclEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkAclEntryInput"} - if s.Egress == nil { - invalidParams.Add(request.NewErrParamRequired("Egress")) - } - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - if s.RuleAction == nil { - invalidParams.Add(request.NewErrParamRequired("RuleAction")) - } - if s.RuleNumber == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *CreateNetworkAclEntryInput) SetCidrBlock(v string) *CreateNetworkAclEntryInput { - s.CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateNetworkAclEntryInput) SetDryRun(v bool) *CreateNetworkAclEntryInput { - s.DryRun = &v - return s -} - -// SetEgress sets the Egress field's value. -func (s *CreateNetworkAclEntryInput) SetEgress(v bool) *CreateNetworkAclEntryInput { - s.Egress = &v - return s -} - -// SetIcmpTypeCode sets the IcmpTypeCode field's value. -func (s *CreateNetworkAclEntryInput) SetIcmpTypeCode(v *IcmpTypeCode) *CreateNetworkAclEntryInput { - s.IcmpTypeCode = v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *CreateNetworkAclEntryInput) SetIpv6CidrBlock(v string) *CreateNetworkAclEntryInput { - s.Ipv6CidrBlock = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *CreateNetworkAclEntryInput) SetNetworkAclId(v string) *CreateNetworkAclEntryInput { - s.NetworkAclId = &v - return s -} - -// SetPortRange sets the PortRange field's value. -func (s *CreateNetworkAclEntryInput) SetPortRange(v *PortRange) *CreateNetworkAclEntryInput { - s.PortRange = v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *CreateNetworkAclEntryInput) SetProtocol(v string) *CreateNetworkAclEntryInput { - s.Protocol = &v - return s -} - -// SetRuleAction sets the RuleAction field's value. -func (s *CreateNetworkAclEntryInput) SetRuleAction(v string) *CreateNetworkAclEntryInput { - s.RuleAction = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *CreateNetworkAclEntryInput) SetRuleNumber(v int64) *CreateNetworkAclEntryInput { - s.RuleNumber = &v - return s -} - -type CreateNetworkAclEntryOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateNetworkAclEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkAclEntryOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateNetworkAcl. -type CreateNetworkAclInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateNetworkAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkAclInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateNetworkAclInput) SetDryRun(v bool) *CreateNetworkAclInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateNetworkAclInput) SetVpcId(v string) *CreateNetworkAclInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateNetworkAcl. -type CreateNetworkAclOutput struct { - _ struct{} `type:"structure"` - - // Information about the network ACL. - NetworkAcl *NetworkAcl `locationName:"networkAcl" type:"structure"` -} - -// String returns the string representation -func (s CreateNetworkAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkAclOutput) GoString() string { - return s.String() -} - -// SetNetworkAcl sets the NetworkAcl field's value. -func (s *CreateNetworkAclOutput) SetNetworkAcl(v *NetworkAcl) *CreateNetworkAclOutput { - s.NetworkAcl = v - return s -} - -// Contains the parameters for CreateNetworkInterface. -type CreateNetworkInterfaceInput struct { - _ struct{} `type:"structure"` - - // A description for the network interface. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IDs of one or more security groups. - Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // The number of IPv6 addresses to assign to a network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. You can't - // use this option if specifying specific IPv6 addresses. If your subnet has - // the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 - // to override this setting. - Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"` - - // One or more specific IPv6 addresses from the IPv6 CIDR block range of your - // subnet. You can't use this option if you're specifying a number of IPv6 addresses. - Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6Addresses" locationNameList:"item" type:"list"` - - // The primary private IPv4 address of the network interface. If you don't specify - // an IPv4 address, Amazon EC2 selects one for you from the subnet's IPv4 CIDR - // range. If you specify an IP address, you cannot indicate any IP addresses - // specified in privateIpAddresses as primary (only one IP address can be designated - // as primary). - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // One or more private IPv4 addresses. - PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddresses" locationNameList:"item" type:"list"` - - // The number of secondary private IPv4 addresses to assign to a network interface. - // When you specify a number of secondary IPv4 addresses, Amazon EC2 selects - // these IP addresses within the subnet's IPv4 CIDR range. You can't specify - // this option and specify more than one private IP address using privateIpAddresses. - // - // The number of IP addresses you can assign to a network interface varies by - // instance type. For more information, see IP Addresses Per ENI Per Instance - // Type (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) - // in the Amazon Virtual Private Cloud User Guide. - SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` - - // The ID of the subnet to associate with the network interface. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateNetworkInterfaceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkInterfaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkInterfaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkInterfaceInput"} - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - if s.PrivateIpAddresses != nil { - for i, v := range s.PrivateIpAddresses { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PrivateIpAddresses", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateNetworkInterfaceInput) SetDescription(v string) *CreateNetworkInterfaceInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateNetworkInterfaceInput) SetDryRun(v bool) *CreateNetworkInterfaceInput { - s.DryRun = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *CreateNetworkInterfaceInput) SetGroups(v []*string) *CreateNetworkInterfaceInput { - s.Groups = v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *CreateNetworkInterfaceInput) SetIpv6AddressCount(v int64) *CreateNetworkInterfaceInput { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *CreateNetworkInterfaceInput) SetIpv6Addresses(v []*InstanceIpv6Address) *CreateNetworkInterfaceInput { - s.Ipv6Addresses = v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *CreateNetworkInterfaceInput) SetPrivateIpAddress(v string) *CreateNetworkInterfaceInput { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *CreateNetworkInterfaceInput) SetPrivateIpAddresses(v []*PrivateIpAddressSpecification) *CreateNetworkInterfaceInput { - s.PrivateIpAddresses = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *CreateNetworkInterfaceInput) SetSecondaryPrivateIpAddressCount(v int64) *CreateNetworkInterfaceInput { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *CreateNetworkInterfaceInput) SetSubnetId(v string) *CreateNetworkInterfaceInput { - s.SubnetId = &v - return s -} - -// Contains the output of CreateNetworkInterface. -type CreateNetworkInterfaceOutput struct { - _ struct{} `type:"structure"` - - // Information about the network interface. - NetworkInterface *NetworkInterface `locationName:"networkInterface" type:"structure"` -} - -// String returns the string representation -func (s CreateNetworkInterfaceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkInterfaceOutput) GoString() string { - return s.String() -} - -// SetNetworkInterface sets the NetworkInterface field's value. -func (s *CreateNetworkInterfaceOutput) SetNetworkInterface(v *NetworkInterface) *CreateNetworkInterfaceOutput { - s.NetworkInterface = v - return s -} - -// Contains the parameters for CreateNetworkInterfacePermission. -type CreateNetworkInterfacePermissionInput struct { - _ struct{} `type:"structure"` - - // The AWS account ID. - AwsAccountId *string `type:"string"` - - // The AWS service. Currently not supported. - AwsService *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `type:"string" required:"true"` - - // The type of permission to grant. - // - // Permission is a required field - Permission *string `type:"string" required:"true" enum:"InterfacePermissionType"` -} - -// String returns the string representation -func (s CreateNetworkInterfacePermissionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkInterfacePermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkInterfacePermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkInterfacePermissionInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - if s.Permission == nil { - invalidParams.Add(request.NewErrParamRequired("Permission")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *CreateNetworkInterfacePermissionInput) SetAwsAccountId(v string) *CreateNetworkInterfacePermissionInput { - s.AwsAccountId = &v - return s -} - -// SetAwsService sets the AwsService field's value. -func (s *CreateNetworkInterfacePermissionInput) SetAwsService(v string) *CreateNetworkInterfacePermissionInput { - s.AwsService = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateNetworkInterfacePermissionInput) SetDryRun(v bool) *CreateNetworkInterfacePermissionInput { - s.DryRun = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *CreateNetworkInterfacePermissionInput) SetNetworkInterfaceId(v string) *CreateNetworkInterfacePermissionInput { - s.NetworkInterfaceId = &v - return s -} - -// SetPermission sets the Permission field's value. -func (s *CreateNetworkInterfacePermissionInput) SetPermission(v string) *CreateNetworkInterfacePermissionInput { - s.Permission = &v - return s -} - -// Contains the output of CreateNetworkInterfacePermission. -type CreateNetworkInterfacePermissionOutput struct { - _ struct{} `type:"structure"` - - // Information about the permission for the network interface. - InterfacePermission *NetworkInterfacePermission `locationName:"interfacePermission" type:"structure"` -} - -// String returns the string representation -func (s CreateNetworkInterfacePermissionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkInterfacePermissionOutput) GoString() string { - return s.String() -} - -// SetInterfacePermission sets the InterfacePermission field's value. -func (s *CreateNetworkInterfacePermissionOutput) SetInterfacePermission(v *NetworkInterfacePermission) *CreateNetworkInterfacePermissionOutput { - s.InterfacePermission = v - return s -} - -// Contains the parameters for CreatePlacementGroup. -type CreatePlacementGroupInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // A name for the placement group. Must be unique within the scope of your account - // for the region. - // - // Constraints: Up to 255 ASCII characters - // - // GroupName is a required field - GroupName *string `locationName:"groupName" type:"string" required:"true"` - - // The placement strategy. - // - // Strategy is a required field - Strategy *string `locationName:"strategy" type:"string" required:"true" enum:"PlacementStrategy"` -} - -// String returns the string representation -func (s CreatePlacementGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlacementGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePlacementGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePlacementGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.Strategy == nil { - invalidParams.Add(request.NewErrParamRequired("Strategy")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreatePlacementGroupInput) SetDryRun(v bool) *CreatePlacementGroupInput { - s.DryRun = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreatePlacementGroupInput) SetGroupName(v string) *CreatePlacementGroupInput { - s.GroupName = &v - return s -} - -// SetStrategy sets the Strategy field's value. -func (s *CreatePlacementGroupInput) SetStrategy(v string) *CreatePlacementGroupInput { - s.Strategy = &v - return s -} - -type CreatePlacementGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreatePlacementGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlacementGroupOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateReservedInstancesListing. -type CreateReservedInstancesListingInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of your - // listings. This helps avoid duplicate listings. For more information, see - // Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // ClientToken is a required field - ClientToken *string `locationName:"clientToken" type:"string" required:"true"` - - // The number of instances that are a part of a Reserved Instance account to - // be listed in the Reserved Instance Marketplace. This number should be less - // than or equal to the instance count associated with the Reserved Instance - // ID specified in this call. - // - // InstanceCount is a required field - InstanceCount *int64 `locationName:"instanceCount" type:"integer" required:"true"` - - // A list specifying the price of the Standard Reserved Instance for each month - // remaining in the Reserved Instance term. - // - // PriceSchedules is a required field - PriceSchedules []*PriceScheduleSpecification `locationName:"priceSchedules" locationNameList:"item" type:"list" required:"true"` - - // The ID of the active Standard Reserved Instance. - // - // ReservedInstancesId is a required field - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateReservedInstancesListingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReservedInstancesListingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReservedInstancesListingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReservedInstancesListingInput"} - if s.ClientToken == nil { - invalidParams.Add(request.NewErrParamRequired("ClientToken")) - } - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.PriceSchedules == nil { - invalidParams.Add(request.NewErrParamRequired("PriceSchedules")) - } - if s.ReservedInstancesId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateReservedInstancesListingInput) SetClientToken(v string) *CreateReservedInstancesListingInput { - s.ClientToken = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *CreateReservedInstancesListingInput) SetInstanceCount(v int64) *CreateReservedInstancesListingInput { - s.InstanceCount = &v - return s -} - -// SetPriceSchedules sets the PriceSchedules field's value. -func (s *CreateReservedInstancesListingInput) SetPriceSchedules(v []*PriceScheduleSpecification) *CreateReservedInstancesListingInput { - s.PriceSchedules = v - return s -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *CreateReservedInstancesListingInput) SetReservedInstancesId(v string) *CreateReservedInstancesListingInput { - s.ReservedInstancesId = &v - return s -} - -// Contains the output of CreateReservedInstancesListing. -type CreateReservedInstancesListingOutput struct { - _ struct{} `type:"structure"` - - // Information about the Standard Reserved Instance listing. - ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CreateReservedInstancesListingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReservedInstancesListingOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesListings sets the ReservedInstancesListings field's value. -func (s *CreateReservedInstancesListingOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *CreateReservedInstancesListingOutput { - s.ReservedInstancesListings = v - return s -} - -// Contains the parameters for CreateRoute. -type CreateRouteInput struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR address block used for the destination match. Routing decisions - // are based on the most specific match. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // The IPv6 CIDR block used for the destination match. Routing decisions are - // based on the most specific match. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // [IPv6 traffic only] The ID of an egress-only Internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` - - // The ID of an Internet gateway or virtual private gateway attached to your - // VPC. - GatewayId *string `locationName:"gatewayId" type:"string"` - - // The ID of a NAT instance in your VPC. The operation fails if you specify - // an instance ID unless exactly one network interface is attached. - InstanceId *string `locationName:"instanceId" type:"string"` - - // [IPv4 traffic only] The ID of a NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` - - // The ID of a network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the route table for the route. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` - - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s CreateRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRouteInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *CreateRouteInput) SetDestinationCidrBlock(v string) *CreateRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *CreateRouteInput) SetDestinationIpv6CidrBlock(v string) *CreateRouteInput { - s.DestinationIpv6CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateRouteInput) SetDryRun(v bool) *CreateRouteInput { - s.DryRun = &v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *CreateRouteInput) SetEgressOnlyInternetGatewayId(v string) *CreateRouteInput { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// SetGatewayId sets the GatewayId field's value. -func (s *CreateRouteInput) SetGatewayId(v string) *CreateRouteInput { - s.GatewayId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateRouteInput) SetInstanceId(v string) *CreateRouteInput { - s.InstanceId = &v - return s -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *CreateRouteInput) SetNatGatewayId(v string) *CreateRouteInput { - s.NatGatewayId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *CreateRouteInput) SetNetworkInterfaceId(v string) *CreateRouteInput { - s.NetworkInterfaceId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *CreateRouteInput) SetRouteTableId(v string) *CreateRouteInput { - s.RouteTableId = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *CreateRouteInput) SetVpcPeeringConnectionId(v string) *CreateRouteInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Contains the output of CreateRoute. -type CreateRouteOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s CreateRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRouteOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *CreateRouteOutput) SetReturn(v bool) *CreateRouteOutput { - s.Return = &v - return s -} - -// Contains the parameters for CreateRouteTable. -type CreateRouteTableInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRouteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRouteTableInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateRouteTableInput) SetDryRun(v bool) *CreateRouteTableInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateRouteTableInput) SetVpcId(v string) *CreateRouteTableInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateRouteTable. -type CreateRouteTableOutput struct { - _ struct{} `type:"structure"` - - // Information about the route table. - RouteTable *RouteTable `locationName:"routeTable" type:"structure"` -} - -// String returns the string representation -func (s CreateRouteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRouteTableOutput) GoString() string { - return s.String() -} - -// SetRouteTable sets the RouteTable field's value. -func (s *CreateRouteTableOutput) SetRouteTable(v *RouteTable) *CreateRouteTableOutput { - s.RouteTable = v - return s -} - -// Contains the parameters for CreateSecurityGroup. -type CreateSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // A description for the security group. This is informational only. - // - // Constraints: Up to 255 characters in length - // - // Constraints for EC2-Classic: ASCII characters - // - // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* - // - // Description is a required field - Description *string `locationName:"GroupDescription" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The name of the security group. - // - // Constraints: Up to 255 characters in length. Cannot start with sg-. - // - // Constraints for EC2-Classic: ASCII characters - // - // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* - // - // GroupName is a required field - GroupName *string `type:"string" required:"true"` - - // [EC2-VPC] The ID of the VPC. Required for EC2-VPC. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s CreateSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSecurityGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSecurityGroupInput"} - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateSecurityGroupInput) SetDescription(v string) *CreateSecurityGroupInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSecurityGroupInput) SetDryRun(v bool) *CreateSecurityGroupInput { - s.DryRun = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreateSecurityGroupInput) SetGroupName(v string) *CreateSecurityGroupInput { - s.GroupName = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateSecurityGroupInput) SetVpcId(v string) *CreateSecurityGroupInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateSecurityGroup. -type CreateSecurityGroupOutput struct { - _ struct{} `type:"structure"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` -} - -// String returns the string representation -func (s CreateSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSecurityGroupOutput) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *CreateSecurityGroupOutput) SetGroupId(v string) *CreateSecurityGroupOutput { - s.GroupId = &v - return s -} - -// Contains the parameters for CreateSnapshot. -type CreateSnapshotInput struct { - _ struct{} `type:"structure"` - - // A description for the snapshot. - Description *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The tags to apply to the snapshot during creation. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // The ID of the EBS volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateSnapshotInput) SetDescription(v string) *CreateSnapshotInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSnapshotInput) SetDryRun(v bool) *CreateSnapshotInput { - s.DryRun = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateSnapshotInput) SetTagSpecifications(v []*TagSpecification) *CreateSnapshotInput { - s.TagSpecifications = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *CreateSnapshotInput) SetVolumeId(v string) *CreateSnapshotInput { - s.VolumeId = &v - return s -} - -// Contains the parameters for CreateSpotDatafeedSubscription. -type CreateSpotDatafeedSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket in which to store the Spot Instance data feed. - // - // Bucket is a required field - Bucket *string `locationName:"bucket" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // A prefix for the data feed file names. - Prefix *string `locationName:"prefix" type:"string"` -} - -// String returns the string representation -func (s CreateSpotDatafeedSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSpotDatafeedSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSpotDatafeedSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSpotDatafeedSubscriptionInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *CreateSpotDatafeedSubscriptionInput) SetBucket(v string) *CreateSpotDatafeedSubscriptionInput { - s.Bucket = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSpotDatafeedSubscriptionInput) SetDryRun(v bool) *CreateSpotDatafeedSubscriptionInput { - s.DryRun = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *CreateSpotDatafeedSubscriptionInput) SetPrefix(v string) *CreateSpotDatafeedSubscriptionInput { - s.Prefix = &v - return s -} - -// Contains the output of CreateSpotDatafeedSubscription. -type CreateSpotDatafeedSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The Spot Instance data feed subscription. - SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` -} - -// String returns the string representation -func (s CreateSpotDatafeedSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSpotDatafeedSubscriptionOutput) GoString() string { - return s.String() -} - -// SetSpotDatafeedSubscription sets the SpotDatafeedSubscription field's value. -func (s *CreateSpotDatafeedSubscriptionOutput) SetSpotDatafeedSubscription(v *SpotDatafeedSubscription) *CreateSpotDatafeedSubscriptionOutput { - s.SpotDatafeedSubscription = v - return s -} - -// Contains the parameters for CreateSubnet. -type CreateSubnetInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone for the subnet. - // - // Default: AWS selects one for you. If you create more than one subnet in your - // VPC, we may not necessarily select a different zone for each subnet. - AvailabilityZone *string `type:"string"` - - // The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. - // - // CidrBlock is a required field - CidrBlock *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IPv6 network range for the subnet, in CIDR notation. The subnet size - // must use a /64 prefix length. - Ipv6CidrBlock *string `type:"string"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSubnetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSubnetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSubnetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSubnetInput"} - if s.CidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("CidrBlock")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateSubnetInput) SetAvailabilityZone(v string) *CreateSubnetInput { - s.AvailabilityZone = &v - return s -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *CreateSubnetInput) SetCidrBlock(v string) *CreateSubnetInput { - s.CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSubnetInput) SetDryRun(v bool) *CreateSubnetInput { - s.DryRun = &v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *CreateSubnetInput) SetIpv6CidrBlock(v string) *CreateSubnetInput { - s.Ipv6CidrBlock = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateSubnetInput) SetVpcId(v string) *CreateSubnetInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateSubnet. -type CreateSubnetOutput struct { - _ struct{} `type:"structure"` - - // Information about the subnet. - Subnet *Subnet `locationName:"subnet" type:"structure"` -} - -// String returns the string representation -func (s CreateSubnetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSubnetOutput) GoString() string { - return s.String() -} - -// SetSubnet sets the Subnet field's value. -func (s *CreateSubnetOutput) SetSubnet(v *Subnet) *CreateSubnetOutput { - s.Subnet = v - return s -} - -// Contains the parameters for CreateTags. -type CreateTagsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IDs of one or more resources to tag. For example, ami-1a2b3c4d. - // - // Resources is a required field - Resources []*string `locationName:"ResourceId" type:"list" required:"true"` - - // One or more tags. The value parameter is required, but if you don't want - // the tag to have a value, specify the parameter with no value, and we set - // the value to an empty string. - // - // Tags is a required field - Tags []*Tag `locationName:"Tag" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s CreateTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTagsInput"} - if s.Resources == nil { - invalidParams.Add(request.NewErrParamRequired("Resources")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateTagsInput) SetDryRun(v bool) *CreateTagsInput { - s.DryRun = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *CreateTagsInput) SetResources(v []*string) *CreateTagsInput { - s.Resources = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateTagsInput) SetTags(v []*Tag) *CreateTagsInput { - s.Tags = v - return s -} - -type CreateTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTagsOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateVolume. -type CreateVolumeInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which to create the volume. Use DescribeAvailabilityZones - // to list the Availability Zones that are currently available to you. - // - // AvailabilityZone is a required field - AvailabilityZone *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes - // may only be attached to instances that support Amazon EBS encryption. Volumes - // that are created from encrypted snapshots are automatically encrypted. There - // is no way to create an encrypted volume from an unencrypted snapshot or vice - // versa. If your AMI uses encrypted volumes, you can only launch it on supported - // instance types. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) - // in the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The number of I/O operations per second (IOPS) to provision for the volume, - // with a maximum ratio of 50 IOPS/GiB. Range is 100 to 32000 IOPS for volumes - // in most regions. For exceptions, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html). - // - // This parameter is valid only for Provisioned IOPS SSD (io1) volumes. - Iops *int64 `type:"integer"` - - // An identifier for the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use when creating the encrypted volume. This parameter is only - // required if you want to use a non-default CMK; if this parameter is not specified, - // the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted - // flag must also be set. - // - // The CMK identifier may be provided in any of the following formats: - // - // * Key ID - // - // * Key alias - // - // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed - // by the region of the CMK, the AWS account ID of the CMK owner, the key - // namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // - // - // * ARN using key alias. The alias ARN contains the arn:aws:kms namespace, - // followed by the region of the CMK, the AWS account ID of the CMK owner, - // the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // - // AWS parses KmsKeyId asynchronously, meaning that the action you call may - // appear to complete even though you provided an invalid identifier. The action - // will eventually fail. - KmsKeyId *string `type:"string"` - - // The size of the volume, in GiBs. - // - // Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 - // for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size - // must be equal to or larger than the snapshot size. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - Size *int64 `type:"integer"` - - // The snapshot from which to create the volume. - SnapshotId *string `type:"string"` - - // The tags to apply to the volume during creation. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned - // IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard - // for Magnetic volumes. - // - // Defaults: If no volume type is specified, the default is standard in us-east-1, - // eu-west-1, eu-central-1, us-west-2, us-west-1, sa-east-1, ap-northeast-1, - // ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-south-1, us-gov-west-1, - // and cn-north-1. In all other regions, EBS defaults to gp2. - VolumeType *string `type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s CreateVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVolumeInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateVolumeInput) SetAvailabilityZone(v string) *CreateVolumeInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVolumeInput) SetDryRun(v bool) *CreateVolumeInput { - s.DryRun = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *CreateVolumeInput) SetEncrypted(v bool) *CreateVolumeInput { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *CreateVolumeInput) SetIops(v int64) *CreateVolumeInput { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateVolumeInput) SetKmsKeyId(v string) *CreateVolumeInput { - s.KmsKeyId = &v - return s -} - -// SetSize sets the Size field's value. -func (s *CreateVolumeInput) SetSize(v int64) *CreateVolumeInput { - s.Size = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *CreateVolumeInput) SetSnapshotId(v string) *CreateVolumeInput { - s.SnapshotId = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateVolumeInput) SetTagSpecifications(v []*TagSpecification) *CreateVolumeInput { - s.TagSpecifications = v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *CreateVolumeInput) SetVolumeType(v string) *CreateVolumeInput { - s.VolumeType = &v - return s -} - -// Describes the user or group to be added or removed from the permissions for -// a volume. -type CreateVolumePermission struct { - _ struct{} `type:"structure"` - - // The specific group that is to be added or removed from a volume's list of - // create volume permissions. - Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` - - // The specific AWS account ID that is to be added or removed from a volume's - // list of create volume permissions. - UserId *string `locationName:"userId" type:"string"` -} - -// String returns the string representation -func (s CreateVolumePermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVolumePermission) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *CreateVolumePermission) SetGroup(v string) *CreateVolumePermission { - s.Group = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *CreateVolumePermission) SetUserId(v string) *CreateVolumePermission { - s.UserId = &v - return s -} - -// Describes modifications to the permissions for a volume. -type CreateVolumePermissionModifications struct { - _ struct{} `type:"structure"` - - // Adds a specific AWS account ID or group to a volume's list of create volume - // permissions. - Add []*CreateVolumePermission `locationNameList:"item" type:"list"` - - // Removes a specific AWS account ID or group from a volume's list of create - // volume permissions. - Remove []*CreateVolumePermission `locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CreateVolumePermissionModifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVolumePermissionModifications) GoString() string { - return s.String() -} - -// SetAdd sets the Add field's value. -func (s *CreateVolumePermissionModifications) SetAdd(v []*CreateVolumePermission) *CreateVolumePermissionModifications { - s.Add = v - return s -} - -// SetRemove sets the Remove field's value. -func (s *CreateVolumePermissionModifications) SetRemove(v []*CreateVolumePermission) *CreateVolumePermissionModifications { - s.Remove = v - return s -} - -type CreateVpcEndpointConnectionNotificationInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // One or more endpoint events for which to receive notifications. Valid values - // are Accept, Connect, Delete, and Reject. - // - // ConnectionEvents is a required field - ConnectionEvents []*string `locationNameList:"item" type:"list" required:"true"` - - // The ARN of the SNS topic for the notifications. - // - // ConnectionNotificationArn is a required field - ConnectionNotificationArn *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the endpoint service. - ServiceId *string `type:"string"` - - // The ID of the endpoint. - VpcEndpointId *string `type:"string"` -} - -// String returns the string representation -func (s CreateVpcEndpointConnectionNotificationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcEndpointConnectionNotificationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcEndpointConnectionNotificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointConnectionNotificationInput"} - if s.ConnectionEvents == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionEvents")) - } - if s.ConnectionNotificationArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionNotificationArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetClientToken(v string) *CreateVpcEndpointConnectionNotificationInput { - s.ClientToken = &v - return s -} - -// SetConnectionEvents sets the ConnectionEvents field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetConnectionEvents(v []*string) *CreateVpcEndpointConnectionNotificationInput { - s.ConnectionEvents = v - return s -} - -// SetConnectionNotificationArn sets the ConnectionNotificationArn field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetConnectionNotificationArn(v string) *CreateVpcEndpointConnectionNotificationInput { - s.ConnectionNotificationArn = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetDryRun(v bool) *CreateVpcEndpointConnectionNotificationInput { - s.DryRun = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetServiceId(v string) *CreateVpcEndpointConnectionNotificationInput { - s.ServiceId = &v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetVpcEndpointId(v string) *CreateVpcEndpointConnectionNotificationInput { - s.VpcEndpointId = &v - return s -} - -type CreateVpcEndpointConnectionNotificationOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the notification. - ConnectionNotification *ConnectionNotification `locationName:"connectionNotification" type:"structure"` -} - -// String returns the string representation -func (s CreateVpcEndpointConnectionNotificationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcEndpointConnectionNotificationOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointConnectionNotificationOutput) SetClientToken(v string) *CreateVpcEndpointConnectionNotificationOutput { - s.ClientToken = &v - return s -} - -// SetConnectionNotification sets the ConnectionNotification field's value. -func (s *CreateVpcEndpointConnectionNotificationOutput) SetConnectionNotification(v *ConnectionNotification) *CreateVpcEndpointConnectionNotificationOutput { - s.ConnectionNotification = v - return s -} - -// Contains the parameters for CreateVpcEndpoint. -type CreateVpcEndpointInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // (Gateway endpoint) A policy to attach to the endpoint that controls access - // to the service. The policy must be in valid JSON format. If this parameter - // is not specified, we attach a default policy that allows full access to the - // service. - PolicyDocument *string `type:"string"` - - // (Interface endpoint) Indicate whether to associate a private hosted zone - // with the specified VPC. The private hosted zone contains a record set for - // the default public DNS name for the service for the region (for example, - // kinesis.us-east-1.amazonaws.com) which resolves to the private IP addresses - // of the endpoint network interfaces in the VPC. This enables you to make requests - // to the default public DNS name for the service instead of the public DNS - // names that are automatically generated by the VPC endpoint service. - // - // To use a private hosted zone, you must set the following VPC attributes to - // true: enableDnsHostnames and enableDnsSupport. Use ModifyVpcAttribute to - // set the VPC attributes. - // - // Default: true - PrivateDnsEnabled *bool `type:"boolean"` - - // (Gateway endpoint) One or more route table IDs. - RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` - - // (Interface endpoint) The ID of one or more security groups to associate with - // the endpoint network interface. - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` - - // The service name. To get a list of available services, use the DescribeVpcEndpointServices - // request, or get the name from the service provider. - // - // ServiceName is a required field - ServiceName *string `type:"string" required:"true"` - - // (Interface endpoint) The ID of one or more subnets in which to create an - // endpoint network interface. - SubnetIds []*string `locationName:"SubnetId" locationNameList:"item" type:"list"` - - // The type of endpoint. - // - // Default: Gateway - VpcEndpointType *string `type:"string" enum:"VpcEndpointType"` - - // The ID of the VPC in which the endpoint will be used. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateVpcEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointInput"} - if s.ServiceName == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceName")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointInput) SetClientToken(v string) *CreateVpcEndpointInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcEndpointInput) SetDryRun(v bool) *CreateVpcEndpointInput { - s.DryRun = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *CreateVpcEndpointInput) SetPolicyDocument(v string) *CreateVpcEndpointInput { - s.PolicyDocument = &v - return s -} - -// SetPrivateDnsEnabled sets the PrivateDnsEnabled field's value. -func (s *CreateVpcEndpointInput) SetPrivateDnsEnabled(v bool) *CreateVpcEndpointInput { - s.PrivateDnsEnabled = &v - return s -} - -// SetRouteTableIds sets the RouteTableIds field's value. -func (s *CreateVpcEndpointInput) SetRouteTableIds(v []*string) *CreateVpcEndpointInput { - s.RouteTableIds = v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateVpcEndpointInput) SetSecurityGroupIds(v []*string) *CreateVpcEndpointInput { - s.SecurityGroupIds = v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *CreateVpcEndpointInput) SetServiceName(v string) *CreateVpcEndpointInput { - s.ServiceName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateVpcEndpointInput) SetSubnetIds(v []*string) *CreateVpcEndpointInput { - s.SubnetIds = v - return s -} - -// SetVpcEndpointType sets the VpcEndpointType field's value. -func (s *CreateVpcEndpointInput) SetVpcEndpointType(v string) *CreateVpcEndpointInput { - s.VpcEndpointType = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateVpcEndpointInput) SetVpcId(v string) *CreateVpcEndpointInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateVpcEndpoint. -type CreateVpcEndpointOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the endpoint. - VpcEndpoint *VpcEndpoint `locationName:"vpcEndpoint" type:"structure"` -} - -// String returns the string representation -func (s CreateVpcEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcEndpointOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointOutput) SetClientToken(v string) *CreateVpcEndpointOutput { - s.ClientToken = &v - return s -} - -// SetVpcEndpoint sets the VpcEndpoint field's value. -func (s *CreateVpcEndpointOutput) SetVpcEndpoint(v *VpcEndpoint) *CreateVpcEndpointOutput { - s.VpcEndpoint = v - return s -} - -type CreateVpcEndpointServiceConfigurationInput struct { - _ struct{} `type:"structure"` - - // Indicate whether requests from service consumers to create an endpoint to - // your service must be accepted. To accept a request, use AcceptVpcEndpointConnections. - AcceptanceRequired *bool `type:"boolean"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The Amazon Resource Names (ARNs) of one or more Network Load Balancers for - // your service. - // - // NetworkLoadBalancerArns is a required field - NetworkLoadBalancerArns []*string `locationName:"NetworkLoadBalancerArn" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s CreateVpcEndpointServiceConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcEndpointServiceConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcEndpointServiceConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointServiceConfigurationInput"} - if s.NetworkLoadBalancerArns == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkLoadBalancerArns")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAcceptanceRequired sets the AcceptanceRequired field's value. -func (s *CreateVpcEndpointServiceConfigurationInput) SetAcceptanceRequired(v bool) *CreateVpcEndpointServiceConfigurationInput { - s.AcceptanceRequired = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointServiceConfigurationInput) SetClientToken(v string) *CreateVpcEndpointServiceConfigurationInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcEndpointServiceConfigurationInput) SetDryRun(v bool) *CreateVpcEndpointServiceConfigurationInput { - s.DryRun = &v - return s -} - -// SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value. -func (s *CreateVpcEndpointServiceConfigurationInput) SetNetworkLoadBalancerArns(v []*string) *CreateVpcEndpointServiceConfigurationInput { - s.NetworkLoadBalancerArns = v - return s -} - -type CreateVpcEndpointServiceConfigurationOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the service configuration. - ServiceConfiguration *ServiceConfiguration `locationName:"serviceConfiguration" type:"structure"` -} - -// String returns the string representation -func (s CreateVpcEndpointServiceConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcEndpointServiceConfigurationOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointServiceConfigurationOutput) SetClientToken(v string) *CreateVpcEndpointServiceConfigurationOutput { - s.ClientToken = &v - return s -} - -// SetServiceConfiguration sets the ServiceConfiguration field's value. -func (s *CreateVpcEndpointServiceConfigurationOutput) SetServiceConfiguration(v *ServiceConfiguration) *CreateVpcEndpointServiceConfigurationOutput { - s.ServiceConfiguration = v - return s -} - -// Contains the parameters for CreateVpc. -type CreateVpcInput struct { - _ struct{} `type:"structure"` - - // Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for - // the VPC. You cannot specify the range of IP addresses, or the size of the - // CIDR block. - AmazonProvidedIpv6CidrBlock *bool `locationName:"amazonProvidedIpv6CidrBlock" type:"boolean"` - - // The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. - // - // CidrBlock is a required field - CidrBlock *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The tenancy options for instances launched into the VPC. For default, instances - // are launched with shared tenancy by default. You can launch instances with - // any tenancy into a shared tenancy VPC. For dedicated, instances are launched - // as dedicated tenancy instances by default. You can only launch instances - // with a tenancy of dedicated or host into a dedicated tenancy VPC. - // - // Important: The host value cannot be used with this parameter. Use the default - // or dedicated values only. - // - // Default: default - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` -} - -// String returns the string representation -func (s CreateVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcInput"} - if s.CidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("CidrBlock")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmazonProvidedIpv6CidrBlock sets the AmazonProvidedIpv6CidrBlock field's value. -func (s *CreateVpcInput) SetAmazonProvidedIpv6CidrBlock(v bool) *CreateVpcInput { - s.AmazonProvidedIpv6CidrBlock = &v - return s -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *CreateVpcInput) SetCidrBlock(v string) *CreateVpcInput { - s.CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcInput) SetDryRun(v bool) *CreateVpcInput { - s.DryRun = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *CreateVpcInput) SetInstanceTenancy(v string) *CreateVpcInput { - s.InstanceTenancy = &v - return s -} - -// Contains the output of CreateVpc. -type CreateVpcOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC. - Vpc *Vpc `locationName:"vpc" type:"structure"` -} - -// String returns the string representation -func (s CreateVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcOutput) GoString() string { - return s.String() -} - -// SetVpc sets the Vpc field's value. -func (s *CreateVpcOutput) SetVpc(v *Vpc) *CreateVpcOutput { - s.Vpc = v - return s -} - -// Contains the parameters for CreateVpcPeeringConnection. -type CreateVpcPeeringConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The AWS account ID of the owner of the accepter VPC. - // - // Default: Your AWS account ID - PeerOwnerId *string `locationName:"peerOwnerId" type:"string"` - - // The region code for the accepter VPC, if the accepter VPC is located in a - // region other than the region in which you make the request. - // - // Default: The region in which you make the request. - PeerRegion *string `type:"string"` - - // The ID of the VPC with which you are creating the VPC peering connection. - // You must specify this parameter in the request. - PeerVpcId *string `locationName:"peerVpcId" type:"string"` - - // The ID of the requester VPC. You must specify this parameter in the request. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s CreateVpcPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcPeeringConnectionInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcPeeringConnectionInput) SetDryRun(v bool) *CreateVpcPeeringConnectionInput { - s.DryRun = &v - return s -} - -// SetPeerOwnerId sets the PeerOwnerId field's value. -func (s *CreateVpcPeeringConnectionInput) SetPeerOwnerId(v string) *CreateVpcPeeringConnectionInput { - s.PeerOwnerId = &v - return s -} - -// SetPeerRegion sets the PeerRegion field's value. -func (s *CreateVpcPeeringConnectionInput) SetPeerRegion(v string) *CreateVpcPeeringConnectionInput { - s.PeerRegion = &v - return s -} - -// SetPeerVpcId sets the PeerVpcId field's value. -func (s *CreateVpcPeeringConnectionInput) SetPeerVpcId(v string) *CreateVpcPeeringConnectionInput { - s.PeerVpcId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateVpcPeeringConnectionInput) SetVpcId(v string) *CreateVpcPeeringConnectionInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateVpcPeeringConnection. -type CreateVpcPeeringConnectionOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC peering connection. - VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` -} - -// String returns the string representation -func (s CreateVpcPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcPeeringConnectionOutput) GoString() string { - return s.String() -} - -// SetVpcPeeringConnection sets the VpcPeeringConnection field's value. -func (s *CreateVpcPeeringConnectionOutput) SetVpcPeeringConnection(v *VpcPeeringConnection) *CreateVpcPeeringConnectionOutput { - s.VpcPeeringConnection = v - return s -} - -// Contains the parameters for CreateVpnConnection. -type CreateVpnConnectionInput struct { - _ struct{} `type:"structure"` - - // The ID of the customer gateway. - // - // CustomerGatewayId is a required field - CustomerGatewayId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The options for the VPN connection. - Options *VpnConnectionOptionsSpecification `locationName:"options" type:"structure"` - - // The type of VPN connection (ipsec.1). - // - // Type is a required field - Type *string `type:"string" required:"true"` - - // The ID of the virtual private gateway. - // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateVpnConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpnConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpnConnectionInput"} - if s.CustomerGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("CustomerGatewayId")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.VpnGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *CreateVpnConnectionInput) SetCustomerGatewayId(v string) *CreateVpnConnectionInput { - s.CustomerGatewayId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpnConnectionInput) SetDryRun(v bool) *CreateVpnConnectionInput { - s.DryRun = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *CreateVpnConnectionInput) SetOptions(v *VpnConnectionOptionsSpecification) *CreateVpnConnectionInput { - s.Options = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateVpnConnectionInput) SetType(v string) *CreateVpnConnectionInput { - s.Type = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *CreateVpnConnectionInput) SetVpnGatewayId(v string) *CreateVpnConnectionInput { - s.VpnGatewayId = &v - return s -} - -// Contains the output of CreateVpnConnection. -type CreateVpnConnectionOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPN connection. - VpnConnection *VpnConnection `locationName:"vpnConnection" type:"structure"` -} - -// String returns the string representation -func (s CreateVpnConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnConnectionOutput) GoString() string { - return s.String() -} - -// SetVpnConnection sets the VpnConnection field's value. -func (s *CreateVpnConnectionOutput) SetVpnConnection(v *VpnConnection) *CreateVpnConnectionOutput { - s.VpnConnection = v - return s -} - -// Contains the parameters for CreateVpnConnectionRoute. -type CreateVpnConnectionRouteInput struct { - _ struct{} `type:"structure"` - - // The CIDR block associated with the local subnet of the customer network. - // - // DestinationCidrBlock is a required field - DestinationCidrBlock *string `type:"string" required:"true"` - - // The ID of the VPN connection. - // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateVpnConnectionRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnConnectionRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpnConnectionRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpnConnectionRouteInput"} - if s.DestinationCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) - } - if s.VpnConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *CreateVpnConnectionRouteInput) SetDestinationCidrBlock(v string) *CreateVpnConnectionRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *CreateVpnConnectionRouteInput) SetVpnConnectionId(v string) *CreateVpnConnectionRouteInput { - s.VpnConnectionId = &v - return s -} - -type CreateVpnConnectionRouteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateVpnConnectionRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnConnectionRouteOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateVpnGateway. -type CreateVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. - // If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If - // you're using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range. - // - // Default: 64512 - AmazonSideAsn *int64 `type:"long"` - - // The Availability Zone for the virtual private gateway. - AvailabilityZone *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The type of VPN connection this virtual private gateway supports. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"GatewayType"` -} - -// String returns the string representation -func (s CreateVpnGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpnGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpnGatewayInput"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmazonSideAsn sets the AmazonSideAsn field's value. -func (s *CreateVpnGatewayInput) SetAmazonSideAsn(v int64) *CreateVpnGatewayInput { - s.AmazonSideAsn = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateVpnGatewayInput) SetAvailabilityZone(v string) *CreateVpnGatewayInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpnGatewayInput) SetDryRun(v bool) *CreateVpnGatewayInput { - s.DryRun = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateVpnGatewayInput) SetType(v string) *CreateVpnGatewayInput { - s.Type = &v - return s -} - -// Contains the output of CreateVpnGateway. -type CreateVpnGatewayOutput struct { - _ struct{} `type:"structure"` - - // Information about the virtual private gateway. - VpnGateway *VpnGateway `locationName:"vpnGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateVpnGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnGatewayOutput) GoString() string { - return s.String() -} - -// SetVpnGateway sets the VpnGateway field's value. -func (s *CreateVpnGatewayOutput) SetVpnGateway(v *VpnGateway) *CreateVpnGatewayOutput { - s.VpnGateway = v - return s -} - -// Describes the credit option for CPU usage of a T2 instance. -type CreditSpecification struct { - _ struct{} `type:"structure"` - - // The credit option for CPU usage of a T2 instance. - CpuCredits *string `locationName:"cpuCredits" type:"string"` -} - -// String returns the string representation -func (s CreditSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreditSpecification) GoString() string { - return s.String() -} - -// SetCpuCredits sets the CpuCredits field's value. -func (s *CreditSpecification) SetCpuCredits(v string) *CreditSpecification { - s.CpuCredits = &v - return s -} - -// The credit option for CPU usage of a T2 instance. -type CreditSpecificationRequest struct { - _ struct{} `type:"structure"` - - // The credit option for CPU usage of a T2 instance. Valid values are standard - // and unlimited. - // - // CpuCredits is a required field - CpuCredits *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreditSpecificationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreditSpecificationRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreditSpecificationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreditSpecificationRequest"} - if s.CpuCredits == nil { - invalidParams.Add(request.NewErrParamRequired("CpuCredits")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCpuCredits sets the CpuCredits field's value. -func (s *CreditSpecificationRequest) SetCpuCredits(v string) *CreditSpecificationRequest { - s.CpuCredits = &v - return s -} - -// Describes a customer gateway. -type CustomerGateway struct { - _ struct{} `type:"structure"` - - // The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number - // (ASN). - BgpAsn *string `locationName:"bgpAsn" type:"string"` - - // The ID of the customer gateway. - CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` - - // The Internet-routable IP address of the customer gateway's outside interface. - IpAddress *string `locationName:"ipAddress" type:"string"` - - // The current state of the customer gateway (pending | available | deleting - // | deleted). - State *string `locationName:"state" type:"string"` - - // Any tags assigned to the customer gateway. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of VPN connection the customer gateway supports (ipsec.1). - Type *string `locationName:"type" type:"string"` -} - -// String returns the string representation -func (s CustomerGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CustomerGateway) GoString() string { - return s.String() -} - -// SetBgpAsn sets the BgpAsn field's value. -func (s *CustomerGateway) SetBgpAsn(v string) *CustomerGateway { - s.BgpAsn = &v - return s -} - -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *CustomerGateway) SetCustomerGatewayId(v string) *CustomerGateway { - s.CustomerGatewayId = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *CustomerGateway) SetIpAddress(v string) *CustomerGateway { - s.IpAddress = &v - return s -} - -// SetState sets the State field's value. -func (s *CustomerGateway) SetState(v string) *CustomerGateway { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CustomerGateway) SetTags(v []*Tag) *CustomerGateway { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CustomerGateway) SetType(v string) *CustomerGateway { - s.Type = &v - return s -} - -// Contains the parameters for DeleteCustomerGateway. -type DeleteCustomerGatewayInput struct { - _ struct{} `type:"structure"` - - // The ID of the customer gateway. - // - // CustomerGatewayId is a required field - CustomerGatewayId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DeleteCustomerGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCustomerGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCustomerGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCustomerGatewayInput"} - if s.CustomerGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("CustomerGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *DeleteCustomerGatewayInput) SetCustomerGatewayId(v string) *DeleteCustomerGatewayInput { - s.CustomerGatewayId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteCustomerGatewayInput) SetDryRun(v bool) *DeleteCustomerGatewayInput { - s.DryRun = &v - return s -} - -type DeleteCustomerGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteCustomerGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCustomerGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteDhcpOptions. -type DeleteDhcpOptionsInput struct { - _ struct{} `type:"structure"` - - // The ID of the DHCP options set. - // - // DhcpOptionsId is a required field - DhcpOptionsId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DeleteDhcpOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDhcpOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDhcpOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDhcpOptionsInput"} - if s.DhcpOptionsId == nil { - invalidParams.Add(request.NewErrParamRequired("DhcpOptionsId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *DeleteDhcpOptionsInput) SetDhcpOptionsId(v string) *DeleteDhcpOptionsInput { - s.DhcpOptionsId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteDhcpOptionsInput) SetDryRun(v bool) *DeleteDhcpOptionsInput { - s.DryRun = &v - return s -} - -type DeleteDhcpOptionsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDhcpOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDhcpOptionsOutput) GoString() string { - return s.String() -} - -type DeleteEgressOnlyInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the egress-only Internet gateway. - // - // EgressOnlyInternetGatewayId is a required field - EgressOnlyInternetGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEgressOnlyInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEgressOnlyInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEgressOnlyInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEgressOnlyInternetGatewayInput"} - if s.EgressOnlyInternetGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("EgressOnlyInternetGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteEgressOnlyInternetGatewayInput) SetDryRun(v bool) *DeleteEgressOnlyInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *DeleteEgressOnlyInternetGatewayInput) SetEgressOnlyInternetGatewayId(v string) *DeleteEgressOnlyInternetGatewayInput { - s.EgressOnlyInternetGatewayId = &v - return s -} - -type DeleteEgressOnlyInternetGatewayOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnCode *bool `locationName:"returnCode" type:"boolean"` -} - -// String returns the string representation -func (s DeleteEgressOnlyInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEgressOnlyInternetGatewayOutput) GoString() string { - return s.String() -} - -// SetReturnCode sets the ReturnCode field's value. -func (s *DeleteEgressOnlyInternetGatewayOutput) SetReturnCode(v bool) *DeleteEgressOnlyInternetGatewayOutput { - s.ReturnCode = &v - return s -} - -// Describes an EC2 Fleet error. -type DeleteFleetError struct { - _ struct{} `type:"structure"` - - // The error code. - Code *string `locationName:"code" type:"string" enum:"DeleteFleetErrorCode"` - - // The description for the error code. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s DeleteFleetError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFleetError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *DeleteFleetError) SetCode(v string) *DeleteFleetError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *DeleteFleetError) SetMessage(v string) *DeleteFleetError { - s.Message = &v - return s -} - -// Describes an EC2 Fleet that was not successfully deleted. -type DeleteFleetErrorItem struct { - _ struct{} `type:"structure"` - - // The error. - Error *DeleteFleetError `locationName:"error" type:"structure"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` -} - -// String returns the string representation -func (s DeleteFleetErrorItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFleetErrorItem) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *DeleteFleetErrorItem) SetError(v *DeleteFleetError) *DeleteFleetErrorItem { - s.Error = v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *DeleteFleetErrorItem) SetFleetId(v string) *DeleteFleetErrorItem { - s.FleetId = &v - return s -} - -// Describes an EC2 Fleet that was successfully deleted. -type DeleteFleetSuccessItem struct { - _ struct{} `type:"structure"` - - // The current state of the EC2 Fleet. - CurrentFleetState *string `locationName:"currentFleetState" type:"string" enum:"FleetStateCode"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` - - // The previous state of the EC2 Fleet. - PreviousFleetState *string `locationName:"previousFleetState" type:"string" enum:"FleetStateCode"` -} - -// String returns the string representation -func (s DeleteFleetSuccessItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFleetSuccessItem) GoString() string { - return s.String() -} - -// SetCurrentFleetState sets the CurrentFleetState field's value. -func (s *DeleteFleetSuccessItem) SetCurrentFleetState(v string) *DeleteFleetSuccessItem { - s.CurrentFleetState = &v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *DeleteFleetSuccessItem) SetFleetId(v string) *DeleteFleetSuccessItem { - s.FleetId = &v - return s -} - -// SetPreviousFleetState sets the PreviousFleetState field's value. -func (s *DeleteFleetSuccessItem) SetPreviousFleetState(v string) *DeleteFleetSuccessItem { - s.PreviousFleetState = &v - return s -} - -type DeleteFleetsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The IDs of the EC2 Fleets. - // - // FleetIds is a required field - FleetIds []*string `locationName:"FleetId" type:"list" required:"true"` - - // Indicates whether to terminate instances for an EC2 Fleet if it is deleted - // successfully. - // - // TerminateInstances is a required field - TerminateInstances *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s DeleteFleetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFleetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFleetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFleetsInput"} - if s.FleetIds == nil { - invalidParams.Add(request.NewErrParamRequired("FleetIds")) - } - if s.TerminateInstances == nil { - invalidParams.Add(request.NewErrParamRequired("TerminateInstances")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteFleetsInput) SetDryRun(v bool) *DeleteFleetsInput { - s.DryRun = &v - return s -} - -// SetFleetIds sets the FleetIds field's value. -func (s *DeleteFleetsInput) SetFleetIds(v []*string) *DeleteFleetsInput { - s.FleetIds = v - return s -} - -// SetTerminateInstances sets the TerminateInstances field's value. -func (s *DeleteFleetsInput) SetTerminateInstances(v bool) *DeleteFleetsInput { - s.TerminateInstances = &v - return s -} - -type DeleteFleetsOutput struct { - _ struct{} `type:"structure"` - - // Information about the EC2 Fleets that are successfully deleted. - SuccessfulFleetDeletions []*DeleteFleetSuccessItem `locationName:"successfulFleetDeletionSet" locationNameList:"item" type:"list"` - - // Information about the EC2 Fleets that are not successfully deleted. - UnsuccessfulFleetDeletions []*DeleteFleetErrorItem `locationName:"unsuccessfulFleetDeletionSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteFleetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFleetsOutput) GoString() string { - return s.String() -} - -// SetSuccessfulFleetDeletions sets the SuccessfulFleetDeletions field's value. -func (s *DeleteFleetsOutput) SetSuccessfulFleetDeletions(v []*DeleteFleetSuccessItem) *DeleteFleetsOutput { - s.SuccessfulFleetDeletions = v - return s -} - -// SetUnsuccessfulFleetDeletions sets the UnsuccessfulFleetDeletions field's value. -func (s *DeleteFleetsOutput) SetUnsuccessfulFleetDeletions(v []*DeleteFleetErrorItem) *DeleteFleetsOutput { - s.UnsuccessfulFleetDeletions = v - return s -} - -// Contains the parameters for DeleteFlowLogs. -type DeleteFlowLogsInput struct { - _ struct{} `type:"structure"` - - // One or more flow log IDs. - // - // FlowLogIds is a required field - FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DeleteFlowLogsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFlowLogsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFlowLogsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFlowLogsInput"} - if s.FlowLogIds == nil { - invalidParams.Add(request.NewErrParamRequired("FlowLogIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFlowLogIds sets the FlowLogIds field's value. -func (s *DeleteFlowLogsInput) SetFlowLogIds(v []*string) *DeleteFlowLogsInput { - s.FlowLogIds = v - return s -} - -// Contains the output of DeleteFlowLogs. -type DeleteFlowLogsOutput struct { - _ struct{} `type:"structure"` - - // Information about the flow logs that could not be deleted successfully. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteFlowLogsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFlowLogsOutput) GoString() string { - return s.String() -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteFlowLogsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteFlowLogsOutput { - s.Unsuccessful = v - return s -} - -type DeleteFpgaImageInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the AFI. - // - // FpgaImageId is a required field - FpgaImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteFpgaImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFpgaImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFpgaImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFpgaImageInput"} - if s.FpgaImageId == nil { - invalidParams.Add(request.NewErrParamRequired("FpgaImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteFpgaImageInput) SetDryRun(v bool) *DeleteFpgaImageInput { - s.DryRun = &v - return s -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *DeleteFpgaImageInput) SetFpgaImageId(v string) *DeleteFpgaImageInput { - s.FpgaImageId = &v - return s -} - -type DeleteFpgaImageOutput struct { - _ struct{} `type:"structure"` - - // Is true if the request succeeds, and an error otherwise. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DeleteFpgaImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFpgaImageOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DeleteFpgaImageOutput) SetReturn(v bool) *DeleteFpgaImageOutput { - s.Return = &v - return s -} - -// Contains the parameters for DeleteInternetGateway. -type DeleteInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the Internet gateway. - // - // InternetGatewayId is a required field - InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInternetGatewayInput"} - if s.InternetGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("InternetGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteInternetGatewayInput) SetDryRun(v bool) *DeleteInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *DeleteInternetGatewayInput) SetInternetGatewayId(v string) *DeleteInternetGatewayInput { - s.InternetGatewayId = &v - return s -} - -type DeleteInternetGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInternetGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteKeyPair. -type DeleteKeyPairInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The name of the key pair. - // - // KeyName is a required field - KeyName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteKeyPairInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteKeyPairInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteKeyPairInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteKeyPairInput"} - if s.KeyName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteKeyPairInput) SetDryRun(v bool) *DeleteKeyPairInput { - s.DryRun = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *DeleteKeyPairInput) SetKeyName(v string) *DeleteKeyPairInput { - s.KeyName = &v - return s -} - -type DeleteKeyPairOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteKeyPairOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteKeyPairOutput) GoString() string { - return s.String() -} - -type DeleteLaunchTemplateInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` -} - -// String returns the string representation -func (s DeleteLaunchTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLaunchTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLaunchTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLaunchTemplateInput"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteLaunchTemplateInput) SetDryRun(v bool) *DeleteLaunchTemplateInput { - s.DryRun = &v - return s -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DeleteLaunchTemplateInput) SetLaunchTemplateId(v string) *DeleteLaunchTemplateInput { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DeleteLaunchTemplateInput) SetLaunchTemplateName(v string) *DeleteLaunchTemplateInput { - s.LaunchTemplateName = &v - return s -} - -type DeleteLaunchTemplateOutput struct { - _ struct{} `type:"structure"` - - // Information about the launch template. - LaunchTemplate *LaunchTemplate `locationName:"launchTemplate" type:"structure"` -} - -// String returns the string representation -func (s DeleteLaunchTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLaunchTemplateOutput) GoString() string { - return s.String() -} - -// SetLaunchTemplate sets the LaunchTemplate field's value. -func (s *DeleteLaunchTemplateOutput) SetLaunchTemplate(v *LaunchTemplate) *DeleteLaunchTemplateOutput { - s.LaunchTemplate = v - return s -} - -type DeleteLaunchTemplateVersionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` - - // The version numbers of one or more launch template versions to delete. - // - // Versions is a required field - Versions []*string `locationName:"LaunchTemplateVersion" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DeleteLaunchTemplateVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLaunchTemplateVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLaunchTemplateVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLaunchTemplateVersionsInput"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - if s.Versions == nil { - invalidParams.Add(request.NewErrParamRequired("Versions")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteLaunchTemplateVersionsInput) SetDryRun(v bool) *DeleteLaunchTemplateVersionsInput { - s.DryRun = &v - return s -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DeleteLaunchTemplateVersionsInput) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsInput { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DeleteLaunchTemplateVersionsInput) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsInput { - s.LaunchTemplateName = &v - return s -} - -// SetVersions sets the Versions field's value. -func (s *DeleteLaunchTemplateVersionsInput) SetVersions(v []*string) *DeleteLaunchTemplateVersionsInput { - s.Versions = v - return s -} - -type DeleteLaunchTemplateVersionsOutput struct { - _ struct{} `type:"structure"` - - // Information about the launch template versions that were successfully deleted. - SuccessfullyDeletedLaunchTemplateVersions []*DeleteLaunchTemplateVersionsResponseSuccessItem `locationName:"successfullyDeletedLaunchTemplateVersionSet" locationNameList:"item" type:"list"` - - // Information about the launch template versions that could not be deleted. - UnsuccessfullyDeletedLaunchTemplateVersions []*DeleteLaunchTemplateVersionsResponseErrorItem `locationName:"unsuccessfullyDeletedLaunchTemplateVersionSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteLaunchTemplateVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLaunchTemplateVersionsOutput) GoString() string { - return s.String() -} - -// SetSuccessfullyDeletedLaunchTemplateVersions sets the SuccessfullyDeletedLaunchTemplateVersions field's value. -func (s *DeleteLaunchTemplateVersionsOutput) SetSuccessfullyDeletedLaunchTemplateVersions(v []*DeleteLaunchTemplateVersionsResponseSuccessItem) *DeleteLaunchTemplateVersionsOutput { - s.SuccessfullyDeletedLaunchTemplateVersions = v - return s -} - -// SetUnsuccessfullyDeletedLaunchTemplateVersions sets the UnsuccessfullyDeletedLaunchTemplateVersions field's value. -func (s *DeleteLaunchTemplateVersionsOutput) SetUnsuccessfullyDeletedLaunchTemplateVersions(v []*DeleteLaunchTemplateVersionsResponseErrorItem) *DeleteLaunchTemplateVersionsOutput { - s.UnsuccessfullyDeletedLaunchTemplateVersions = v - return s -} - -// Describes a launch template version that could not be deleted. -type DeleteLaunchTemplateVersionsResponseErrorItem struct { - _ struct{} `type:"structure"` - - // The ID of the launch template. - LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` - - // The name of the launch template. - LaunchTemplateName *string `locationName:"launchTemplateName" type:"string"` - - // Information about the error. - ResponseError *ResponseError `locationName:"responseError" type:"structure"` - - // The version number of the launch template. - VersionNumber *int64 `locationName:"versionNumber" type:"long"` -} - -// String returns the string representation -func (s DeleteLaunchTemplateVersionsResponseErrorItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLaunchTemplateVersionsResponseErrorItem) GoString() string { - return s.String() -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsResponseErrorItem { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsResponseErrorItem { - s.LaunchTemplateName = &v - return s -} - -// SetResponseError sets the ResponseError field's value. -func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetResponseError(v *ResponseError) *DeleteLaunchTemplateVersionsResponseErrorItem { - s.ResponseError = v - return s -} - -// SetVersionNumber sets the VersionNumber field's value. -func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetVersionNumber(v int64) *DeleteLaunchTemplateVersionsResponseErrorItem { - s.VersionNumber = &v - return s -} - -// Describes a launch template version that was successfully deleted. -type DeleteLaunchTemplateVersionsResponseSuccessItem struct { - _ struct{} `type:"structure"` - - // The ID of the launch template. - LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` - - // The name of the launch template. - LaunchTemplateName *string `locationName:"launchTemplateName" type:"string"` - - // The version number of the launch template. - VersionNumber *int64 `locationName:"versionNumber" type:"long"` -} - -// String returns the string representation -func (s DeleteLaunchTemplateVersionsResponseSuccessItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLaunchTemplateVersionsResponseSuccessItem) GoString() string { - return s.String() -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsResponseSuccessItem { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsResponseSuccessItem { - s.LaunchTemplateName = &v - return s -} - -// SetVersionNumber sets the VersionNumber field's value. -func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetVersionNumber(v int64) *DeleteLaunchTemplateVersionsResponseSuccessItem { - s.VersionNumber = &v - return s -} - -// Contains the parameters for DeleteNatGateway. -type DeleteNatGatewayInput struct { - _ struct{} `type:"structure"` - - // The ID of the NAT gateway. - // - // NatGatewayId is a required field - NatGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteNatGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNatGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNatGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNatGatewayInput"} - if s.NatGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("NatGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *DeleteNatGatewayInput) SetNatGatewayId(v string) *DeleteNatGatewayInput { - s.NatGatewayId = &v - return s -} - -// Contains the output of DeleteNatGateway. -type DeleteNatGatewayOutput struct { - _ struct{} `type:"structure"` - - // The ID of the NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` -} - -// String returns the string representation -func (s DeleteNatGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNatGatewayOutput) GoString() string { - return s.String() -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *DeleteNatGatewayOutput) SetNatGatewayId(v string) *DeleteNatGatewayOutput { - s.NatGatewayId = &v - return s -} - -// Contains the parameters for DeleteNetworkAclEntry. -type DeleteNetworkAclEntryInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether the rule is an egress rule. - // - // Egress is a required field - Egress *bool `locationName:"egress" type:"boolean" required:"true"` - - // The ID of the network ACL. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - - // The rule number of the entry to delete. - // - // RuleNumber is a required field - RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` -} - -// String returns the string representation -func (s DeleteNetworkAclEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkAclEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkAclEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkAclEntryInput"} - if s.Egress == nil { - invalidParams.Add(request.NewErrParamRequired("Egress")) - } - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - if s.RuleNumber == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkAclEntryInput) SetDryRun(v bool) *DeleteNetworkAclEntryInput { - s.DryRun = &v - return s -} - -// SetEgress sets the Egress field's value. -func (s *DeleteNetworkAclEntryInput) SetEgress(v bool) *DeleteNetworkAclEntryInput { - s.Egress = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *DeleteNetworkAclEntryInput) SetNetworkAclId(v string) *DeleteNetworkAclEntryInput { - s.NetworkAclId = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *DeleteNetworkAclEntryInput) SetRuleNumber(v int64) *DeleteNetworkAclEntryInput { - s.RuleNumber = &v - return s -} - -type DeleteNetworkAclEntryOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteNetworkAclEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkAclEntryOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteNetworkAcl. -type DeleteNetworkAclInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the network ACL. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteNetworkAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkAclInput"} - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkAclInput) SetDryRun(v bool) *DeleteNetworkAclInput { - s.DryRun = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *DeleteNetworkAclInput) SetNetworkAclId(v string) *DeleteNetworkAclInput { - s.NetworkAclId = &v - return s -} - -type DeleteNetworkAclOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteNetworkAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkAclOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteNetworkInterface. -type DeleteNetworkInterfaceInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteNetworkInterfaceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkInterfaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkInterfaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkInterfaceInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkInterfaceInput) SetDryRun(v bool) *DeleteNetworkInterfaceInput { - s.DryRun = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *DeleteNetworkInterfaceInput) SetNetworkInterfaceId(v string) *DeleteNetworkInterfaceInput { - s.NetworkInterfaceId = &v - return s -} - -type DeleteNetworkInterfaceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteNetworkInterfaceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkInterfaceOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteNetworkInterfacePermission. -type DeleteNetworkInterfacePermissionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // Specify true to remove the permission even if the network interface is attached - // to an instance. - Force *bool `type:"boolean"` - - // The ID of the network interface permission. - // - // NetworkInterfacePermissionId is a required field - NetworkInterfacePermissionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteNetworkInterfacePermissionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkInterfacePermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkInterfacePermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkInterfacePermissionInput"} - if s.NetworkInterfacePermissionId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfacePermissionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkInterfacePermissionInput) SetDryRun(v bool) *DeleteNetworkInterfacePermissionInput { - s.DryRun = &v - return s -} - -// SetForce sets the Force field's value. -func (s *DeleteNetworkInterfacePermissionInput) SetForce(v bool) *DeleteNetworkInterfacePermissionInput { - s.Force = &v - return s -} - -// SetNetworkInterfacePermissionId sets the NetworkInterfacePermissionId field's value. -func (s *DeleteNetworkInterfacePermissionInput) SetNetworkInterfacePermissionId(v string) *DeleteNetworkInterfacePermissionInput { - s.NetworkInterfacePermissionId = &v - return s -} - -// Contains the output for DeleteNetworkInterfacePermission. -type DeleteNetworkInterfacePermissionOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds, otherwise returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DeleteNetworkInterfacePermissionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkInterfacePermissionOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DeleteNetworkInterfacePermissionOutput) SetReturn(v bool) *DeleteNetworkInterfacePermissionOutput { - s.Return = &v - return s -} - -// Contains the parameters for DeletePlacementGroup. -type DeletePlacementGroupInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The name of the placement group. - // - // GroupName is a required field - GroupName *string `locationName:"groupName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePlacementGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePlacementGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePlacementGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePlacementGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeletePlacementGroupInput) SetDryRun(v bool) *DeletePlacementGroupInput { - s.DryRun = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *DeletePlacementGroupInput) SetGroupName(v string) *DeletePlacementGroupInput { - s.GroupName = &v - return s -} - -type DeletePlacementGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeletePlacementGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePlacementGroupOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteRoute. -type DeleteRouteInput struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR range for the route. The value you specify must match the CIDR - // for the route exactly. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // The IPv6 CIDR range for the route. The value you specify must match the CIDR - // for the route exactly. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRouteInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *DeleteRouteInput) SetDestinationCidrBlock(v string) *DeleteRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *DeleteRouteInput) SetDestinationIpv6CidrBlock(v string) *DeleteRouteInput { - s.DestinationIpv6CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteRouteInput) SetDryRun(v bool) *DeleteRouteInput { - s.DryRun = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *DeleteRouteInput) SetRouteTableId(v string) *DeleteRouteInput { - s.RouteTableId = &v - return s -} - -type DeleteRouteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRouteOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteRouteTable. -type DeleteRouteTableInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRouteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRouteTableInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteRouteTableInput) SetDryRun(v bool) *DeleteRouteTableInput { - s.DryRun = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *DeleteRouteTableInput) SetRouteTableId(v string) *DeleteRouteTableInput { - s.RouteTableId = &v - return s -} - -type DeleteRouteTableOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRouteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRouteTableOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteSecurityGroup. -type DeleteSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the security group. Required for a nondefault VPC. - GroupId *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the security group. You can specify - // either the security group name or the security group ID. - GroupName *string `type:"string"` -} - -// String returns the string representation -func (s DeleteSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSecurityGroupInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteSecurityGroupInput) SetDryRun(v bool) *DeleteSecurityGroupInput { - s.DryRun = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *DeleteSecurityGroupInput) SetGroupId(v string) *DeleteSecurityGroupInput { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *DeleteSecurityGroupInput) SetGroupName(v string) *DeleteSecurityGroupInput { - s.GroupName = &v - return s -} - -type DeleteSecurityGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSecurityGroupOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteSnapshot. -type DeleteSnapshotInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the EBS snapshot. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSnapshotInput"} - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteSnapshotInput) SetDryRun(v bool) *DeleteSnapshotInput { - s.DryRun = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *DeleteSnapshotInput) SetSnapshotId(v string) *DeleteSnapshotInput { - s.SnapshotId = &v - return s -} - -type DeleteSnapshotOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSnapshotOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteSpotDatafeedSubscription. -type DeleteSpotDatafeedSubscriptionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DeleteSpotDatafeedSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSpotDatafeedSubscriptionInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteSpotDatafeedSubscriptionInput) SetDryRun(v bool) *DeleteSpotDatafeedSubscriptionInput { - s.DryRun = &v - return s -} - -type DeleteSpotDatafeedSubscriptionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSpotDatafeedSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSpotDatafeedSubscriptionOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteSubnet. -type DeleteSubnetInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the subnet. - // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSubnetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSubnetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSubnetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSubnetInput"} - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteSubnetInput) SetDryRun(v bool) *DeleteSubnetInput { - s.DryRun = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *DeleteSubnetInput) SetSubnetId(v string) *DeleteSubnetInput { - s.SubnetId = &v - return s -} - -type DeleteSubnetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSubnetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSubnetOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteTags. -type DeleteTagsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IDs of one or more resources. - // - // Resources is a required field - Resources []*string `locationName:"resourceId" type:"list" required:"true"` - - // One or more tags to delete. Specify a tag key and an optional tag value to - // delete specific tags. If you specify a tag key without a tag value, we delete - // any tag with this key regardless of its value. If you specify a tag key with - // an empty string as the tag value, we delete the tag only if its value is - // an empty string. - // - // If you omit this parameter, we delete all user-defined tags for the specified - // resources. We do not delete AWS-generated tags (tags that have the aws: prefix). - Tags []*Tag `locationName:"tag" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTagsInput"} - if s.Resources == nil { - invalidParams.Add(request.NewErrParamRequired("Resources")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteTagsInput) SetDryRun(v bool) *DeleteTagsInput { - s.DryRun = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *DeleteTagsInput) SetResources(v []*string) *DeleteTagsInput { - s.Resources = v - return s -} - -// SetTags sets the Tags field's value. -func (s *DeleteTagsInput) SetTags(v []*Tag) *DeleteTagsInput { - s.Tags = v - return s -} - -type DeleteTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTagsOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVolume. -type DeleteVolumeInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVolumeInput) SetDryRun(v bool) *DeleteVolumeInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DeleteVolumeInput) SetVolumeId(v string) *DeleteVolumeInput { - s.VolumeId = &v - return s -} - -type DeleteVolumeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVolumeOutput) GoString() string { - return s.String() -} - -type DeleteVpcEndpointConnectionNotificationsInput struct { - _ struct{} `type:"structure"` - - // One or more notification IDs. - // - // ConnectionNotificationIds is a required field - ConnectionNotificationIds []*string `locationName:"ConnectionNotificationId" locationNameList:"item" type:"list" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` -} - -// String returns the string representation -func (s DeleteVpcEndpointConnectionNotificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcEndpointConnectionNotificationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcEndpointConnectionNotificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointConnectionNotificationsInput"} - if s.ConnectionNotificationIds == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionNotificationIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectionNotificationIds sets the ConnectionNotificationIds field's value. -func (s *DeleteVpcEndpointConnectionNotificationsInput) SetConnectionNotificationIds(v []*string) *DeleteVpcEndpointConnectionNotificationsInput { - s.ConnectionNotificationIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcEndpointConnectionNotificationsInput) SetDryRun(v bool) *DeleteVpcEndpointConnectionNotificationsInput { - s.DryRun = &v - return s -} - -type DeleteVpcEndpointConnectionNotificationsOutput struct { - _ struct{} `type:"structure"` - - // Information about the notifications that could not be deleted successfully. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteVpcEndpointConnectionNotificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcEndpointConnectionNotificationsOutput) GoString() string { - return s.String() -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteVpcEndpointConnectionNotificationsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointConnectionNotificationsOutput { - s.Unsuccessful = v - return s -} - -type DeleteVpcEndpointServiceConfigurationsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The IDs of one or more services. - // - // ServiceIds is a required field - ServiceIds []*string `locationName:"ServiceId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DeleteVpcEndpointServiceConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcEndpointServiceConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcEndpointServiceConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointServiceConfigurationsInput"} - if s.ServiceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcEndpointServiceConfigurationsInput) SetDryRun(v bool) *DeleteVpcEndpointServiceConfigurationsInput { - s.DryRun = &v - return s -} - -// SetServiceIds sets the ServiceIds field's value. -func (s *DeleteVpcEndpointServiceConfigurationsInput) SetServiceIds(v []*string) *DeleteVpcEndpointServiceConfigurationsInput { - s.ServiceIds = v - return s -} - -type DeleteVpcEndpointServiceConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // Information about the service configurations that were not deleted, if applicable. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteVpcEndpointServiceConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcEndpointServiceConfigurationsOutput) GoString() string { - return s.String() -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteVpcEndpointServiceConfigurationsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointServiceConfigurationsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters for DeleteVpcEndpoints. -type DeleteVpcEndpointsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more VPC endpoint IDs. - // - // VpcEndpointIds is a required field - VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DeleteVpcEndpointsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcEndpointsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointsInput"} - if s.VpcEndpointIds == nil { - invalidParams.Add(request.NewErrParamRequired("VpcEndpointIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcEndpointsInput) SetDryRun(v bool) *DeleteVpcEndpointsInput { - s.DryRun = &v - return s -} - -// SetVpcEndpointIds sets the VpcEndpointIds field's value. -func (s *DeleteVpcEndpointsInput) SetVpcEndpointIds(v []*string) *DeleteVpcEndpointsInput { - s.VpcEndpointIds = v - return s -} - -// Contains the output of DeleteVpcEndpoints. -type DeleteVpcEndpointsOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC endpoints that were not successfully deleted. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteVpcEndpointsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcEndpointsOutput) GoString() string { - return s.String() -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteVpcEndpointsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters for DeleteVpc. -type DeleteVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcInput) SetDryRun(v bool) *DeleteVpcInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DeleteVpcInput) SetVpcId(v string) *DeleteVpcInput { - s.VpcId = &v - return s -} - -type DeleteVpcOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVpcPeeringConnection. -type DeleteVpcPeeringConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC peering connection. - // - // VpcPeeringConnectionId is a required field - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpcPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcPeeringConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcPeeringConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcPeeringConnectionInput"} - if s.VpcPeeringConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcPeeringConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcPeeringConnectionInput) SetDryRun(v bool) *DeleteVpcPeeringConnectionInput { - s.DryRun = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *DeleteVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *DeleteVpcPeeringConnectionInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Contains the output of DeleteVpcPeeringConnection. -type DeleteVpcPeeringConnectionOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DeleteVpcPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcPeeringConnectionOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DeleteVpcPeeringConnectionOutput) SetReturn(v bool) *DeleteVpcPeeringConnectionOutput { - s.Return = &v - return s -} - -// Contains the parameters for DeleteVpnConnection. -type DeleteVpnConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPN connection. - // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpnConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpnConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpnConnectionInput"} - if s.VpnConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpnConnectionInput) SetDryRun(v bool) *DeleteVpnConnectionInput { - s.DryRun = &v - return s -} - -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *DeleteVpnConnectionInput) SetVpnConnectionId(v string) *DeleteVpnConnectionInput { - s.VpnConnectionId = &v - return s -} - -type DeleteVpnConnectionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVpnConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnConnectionOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVpnConnectionRoute. -type DeleteVpnConnectionRouteInput struct { - _ struct{} `type:"structure"` - - // The CIDR block associated with the local subnet of the customer network. - // - // DestinationCidrBlock is a required field - DestinationCidrBlock *string `type:"string" required:"true"` - - // The ID of the VPN connection. - // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpnConnectionRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnConnectionRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpnConnectionRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpnConnectionRouteInput"} - if s.DestinationCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) - } - if s.VpnConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *DeleteVpnConnectionRouteInput) SetDestinationCidrBlock(v string) *DeleteVpnConnectionRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *DeleteVpnConnectionRouteInput) SetVpnConnectionId(v string) *DeleteVpnConnectionRouteInput { - s.VpnConnectionId = &v - return s -} - -type DeleteVpnConnectionRouteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVpnConnectionRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnConnectionRouteOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVpnGateway. -type DeleteVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the virtual private gateway. - // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpnGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpnGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpnGatewayInput"} - if s.VpnGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpnGatewayInput) SetDryRun(v bool) *DeleteVpnGatewayInput { - s.DryRun = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *DeleteVpnGatewayInput) SetVpnGatewayId(v string) *DeleteVpnGatewayInput { - s.VpnGatewayId = &v - return s -} - -type DeleteVpnGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVpnGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeregisterImage. -type DeregisterImageInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the AMI. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterImageInput"} - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeregisterImageInput) SetDryRun(v bool) *DeregisterImageInput { - s.DryRun = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *DeregisterImageInput) SetImageId(v string) *DeregisterImageInput { - s.ImageId = &v - return s -} - -type DeregisterImageOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterImageOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DescribeAccountAttributes. -type DescribeAccountAttributesInput struct { - _ struct{} `type:"structure"` - - // One or more account attribute names. - AttributeNames []*string `locationName:"attributeName" locationNameList:"attributeName" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DescribeAccountAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAccountAttributesInput) GoString() string { - return s.String() -} - -// SetAttributeNames sets the AttributeNames field's value. -func (s *DescribeAccountAttributesInput) SetAttributeNames(v []*string) *DescribeAccountAttributesInput { - s.AttributeNames = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeAccountAttributesInput) SetDryRun(v bool) *DescribeAccountAttributesInput { - s.DryRun = &v - return s -} - -// Contains the output of DescribeAccountAttributes. -type DescribeAccountAttributesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more account attributes. - AccountAttributes []*AccountAttribute `locationName:"accountAttributeSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeAccountAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAccountAttributesOutput) GoString() string { - return s.String() -} - -// SetAccountAttributes sets the AccountAttributes field's value. -func (s *DescribeAccountAttributesOutput) SetAccountAttributes(v []*AccountAttribute) *DescribeAccountAttributesOutput { - s.AccountAttributes = v - return s -} - -// Contains the parameters for DescribeAddresses. -type DescribeAddressesInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] One or more allocation IDs. - // - // Default: Describes all your Elastic IP addresses. - AllocationIds []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. Filter names and values are case-sensitive. - // - // * allocation-id - [EC2-VPC] The allocation ID for the address. - // - // * association-id - [EC2-VPC] The association ID for the address. - // - // * domain - Indicates whether the address is for use in EC2-Classic (standard) - // or in a VPC (vpc). - // - // * instance-id - The ID of the instance the address is associated with, - // if any. - // - // * network-interface-id - [EC2-VPC] The ID of the network interface that - // the address is associated with, if any. - // - // * network-interface-owner-id - The AWS account ID of the owner. - // - // * private-ip-address - [EC2-VPC] The private IP address associated with - // the Elastic IP address. - // - // * public-ip - The Elastic IP address. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of the tag's key). If you want to - // list only resources where Purpose is X, see the tag:key=value filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // [EC2-Classic] One or more Elastic IP addresses. - // - // Default: Describes all your Elastic IP addresses. - PublicIps []*string `locationName:"PublicIp" locationNameList:"PublicIp" type:"list"` -} - -// String returns the string representation -func (s DescribeAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAddressesInput) GoString() string { - return s.String() -} - -// SetAllocationIds sets the AllocationIds field's value. -func (s *DescribeAddressesInput) SetAllocationIds(v []*string) *DescribeAddressesInput { - s.AllocationIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeAddressesInput) SetDryRun(v bool) *DescribeAddressesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeAddressesInput) SetFilters(v []*Filter) *DescribeAddressesInput { - s.Filters = v - return s -} - -// SetPublicIps sets the PublicIps field's value. -func (s *DescribeAddressesInput) SetPublicIps(v []*string) *DescribeAddressesInput { - s.PublicIps = v - return s -} - -// Contains the output of DescribeAddresses. -type DescribeAddressesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more Elastic IP addresses. - Addresses []*Address `locationName:"addressesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAddressesOutput) GoString() string { - return s.String() -} - -// SetAddresses sets the Addresses field's value. -func (s *DescribeAddressesOutput) SetAddresses(v []*Address) *DescribeAddressesOutput { - s.Addresses = v - return s -} - -type DescribeAggregateIdFormatInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` -} - -// String returns the string representation -func (s DescribeAggregateIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAggregateIdFormatInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeAggregateIdFormatInput) SetDryRun(v bool) *DescribeAggregateIdFormatInput { - s.DryRun = &v - return s -} - -type DescribeAggregateIdFormatOutput struct { - _ struct{} `type:"structure"` - - // Information about each resource's ID format. - Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` - - // Indicates whether all resource types in the region are configured to use - // longer IDs. This value is only true if all users are configured to use longer - // IDs for all resources types in the region. - UseLongIdsAggregated *bool `locationName:"useLongIdsAggregated" type:"boolean"` -} - -// String returns the string representation -func (s DescribeAggregateIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAggregateIdFormatOutput) GoString() string { - return s.String() -} - -// SetStatuses sets the Statuses field's value. -func (s *DescribeAggregateIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeAggregateIdFormatOutput { - s.Statuses = v - return s -} - -// SetUseLongIdsAggregated sets the UseLongIdsAggregated field's value. -func (s *DescribeAggregateIdFormatOutput) SetUseLongIdsAggregated(v bool) *DescribeAggregateIdFormatOutput { - s.UseLongIdsAggregated = &v - return s -} - -// Contains the parameters for DescribeAvailabilityZones. -type DescribeAvailabilityZonesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * message - Information about the Availability Zone. - // - // * region-name - The name of the region for the Availability Zone (for - // example, us-east-1). - // - // * state - The state of the Availability Zone (available | information - // | impaired | unavailable). - // - // * zone-name - The name of the Availability Zone (for example, us-east-1a). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The names of one or more Availability Zones. - ZoneNames []*string `locationName:"ZoneName" locationNameList:"ZoneName" type:"list"` -} - -// String returns the string representation -func (s DescribeAvailabilityZonesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAvailabilityZonesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeAvailabilityZonesInput) SetDryRun(v bool) *DescribeAvailabilityZonesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeAvailabilityZonesInput) SetFilters(v []*Filter) *DescribeAvailabilityZonesInput { - s.Filters = v - return s -} - -// SetZoneNames sets the ZoneNames field's value. -func (s *DescribeAvailabilityZonesInput) SetZoneNames(v []*string) *DescribeAvailabilityZonesInput { - s.ZoneNames = v - return s -} - -// Contains the output of DescribeAvailabiltyZones. -type DescribeAvailabilityZonesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more Availability Zones. - AvailabilityZones []*AvailabilityZone `locationName:"availabilityZoneInfo" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeAvailabilityZonesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAvailabilityZonesOutput) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DescribeAvailabilityZonesOutput) SetAvailabilityZones(v []*AvailabilityZone) *DescribeAvailabilityZonesOutput { - s.AvailabilityZones = v - return s -} - -// Contains the parameters for DescribeBundleTasks. -type DescribeBundleTasksInput struct { - _ struct{} `type:"structure"` - - // One or more bundle task IDs. - // - // Default: Describes all your bundle tasks. - BundleIds []*string `locationName:"BundleId" locationNameList:"BundleId" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * bundle-id - The ID of the bundle task. - // - // * error-code - If the task failed, the error code returned. - // - // * error-message - If the task failed, the error message returned. - // - // * instance-id - The ID of the instance. - // - // * progress - The level of task completion, as a percentage (for example, - // 20%). - // - // * s3-bucket - The Amazon S3 bucket to store the AMI. - // - // * s3-prefix - The beginning of the AMI name. - // - // * start-time - The time the task started (for example, 2013-09-15T17:15:20.000Z). - // - // * state - The state of the task (pending | waiting-for-shutdown | bundling - // | storing | cancelling | complete | failed). - // - // * update-time - The time of the most recent update for the task. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` -} - -// String returns the string representation -func (s DescribeBundleTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeBundleTasksInput) GoString() string { - return s.String() -} - -// SetBundleIds sets the BundleIds field's value. -func (s *DescribeBundleTasksInput) SetBundleIds(v []*string) *DescribeBundleTasksInput { - s.BundleIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeBundleTasksInput) SetDryRun(v bool) *DescribeBundleTasksInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeBundleTasksInput) SetFilters(v []*Filter) *DescribeBundleTasksInput { - s.Filters = v - return s -} - -// Contains the output of DescribeBundleTasks. -type DescribeBundleTasksOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more bundle tasks. - BundleTasks []*BundleTask `locationName:"bundleInstanceTasksSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeBundleTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeBundleTasksOutput) GoString() string { - return s.String() -} - -// SetBundleTasks sets the BundleTasks field's value. -func (s *DescribeBundleTasksOutput) SetBundleTasks(v []*BundleTask) *DescribeBundleTasksOutput { - s.BundleTasks = v - return s -} - -// Contains the parameters for DescribeClassicLinkInstances. -type DescribeClassicLinkInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * group-id - The ID of a VPC security group that's associated with the - // instance. - // - // * instance-id - The ID of the instance. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC that the instance is linked to. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more instance IDs. Must be instances linked to a VPC through ClassicLink. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. You cannot specify this parameter and the instance IDs parameter - // in the same request. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeClassicLinkInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClassicLinkInstancesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeClassicLinkInstancesInput) SetDryRun(v bool) *DescribeClassicLinkInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeClassicLinkInstancesInput) SetFilters(v []*Filter) *DescribeClassicLinkInstancesInput { - s.Filters = v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeClassicLinkInstancesInput) SetInstanceIds(v []*string) *DescribeClassicLinkInstancesInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeClassicLinkInstancesInput) SetMaxResults(v int64) *DescribeClassicLinkInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeClassicLinkInstancesInput) SetNextToken(v string) *DescribeClassicLinkInstancesInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeClassicLinkInstances. -type DescribeClassicLinkInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more linked EC2-Classic instances. - Instances []*ClassicLinkInstance `locationName:"instancesSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeClassicLinkInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClassicLinkInstancesOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *DescribeClassicLinkInstancesOutput) SetInstances(v []*ClassicLinkInstance) *DescribeClassicLinkInstancesOutput { - s.Instances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeClassicLinkInstancesOutput) SetNextToken(v string) *DescribeClassicLinkInstancesOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeConversionTasks. -type DescribeConversionTasksInput struct { - _ struct{} `type:"structure"` - - // One or more conversion task IDs. - ConversionTaskIds []*string `locationName:"conversionTaskId" locationNameList:"item" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DescribeConversionTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConversionTasksInput) GoString() string { - return s.String() -} - -// SetConversionTaskIds sets the ConversionTaskIds field's value. -func (s *DescribeConversionTasksInput) SetConversionTaskIds(v []*string) *DescribeConversionTasksInput { - s.ConversionTaskIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeConversionTasksInput) SetDryRun(v bool) *DescribeConversionTasksInput { - s.DryRun = &v - return s -} - -// Contains the output for DescribeConversionTasks. -type DescribeConversionTasksOutput struct { - _ struct{} `type:"structure"` - - // Information about the conversion tasks. - ConversionTasks []*ConversionTask `locationName:"conversionTasks" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeConversionTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConversionTasksOutput) GoString() string { - return s.String() -} - -// SetConversionTasks sets the ConversionTasks field's value. -func (s *DescribeConversionTasksOutput) SetConversionTasks(v []*ConversionTask) *DescribeConversionTasksOutput { - s.ConversionTasks = v - return s -} - -// Contains the parameters for DescribeCustomerGateways. -type DescribeCustomerGatewaysInput struct { - _ struct{} `type:"structure"` - - // One or more customer gateway IDs. - // - // Default: Describes all your customer gateways. - CustomerGatewayIds []*string `locationName:"CustomerGatewayId" locationNameList:"CustomerGatewayId" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * bgp-asn - The customer gateway's Border Gateway Protocol (BGP) Autonomous - // System Number (ASN). - // - // * customer-gateway-id - The ID of the customer gateway. - // - // * ip-address - The IP address of the customer gateway's Internet-routable - // external interface. - // - // * state - The state of the customer gateway (pending | available | deleting - // | deleted). - // - // * type - The type of customer gateway. Currently, the only supported type - // is ipsec.1. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` -} - -// String returns the string representation -func (s DescribeCustomerGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCustomerGatewaysInput) GoString() string { - return s.String() -} - -// SetCustomerGatewayIds sets the CustomerGatewayIds field's value. -func (s *DescribeCustomerGatewaysInput) SetCustomerGatewayIds(v []*string) *DescribeCustomerGatewaysInput { - s.CustomerGatewayIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeCustomerGatewaysInput) SetDryRun(v bool) *DescribeCustomerGatewaysInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeCustomerGatewaysInput) SetFilters(v []*Filter) *DescribeCustomerGatewaysInput { - s.Filters = v - return s -} - -// Contains the output of DescribeCustomerGateways. -type DescribeCustomerGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more customer gateways. - CustomerGateways []*CustomerGateway `locationName:"customerGatewaySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeCustomerGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCustomerGatewaysOutput) GoString() string { - return s.String() -} - -// SetCustomerGateways sets the CustomerGateways field's value. -func (s *DescribeCustomerGatewaysOutput) SetCustomerGateways(v []*CustomerGateway) *DescribeCustomerGatewaysOutput { - s.CustomerGateways = v - return s -} - -// Contains the parameters for DescribeDhcpOptions. -type DescribeDhcpOptionsInput struct { - _ struct{} `type:"structure"` - - // The IDs of one or more DHCP options sets. - // - // Default: Describes all your DHCP options sets. - DhcpOptionsIds []*string `locationName:"DhcpOptionsId" locationNameList:"DhcpOptionsId" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * dhcp-options-id - The ID of a set of DHCP options. - // - // * key - The key for one of the options (for example, domain-name). - // - // * value - The value for one of the options. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` -} - -// String returns the string representation -func (s DescribeDhcpOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDhcpOptionsInput) GoString() string { - return s.String() -} - -// SetDhcpOptionsIds sets the DhcpOptionsIds field's value. -func (s *DescribeDhcpOptionsInput) SetDhcpOptionsIds(v []*string) *DescribeDhcpOptionsInput { - s.DhcpOptionsIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeDhcpOptionsInput) SetDryRun(v bool) *DescribeDhcpOptionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDhcpOptionsInput) SetFilters(v []*Filter) *DescribeDhcpOptionsInput { - s.Filters = v - return s -} - -// Contains the output of DescribeDhcpOptions. -type DescribeDhcpOptionsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more DHCP options sets. - DhcpOptions []*DhcpOptions `locationName:"dhcpOptionsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeDhcpOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDhcpOptionsOutput) GoString() string { - return s.String() -} - -// SetDhcpOptions sets the DhcpOptions field's value. -func (s *DescribeDhcpOptionsOutput) SetDhcpOptions(v []*DhcpOptions) *DescribeDhcpOptionsOutput { - s.DhcpOptions = v - return s -} - -type DescribeEgressOnlyInternetGatewaysInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more egress-only Internet gateway IDs. - EgressOnlyInternetGatewayIds []*string `locationName:"EgressOnlyInternetGatewayId" locationNameList:"item" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // NextToken value. This value can be between 5 and 1000; if MaxResults is given - // a value larger than 1000, only 1000 results are returned. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEgressOnlyInternetGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEgressOnlyInternetGatewaysInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetDryRun(v bool) *DescribeEgressOnlyInternetGatewaysInput { - s.DryRun = &v - return s -} - -// SetEgressOnlyInternetGatewayIds sets the EgressOnlyInternetGatewayIds field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetEgressOnlyInternetGatewayIds(v []*string) *DescribeEgressOnlyInternetGatewaysInput { - s.EgressOnlyInternetGatewayIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetMaxResults(v int64) *DescribeEgressOnlyInternetGatewaysInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetNextToken(v string) *DescribeEgressOnlyInternetGatewaysInput { - s.NextToken = &v - return s -} - -type DescribeEgressOnlyInternetGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about the egress-only Internet gateways. - EgressOnlyInternetGateways []*EgressOnlyInternetGateway `locationName:"egressOnlyInternetGatewaySet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeEgressOnlyInternetGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEgressOnlyInternetGatewaysOutput) GoString() string { - return s.String() -} - -// SetEgressOnlyInternetGateways sets the EgressOnlyInternetGateways field's value. -func (s *DescribeEgressOnlyInternetGatewaysOutput) SetEgressOnlyInternetGateways(v []*EgressOnlyInternetGateway) *DescribeEgressOnlyInternetGatewaysOutput { - s.EgressOnlyInternetGateways = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEgressOnlyInternetGatewaysOutput) SetNextToken(v string) *DescribeEgressOnlyInternetGatewaysOutput { - s.NextToken = &v - return s -} - -type DescribeElasticGpusInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more Elastic GPU IDs. - ElasticGpuIds []*string `locationName:"ElasticGpuId" locationNameList:"item" type:"list"` - - // One or more filters. - // - // * availability-zone - The Availability Zone in which the Elastic GPU resides. - // - // * elastic-gpu-health - The status of the Elastic GPU (OK | IMPAIRED). - // - // * elastic-gpu-state - The state of the Elastic GPU (ATTACHED). - // - // * elastic-gpu-type - The type of Elastic GPU; for example, eg1.medium. - // - // * instance-id - The ID of the instance to which the Elastic GPU is associated. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. - MaxResults *int64 `type:"integer"` - - // The token to request the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeElasticGpusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticGpusInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeElasticGpusInput) SetDryRun(v bool) *DescribeElasticGpusInput { - s.DryRun = &v - return s -} - -// SetElasticGpuIds sets the ElasticGpuIds field's value. -func (s *DescribeElasticGpusInput) SetElasticGpuIds(v []*string) *DescribeElasticGpusInput { - s.ElasticGpuIds = v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeElasticGpusInput) SetFilters(v []*Filter) *DescribeElasticGpusInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeElasticGpusInput) SetMaxResults(v int64) *DescribeElasticGpusInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeElasticGpusInput) SetNextToken(v string) *DescribeElasticGpusInput { - s.NextToken = &v - return s -} - -type DescribeElasticGpusOutput struct { - _ struct{} `type:"structure"` - - // Information about the Elastic GPUs. - ElasticGpuSet []*ElasticGpus `locationName:"elasticGpuSet" locationNameList:"item" type:"list"` - - // The total number of items to return. If the total number of items available - // is more than the value specified in max-items then a Next-Token will be provided - // in the output that you can use to resume pagination. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeElasticGpusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeElasticGpusOutput) GoString() string { - return s.String() -} - -// SetElasticGpuSet sets the ElasticGpuSet field's value. -func (s *DescribeElasticGpusOutput) SetElasticGpuSet(v []*ElasticGpus) *DescribeElasticGpusOutput { - s.ElasticGpuSet = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeElasticGpusOutput) SetMaxResults(v int64) *DescribeElasticGpusOutput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeElasticGpusOutput) SetNextToken(v string) *DescribeElasticGpusOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeExportTasks. -type DescribeExportTasksInput struct { - _ struct{} `type:"structure"` - - // One or more export task IDs. - ExportTaskIds []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"` -} - -// String returns the string representation -func (s DescribeExportTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeExportTasksInput) GoString() string { - return s.String() -} - -// SetExportTaskIds sets the ExportTaskIds field's value. -func (s *DescribeExportTasksInput) SetExportTaskIds(v []*string) *DescribeExportTasksInput { - s.ExportTaskIds = v - return s -} - -// Contains the output for DescribeExportTasks. -type DescribeExportTasksOutput struct { - _ struct{} `type:"structure"` - - // Information about the export tasks. - ExportTasks []*ExportTask `locationName:"exportTaskSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeExportTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeExportTasksOutput) GoString() string { - return s.String() -} - -// SetExportTasks sets the ExportTasks field's value. -func (s *DescribeExportTasksOutput) SetExportTasks(v []*ExportTask) *DescribeExportTasksOutput { - s.ExportTasks = v - return s -} - -type DescribeFleetHistoryInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The type of events to describe. By default, all events are described. - EventType *string `type:"string" enum:"FleetEventType"` - - // The ID of the EC2 Fleet. - // - // FleetId is a required field - FleetId *string `type:"string" required:"true"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` - - // The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s DescribeFleetHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFleetHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFleetHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFleetHistoryInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeFleetHistoryInput) SetDryRun(v bool) *DescribeFleetHistoryInput { - s.DryRun = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *DescribeFleetHistoryInput) SetEventType(v string) *DescribeFleetHistoryInput { - s.EventType = &v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *DescribeFleetHistoryInput) SetFleetId(v string) *DescribeFleetHistoryInput { - s.FleetId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFleetHistoryInput) SetMaxResults(v int64) *DescribeFleetHistoryInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetHistoryInput) SetNextToken(v string) *DescribeFleetHistoryInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeFleetHistoryInput) SetStartTime(v time.Time) *DescribeFleetHistoryInput { - s.StartTime = &v - return s -} - -type DescribeFleetHistoryOutput struct { - _ struct{} `type:"structure"` - - // The ID of the EC Fleet. - FleetId *string `locationName:"fleetId" type:"string"` - - // Information about the events in the history of the EC2 Fleet. - HistoryRecords []*HistoryRecordEntry `locationName:"historyRecordSet" locationNameList:"item" type:"list"` - - // The last date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // All records up to this time were retrieved. - // - // If nextToken indicates that there are more results, this value is not present. - LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp" timestampFormat:"iso8601"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeFleetHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFleetHistoryOutput) GoString() string { - return s.String() -} - -// SetFleetId sets the FleetId field's value. -func (s *DescribeFleetHistoryOutput) SetFleetId(v string) *DescribeFleetHistoryOutput { - s.FleetId = &v - return s -} - -// SetHistoryRecords sets the HistoryRecords field's value. -func (s *DescribeFleetHistoryOutput) SetHistoryRecords(v []*HistoryRecordEntry) *DescribeFleetHistoryOutput { - s.HistoryRecords = v - return s -} - -// SetLastEvaluatedTime sets the LastEvaluatedTime field's value. -func (s *DescribeFleetHistoryOutput) SetLastEvaluatedTime(v time.Time) *DescribeFleetHistoryOutput { - s.LastEvaluatedTime = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetHistoryOutput) SetNextToken(v string) *DescribeFleetHistoryOutput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeFleetHistoryOutput) SetStartTime(v time.Time) *DescribeFleetHistoryOutput { - s.StartTime = &v - return s -} - -type DescribeFleetInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The ID of the EC2 Fleet. - // - // FleetId is a required field - FleetId *string `type:"string" required:"true"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeFleetInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFleetInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFleetInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFleetInstancesInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeFleetInstancesInput) SetDryRun(v bool) *DescribeFleetInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeFleetInstancesInput) SetFilters(v []*Filter) *DescribeFleetInstancesInput { - s.Filters = v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *DescribeFleetInstancesInput) SetFleetId(v string) *DescribeFleetInstancesInput { - s.FleetId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFleetInstancesInput) SetMaxResults(v int64) *DescribeFleetInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetInstancesInput) SetNextToken(v string) *DescribeFleetInstancesInput { - s.NextToken = &v - return s -} - -type DescribeFleetInstancesOutput struct { - _ struct{} `type:"structure"` - - // The running instances. This list is refreshed periodically and might be out - // of date. - ActiveInstances []*ActiveInstance `locationName:"activeInstanceSet" locationNameList:"item" type:"list"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeFleetInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFleetInstancesOutput) GoString() string { - return s.String() -} - -// SetActiveInstances sets the ActiveInstances field's value. -func (s *DescribeFleetInstancesOutput) SetActiveInstances(v []*ActiveInstance) *DescribeFleetInstancesOutput { - s.ActiveInstances = v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *DescribeFleetInstancesOutput) SetFleetId(v string) *DescribeFleetInstancesOutput { - s.FleetId = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetInstancesOutput) SetNextToken(v string) *DescribeFleetInstancesOutput { - s.NextToken = &v - return s -} - -type DescribeFleetsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The ID of the EC2 Fleets. - FleetIds []*string `locationName:"FleetId" type:"list"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeFleetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFleetsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeFleetsInput) SetDryRun(v bool) *DescribeFleetsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeFleetsInput) SetFilters(v []*Filter) *DescribeFleetsInput { - s.Filters = v - return s -} - -// SetFleetIds sets the FleetIds field's value. -func (s *DescribeFleetsInput) SetFleetIds(v []*string) *DescribeFleetsInput { - s.FleetIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFleetsInput) SetMaxResults(v int64) *DescribeFleetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetsInput) SetNextToken(v string) *DescribeFleetsInput { - s.NextToken = &v - return s -} - -type DescribeFleetsOutput struct { - _ struct{} `type:"structure"` - - // The EC2 Fleets. - Fleets []*FleetData `locationName:"fleetSet" locationNameList:"item" type:"list"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeFleetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFleetsOutput) GoString() string { - return s.String() -} - -// SetFleets sets the Fleets field's value. -func (s *DescribeFleetsOutput) SetFleets(v []*FleetData) *DescribeFleetsOutput { - s.Fleets = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetsOutput) SetNextToken(v string) *DescribeFleetsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeFlowLogs. -type DescribeFlowLogsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * deliver-log-status - The status of the logs delivery (SUCCESS | FAILED). - // - // * flow-log-id - The ID of the flow log. - // - // * log-group-name - The name of the log group. - // - // * resource-id - The ID of the VPC, subnet, or network interface. - // - // * traffic-type - The type of traffic (ACCEPT | REJECT | ALL) - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // One or more flow log IDs. - FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // NextToken value. This value can be between 5 and 1000; if MaxResults is given - // a value larger than 1000, only 1000 results are returned. You cannot specify - // this parameter and the flow log IDs parameter in the same request. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeFlowLogsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFlowLogsInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeFlowLogsInput) SetFilter(v []*Filter) *DescribeFlowLogsInput { - s.Filter = v - return s -} - -// SetFlowLogIds sets the FlowLogIds field's value. -func (s *DescribeFlowLogsInput) SetFlowLogIds(v []*string) *DescribeFlowLogsInput { - s.FlowLogIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFlowLogsInput) SetMaxResults(v int64) *DescribeFlowLogsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFlowLogsInput) SetNextToken(v string) *DescribeFlowLogsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeFlowLogs. -type DescribeFlowLogsOutput struct { - _ struct{} `type:"structure"` - - // Information about the flow logs. - FlowLogs []*FlowLog `locationName:"flowLogSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeFlowLogsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFlowLogsOutput) GoString() string { - return s.String() -} - -// SetFlowLogs sets the FlowLogs field's value. -func (s *DescribeFlowLogsOutput) SetFlowLogs(v []*FlowLog) *DescribeFlowLogsOutput { - s.FlowLogs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFlowLogsOutput) SetNextToken(v string) *DescribeFlowLogsOutput { - s.NextToken = &v - return s -} - -type DescribeFpgaImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The AFI attribute. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"FpgaImageAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the AFI. - // - // FpgaImageId is a required field - FpgaImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeFpgaImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFpgaImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFpgaImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFpgaImageAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.FpgaImageId == nil { - invalidParams.Add(request.NewErrParamRequired("FpgaImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeFpgaImageAttributeInput) SetAttribute(v string) *DescribeFpgaImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeFpgaImageAttributeInput) SetDryRun(v bool) *DescribeFpgaImageAttributeInput { - s.DryRun = &v - return s -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *DescribeFpgaImageAttributeInput) SetFpgaImageId(v string) *DescribeFpgaImageAttributeInput { - s.FpgaImageId = &v - return s -} - -type DescribeFpgaImageAttributeOutput struct { - _ struct{} `type:"structure"` - - // Information about the attribute. - FpgaImageAttribute *FpgaImageAttribute `locationName:"fpgaImageAttribute" type:"structure"` -} - -// String returns the string representation -func (s DescribeFpgaImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFpgaImageAttributeOutput) GoString() string { - return s.String() -} - -// SetFpgaImageAttribute sets the FpgaImageAttribute field's value. -func (s *DescribeFpgaImageAttributeOutput) SetFpgaImageAttribute(v *FpgaImageAttribute) *DescribeFpgaImageAttributeOutput { - s.FpgaImageAttribute = v - return s -} - -type DescribeFpgaImagesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * create-time - The creation time of the AFI. - // - // * fpga-image-id - The FPGA image identifier (AFI ID). - // - // * fpga-image-global-id - The global FPGA image identifier (AGFI ID). - // - // * name - The name of the AFI. - // - // * owner-id - The AWS account ID of the AFI owner. - // - // * product-code - The product code. - // - // * shell-version - The version of the AWS Shell that was used to create - // the bitstream. - // - // * state - The state of the AFI (pending | failed | available | unavailable). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * update-time - The time of the most recent update. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more AFI IDs. - FpgaImageIds []*string `locationName:"FpgaImageId" locationNameList:"item" type:"list"` - - // The maximum number of results to return in a single call. - MaxResults *int64 `min:"5" type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `min:"1" type:"string"` - - // Filters the AFI by owner. Specify an AWS account ID, self (owner is the sender - // of the request), or an AWS owner alias (valid values are amazon | aws-marketplace). - Owners []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` -} - -// String returns the string representation -func (s DescribeFpgaImagesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFpgaImagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFpgaImagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFpgaImagesInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeFpgaImagesInput) SetDryRun(v bool) *DescribeFpgaImagesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeFpgaImagesInput) SetFilters(v []*Filter) *DescribeFpgaImagesInput { - s.Filters = v - return s -} - -// SetFpgaImageIds sets the FpgaImageIds field's value. -func (s *DescribeFpgaImagesInput) SetFpgaImageIds(v []*string) *DescribeFpgaImagesInput { - s.FpgaImageIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFpgaImagesInput) SetMaxResults(v int64) *DescribeFpgaImagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFpgaImagesInput) SetNextToken(v string) *DescribeFpgaImagesInput { - s.NextToken = &v - return s -} - -// SetOwners sets the Owners field's value. -func (s *DescribeFpgaImagesInput) SetOwners(v []*string) *DescribeFpgaImagesInput { - s.Owners = v - return s -} - -type DescribeFpgaImagesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more FPGA images. - FpgaImages []*FpgaImage `locationName:"fpgaImageSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeFpgaImagesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFpgaImagesOutput) GoString() string { - return s.String() -} - -// SetFpgaImages sets the FpgaImages field's value. -func (s *DescribeFpgaImagesOutput) SetFpgaImages(v []*FpgaImage) *DescribeFpgaImagesOutput { - s.FpgaImages = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFpgaImagesOutput) SetNextToken(v string) *DescribeFpgaImagesOutput { - s.NextToken = &v - return s -} - -type DescribeHostReservationOfferingsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * instance-family - The instance family of the offering (e.g., m4). - // - // * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // This is the maximum duration of the reservation you'd like to purchase, specified - // in seconds. Reservations are available in one-year and three-year terms. - // The number of seconds specified must be the number of seconds in a year (365x24x60x60) - // times one of the supported durations (1 or 3). For example, specify 94608000 - // for three years. - MaxDuration *int64 `type:"integer"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500; if maxResults is given - // a larger value than 500, you will receive an error. - MaxResults *int64 `type:"integer"` - - // This is the minimum duration of the reservation you'd like to purchase, specified - // in seconds. Reservations are available in one-year and three-year terms. - // The number of seconds specified must be the number of seconds in a year (365x24x60x60) - // times one of the supported durations (1 or 3). For example, specify 31536000 - // for one year. - MinDuration *int64 `type:"integer"` - - // The token to use to retrieve the next page of results. - NextToken *string `type:"string"` - - // The ID of the reservation offering. - OfferingId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeHostReservationOfferingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostReservationOfferingsInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeHostReservationOfferingsInput) SetFilter(v []*Filter) *DescribeHostReservationOfferingsInput { - s.Filter = v - return s -} - -// SetMaxDuration sets the MaxDuration field's value. -func (s *DescribeHostReservationOfferingsInput) SetMaxDuration(v int64) *DescribeHostReservationOfferingsInput { - s.MaxDuration = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostReservationOfferingsInput) SetMaxResults(v int64) *DescribeHostReservationOfferingsInput { - s.MaxResults = &v - return s -} - -// SetMinDuration sets the MinDuration field's value. -func (s *DescribeHostReservationOfferingsInput) SetMinDuration(v int64) *DescribeHostReservationOfferingsInput { - s.MinDuration = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationOfferingsInput) SetNextToken(v string) *DescribeHostReservationOfferingsInput { - s.NextToken = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *DescribeHostReservationOfferingsInput) SetOfferingId(v string) *DescribeHostReservationOfferingsInput { - s.OfferingId = &v - return s -} - -type DescribeHostReservationOfferingsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the offerings. - OfferingSet []*HostOffering `locationName:"offeringSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeHostReservationOfferingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostReservationOfferingsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationOfferingsOutput) SetNextToken(v string) *DescribeHostReservationOfferingsOutput { - s.NextToken = &v - return s -} - -// SetOfferingSet sets the OfferingSet field's value. -func (s *DescribeHostReservationOfferingsOutput) SetOfferingSet(v []*HostOffering) *DescribeHostReservationOfferingsOutput { - s.OfferingSet = v - return s -} - -type DescribeHostReservationsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * instance-family - The instance family (e.g., m4). - // - // * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). - // - // * state - The state of the reservation (payment-pending | payment-failed - // | active | retired). - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // One or more host reservation IDs. - HostReservationIdSet []*string `locationNameList:"item" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500; if maxResults is given - // a larger value than 500, you will receive an error. - MaxResults *int64 `type:"integer"` - - // The token to use to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeHostReservationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostReservationsInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeHostReservationsInput) SetFilter(v []*Filter) *DescribeHostReservationsInput { - s.Filter = v - return s -} - -// SetHostReservationIdSet sets the HostReservationIdSet field's value. -func (s *DescribeHostReservationsInput) SetHostReservationIdSet(v []*string) *DescribeHostReservationsInput { - s.HostReservationIdSet = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostReservationsInput) SetMaxResults(v int64) *DescribeHostReservationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationsInput) SetNextToken(v string) *DescribeHostReservationsInput { - s.NextToken = &v - return s -} - -type DescribeHostReservationsOutput struct { - _ struct{} `type:"structure"` - - // Details about the reservation's configuration. - HostReservationSet []*HostReservation `locationName:"hostReservationSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeHostReservationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostReservationsOutput) GoString() string { - return s.String() -} - -// SetHostReservationSet sets the HostReservationSet field's value. -func (s *DescribeHostReservationsOutput) SetHostReservationSet(v []*HostReservation) *DescribeHostReservationsOutput { - s.HostReservationSet = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationsOutput) SetNextToken(v string) *DescribeHostReservationsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeHosts. -type DescribeHostsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * auto-placement - Whether auto-placement is enabled or disabled (on | - // off). - // - // * availability-zone - The Availability Zone of the host. - // - // * client-token - The idempotency token you provided when you allocated - // the host. - // - // * host-reservation-id - The ID of the reservation assigned to this host. - // - // * instance-type - The instance type size that the Dedicated Host is configured - // to support. - // - // * state - The allocation state of the Dedicated Host (available | under-assessment - // | permanent-failure | released | released-permanent-failure). - Filter []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` - - // The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches. - HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500; if maxResults is given - // a larger value than 500, you will receive an error. You cannot specify this - // parameter and the host IDs parameter in the same request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeHostsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostsInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeHostsInput) SetFilter(v []*Filter) *DescribeHostsInput { - s.Filter = v - return s -} - -// SetHostIds sets the HostIds field's value. -func (s *DescribeHostsInput) SetHostIds(v []*string) *DescribeHostsInput { - s.HostIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostsInput) SetMaxResults(v int64) *DescribeHostsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostsInput) SetNextToken(v string) *DescribeHostsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeHosts. -type DescribeHostsOutput struct { - _ struct{} `type:"structure"` - - // Information about the Dedicated Hosts. - Hosts []*Host `locationName:"hostSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeHostsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostsOutput) GoString() string { - return s.String() -} - -// SetHosts sets the Hosts field's value. -func (s *DescribeHostsOutput) SetHosts(v []*Host) *DescribeHostsOutput { - s.Hosts = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostsOutput) SetNextToken(v string) *DescribeHostsOutput { - s.NextToken = &v - return s -} - -type DescribeIamInstanceProfileAssociationsInput struct { - _ struct{} `type:"structure"` - - // One or more IAM instance profile associations. - AssociationIds []*string `locationName:"AssociationId" locationNameList:"AssociationId" type:"list"` - - // One or more filters. - // - // * instance-id - The ID of the instance. - // - // * state - The state of the association (associating | associated | disassociating - // | disassociated). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int64 `min:"5" type:"integer"` - - // The token to request the next page of results. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeIamInstanceProfileAssociationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIamInstanceProfileAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeIamInstanceProfileAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeIamInstanceProfileAssociationsInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationIds sets the AssociationIds field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetAssociationIds(v []*string) *DescribeIamInstanceProfileAssociationsInput { - s.AssociationIds = v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetFilters(v []*Filter) *DescribeIamInstanceProfileAssociationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetMaxResults(v int64) *DescribeIamInstanceProfileAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsInput { - s.NextToken = &v - return s -} - -type DescribeIamInstanceProfileAssociationsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more IAM instance profile associations. - IamInstanceProfileAssociations []*IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociationSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeIamInstanceProfileAssociationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIamInstanceProfileAssociationsOutput) GoString() string { - return s.String() -} - -// SetIamInstanceProfileAssociations sets the IamInstanceProfileAssociations field's value. -func (s *DescribeIamInstanceProfileAssociationsOutput) SetIamInstanceProfileAssociations(v []*IamInstanceProfileAssociation) *DescribeIamInstanceProfileAssociationsOutput { - s.IamInstanceProfileAssociations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeIamInstanceProfileAssociationsOutput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeIdFormat. -type DescribeIdFormatInput struct { - _ struct{} `type:"structure"` - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log - // | image | import-task | instance | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | reservation - // | route-table | route-table-association | security-group | snapshot | subnet - // | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association - // | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway - Resource *string `type:"string"` -} - -// String returns the string representation -func (s DescribeIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIdFormatInput) GoString() string { - return s.String() -} - -// SetResource sets the Resource field's value. -func (s *DescribeIdFormatInput) SetResource(v string) *DescribeIdFormatInput { - s.Resource = &v - return s -} - -// Contains the output of DescribeIdFormat. -type DescribeIdFormatOutput struct { - _ struct{} `type:"structure"` - - // Information about the ID format for the resource. - Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIdFormatOutput) GoString() string { - return s.String() -} - -// SetStatuses sets the Statuses field's value. -func (s *DescribeIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdFormatOutput { - s.Statuses = v - return s -} - -// Contains the parameters for DescribeIdentityIdFormat. -type DescribeIdentityIdFormatInput struct { - _ struct{} `type:"structure"` - - // The ARN of the principal, which can be an IAM role, IAM user, or the root - // user. - // - // PrincipalArn is a required field - PrincipalArn *string `locationName:"principalArn" type:"string" required:"true"` - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log - // | image | import-task | instance | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | reservation - // | route-table | route-table-association | security-group | snapshot | subnet - // | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association - // | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway - Resource *string `locationName:"resource" type:"string"` -} - -// String returns the string representation -func (s DescribeIdentityIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIdentityIdFormatInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeIdentityIdFormatInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeIdentityIdFormatInput"} - if s.PrincipalArn == nil { - invalidParams.Add(request.NewErrParamRequired("PrincipalArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrincipalArn sets the PrincipalArn field's value. -func (s *DescribeIdentityIdFormatInput) SetPrincipalArn(v string) *DescribeIdentityIdFormatInput { - s.PrincipalArn = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *DescribeIdentityIdFormatInput) SetResource(v string) *DescribeIdentityIdFormatInput { - s.Resource = &v - return s -} - -// Contains the output of DescribeIdentityIdFormat. -type DescribeIdentityIdFormatOutput struct { - _ struct{} `type:"structure"` - - // Information about the ID format for the resources. - Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeIdentityIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIdentityIdFormatOutput) GoString() string { - return s.String() -} - -// SetStatuses sets the Statuses field's value. -func (s *DescribeIdentityIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdentityIdFormatOutput { - s.Statuses = v - return s -} - -// Contains the parameters for DescribeImageAttribute. -type DescribeImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The AMI attribute. - // - // Note: Depending on your account privileges, the blockDeviceMapping attribute - // may return a Client.AuthFailure error. If this happens, use DescribeImages - // to get information about the block device mapping for the AMI. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"ImageAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the AMI. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeImageAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeImageAttributeInput) SetAttribute(v string) *DescribeImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeImageAttributeInput) SetDryRun(v bool) *DescribeImageAttributeInput { - s.DryRun = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *DescribeImageAttributeInput) SetImageId(v string) *DescribeImageAttributeInput { - s.ImageId = &v - return s -} - -// Describes an image attribute. -type DescribeImageAttributeOutput struct { - _ struct{} `type:"structure"` - - // One or more block device mapping entries. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // A description for the AMI. - Description *AttributeValue `locationName:"description" type:"structure"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The kernel ID. - KernelId *AttributeValue `locationName:"kernel" type:"structure"` - - // One or more launch permissions. - LaunchPermissions []*LaunchPermission `locationName:"launchPermission" locationNameList:"item" type:"list"` - - // One or more product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // The RAM disk ID. - RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` - - // Indicates whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` -} - -// String returns the string representation -func (s DescribeImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImageAttributeOutput) GoString() string { - return s.String() -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *DescribeImageAttributeOutput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *DescribeImageAttributeOutput { - s.BlockDeviceMappings = v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribeImageAttributeOutput) SetDescription(v *AttributeValue) *DescribeImageAttributeOutput { - s.Description = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *DescribeImageAttributeOutput) SetImageId(v string) *DescribeImageAttributeOutput { - s.ImageId = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *DescribeImageAttributeOutput) SetKernelId(v *AttributeValue) *DescribeImageAttributeOutput { - s.KernelId = v - return s -} - -// SetLaunchPermissions sets the LaunchPermissions field's value. -func (s *DescribeImageAttributeOutput) SetLaunchPermissions(v []*LaunchPermission) *DescribeImageAttributeOutput { - s.LaunchPermissions = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeImageAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeImageAttributeOutput { - s.ProductCodes = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *DescribeImageAttributeOutput) SetRamdiskId(v *AttributeValue) *DescribeImageAttributeOutput { - s.RamdiskId = v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *DescribeImageAttributeOutput) SetSriovNetSupport(v *AttributeValue) *DescribeImageAttributeOutput { - s.SriovNetSupport = v - return s -} - -// Contains the parameters for DescribeImages. -type DescribeImagesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Scopes the images by users with explicit launch permissions. Specify an AWS - // account ID, self (the sender of the request), or all (public AMIs). - ExecutableUsers []*string `locationName:"ExecutableBy" locationNameList:"ExecutableBy" type:"list"` - - // One or more filters. - // - // * architecture - The image architecture (i386 | x86_64). - // - // * block-device-mapping.delete-on-termination - A Boolean value that indicates - // whether the Amazon EBS volume is deleted on instance termination. - // - // * block-device-mapping.device-name - The device name specified in the - // block device mapping (for example, /dev/sdh or xvdh). - // - // * block-device-mapping.snapshot-id - The ID of the snapshot used for the - // EBS volume. - // - // * block-device-mapping.volume-size - The volume size of the EBS volume, - // in GiB. - // - // * block-device-mapping.volume-type - The volume type of the EBS volume - // (gp2 | io1 | st1 | sc1 | standard). - // - // * description - The description of the image (provided during image creation). - // - // * ena-support - A Boolean that indicates whether enhanced networking with - // ENA is enabled. - // - // * hypervisor - The hypervisor type (ovm | xen). - // - // * image-id - The ID of the image. - // - // * image-type - The image type (machine | kernel | ramdisk). - // - // * is-public - A Boolean that indicates whether the image is public. - // - // * kernel-id - The kernel ID. - // - // * manifest-location - The location of the image manifest. - // - // * name - The name of the AMI (provided during image creation). - // - // * owner-alias - String value from an Amazon-maintained list (amazon | - // aws-marketplace | microsoft) of snapshot owners. Not to be confused with - // the user-configured AWS account alias, which is set from the IAM console. - // - // * owner-id - The AWS account ID of the image owner. - // - // * platform - The platform. To only list Windows-based AMIs, use windows. - // - // * product-code - The product code. - // - // * product-code.type - The type of the product code (devpay | marketplace). - // - // * ramdisk-id - The RAM disk ID. - // - // * root-device-name - The device name of the root device volume (for example, - // /dev/sda1). - // - // * root-device-type - The type of the root device volume (ebs | instance-store). - // - // * state - The state of the image (available | pending | failed). - // - // * state-reason-code - The reason code for the state change. - // - // * state-reason-message - The message for the state change. - // - // * sriov-net-support - A value of simple indicates that enhanced networking - // with the Intel 82599 VF interface is enabled. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * virtualization-type - The virtualization type (paravirtual | hvm). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more image IDs. - // - // Default: Describes all images available to you. - ImageIds []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` - - // Filters the images by the owner. Specify an AWS account ID, self (owner is - // the sender of the request), or an AWS owner alias (valid values are amazon - // | aws-marketplace | microsoft). Omitting this option returns all images for - // which you have launch permissions, regardless of ownership. - Owners []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` -} - -// String returns the string representation -func (s DescribeImagesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImagesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeImagesInput) SetDryRun(v bool) *DescribeImagesInput { - s.DryRun = &v - return s -} - -// SetExecutableUsers sets the ExecutableUsers field's value. -func (s *DescribeImagesInput) SetExecutableUsers(v []*string) *DescribeImagesInput { - s.ExecutableUsers = v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeImagesInput) SetFilters(v []*Filter) *DescribeImagesInput { - s.Filters = v - return s -} - -// SetImageIds sets the ImageIds field's value. -func (s *DescribeImagesInput) SetImageIds(v []*string) *DescribeImagesInput { - s.ImageIds = v - return s -} - -// SetOwners sets the Owners field's value. -func (s *DescribeImagesInput) SetOwners(v []*string) *DescribeImagesInput { - s.Owners = v - return s -} - -// Contains the output of DescribeImages. -type DescribeImagesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more images. - Images []*Image `locationName:"imagesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeImagesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImagesOutput) GoString() string { - return s.String() -} - -// SetImages sets the Images field's value. -func (s *DescribeImagesOutput) SetImages(v []*Image) *DescribeImagesOutput { - s.Images = v - return s -} - -// Contains the parameters for DescribeImportImageTasks. -type DescribeImportImageTasksInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // Filter tasks using the task-state filter and one of the following values: - // active, completed, deleting, deleted. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // A list of import image task IDs. - ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // A token that indicates the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeImportImageTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImportImageTasksInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeImportImageTasksInput) SetDryRun(v bool) *DescribeImportImageTasksInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeImportImageTasksInput) SetFilters(v []*Filter) *DescribeImportImageTasksInput { - s.Filters = v - return s -} - -// SetImportTaskIds sets the ImportTaskIds field's value. -func (s *DescribeImportImageTasksInput) SetImportTaskIds(v []*string) *DescribeImportImageTasksInput { - s.ImportTaskIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeImportImageTasksInput) SetMaxResults(v int64) *DescribeImportImageTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImportImageTasksInput) SetNextToken(v string) *DescribeImportImageTasksInput { - s.NextToken = &v - return s -} - -// Contains the output for DescribeImportImageTasks. -type DescribeImportImageTasksOutput struct { - _ struct{} `type:"structure"` - - // A list of zero or more import image tasks that are currently active or were - // completed or canceled in the previous 7 days. - ImportImageTasks []*ImportImageTask `locationName:"importImageTaskSet" locationNameList:"item" type:"list"` - - // The token to use to get the next page of results. This value is null when - // there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeImportImageTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImportImageTasksOutput) GoString() string { - return s.String() -} - -// SetImportImageTasks sets the ImportImageTasks field's value. -func (s *DescribeImportImageTasksOutput) SetImportImageTasks(v []*ImportImageTask) *DescribeImportImageTasksOutput { - s.ImportImageTasks = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImportImageTasksOutput) SetNextToken(v string) *DescribeImportImageTasksOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeImportSnapshotTasks. -type DescribeImportSnapshotTasksInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // A list of import snapshot task IDs. - ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // A token that indicates the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeImportSnapshotTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImportSnapshotTasksInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeImportSnapshotTasksInput) SetDryRun(v bool) *DescribeImportSnapshotTasksInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeImportSnapshotTasksInput) SetFilters(v []*Filter) *DescribeImportSnapshotTasksInput { - s.Filters = v - return s -} - -// SetImportTaskIds sets the ImportTaskIds field's value. -func (s *DescribeImportSnapshotTasksInput) SetImportTaskIds(v []*string) *DescribeImportSnapshotTasksInput { - s.ImportTaskIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeImportSnapshotTasksInput) SetMaxResults(v int64) *DescribeImportSnapshotTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImportSnapshotTasksInput) SetNextToken(v string) *DescribeImportSnapshotTasksInput { - s.NextToken = &v - return s -} - -// Contains the output for DescribeImportSnapshotTasks. -type DescribeImportSnapshotTasksOutput struct { - _ struct{} `type:"structure"` - - // A list of zero or more import snapshot tasks that are currently active or - // were completed or canceled in the previous 7 days. - ImportSnapshotTasks []*ImportSnapshotTask `locationName:"importSnapshotTaskSet" locationNameList:"item" type:"list"` - - // The token to use to get the next page of results. This value is null when - // there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeImportSnapshotTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImportSnapshotTasksOutput) GoString() string { - return s.String() -} - -// SetImportSnapshotTasks sets the ImportSnapshotTasks field's value. -func (s *DescribeImportSnapshotTasksOutput) SetImportSnapshotTasks(v []*ImportSnapshotTask) *DescribeImportSnapshotTasksOutput { - s.ImportSnapshotTasks = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImportSnapshotTasksOutput) SetNextToken(v string) *DescribeImportSnapshotTasksOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeInstanceAttribute. -type DescribeInstanceAttributeInput struct { - _ struct{} `type:"structure"` - - // The instance attribute. - // - // Note: The enaSupport attribute is not supported at this time. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"InstanceAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeInstanceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstanceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeInstanceAttributeInput) SetAttribute(v string) *DescribeInstanceAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInstanceAttributeInput) SetDryRun(v bool) *DescribeInstanceAttributeInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceAttributeInput) SetInstanceId(v string) *DescribeInstanceAttributeInput { - s.InstanceId = &v - return s -} - -// Describes an instance attribute. -type DescribeInstanceAttributeOutput struct { - _ struct{} `type:"structure"` - - // The block device mapping of the instance. - BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // If the value is true, you can't terminate the instance through the Amazon - // EC2 console, CLI, or API; otherwise, you can. - DisableApiTermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` - - // Indicates whether the instance is optimized for Amazon EBS I/O. - EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` - - // Indicates whether enhanced networking with ENA is enabled. - EnaSupport *AttributeBooleanValue `locationName:"enaSupport" type:"structure"` - - // The security groups associated with the instance. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *AttributeValue `locationName:"instanceInitiatedShutdownBehavior" type:"structure"` - - // The instance type. - InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` - - // The kernel ID. - KernelId *AttributeValue `locationName:"kernel" type:"structure"` - - // A list of product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // The RAM disk ID. - RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` - - // The device name of the root device volume (for example, /dev/sda1). - RootDeviceName *AttributeValue `locationName:"rootDeviceName" type:"structure"` - - // Indicates whether source/destination checking is enabled. A value of true - // means that checking is enabled, and false means that checking is disabled. - // This value must be false for a NAT instance to perform NAT. - SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` - - // Indicates whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` - - // The user data. - UserData *AttributeValue `locationName:"userData" type:"structure"` -} - -// String returns the string representation -func (s DescribeInstanceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceAttributeOutput) GoString() string { - return s.String() -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *DescribeInstanceAttributeOutput) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *DescribeInstanceAttributeOutput { - s.BlockDeviceMappings = v - return s -} - -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *DescribeInstanceAttributeOutput) SetDisableApiTermination(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.DisableApiTermination = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *DescribeInstanceAttributeOutput) SetEbsOptimized(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.EbsOptimized = v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *DescribeInstanceAttributeOutput) SetEnaSupport(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.EnaSupport = v - return s -} - -// SetGroups sets the Groups field's value. -func (s *DescribeInstanceAttributeOutput) SetGroups(v []*GroupIdentifier) *DescribeInstanceAttributeOutput { - s.Groups = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceId(v string) *DescribeInstanceAttributeOutput { - s.InstanceId = &v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceInitiatedShutdownBehavior(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.InstanceInitiatedShutdownBehavior = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceType(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.InstanceType = v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *DescribeInstanceAttributeOutput) SetKernelId(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.KernelId = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeInstanceAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeInstanceAttributeOutput { - s.ProductCodes = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *DescribeInstanceAttributeOutput) SetRamdiskId(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.RamdiskId = v - return s -} - -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *DescribeInstanceAttributeOutput) SetRootDeviceName(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.RootDeviceName = v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *DescribeInstanceAttributeOutput) SetSourceDestCheck(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.SourceDestCheck = v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *DescribeInstanceAttributeOutput) SetSriovNetSupport(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.SriovNetSupport = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *DescribeInstanceAttributeOutput) SetUserData(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.UserData = v - return s -} - -type DescribeInstanceCreditSpecificationsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * instance-id - The ID of the instance. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more instance IDs. - // - // Default: Describes all your instances. - // - // Constraints: Maximum 1000 explicitly specified instance IDs. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. You cannot specify this parameter and the - // instance IDs parameter in the same call. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceCreditSpecificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceCreditSpecificationsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetDryRun(v bool) *DescribeInstanceCreditSpecificationsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetFilters(v []*Filter) *DescribeInstanceCreditSpecificationsInput { - s.Filters = v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetInstanceIds(v []*string) *DescribeInstanceCreditSpecificationsInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetMaxResults(v int64) *DescribeInstanceCreditSpecificationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetNextToken(v string) *DescribeInstanceCreditSpecificationsInput { - s.NextToken = &v - return s -} - -type DescribeInstanceCreditSpecificationsOutput struct { - _ struct{} `type:"structure"` - - // Information about the credit option for CPU usage of an instance. - InstanceCreditSpecifications []*InstanceCreditSpecification `locationName:"instanceCreditSpecificationSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceCreditSpecificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceCreditSpecificationsOutput) GoString() string { - return s.String() -} - -// SetInstanceCreditSpecifications sets the InstanceCreditSpecifications field's value. -func (s *DescribeInstanceCreditSpecificationsOutput) SetInstanceCreditSpecifications(v []*InstanceCreditSpecification) *DescribeInstanceCreditSpecificationsOutput { - s.InstanceCreditSpecifications = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceCreditSpecificationsOutput) SetNextToken(v string) *DescribeInstanceCreditSpecificationsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeInstanceStatus. -type DescribeInstanceStatusInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone of the instance. - // - // * event.code - The code for the scheduled event (instance-reboot | system-reboot - // | system-maintenance | instance-retirement | instance-stop). - // - // * event.description - A description of the event. - // - // * event.not-after - The latest end time for the scheduled event (for example, - // 2014-09-15T17:15:20.000Z). - // - // * event.not-before - The earliest start time for the scheduled event (for - // example, 2014-09-15T17:15:20.000Z). - // - // * instance-state-code - The code for the instance state, as a 16-bit unsigned - // integer. The high byte is an opaque internal value and should be ignored. - // The low byte is set based on the state represented. The valid values are - // 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), - // and 80 (stopped). - // - // * instance-state-name - The state of the instance (pending | running | - // shutting-down | terminated | stopping | stopped). - // - // * instance-status.reachability - Filters on instance status where the - // name is reachability (passed | failed | initializing | insufficient-data). - // - // * instance-status.status - The status of the instance (ok | impaired | - // initializing | insufficient-data | not-applicable). - // - // * system-status.reachability - Filters on system status where the name - // is reachability (passed | failed | initializing | insufficient-data). - // - // * system-status.status - The system status of the instance (ok | impaired - // | initializing | insufficient-data | not-applicable). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // When true, includes the health status for all instances. When false, includes - // the health status for running instances only. - // - // Default: false - IncludeAllInstances *bool `locationName:"includeAllInstances" type:"boolean"` - - // One or more instance IDs. - // - // Default: Describes all your instances. - // - // Constraints: Maximum 100 explicitly specified instance IDs. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. You cannot specify this parameter and the - // instance IDs parameter in the same call. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceStatusInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInstanceStatusInput) SetDryRun(v bool) *DescribeInstanceStatusInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInstanceStatusInput) SetFilters(v []*Filter) *DescribeInstanceStatusInput { - s.Filters = v - return s -} - -// SetIncludeAllInstances sets the IncludeAllInstances field's value. -func (s *DescribeInstanceStatusInput) SetIncludeAllInstances(v bool) *DescribeInstanceStatusInput { - s.IncludeAllInstances = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstanceStatusInput) SetInstanceIds(v []*string) *DescribeInstanceStatusInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstanceStatusInput) SetMaxResults(v int64) *DescribeInstanceStatusInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceStatusInput) SetNextToken(v string) *DescribeInstanceStatusInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeInstanceStatus. -type DescribeInstanceStatusOutput struct { - _ struct{} `type:"structure"` - - // One or more instance status descriptions. - InstanceStatuses []*InstanceStatus `locationName:"instanceStatusSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceStatusOutput) GoString() string { - return s.String() -} - -// SetInstanceStatuses sets the InstanceStatuses field's value. -func (s *DescribeInstanceStatusOutput) SetInstanceStatuses(v []*InstanceStatus) *DescribeInstanceStatusOutput { - s.InstanceStatuses = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceStatusOutput) SetNextToken(v string) *DescribeInstanceStatusOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeInstances. -type DescribeInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * affinity - The affinity setting for an instance running on a Dedicated - // Host (default | host). - // - // * architecture - The instance architecture (i386 | x86_64). - // - // * availability-zone - The Availability Zone of the instance. - // - // * block-device-mapping.attach-time - The attach time for an EBS volume - // mapped to the instance, for example, 2010-09-15T17:15:20.000Z. - // - // * block-device-mapping.delete-on-termination - A Boolean that indicates - // whether the EBS volume is deleted on instance termination. - // - // * block-device-mapping.device-name - The device name specified in the - // block device mapping (for example, /dev/sdh or xvdh). - // - // * block-device-mapping.status - The status for the EBS volume (attaching - // | attached | detaching | detached). - // - // * block-device-mapping.volume-id - The volume ID of the EBS volume. - // - // * client-token - The idempotency token you provided when you launched - // the instance. - // - // * dns-name - The public DNS name of the instance. - // - // * group-id - The ID of the security group for the instance. EC2-Classic - // only. - // - // * group-name - The name of the security group for the instance. EC2-Classic - // only. - // - // * host-id - The ID of the Dedicated Host on which the instance is running, - // if applicable. - // - // * hypervisor - The hypervisor type of the instance (ovm | xen). - // - // * iam-instance-profile.arn - The instance profile associated with the - // instance. Specified as an ARN. - // - // * image-id - The ID of the image used to launch the instance. - // - // * instance-id - The ID of the instance. - // - // * instance-lifecycle - Indicates whether this is a Spot Instance or a - // Scheduled Instance (spot | scheduled). - // - // * instance-state-code - The state of the instance, as a 16-bit unsigned - // integer. The high byte is an opaque internal value and should be ignored. - // The low byte is set based on the state represented. The valid values are: - // 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), - // and 80 (stopped). - // - // * instance-state-name - The state of the instance (pending | running | - // shutting-down | terminated | stopping | stopped). - // - // * instance-type - The type of instance (for example, t2.micro). - // - // * instance.group-id - The ID of the security group for the instance. - // - // * instance.group-name - The name of the security group for the instance. - // - // - // * ip-address - The public IPv4 address of the instance. - // - // * kernel-id - The kernel ID. - // - // * key-name - The name of the key pair used when the instance was launched. - // - // * launch-index - When launching multiple instances, this is the index - // for the instance in the launch group (for example, 0, 1, 2, and so on). - // - // - // * launch-time - The time when the instance was launched. - // - // * monitoring-state - Indicates whether detailed monitoring is enabled - // (disabled | enabled). - // - // * network-interface.addresses.private-ip-address - The private IPv4 address - // associated with the network interface. - // - // * network-interface.addresses.primary - Specifies whether the IPv4 address - // of the network interface is the primary private IPv4 address. - // - // * network-interface.addresses.association.public-ip - The ID of the association - // of an Elastic IP address (IPv4) with a network interface. - // - // * network-interface.addresses.association.ip-owner-id - The owner ID of - // the private IPv4 address associated with the network interface. - // - // * network-interface.association.public-ip - The address of the Elastic - // IP address (IPv4) bound to the network interface. - // - // * network-interface.association.ip-owner-id - The owner of the Elastic - // IP address (IPv4) associated with the network interface. - // - // * network-interface.association.allocation-id - The allocation ID returned - // when you allocated the Elastic IP address (IPv4) for your network interface. - // - // * network-interface.association.association-id - The association ID returned - // when the network interface was associated with an IPv4 address. - // - // * network-interface.attachment.attachment-id - The ID of the interface - // attachment. - // - // * network-interface.attachment.instance-id - The ID of the instance to - // which the network interface is attached. - // - // * network-interface.attachment.instance-owner-id - The owner ID of the - // instance to which the network interface is attached. - // - // * network-interface.attachment.device-index - The device index to which - // the network interface is attached. - // - // * network-interface.attachment.status - The status of the attachment (attaching - // | attached | detaching | detached). - // - // * network-interface.attachment.attach-time - The time that the network - // interface was attached to an instance. - // - // * network-interface.attachment.delete-on-termination - Specifies whether - // the attachment is deleted when an instance is terminated. - // - // * network-interface.availability-zone - The Availability Zone for the - // network interface. - // - // * network-interface.description - The description of the network interface. - // - // * network-interface.group-id - The ID of a security group associated with - // the network interface. - // - // * network-interface.group-name - The name of a security group associated - // with the network interface. - // - // * network-interface.ipv6-addresses.ipv6-address - The IPv6 address associated - // with the network interface. - // - // * network-interface.mac-address - The MAC address of the network interface. - // - // * network-interface.network-interface-id - The ID of the network interface. - // - // * network-interface.owner-id - The ID of the owner of the network interface. - // - // * network-interface.private-dns-name - The private DNS name of the network - // interface. - // - // * network-interface.requester-id - The requester ID for the network interface. - // - // * network-interface.requester-managed - Indicates whether the network - // interface is being managed by AWS. - // - // * network-interface.status - The status of the network interface (available) - // | in-use). - // - // * network-interface.source-dest-check - Whether the network interface - // performs source/destination checking. A value of true means that checking - // is enabled, and false means that checking is disabled. The value must - // be false for the network interface to perform network address translation - // (NAT) in your VPC. - // - // * network-interface.subnet-id - The ID of the subnet for the network interface. - // - // * network-interface.vpc-id - The ID of the VPC for the network interface. - // - // * owner-id - The AWS account ID of the instance owner. - // - // * placement-group-name - The name of the placement group for the instance. - // - // * platform - The platform. Use windows if you have Windows instances; - // otherwise, leave blank. - // - // * private-dns-name - The private IPv4 DNS name of the instance. - // - // * private-ip-address - The private IPv4 address of the instance. - // - // * product-code - The product code associated with the AMI used to launch - // the instance. - // - // * product-code.type - The type of product code (devpay | marketplace). - // - // * ramdisk-id - The RAM disk ID. - // - // * reason - The reason for the current state of the instance (for example, - // shows "User Initiated [date]" when you stop or terminate the instance). - // Similar to the state-reason-code filter. - // - // * requester-id - The ID of the entity that launched the instance on your - // behalf (for example, AWS Management Console, Auto Scaling, and so on). - // - // * reservation-id - The ID of the instance's reservation. A reservation - // ID is created any time you launch an instance. A reservation ID has a - // one-to-one relationship with an instance launch request, but can be associated - // with more than one instance if you launch multiple instances using the - // same launch request. For example, if you launch one instance, you get - // one reservation ID. If you launch ten instances using the same launch - // request, you also get one reservation ID. - // - // * root-device-name - The device name of the root device volume (for example, - // /dev/sda1). - // - // * root-device-type - The type of the root device volume (ebs | instance-store). - // - // * source-dest-check - Indicates whether the instance performs source/destination - // checking. A value of true means that checking is enabled, and false means - // that checking is disabled. The value must be false for the instance to - // perform network address translation (NAT) in your VPC. - // - // * spot-instance-request-id - The ID of the Spot Instance request. - // - // * state-reason-code - The reason code for the state change. - // - // * state-reason-message - A message that describes the state change. - // - // * subnet-id - The ID of the subnet for the instance. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of the tag's key). If you want to - // list only resources where Purpose is X, see the tag:key=value filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * tenancy - The tenancy of an instance (dedicated | default | host). - // - // * virtualization-type - The virtualization type of the instance (paravirtual - // | hvm). - // - // * vpc-id - The ID of the VPC that the instance is running in. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more instance IDs. - // - // Default: Describes all your instances. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. You cannot specify this parameter and the - // instance IDs parameter or tag filters in the same call. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to request the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInstancesInput) SetDryRun(v bool) *DescribeInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInstancesInput) SetFilters(v []*Filter) *DescribeInstancesInput { - s.Filters = v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstancesInput) SetInstanceIds(v []*string) *DescribeInstancesInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstancesInput) SetMaxResults(v int64) *DescribeInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesInput) SetNextToken(v string) *DescribeInstancesInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeInstances. -type DescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Zero or more reservations. - Reservations []*Reservation `locationName:"reservationSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesOutput) SetNextToken(v string) *DescribeInstancesOutput { - s.NextToken = &v - return s -} - -// SetReservations sets the Reservations field's value. -func (s *DescribeInstancesOutput) SetReservations(v []*Reservation) *DescribeInstancesOutput { - s.Reservations = v - return s -} - -// Contains the parameters for DescribeInternetGateways. -type DescribeInternetGatewaysInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * attachment.state - The current state of the attachment between the gateway - // and the VPC (available). Present only if a VPC is attached. - // - // * attachment.vpc-id - The ID of an attached VPC. - // - // * internet-gateway-id - The ID of the Internet gateway. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more Internet gateway IDs. - // - // Default: Describes all your Internet gateways. - InternetGatewayIds []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeInternetGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInternetGatewaysInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInternetGatewaysInput) SetDryRun(v bool) *DescribeInternetGatewaysInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInternetGatewaysInput) SetFilters(v []*Filter) *DescribeInternetGatewaysInput { - s.Filters = v - return s -} - -// SetInternetGatewayIds sets the InternetGatewayIds field's value. -func (s *DescribeInternetGatewaysInput) SetInternetGatewayIds(v []*string) *DescribeInternetGatewaysInput { - s.InternetGatewayIds = v - return s -} - -// Contains the output of DescribeInternetGateways. -type DescribeInternetGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more Internet gateways. - InternetGateways []*InternetGateway `locationName:"internetGatewaySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeInternetGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInternetGatewaysOutput) GoString() string { - return s.String() -} - -// SetInternetGateways sets the InternetGateways field's value. -func (s *DescribeInternetGatewaysOutput) SetInternetGateways(v []*InternetGateway) *DescribeInternetGatewaysOutput { - s.InternetGateways = v - return s -} - -// Contains the parameters for DescribeKeyPairs. -type DescribeKeyPairsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * fingerprint - The fingerprint of the key pair. - // - // * key-name - The name of the key pair. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more key pair names. - // - // Default: Describes all your key pairs. - KeyNames []*string `locationName:"KeyName" locationNameList:"KeyName" type:"list"` -} - -// String returns the string representation -func (s DescribeKeyPairsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeKeyPairsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeKeyPairsInput) SetDryRun(v bool) *DescribeKeyPairsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeKeyPairsInput) SetFilters(v []*Filter) *DescribeKeyPairsInput { - s.Filters = v - return s -} - -// SetKeyNames sets the KeyNames field's value. -func (s *DescribeKeyPairsInput) SetKeyNames(v []*string) *DescribeKeyPairsInput { - s.KeyNames = v - return s -} - -// Contains the output of DescribeKeyPairs. -type DescribeKeyPairsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more key pairs. - KeyPairs []*KeyPairInfo `locationName:"keySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeKeyPairsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeKeyPairsOutput) GoString() string { - return s.String() -} - -// SetKeyPairs sets the KeyPairs field's value. -func (s *DescribeKeyPairsOutput) SetKeyPairs(v []*KeyPairInfo) *DescribeKeyPairsOutput { - s.KeyPairs = v - return s -} - -type DescribeLaunchTemplateVersionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * create-time - The time the launch template version was created. - // - // * ebs-optimized - A boolean that indicates whether the instance is optimized - // for Amazon EBS I/O. - // - // * iam-instance-profile - The ARN of the IAM instance profile. - // - // * image-id - The ID of the AMI. - // - // * instance-type - The instance type. - // - // * is-default-version - A boolean that indicates whether the launch template - // version is the default version. - // - // * kernel-id - The kernel ID. - // - // * ram-disk-id - The RAM disk ID. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. - MaxResults *int64 `type:"integer"` - - // The version number up to which to describe launch template versions. - MaxVersion *string `type:"string"` - - // The version number after which to describe launch template versions. - MinVersion *string `type:"string"` - - // The token to request the next page of results. - NextToken *string `type:"string"` - - // One or more versions of the launch template. - Versions []*string `locationName:"LaunchTemplateVersion" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeLaunchTemplateVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLaunchTemplateVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLaunchTemplateVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLaunchTemplateVersionsInput"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetDryRun(v bool) *DescribeLaunchTemplateVersionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetFilters(v []*Filter) *DescribeLaunchTemplateVersionsInput { - s.Filters = v - return s -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetLaunchTemplateId(v string) *DescribeLaunchTemplateVersionsInput { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetLaunchTemplateName(v string) *DescribeLaunchTemplateVersionsInput { - s.LaunchTemplateName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetMaxResults(v int64) *DescribeLaunchTemplateVersionsInput { - s.MaxResults = &v - return s -} - -// SetMaxVersion sets the MaxVersion field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetMaxVersion(v string) *DescribeLaunchTemplateVersionsInput { - s.MaxVersion = &v - return s -} - -// SetMinVersion sets the MinVersion field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetMinVersion(v string) *DescribeLaunchTemplateVersionsInput { - s.MinVersion = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetNextToken(v string) *DescribeLaunchTemplateVersionsInput { - s.NextToken = &v - return s -} - -// SetVersions sets the Versions field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetVersions(v []*string) *DescribeLaunchTemplateVersionsInput { - s.Versions = v - return s -} - -type DescribeLaunchTemplateVersionsOutput struct { - _ struct{} `type:"structure"` - - // Information about the launch template versions. - LaunchTemplateVersions []*LaunchTemplateVersion `locationName:"launchTemplateVersionSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeLaunchTemplateVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLaunchTemplateVersionsOutput) GoString() string { - return s.String() -} - -// SetLaunchTemplateVersions sets the LaunchTemplateVersions field's value. -func (s *DescribeLaunchTemplateVersionsOutput) SetLaunchTemplateVersions(v []*LaunchTemplateVersion) *DescribeLaunchTemplateVersionsOutput { - s.LaunchTemplateVersions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchTemplateVersionsOutput) SetNextToken(v string) *DescribeLaunchTemplateVersionsOutput { - s.NextToken = &v - return s -} - -type DescribeLaunchTemplatesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * create-time - The time the launch template was created. - // - // * launch-template-name - The name of the launch template. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of the tag's key). If you want to - // list only resources where Purpose is X, see the tag:key=value filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more launch template IDs. - LaunchTemplateIds []*string `locationName:"LaunchTemplateId" locationNameList:"item" type:"list"` - - // One or more launch template names. - LaunchTemplateNames []*string `locationName:"LaunchTemplateName" locationNameList:"item" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. - MaxResults *int64 `type:"integer"` - - // The token to request the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLaunchTemplatesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLaunchTemplatesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeLaunchTemplatesInput) SetDryRun(v bool) *DescribeLaunchTemplatesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeLaunchTemplatesInput) SetFilters(v []*Filter) *DescribeLaunchTemplatesInput { - s.Filters = v - return s -} - -// SetLaunchTemplateIds sets the LaunchTemplateIds field's value. -func (s *DescribeLaunchTemplatesInput) SetLaunchTemplateIds(v []*string) *DescribeLaunchTemplatesInput { - s.LaunchTemplateIds = v - return s -} - -// SetLaunchTemplateNames sets the LaunchTemplateNames field's value. -func (s *DescribeLaunchTemplatesInput) SetLaunchTemplateNames(v []*string) *DescribeLaunchTemplatesInput { - s.LaunchTemplateNames = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeLaunchTemplatesInput) SetMaxResults(v int64) *DescribeLaunchTemplatesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchTemplatesInput) SetNextToken(v string) *DescribeLaunchTemplatesInput { - s.NextToken = &v - return s -} - -type DescribeLaunchTemplatesOutput struct { - _ struct{} `type:"structure"` - - // Information about the launch templates. - LaunchTemplates []*LaunchTemplate `locationName:"launchTemplates" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeLaunchTemplatesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLaunchTemplatesOutput) GoString() string { - return s.String() -} - -// SetLaunchTemplates sets the LaunchTemplates field's value. -func (s *DescribeLaunchTemplatesOutput) SetLaunchTemplates(v []*LaunchTemplate) *DescribeLaunchTemplatesOutput { - s.LaunchTemplates = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchTemplatesOutput) SetNextToken(v string) *DescribeLaunchTemplatesOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeMovingAddresses. -type DescribeMovingAddressesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * moving-status - The status of the Elastic IP address (MovingToVpc | - // RestoringToClassic). - Filters []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value outside of this range, an error is returned. - // - // Default: If no value is provided, the default is 1000. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to use to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // One or more Elastic IP addresses. - PublicIps []*string `locationName:"publicIp" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeMovingAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMovingAddressesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeMovingAddressesInput) SetDryRun(v bool) *DescribeMovingAddressesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeMovingAddressesInput) SetFilters(v []*Filter) *DescribeMovingAddressesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeMovingAddressesInput) SetMaxResults(v int64) *DescribeMovingAddressesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMovingAddressesInput) SetNextToken(v string) *DescribeMovingAddressesInput { - s.NextToken = &v - return s -} - -// SetPublicIps sets the PublicIps field's value. -func (s *DescribeMovingAddressesInput) SetPublicIps(v []*string) *DescribeMovingAddressesInput { - s.PublicIps = v - return s -} - -// Contains the output of DescribeMovingAddresses. -type DescribeMovingAddressesOutput struct { - _ struct{} `type:"structure"` - - // The status for each Elastic IP address. - MovingAddressStatuses []*MovingAddressStatus `locationName:"movingAddressStatusSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeMovingAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMovingAddressesOutput) GoString() string { - return s.String() -} - -// SetMovingAddressStatuses sets the MovingAddressStatuses field's value. -func (s *DescribeMovingAddressesOutput) SetMovingAddressStatuses(v []*MovingAddressStatus) *DescribeMovingAddressesOutput { - s.MovingAddressStatuses = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMovingAddressesOutput) SetNextToken(v string) *DescribeMovingAddressesOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeNatGateways. -type DescribeNatGatewaysInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * nat-gateway-id - The ID of the NAT gateway. - // - // * state - The state of the NAT gateway (pending | failed | available | - // deleting | deleted). - // - // * subnet-id - The ID of the subnet in which the NAT gateway resides. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC in which the NAT gateway resides. - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value specified is greater than 1000, we return only 1000 - // items. - MaxResults *int64 `type:"integer"` - - // One or more NAT gateway IDs. - NatGatewayIds []*string `locationName:"NatGatewayId" locationNameList:"item" type:"list"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeNatGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNatGatewaysInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeNatGatewaysInput) SetFilter(v []*Filter) *DescribeNatGatewaysInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeNatGatewaysInput) SetMaxResults(v int64) *DescribeNatGatewaysInput { - s.MaxResults = &v - return s -} - -// SetNatGatewayIds sets the NatGatewayIds field's value. -func (s *DescribeNatGatewaysInput) SetNatGatewayIds(v []*string) *DescribeNatGatewaysInput { - s.NatGatewayIds = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeNatGatewaysInput) SetNextToken(v string) *DescribeNatGatewaysInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeNatGateways. -type DescribeNatGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about the NAT gateways. - NatGateways []*NatGateway `locationName:"natGatewaySet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeNatGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNatGatewaysOutput) GoString() string { - return s.String() -} - -// SetNatGateways sets the NatGateways field's value. -func (s *DescribeNatGatewaysOutput) SetNatGateways(v []*NatGateway) *DescribeNatGatewaysOutput { - s.NatGateways = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeNatGatewaysOutput) SetNextToken(v string) *DescribeNatGatewaysOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeNetworkAcls. -type DescribeNetworkAclsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * association.association-id - The ID of an association ID for the ACL. - // - // * association.network-acl-id - The ID of the network ACL involved in the - // association. - // - // * association.subnet-id - The ID of the subnet involved in the association. - // - // * default - Indicates whether the ACL is the default network ACL for the - // VPC. - // - // * entry.cidr - The IPv4 CIDR range specified in the entry. - // - // * entry.egress - Indicates whether the entry applies to egress traffic. - // - // * entry.icmp.code - The ICMP code specified in the entry, if any. - // - // * entry.icmp.type - The ICMP type specified in the entry, if any. - // - // * entry.ipv6-cidr - The IPv6 CIDR range specified in the entry. - // - // * entry.port-range.from - The start of the port range specified in the - // entry. - // - // * entry.port-range.to - The end of the port range specified in the entry. - // - // - // * entry.protocol - The protocol specified in the entry (tcp | udp | icmp - // or a protocol number). - // - // * entry.rule-action - Allows or denies the matching traffic (allow | deny). - // - // * entry.rule-number - The number of an entry (in other words, rule) in - // the ACL's set of entries. - // - // * network-acl-id - The ID of the network ACL. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC for the network ACL. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more network ACL IDs. - // - // Default: Describes all your network ACLs. - NetworkAclIds []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeNetworkAclsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkAclsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeNetworkAclsInput) SetDryRun(v bool) *DescribeNetworkAclsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeNetworkAclsInput) SetFilters(v []*Filter) *DescribeNetworkAclsInput { - s.Filters = v - return s -} - -// SetNetworkAclIds sets the NetworkAclIds field's value. -func (s *DescribeNetworkAclsInput) SetNetworkAclIds(v []*string) *DescribeNetworkAclsInput { - s.NetworkAclIds = v - return s -} - -// Contains the output of DescribeNetworkAcls. -type DescribeNetworkAclsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more network ACLs. - NetworkAcls []*NetworkAcl `locationName:"networkAclSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeNetworkAclsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkAclsOutput) GoString() string { - return s.String() -} - -// SetNetworkAcls sets the NetworkAcls field's value. -func (s *DescribeNetworkAclsOutput) SetNetworkAcls(v []*NetworkAcl) *DescribeNetworkAclsOutput { - s.NetworkAcls = v - return s -} - -// Contains the parameters for DescribeNetworkInterfaceAttribute. -type DescribeNetworkInterfaceAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute of the network interface. This parameter is required. - Attribute *string `locationName:"attribute" type:"string" enum:"NetworkInterfaceAttribute"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeNetworkInterfaceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfaceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeNetworkInterfaceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkInterfaceAttributeInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeNetworkInterfaceAttributeInput) SetAttribute(v string) *DescribeNetworkInterfaceAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeNetworkInterfaceAttributeInput) SetDryRun(v bool) *DescribeNetworkInterfaceAttributeInput { - s.DryRun = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *DescribeNetworkInterfaceAttributeInput) SetNetworkInterfaceId(v string) *DescribeNetworkInterfaceAttributeInput { - s.NetworkInterfaceId = &v - return s -} - -// Contains the output of DescribeNetworkInterfaceAttribute. -type DescribeNetworkInterfaceAttributeOutput struct { - _ struct{} `type:"structure"` - - // The attachment (if any) of the network interface. - Attachment *NetworkInterfaceAttachment `locationName:"attachment" type:"structure"` - - // The description of the network interface. - Description *AttributeValue `locationName:"description" type:"structure"` - - // The security groups associated with the network interface. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // Indicates whether source/destination checking is enabled. - SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` -} - -// String returns the string representation -func (s DescribeNetworkInterfaceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfaceAttributeOutput) GoString() string { - return s.String() -} - -// SetAttachment sets the Attachment field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetAttachment(v *NetworkInterfaceAttachment) *DescribeNetworkInterfaceAttributeOutput { - s.Attachment = v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetDescription(v *AttributeValue) *DescribeNetworkInterfaceAttributeOutput { - s.Description = v - return s -} - -// SetGroups sets the Groups field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetGroups(v []*GroupIdentifier) *DescribeNetworkInterfaceAttributeOutput { - s.Groups = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetNetworkInterfaceId(v string) *DescribeNetworkInterfaceAttributeOutput { - s.NetworkInterfaceId = &v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetSourceDestCheck(v *AttributeBooleanValue) *DescribeNetworkInterfaceAttributeOutput { - s.SourceDestCheck = v - return s -} - -// Contains the parameters for DescribeNetworkInterfacePermissions. -type DescribeNetworkInterfacePermissionsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * network-interface-permission.network-interface-permission-id - The ID - // of the permission. - // - // * network-interface-permission.network-interface-id - The ID of the network - // interface. - // - // * network-interface-permission.aws-account-id - The AWS account ID. - // - // * network-interface-permission.aws-service - The AWS service. - // - // * network-interface-permission.permission - The type of permission (INSTANCE-ATTACH - // | EIP-ASSOCIATE). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. If - // this parameter is not specified, up to 50 results are returned by default. - MaxResults *int64 `type:"integer"` - - // One or more network interface permission IDs. - NetworkInterfacePermissionIds []*string `locationName:"NetworkInterfacePermissionId" type:"list"` - - // The token to request the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeNetworkInterfacePermissionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfacePermissionsInput) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *DescribeNetworkInterfacePermissionsInput) SetFilters(v []*Filter) *DescribeNetworkInterfacePermissionsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeNetworkInterfacePermissionsInput) SetMaxResults(v int64) *DescribeNetworkInterfacePermissionsInput { - s.MaxResults = &v - return s -} - -// SetNetworkInterfacePermissionIds sets the NetworkInterfacePermissionIds field's value. -func (s *DescribeNetworkInterfacePermissionsInput) SetNetworkInterfacePermissionIds(v []*string) *DescribeNetworkInterfacePermissionsInput { - s.NetworkInterfacePermissionIds = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeNetworkInterfacePermissionsInput) SetNextToken(v string) *DescribeNetworkInterfacePermissionsInput { - s.NextToken = &v - return s -} - -// Contains the output for DescribeNetworkInterfacePermissions. -type DescribeNetworkInterfacePermissionsOutput struct { - _ struct{} `type:"structure"` - - // The network interface permissions. - NetworkInterfacePermissions []*NetworkInterfacePermission `locationName:"networkInterfacePermissions" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeNetworkInterfacePermissionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfacePermissionsOutput) GoString() string { - return s.String() -} - -// SetNetworkInterfacePermissions sets the NetworkInterfacePermissions field's value. -func (s *DescribeNetworkInterfacePermissionsOutput) SetNetworkInterfacePermissions(v []*NetworkInterfacePermission) *DescribeNetworkInterfacePermissionsOutput { - s.NetworkInterfacePermissions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeNetworkInterfacePermissionsOutput) SetNextToken(v string) *DescribeNetworkInterfacePermissionsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeNetworkInterfaces. -type DescribeNetworkInterfacesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * addresses.private-ip-address - The private IPv4 addresses associated - // with the network interface. - // - // * addresses.primary - Whether the private IPv4 address is the primary - // IP address associated with the network interface. - // - // * addresses.association.public-ip - The association ID returned when the - // network interface was associated with the Elastic IP address (IPv4). - // - // * addresses.association.owner-id - The owner ID of the addresses associated - // with the network interface. - // - // * association.association-id - The association ID returned when the network - // interface was associated with an IPv4 address. - // - // * association.allocation-id - The allocation ID returned when you allocated - // the Elastic IP address (IPv4) for your network interface. - // - // * association.ip-owner-id - The owner of the Elastic IP address (IPv4) - // associated with the network interface. - // - // * association.public-ip - The address of the Elastic IP address (IPv4) - // bound to the network interface. - // - // * association.public-dns-name - The public DNS name for the network interface - // (IPv4). - // - // * attachment.attachment-id - The ID of the interface attachment. - // - // * attachment.attach.time - The time that the network interface was attached - // to an instance. - // - // * attachment.delete-on-termination - Indicates whether the attachment - // is deleted when an instance is terminated. - // - // * attachment.device-index - The device index to which the network interface - // is attached. - // - // * attachment.instance-id - The ID of the instance to which the network - // interface is attached. - // - // * attachment.instance-owner-id - The owner ID of the instance to which - // the network interface is attached. - // - // * attachment.nat-gateway-id - The ID of the NAT gateway to which the network - // interface is attached. - // - // * attachment.status - The status of the attachment (attaching | attached - // | detaching | detached). - // - // * availability-zone - The Availability Zone of the network interface. - // - // * description - The description of the network interface. - // - // * group-id - The ID of a security group associated with the network interface. - // - // * group-name - The name of a security group associated with the network - // interface. - // - // * ipv6-addresses.ipv6-address - An IPv6 address associated with the network - // interface. - // - // * mac-address - The MAC address of the network interface. - // - // * network-interface-id - The ID of the network interface. - // - // * owner-id - The AWS account ID of the network interface owner. - // - // * private-ip-address - The private IPv4 address or addresses of the network - // interface. - // - // * private-dns-name - The private DNS name of the network interface (IPv4). - // - // * requester-id - The ID of the entity that launched the instance on your - // behalf (for example, AWS Management Console, Auto Scaling, and so on). - // - // * requester-managed - Indicates whether the network interface is being - // managed by an AWS service (for example, AWS Management Console, Auto Scaling, - // and so on). - // - // * source-desk-check - Indicates whether the network interface performs - // source/destination checking. A value of true means checking is enabled, - // and false means checking is disabled. The value must be false for the - // network interface to perform network address translation (NAT) in your - // VPC. - // - // * status - The status of the network interface. If the network interface - // is not attached to an instance, the status is available; if a network - // interface is attached to an instance the status is in-use. - // - // * subnet-id - The ID of the subnet for the network interface. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC for the network interface. - Filters []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` - - // One or more network interface IDs. - // - // Default: Describes all your network interfaces. - NetworkInterfaceIds []*string `locationName:"NetworkInterfaceId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeNetworkInterfacesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfacesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeNetworkInterfacesInput) SetDryRun(v bool) *DescribeNetworkInterfacesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeNetworkInterfacesInput) SetFilters(v []*Filter) *DescribeNetworkInterfacesInput { - s.Filters = v - return s -} - -// SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value. -func (s *DescribeNetworkInterfacesInput) SetNetworkInterfaceIds(v []*string) *DescribeNetworkInterfacesInput { - s.NetworkInterfaceIds = v - return s -} - -// Contains the output of DescribeNetworkInterfaces. -type DescribeNetworkInterfacesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more network interfaces. - NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeNetworkInterfacesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfacesOutput) GoString() string { - return s.String() -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *DescribeNetworkInterfacesOutput) SetNetworkInterfaces(v []*NetworkInterface) *DescribeNetworkInterfacesOutput { - s.NetworkInterfaces = v - return s -} - -// Contains the parameters for DescribePlacementGroups. -type DescribePlacementGroupsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * group-name - The name of the placement group. - // - // * state - The state of the placement group (pending | available | deleting - // | deleted). - // - // * strategy - The strategy of the placement group (cluster | spread). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more placement group names. - // - // Default: Describes all your placement groups, or only those otherwise specified. - GroupNames []*string `locationName:"groupName" type:"list"` -} - -// String returns the string representation -func (s DescribePlacementGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePlacementGroupsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribePlacementGroupsInput) SetDryRun(v bool) *DescribePlacementGroupsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribePlacementGroupsInput) SetFilters(v []*Filter) *DescribePlacementGroupsInput { - s.Filters = v - return s -} - -// SetGroupNames sets the GroupNames field's value. -func (s *DescribePlacementGroupsInput) SetGroupNames(v []*string) *DescribePlacementGroupsInput { - s.GroupNames = v - return s -} - -// Contains the output of DescribePlacementGroups. -type DescribePlacementGroupsOutput struct { - _ struct{} `type:"structure"` - - // One or more placement groups. - PlacementGroups []*PlacementGroup `locationName:"placementGroupSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribePlacementGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePlacementGroupsOutput) GoString() string { - return s.String() -} - -// SetPlacementGroups sets the PlacementGroups field's value. -func (s *DescribePlacementGroupsOutput) SetPlacementGroups(v []*PlacementGroup) *DescribePlacementGroupsOutput { - s.PlacementGroups = v - return s -} - -// Contains the parameters for DescribePrefixLists. -type DescribePrefixListsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * prefix-list-id: The ID of a prefix list. - // - // * prefix-list-name: The name of a prefix list. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value specified is greater than 1000, we return only 1000 - // items. - MaxResults *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `type:"string"` - - // One or more prefix list IDs. - PrefixListIds []*string `locationName:"PrefixListId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribePrefixListsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePrefixListsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribePrefixListsInput) SetDryRun(v bool) *DescribePrefixListsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribePrefixListsInput) SetFilters(v []*Filter) *DescribePrefixListsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribePrefixListsInput) SetMaxResults(v int64) *DescribePrefixListsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePrefixListsInput) SetNextToken(v string) *DescribePrefixListsInput { - s.NextToken = &v - return s -} - -// SetPrefixListIds sets the PrefixListIds field's value. -func (s *DescribePrefixListsInput) SetPrefixListIds(v []*string) *DescribePrefixListsInput { - s.PrefixListIds = v - return s -} - -// Contains the output of DescribePrefixLists. -type DescribePrefixListsOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // All available prefix lists. - PrefixLists []*PrefixList `locationName:"prefixListSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribePrefixListsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePrefixListsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePrefixListsOutput) SetNextToken(v string) *DescribePrefixListsOutput { - s.NextToken = &v - return s -} - -// SetPrefixLists sets the PrefixLists field's value. -func (s *DescribePrefixListsOutput) SetPrefixLists(v []*PrefixList) *DescribePrefixListsOutput { - s.PrefixLists = v - return s -} - -type DescribePrincipalIdFormatInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The token to request the next page of results. - NextToken *string `type:"string"` - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log - // | image | import-task | instance | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | reservation - // | route-table | route-table-association | security-group | snapshot | subnet - // | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association - // | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway - Resources []*string `locationName:"Resource" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribePrincipalIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePrincipalIdFormatInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribePrincipalIdFormatInput) SetDryRun(v bool) *DescribePrincipalIdFormatInput { - s.DryRun = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribePrincipalIdFormatInput) SetMaxResults(v int64) *DescribePrincipalIdFormatInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePrincipalIdFormatInput) SetNextToken(v string) *DescribePrincipalIdFormatInput { - s.NextToken = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *DescribePrincipalIdFormatInput) SetResources(v []*string) *DescribePrincipalIdFormatInput { - s.Resources = v - return s -} - -type DescribePrincipalIdFormatOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the ID format settings for the ARN. - Principals []*PrincipalIdFormat `locationName:"principalSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribePrincipalIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePrincipalIdFormatOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePrincipalIdFormatOutput) SetNextToken(v string) *DescribePrincipalIdFormatOutput { - s.NextToken = &v - return s -} - -// SetPrincipals sets the Principals field's value. -func (s *DescribePrincipalIdFormatOutput) SetPrincipals(v []*PrincipalIdFormat) *DescribePrincipalIdFormatOutput { - s.Principals = v - return s -} - -// Contains the parameters for DescribeRegions. -type DescribeRegionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * endpoint - The endpoint of the region (for example, ec2.us-east-1.amazonaws.com). - // - // * region-name - The name of the region (for example, us-east-1). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The names of one or more regions. - RegionNames []*string `locationName:"RegionName" locationNameList:"RegionName" type:"list"` -} - -// String returns the string representation -func (s DescribeRegionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRegionsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeRegionsInput) SetDryRun(v bool) *DescribeRegionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeRegionsInput) SetFilters(v []*Filter) *DescribeRegionsInput { - s.Filters = v - return s -} - -// SetRegionNames sets the RegionNames field's value. -func (s *DescribeRegionsInput) SetRegionNames(v []*string) *DescribeRegionsInput { - s.RegionNames = v - return s -} - -// Contains the output of DescribeRegions. -type DescribeRegionsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more regions. - Regions []*Region `locationName:"regionInfo" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeRegionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRegionsOutput) GoString() string { - return s.String() -} - -// SetRegions sets the Regions field's value. -func (s *DescribeRegionsOutput) SetRegions(v []*Region) *DescribeRegionsOutput { - s.Regions = v - return s -} - -// Contains the parameters for DescribeReservedInstances. -type DescribeReservedInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone where the Reserved Instance - // can be used. - // - // * duration - The duration of the Reserved Instance (one year or three - // years), in seconds (31536000 | 94608000). - // - // * end - The time when the Reserved Instance expires (for example, 2015-08-07T11:54:42.000Z). - // - // * fixed-price - The purchase price of the Reserved Instance (for example, - // 9800.0). - // - // * instance-type - The instance type that is covered by the reservation. - // - // * scope - The scope of the Reserved Instance (Region or Availability Zone). - // - // * product-description - The Reserved Instance product platform description. - // Instances that include (Amazon VPC) in the product platform description - // will only be displayed to EC2-Classic account holders and are for use - // with Amazon VPC (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE - // Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise Linux - // (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL Server - // Standard | Windows with SQL Server Standard (Amazon VPC) | Windows with - // SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows with - // SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon VPC)). - // - // * reserved-instances-id - The ID of the Reserved Instance. - // - // * start - The time at which the Reserved Instance purchase request was - // placed (for example, 2014-08-07T11:54:42.000Z). - // - // * state - The state of the Reserved Instance (payment-pending | active - // | payment-failed | retired). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * usage-price - The usage price of the Reserved Instance, per hour (for - // example, 0.84). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // Describes whether the Reserved Instance is Standard or Convertible. - OfferingClass *string `type:"string" enum:"OfferingClassType"` - - // The Reserved Instance offering type. If you are using tools that predate - // the 2011-11-01 API version, you only have access to the Medium Utilization - // Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - - // One or more Reserved Instance IDs. - // - // Default: Describes all your Reserved Instances, or only those otherwise specified. - ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeReservedInstancesInput) SetDryRun(v bool) *DescribeReservedInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedInstancesInput) SetFilters(v []*Filter) *DescribeReservedInstancesInput { - s.Filters = v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *DescribeReservedInstancesInput) SetOfferingClass(v string) *DescribeReservedInstancesInput { - s.OfferingClass = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservedInstancesInput) SetOfferingType(v string) *DescribeReservedInstancesInput { - s.OfferingType = &v - return s -} - -// SetReservedInstancesIds sets the ReservedInstancesIds field's value. -func (s *DescribeReservedInstancesInput) SetReservedInstancesIds(v []*string) *DescribeReservedInstancesInput { - s.ReservedInstancesIds = v - return s -} - -// Contains the parameters for DescribeReservedInstancesListings. -type DescribeReservedInstancesListingsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * reserved-instances-id - The ID of the Reserved Instances. - // - // * reserved-instances-listing-id - The ID of the Reserved Instances listing. - // - // * status - The status of the Reserved Instance listing (pending | active - // | cancelled | closed). - // - // * status-message - The reason for the status. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more Reserved Instance IDs. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - - // One or more Reserved Instance listing IDs. - ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` -} - -// String returns the string representation -func (s DescribeReservedInstancesListingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesListingsInput) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedInstancesListingsInput) SetFilters(v []*Filter) *DescribeReservedInstancesListingsInput { - s.Filters = v - return s -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *DescribeReservedInstancesListingsInput) SetReservedInstancesId(v string) *DescribeReservedInstancesListingsInput { - s.ReservedInstancesId = &v - return s -} - -// SetReservedInstancesListingId sets the ReservedInstancesListingId field's value. -func (s *DescribeReservedInstancesListingsInput) SetReservedInstancesListingId(v string) *DescribeReservedInstancesListingsInput { - s.ReservedInstancesListingId = &v - return s -} - -// Contains the output of DescribeReservedInstancesListings. -type DescribeReservedInstancesListingsOutput struct { - _ struct{} `type:"structure"` - - // Information about the Reserved Instance listing. - ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesListingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesListingsOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesListings sets the ReservedInstancesListings field's value. -func (s *DescribeReservedInstancesListingsOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *DescribeReservedInstancesListingsOutput { - s.ReservedInstancesListings = v - return s -} - -// Contains the parameters for DescribeReservedInstancesModifications. -type DescribeReservedInstancesModificationsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * client-token - The idempotency token for the modification request. - // - // * create-date - The time when the modification request was created. - // - // * effective-date - The time when the modification becomes effective. - // - // * modification-result.reserved-instances-id - The ID for the Reserved - // Instances created as part of the modification request. This ID is only - // available when the status of the modification is fulfilled. - // - // * modification-result.target-configuration.availability-zone - The Availability - // Zone for the new Reserved Instances. - // - // * modification-result.target-configuration.instance-count - The number - // of new Reserved Instances. - // - // * modification-result.target-configuration.instance-type - The instance - // type of the new Reserved Instances. - // - // * modification-result.target-configuration.platform - The network platform - // of the new Reserved Instances (EC2-Classic | EC2-VPC). - // - // * reserved-instances-id - The ID of the Reserved Instances modified. - // - // * reserved-instances-modification-id - The ID of the modification request. - // - // * status - The status of the Reserved Instances modification request (processing - // | fulfilled | failed). - // - // * status-message - The reason for the status. - // - // * update-date - The time when the modification request was last updated. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // IDs for the submitted modification request. - ReservedInstancesModificationIds []*string `locationName:"ReservedInstancesModificationId" locationNameList:"ReservedInstancesModificationId" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesModificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesModificationsInput) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedInstancesModificationsInput) SetFilters(v []*Filter) *DescribeReservedInstancesModificationsInput { - s.Filters = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeReservedInstancesModificationsInput) SetNextToken(v string) *DescribeReservedInstancesModificationsInput { - s.NextToken = &v - return s -} - -// SetReservedInstancesModificationIds sets the ReservedInstancesModificationIds field's value. -func (s *DescribeReservedInstancesModificationsInput) SetReservedInstancesModificationIds(v []*string) *DescribeReservedInstancesModificationsInput { - s.ReservedInstancesModificationIds = v - return s -} - -// Contains the output of DescribeReservedInstancesModifications. -type DescribeReservedInstancesModificationsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The Reserved Instance modification information. - ReservedInstancesModifications []*ReservedInstancesModification `locationName:"reservedInstancesModificationsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesModificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesModificationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeReservedInstancesModificationsOutput) SetNextToken(v string) *DescribeReservedInstancesModificationsOutput { - s.NextToken = &v - return s -} - -// SetReservedInstancesModifications sets the ReservedInstancesModifications field's value. -func (s *DescribeReservedInstancesModificationsOutput) SetReservedInstancesModifications(v []*ReservedInstancesModification) *DescribeReservedInstancesModificationsOutput { - s.ReservedInstancesModifications = v - return s -} - -// Contains the parameters for DescribeReservedInstancesOfferings. -type DescribeReservedInstancesOfferingsInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which the Reserved Instance can be used. - AvailabilityZone *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone where the Reserved Instance - // can be used. - // - // * duration - The duration of the Reserved Instance (for example, one year - // or three years), in seconds (31536000 | 94608000). - // - // * fixed-price - The purchase price of the Reserved Instance (for example, - // 9800.0). - // - // * instance-type - The instance type that is covered by the reservation. - // - // * marketplace - Set to true to show only Reserved Instance Marketplace - // offerings. When this filter is not used, which is the default behavior, - // all offerings from both AWS and the Reserved Instance Marketplace are - // listed. - // - // * product-description - The Reserved Instance product platform description. - // Instances that include (Amazon VPC) in the product platform description - // will only be displayed to EC2-Classic account holders and are for use - // with Amazon VPC. (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | - // SUSE Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise - // Linux (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL - // Server Standard | Windows with SQL Server Standard (Amazon VPC) | Windows - // with SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows - // with SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon - // VPC)) - // - // * reserved-instances-offering-id - The Reserved Instances offering ID. - // - // * scope - The scope of the Reserved Instance (Availability Zone or Region). - // - // * usage-price - The usage price of the Reserved Instance, per hour (for - // example, 0.84). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // Include Reserved Instance Marketplace offerings in the response. - IncludeMarketplace *bool `type:"boolean"` - - // The tenancy of the instances covered by the reservation. A Reserved Instance - // with a tenancy of dedicated is applied to instances that run in a VPC on - // single-tenant hardware (i.e., Dedicated Instances). - // - // Important: The host value cannot be used with this parameter. Use the default - // or dedicated values only. - // - // Default: default - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // The instance type that the reservation will cover (for example, m1.small). - // For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. - InstanceType *string `type:"string" enum:"InstanceType"` - - // The maximum duration (in seconds) to filter when searching for offerings. - // - // Default: 94608000 (3 years) - MaxDuration *int64 `type:"long"` - - // The maximum number of instances to filter when searching for offerings. - // - // Default: 20 - MaxInstanceCount *int64 `type:"integer"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. The maximum is 100. - // - // Default: 100 - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The minimum duration (in seconds) to filter when searching for offerings. - // - // Default: 2592000 (1 month) - MinDuration *int64 `type:"long"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The offering class of the Reserved Instance. Can be standard or convertible. - OfferingClass *string `type:"string" enum:"OfferingClassType"` - - // The Reserved Instance offering type. If you are using tools that predate - // the 2011-11-01 API version, you only have access to the Medium Utilization - // Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - - // The Reserved Instance product platform description. Instances that include - // (Amazon VPC) in the description are for use with Amazon VPC. - ProductDescription *string `type:"string" enum:"RIProductDescription"` - - // One or more Reserved Instances offering IDs. - ReservedInstancesOfferingIds []*string `locationName:"ReservedInstancesOfferingId" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesOfferingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesOfferingsInput) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetAvailabilityZone(v string) *DescribeReservedInstancesOfferingsInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetDryRun(v bool) *DescribeReservedInstancesOfferingsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetFilters(v []*Filter) *DescribeReservedInstancesOfferingsInput { - s.Filters = v - return s -} - -// SetIncludeMarketplace sets the IncludeMarketplace field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetIncludeMarketplace(v bool) *DescribeReservedInstancesOfferingsInput { - s.IncludeMarketplace = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetInstanceTenancy(v string) *DescribeReservedInstancesOfferingsInput { - s.InstanceTenancy = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetInstanceType(v string) *DescribeReservedInstancesOfferingsInput { - s.InstanceType = &v - return s -} - -// SetMaxDuration sets the MaxDuration field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetMaxDuration(v int64) *DescribeReservedInstancesOfferingsInput { - s.MaxDuration = &v - return s -} - -// SetMaxInstanceCount sets the MaxInstanceCount field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetMaxInstanceCount(v int64) *DescribeReservedInstancesOfferingsInput { - s.MaxInstanceCount = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetMaxResults(v int64) *DescribeReservedInstancesOfferingsInput { - s.MaxResults = &v - return s -} - -// SetMinDuration sets the MinDuration field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetMinDuration(v int64) *DescribeReservedInstancesOfferingsInput { - s.MinDuration = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetNextToken(v string) *DescribeReservedInstancesOfferingsInput { - s.NextToken = &v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetOfferingClass(v string) *DescribeReservedInstancesOfferingsInput { - s.OfferingClass = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetOfferingType(v string) *DescribeReservedInstancesOfferingsInput { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetProductDescription(v string) *DescribeReservedInstancesOfferingsInput { - s.ProductDescription = &v - return s -} - -// SetReservedInstancesOfferingIds sets the ReservedInstancesOfferingIds field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetReservedInstancesOfferingIds(v []*string) *DescribeReservedInstancesOfferingsInput { - s.ReservedInstancesOfferingIds = v - return s -} - -// Contains the output of DescribeReservedInstancesOfferings. -type DescribeReservedInstancesOfferingsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of Reserved Instances offerings. - ReservedInstancesOfferings []*ReservedInstancesOffering `locationName:"reservedInstancesOfferingsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesOfferingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesOfferingsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeReservedInstancesOfferingsOutput) SetNextToken(v string) *DescribeReservedInstancesOfferingsOutput { - s.NextToken = &v - return s -} - -// SetReservedInstancesOfferings sets the ReservedInstancesOfferings field's value. -func (s *DescribeReservedInstancesOfferingsOutput) SetReservedInstancesOfferings(v []*ReservedInstancesOffering) *DescribeReservedInstancesOfferingsOutput { - s.ReservedInstancesOfferings = v - return s -} - -// Contains the output for DescribeReservedInstances. -type DescribeReservedInstancesOutput struct { - _ struct{} `type:"structure"` - - // A list of Reserved Instances. - ReservedInstances []*ReservedInstances `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesOutput) GoString() string { - return s.String() -} - -// SetReservedInstances sets the ReservedInstances field's value. -func (s *DescribeReservedInstancesOutput) SetReservedInstances(v []*ReservedInstances) *DescribeReservedInstancesOutput { - s.ReservedInstances = v - return s -} - -// Contains the parameters for DescribeRouteTables. -type DescribeRouteTablesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * association.route-table-association-id - The ID of an association ID - // for the route table. - // - // * association.route-table-id - The ID of the route table involved in the - // association. - // - // * association.subnet-id - The ID of the subnet involved in the association. - // - // * association.main - Indicates whether the route table is the main route - // table for the VPC (true | false). Route tables that do not have an association - // ID are not returned in the response. - // - // * route-table-id - The ID of the route table. - // - // * route.destination-cidr-block - The IPv4 CIDR range specified in a route - // in the table. - // - // * route.destination-ipv6-cidr-block - The IPv6 CIDR range specified in - // a route in the route table. - // - // * route.destination-prefix-list-id - The ID (prefix) of the AWS service - // specified in a route in the table. - // - // * route.egress-only-internet-gateway-id - The ID of an egress-only Internet - // gateway specified in a route in the route table. - // - // * route.gateway-id - The ID of a gateway specified in a route in the table. - // - // * route.instance-id - The ID of an instance specified in a route in the - // table. - // - // * route.nat-gateway-id - The ID of a NAT gateway. - // - // * route.origin - Describes how the route was created. CreateRouteTable - // indicates that the route was automatically created when the route table - // was created; CreateRoute indicates that the route was manually added to - // the route table; EnableVgwRoutePropagation indicates that the route was - // propagated by route propagation. - // - // * route.state - The state of a route in the route table (active | blackhole). - // The blackhole state indicates that the route's target isn't available - // (for example, the specified gateway isn't attached to the VPC, the specified - // NAT instance has been terminated, and so on). - // - // * route.vpc-peering-connection-id - The ID of a VPC peering connection - // specified in a route in the table. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC for the route table. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more route table IDs. - // - // Default: Describes all your route tables. - RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeRouteTablesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRouteTablesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeRouteTablesInput) SetDryRun(v bool) *DescribeRouteTablesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeRouteTablesInput) SetFilters(v []*Filter) *DescribeRouteTablesInput { - s.Filters = v - return s -} - -// SetRouteTableIds sets the RouteTableIds field's value. -func (s *DescribeRouteTablesInput) SetRouteTableIds(v []*string) *DescribeRouteTablesInput { - s.RouteTableIds = v - return s -} - -// Contains the output of DescribeRouteTables. -type DescribeRouteTablesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more route tables. - RouteTables []*RouteTable `locationName:"routeTableSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeRouteTablesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRouteTablesOutput) GoString() string { - return s.String() -} - -// SetRouteTables sets the RouteTables field's value. -func (s *DescribeRouteTablesOutput) SetRouteTables(v []*RouteTable) *DescribeRouteTablesOutput { - s.RouteTables = v - return s -} - -// Contains the parameters for DescribeScheduledInstanceAvailability. -type DescribeScheduledInstanceAvailabilityInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone (for example, us-west-2a). - // - // * instance-type - The instance type (for example, c4.large). - // - // * network-platform - The network platform (EC2-Classic or EC2-VPC). - // - // * platform - The platform (Linux/UNIX or Windows). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The time period for the first schedule to start. - // - // FirstSlotStartTimeRange is a required field - FirstSlotStartTimeRange *SlotDateTimeRangeRequest `type:"structure" required:"true"` - - // The maximum number of results to return in a single call. This value can - // be between 5 and 300. The default value is 300. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The maximum available duration, in hours. This value must be greater than - // MinSlotDurationInHours and less than 1,720. - MaxSlotDurationInHours *int64 `type:"integer"` - - // The minimum available duration, in hours. The minimum required duration is - // 1,200 hours per year. For example, the minimum daily schedule is 4 hours, - // the minimum weekly schedule is 24 hours, and the minimum monthly schedule - // is 100 hours. - MinSlotDurationInHours *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` - - // The schedule recurrence. - // - // Recurrence is a required field - Recurrence *ScheduledInstanceRecurrenceRequest `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DescribeScheduledInstanceAvailabilityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledInstanceAvailabilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeScheduledInstanceAvailabilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeScheduledInstanceAvailabilityInput"} - if s.FirstSlotStartTimeRange == nil { - invalidParams.Add(request.NewErrParamRequired("FirstSlotStartTimeRange")) - } - if s.Recurrence == nil { - invalidParams.Add(request.NewErrParamRequired("Recurrence")) - } - if s.FirstSlotStartTimeRange != nil { - if err := s.FirstSlotStartTimeRange.Validate(); err != nil { - invalidParams.AddNested("FirstSlotStartTimeRange", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetDryRun(v bool) *DescribeScheduledInstanceAvailabilityInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetFilters(v []*Filter) *DescribeScheduledInstanceAvailabilityInput { - s.Filters = v - return s -} - -// SetFirstSlotStartTimeRange sets the FirstSlotStartTimeRange field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetFirstSlotStartTimeRange(v *SlotDateTimeRangeRequest) *DescribeScheduledInstanceAvailabilityInput { - s.FirstSlotStartTimeRange = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetMaxResults(v int64) *DescribeScheduledInstanceAvailabilityInput { - s.MaxResults = &v - return s -} - -// SetMaxSlotDurationInHours sets the MaxSlotDurationInHours field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetMaxSlotDurationInHours(v int64) *DescribeScheduledInstanceAvailabilityInput { - s.MaxSlotDurationInHours = &v - return s -} - -// SetMinSlotDurationInHours sets the MinSlotDurationInHours field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetMinSlotDurationInHours(v int64) *DescribeScheduledInstanceAvailabilityInput { - s.MinSlotDurationInHours = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetNextToken(v string) *DescribeScheduledInstanceAvailabilityInput { - s.NextToken = &v - return s -} - -// SetRecurrence sets the Recurrence field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetRecurrence(v *ScheduledInstanceRecurrenceRequest) *DescribeScheduledInstanceAvailabilityInput { - s.Recurrence = v - return s -} - -// Contains the output of DescribeScheduledInstanceAvailability. -type DescribeScheduledInstanceAvailabilityOutput struct { - _ struct{} `type:"structure"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the available Scheduled Instances. - ScheduledInstanceAvailabilitySet []*ScheduledInstanceAvailability `locationName:"scheduledInstanceAvailabilitySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeScheduledInstanceAvailabilityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledInstanceAvailabilityOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledInstanceAvailabilityOutput) SetNextToken(v string) *DescribeScheduledInstanceAvailabilityOutput { - s.NextToken = &v - return s -} - -// SetScheduledInstanceAvailabilitySet sets the ScheduledInstanceAvailabilitySet field's value. -func (s *DescribeScheduledInstanceAvailabilityOutput) SetScheduledInstanceAvailabilitySet(v []*ScheduledInstanceAvailability) *DescribeScheduledInstanceAvailabilityOutput { - s.ScheduledInstanceAvailabilitySet = v - return s -} - -// Contains the parameters for DescribeScheduledInstances. -type DescribeScheduledInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone (for example, us-west-2a). - // - // * instance-type - The instance type (for example, c4.large). - // - // * network-platform - The network platform (EC2-Classic or EC2-VPC). - // - // * platform - The platform (Linux/UNIX or Windows). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. This value can - // be between 5 and 300. The default value is 100. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` - - // One or more Scheduled Instance IDs. - ScheduledInstanceIds []*string `locationName:"ScheduledInstanceId" locationNameList:"ScheduledInstanceId" type:"list"` - - // The time period for the first schedule to start. - SlotStartTimeRange *SlotStartTimeRangeRequest `type:"structure"` -} - -// String returns the string representation -func (s DescribeScheduledInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledInstancesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeScheduledInstancesInput) SetDryRun(v bool) *DescribeScheduledInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeScheduledInstancesInput) SetFilters(v []*Filter) *DescribeScheduledInstancesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeScheduledInstancesInput) SetMaxResults(v int64) *DescribeScheduledInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledInstancesInput) SetNextToken(v string) *DescribeScheduledInstancesInput { - s.NextToken = &v - return s -} - -// SetScheduledInstanceIds sets the ScheduledInstanceIds field's value. -func (s *DescribeScheduledInstancesInput) SetScheduledInstanceIds(v []*string) *DescribeScheduledInstancesInput { - s.ScheduledInstanceIds = v - return s -} - -// SetSlotStartTimeRange sets the SlotStartTimeRange field's value. -func (s *DescribeScheduledInstancesInput) SetSlotStartTimeRange(v *SlotStartTimeRangeRequest) *DescribeScheduledInstancesInput { - s.SlotStartTimeRange = v - return s -} - -// Contains the output of DescribeScheduledInstances. -type DescribeScheduledInstancesOutput struct { - _ struct{} `type:"structure"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the Scheduled Instances. - ScheduledInstanceSet []*ScheduledInstance `locationName:"scheduledInstanceSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeScheduledInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledInstancesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledInstancesOutput) SetNextToken(v string) *DescribeScheduledInstancesOutput { - s.NextToken = &v - return s -} - -// SetScheduledInstanceSet sets the ScheduledInstanceSet field's value. -func (s *DescribeScheduledInstancesOutput) SetScheduledInstanceSet(v []*ScheduledInstance) *DescribeScheduledInstancesOutput { - s.ScheduledInstanceSet = v - return s -} - -type DescribeSecurityGroupReferencesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more security group IDs in your account. - // - // GroupId is a required field - GroupId []*string `locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeSecurityGroupReferencesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityGroupReferencesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSecurityGroupReferencesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSecurityGroupReferencesInput"} - if s.GroupId == nil { - invalidParams.Add(request.NewErrParamRequired("GroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSecurityGroupReferencesInput) SetDryRun(v bool) *DescribeSecurityGroupReferencesInput { - s.DryRun = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *DescribeSecurityGroupReferencesInput) SetGroupId(v []*string) *DescribeSecurityGroupReferencesInput { - s.GroupId = v - return s -} - -type DescribeSecurityGroupReferencesOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPCs with the referencing security groups. - SecurityGroupReferenceSet []*SecurityGroupReference `locationName:"securityGroupReferenceSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSecurityGroupReferencesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityGroupReferencesOutput) GoString() string { - return s.String() -} - -// SetSecurityGroupReferenceSet sets the SecurityGroupReferenceSet field's value. -func (s *DescribeSecurityGroupReferencesOutput) SetSecurityGroupReferenceSet(v []*SecurityGroupReference) *DescribeSecurityGroupReferencesOutput { - s.SecurityGroupReferenceSet = v - return s -} - -// Contains the parameters for DescribeSecurityGroups. -type DescribeSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. If using multiple filters for rules, the results include - // security groups for which any combination of rules - not necessarily a single - // rule - match all filters. - // - // * description - The description of the security group. - // - // * egress.ip-permission.cidr - An IPv4 CIDR block for an outbound security - // group rule. - // - // * egress.ip-permission.from-port - For an outbound rule, the start of - // port range for the TCP and UDP protocols, or an ICMP type number. - // - // * egress.ip-permission.group-id - The ID of a security group that has - // been referenced in an outbound security group rule. - // - // * egress.ip-permission.group-name - The name of a security group that - // has been referenced in an outbound security group rule. - // - // * egress.ip-permission.ipv6-cidr - An IPv6 CIDR block for an outbound - // security group rule. - // - // * egress.ip-permission.prefix-list-id - The ID (prefix) of the AWS service - // to which a security group rule allows outbound access. - // - // * egress.ip-permission.protocol - The IP protocol for an outbound security - // group rule (tcp | udp | icmp or a protocol number). - // - // * egress.ip-permission.to-port - For an outbound rule, the end of port - // range for the TCP and UDP protocols, or an ICMP code. - // - // * egress.ip-permission.user-id - The ID of an AWS account that has been - // referenced in an outbound security group rule. - // - // * group-id - The ID of the security group. - // - // * group-name - The name of the security group. - // - // * ip-permission.cidr - An IPv4 CIDR block for an inbound security group - // rule. - // - // * ip-permission.from-port - For an inbound rule, the start of port range - // for the TCP and UDP protocols, or an ICMP type number. - // - // * ip-permission.group-id - The ID of a security group that has been referenced - // in an inbound security group rule. - // - // * ip-permission.group-name - The name of a security group that has been - // referenced in an inbound security group rule. - // - // * ip-permission.ipv6-cidr - An IPv6 CIDR block for an inbound security - // group rule. - // - // * ip-permission.prefix-list-id - The ID (prefix) of the AWS service from - // which a security group rule allows inbound access. - // - // * ip-permission.protocol - The IP protocol for an inbound security group - // rule (tcp | udp | icmp or a protocol number). - // - // * ip-permission.to-port - For an inbound rule, the end of port range for - // the TCP and UDP protocols, or an ICMP code. - // - // * ip-permission.user-id - The ID of an AWS account that has been referenced - // in an inbound security group rule. - // - // * owner-id - The AWS account ID of the owner of the security group. - // - // * tag-key - The key of a tag assigned to the security group. - // - // * tag-value - The value of a tag assigned to the security group. - // - // * vpc-id - The ID of the VPC specified when the security group was created. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more security group IDs. Required for security groups in a nondefault - // VPC. - // - // Default: Describes all your security groups. - GroupIds []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` - - // [EC2-Classic and default VPC only] One or more security group names. You - // can specify either the security group name or the security group ID. For - // security groups in a nondefault VPC, use the group-name filter to describe - // security groups by name. - // - // Default: Describes all your security groups. - GroupNames []*string `locationName:"GroupName" locationNameList:"GroupName" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another request with the returned NextToken value. - // This value can be between 5 and 1000. If this parameter is not specified, - // then all results are returned. - MaxResults *int64 `type:"integer"` - - // The token to request the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityGroupsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSecurityGroupsInput) SetDryRun(v bool) *DescribeSecurityGroupsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSecurityGroupsInput) SetFilters(v []*Filter) *DescribeSecurityGroupsInput { - s.Filters = v - return s -} - -// SetGroupIds sets the GroupIds field's value. -func (s *DescribeSecurityGroupsInput) SetGroupIds(v []*string) *DescribeSecurityGroupsInput { - s.GroupIds = v - return s -} - -// SetGroupNames sets the GroupNames field's value. -func (s *DescribeSecurityGroupsInput) SetGroupNames(v []*string) *DescribeSecurityGroupsInput { - s.GroupNames = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSecurityGroupsInput) SetMaxResults(v int64) *DescribeSecurityGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSecurityGroupsInput) SetNextToken(v string) *DescribeSecurityGroupsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeSecurityGroups. -type DescribeSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about one or more security groups. - SecurityGroups []*SecurityGroup `locationName:"securityGroupInfo" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSecurityGroupsOutput) SetNextToken(v string) *DescribeSecurityGroupsOutput { - s.NextToken = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *DescribeSecurityGroupsOutput) SetSecurityGroups(v []*SecurityGroup) *DescribeSecurityGroupsOutput { - s.SecurityGroups = v - return s -} - -// Contains the parameters for DescribeSnapshotAttribute. -type DescribeSnapshotAttributeInput struct { - _ struct{} `type:"structure"` - - // The snapshot attribute you would like to view. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"SnapshotAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the EBS snapshot. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeSnapshotAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSnapshotAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSnapshotAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeSnapshotAttributeInput) SetAttribute(v string) *DescribeSnapshotAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSnapshotAttributeInput) SetDryRun(v bool) *DescribeSnapshotAttributeInput { - s.DryRun = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *DescribeSnapshotAttributeInput) SetSnapshotId(v string) *DescribeSnapshotAttributeInput { - s.SnapshotId = &v - return s -} - -// Contains the output of DescribeSnapshotAttribute. -type DescribeSnapshotAttributeOutput struct { - _ struct{} `type:"structure"` - - // A list of permissions for creating volumes from the snapshot. - CreateVolumePermissions []*CreateVolumePermission `locationName:"createVolumePermission" locationNameList:"item" type:"list"` - - // A list of product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // The ID of the EBS snapshot. - SnapshotId *string `locationName:"snapshotId" type:"string"` -} - -// String returns the string representation -func (s DescribeSnapshotAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotAttributeOutput) GoString() string { - return s.String() -} - -// SetCreateVolumePermissions sets the CreateVolumePermissions field's value. -func (s *DescribeSnapshotAttributeOutput) SetCreateVolumePermissions(v []*CreateVolumePermission) *DescribeSnapshotAttributeOutput { - s.CreateVolumePermissions = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeSnapshotAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeSnapshotAttributeOutput { - s.ProductCodes = v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *DescribeSnapshotAttributeOutput) SetSnapshotId(v string) *DescribeSnapshotAttributeOutput { - s.SnapshotId = &v - return s -} - -// Contains the parameters for DescribeSnapshots. -type DescribeSnapshotsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * description - A description of the snapshot. - // - // * owner-alias - Value from an Amazon-maintained list (amazon | aws-marketplace - // | microsoft) of snapshot owners. Not to be confused with the user-configured - // AWS account alias, which is set from the IAM console. - // - // * owner-id - The ID of the AWS account that owns the snapshot. - // - // * progress - The progress of the snapshot, as a percentage (for example, - // 80%). - // - // * snapshot-id - The snapshot ID. - // - // * start-time - The time stamp when the snapshot was initiated. - // - // * status - The status of the snapshot (pending | completed | error). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * volume-id - The ID of the volume the snapshot is for. - // - // * volume-size - The size of the volume, in GiB. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of snapshot results returned by DescribeSnapshots in paginated - // output. When this parameter is used, DescribeSnapshots only returns MaxResults - // results in a single page along with a NextToken response element. The remaining - // results of the initial request can be seen by sending another DescribeSnapshots - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. If this parameter is not used, then DescribeSnapshots returns - // all results. You cannot specify this parameter and the snapshot IDs parameter - // in the same request. - MaxResults *int64 `type:"integer"` - - // The NextToken value returned from a previous paginated DescribeSnapshots - // request where MaxResults was used and the results exceeded the value of that - // parameter. Pagination continues from the end of the previous results that - // returned the NextToken value. This value is null when there are no more results - // to return. - NextToken *string `type:"string"` - - // Returns the snapshots owned by the specified owner. Multiple owners can be - // specified. - OwnerIds []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` - - // One or more AWS accounts IDs that can create volumes from the snapshot. - RestorableByUserIds []*string `locationName:"RestorableBy" type:"list"` - - // One or more snapshot IDs. - // - // Default: Describes snapshots for which you have launch permissions. - SnapshotIds []*string `locationName:"SnapshotId" locationNameList:"SnapshotId" type:"list"` -} - -// String returns the string representation -func (s DescribeSnapshotsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSnapshotsInput) SetDryRun(v bool) *DescribeSnapshotsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSnapshotsInput) SetFilters(v []*Filter) *DescribeSnapshotsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSnapshotsInput) SetMaxResults(v int64) *DescribeSnapshotsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSnapshotsInput) SetNextToken(v string) *DescribeSnapshotsInput { - s.NextToken = &v - return s -} - -// SetOwnerIds sets the OwnerIds field's value. -func (s *DescribeSnapshotsInput) SetOwnerIds(v []*string) *DescribeSnapshotsInput { - s.OwnerIds = v - return s -} - -// SetRestorableByUserIds sets the RestorableByUserIds field's value. -func (s *DescribeSnapshotsInput) SetRestorableByUserIds(v []*string) *DescribeSnapshotsInput { - s.RestorableByUserIds = v - return s -} - -// SetSnapshotIds sets the SnapshotIds field's value. -func (s *DescribeSnapshotsInput) SetSnapshotIds(v []*string) *DescribeSnapshotsInput { - s.SnapshotIds = v - return s -} - -// Contains the output of DescribeSnapshots. -type DescribeSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // The NextToken value to include in a future DescribeSnapshots request. When - // the results of a DescribeSnapshots request exceed MaxResults, this value - // can be used to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the snapshots. - Snapshots []*Snapshot `locationName:"snapshotSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSnapshotsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSnapshotsOutput) SetNextToken(v string) *DescribeSnapshotsOutput { - s.NextToken = &v - return s -} - -// SetSnapshots sets the Snapshots field's value. -func (s *DescribeSnapshotsOutput) SetSnapshots(v []*Snapshot) *DescribeSnapshotsOutput { - s.Snapshots = v - return s -} - -// Contains the parameters for DescribeSpotDatafeedSubscription. -type DescribeSpotDatafeedSubscriptionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DescribeSpotDatafeedSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotDatafeedSubscriptionInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotDatafeedSubscriptionInput) SetDryRun(v bool) *DescribeSpotDatafeedSubscriptionInput { - s.DryRun = &v - return s -} - -// Contains the output of DescribeSpotDatafeedSubscription. -type DescribeSpotDatafeedSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The Spot Instance data feed subscription. - SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` -} - -// String returns the string representation -func (s DescribeSpotDatafeedSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotDatafeedSubscriptionOutput) GoString() string { - return s.String() -} - -// SetSpotDatafeedSubscription sets the SpotDatafeedSubscription field's value. -func (s *DescribeSpotDatafeedSubscriptionOutput) SetSpotDatafeedSubscription(v *SpotDatafeedSubscription) *DescribeSpotDatafeedSubscriptionOutput { - s.SpotDatafeedSubscription = v - return s -} - -// Contains the parameters for DescribeSpotFleetInstances. -type DescribeSpotFleetInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSpotFleetInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSpotFleetInstancesInput"} - if s.SpotFleetRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotFleetInstancesInput) SetDryRun(v bool) *DescribeSpotFleetInstancesInput { - s.DryRun = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSpotFleetInstancesInput) SetMaxResults(v int64) *DescribeSpotFleetInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetInstancesInput) SetNextToken(v string) *DescribeSpotFleetInstancesInput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *DescribeSpotFleetInstancesInput) SetSpotFleetRequestId(v string) *DescribeSpotFleetInstancesInput { - s.SpotFleetRequestId = &v - return s -} - -// Contains the output of DescribeSpotFleetInstances. -type DescribeSpotFleetInstancesOutput struct { - _ struct{} `type:"structure"` - - // The running instances. This list is refreshed periodically and might be out - // of date. - // - // ActiveInstances is a required field - ActiveInstances []*ActiveInstance `locationName:"activeInstanceSet" locationNameList:"item" type:"list" required:"true"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetInstancesOutput) GoString() string { - return s.String() -} - -// SetActiveInstances sets the ActiveInstances field's value. -func (s *DescribeSpotFleetInstancesOutput) SetActiveInstances(v []*ActiveInstance) *DescribeSpotFleetInstancesOutput { - s.ActiveInstances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetInstancesOutput) SetNextToken(v string) *DescribeSpotFleetInstancesOutput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *DescribeSpotFleetInstancesOutput) SetSpotFleetRequestId(v string) *DescribeSpotFleetInstancesOutput { - s.SpotFleetRequestId = &v - return s -} - -// Contains the parameters for DescribeSpotFleetRequestHistory. -type DescribeSpotFleetRequestHistoryInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The type of events to describe. By default, all events are described. - EventType *string `locationName:"eventType" type:"string" enum:"EventType"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` - - // The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetRequestHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetRequestHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSpotFleetRequestHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSpotFleetRequestHistoryInput"} - if s.SpotFleetRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId")) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetDryRun(v bool) *DescribeSpotFleetRequestHistoryInput { - s.DryRun = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetEventType(v string) *DescribeSpotFleetRequestHistoryInput { - s.EventType = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetMaxResults(v int64) *DescribeSpotFleetRequestHistoryInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetNextToken(v string) *DescribeSpotFleetRequestHistoryInput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetSpotFleetRequestId(v string) *DescribeSpotFleetRequestHistoryInput { - s.SpotFleetRequestId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetStartTime(v time.Time) *DescribeSpotFleetRequestHistoryInput { - s.StartTime = &v - return s -} - -// Contains the output of DescribeSpotFleetRequestHistory. -type DescribeSpotFleetRequestHistoryOutput struct { - _ struct{} `type:"structure"` - - // Information about the events in the history of the Spot Fleet request. - // - // HistoryRecords is a required field - HistoryRecords []*HistoryRecord `locationName:"historyRecordSet" locationNameList:"item" type:"list" required:"true"` - - // The last date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // All records up to this time were retrieved. - // - // If nextToken indicates that there are more results, this value is not present. - // - // LastEvaluatedTime is a required field - LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` - - // The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetRequestHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetRequestHistoryOutput) GoString() string { - return s.String() -} - -// SetHistoryRecords sets the HistoryRecords field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetHistoryRecords(v []*HistoryRecord) *DescribeSpotFleetRequestHistoryOutput { - s.HistoryRecords = v - return s -} - -// SetLastEvaluatedTime sets the LastEvaluatedTime field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetLastEvaluatedTime(v time.Time) *DescribeSpotFleetRequestHistoryOutput { - s.LastEvaluatedTime = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetNextToken(v string) *DescribeSpotFleetRequestHistoryOutput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetSpotFleetRequestId(v string) *DescribeSpotFleetRequestHistoryOutput { - s.SpotFleetRequestId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetStartTime(v time.Time) *DescribeSpotFleetRequestHistoryOutput { - s.StartTime = &v - return s -} - -// Contains the parameters for DescribeSpotFleetRequests. -type DescribeSpotFleetRequestsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The IDs of the Spot Fleet requests. - SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSpotFleetRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetRequestsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotFleetRequestsInput) SetDryRun(v bool) *DescribeSpotFleetRequestsInput { - s.DryRun = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSpotFleetRequestsInput) SetMaxResults(v int64) *DescribeSpotFleetRequestsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetRequestsInput) SetNextToken(v string) *DescribeSpotFleetRequestsInput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestIds sets the SpotFleetRequestIds field's value. -func (s *DescribeSpotFleetRequestsInput) SetSpotFleetRequestIds(v []*string) *DescribeSpotFleetRequestsInput { - s.SpotFleetRequestIds = v - return s -} - -// Contains the output of DescribeSpotFleetRequests. -type DescribeSpotFleetRequestsOutput struct { - _ struct{} `type:"structure"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the configuration of your Spot Fleet. - // - // SpotFleetRequestConfigs is a required field - SpotFleetRequestConfigs []*SpotFleetRequestConfig `locationName:"spotFleetRequestConfigSet" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetRequestsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetRequestsOutput) SetNextToken(v string) *DescribeSpotFleetRequestsOutput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestConfigs sets the SpotFleetRequestConfigs field's value. -func (s *DescribeSpotFleetRequestsOutput) SetSpotFleetRequestConfigs(v []*SpotFleetRequestConfig) *DescribeSpotFleetRequestsOutput { - s.SpotFleetRequestConfigs = v - return s -} - -// Contains the parameters for DescribeSpotInstanceRequests. -type DescribeSpotInstanceRequestsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availability-zone-group - The Availability Zone group. - // - // * create-time - The time stamp when the Spot Instance request was created. - // - // * fault-code - The fault code related to the request. - // - // * fault-message - The fault message related to the request. - // - // * instance-id - The ID of the instance that fulfilled the request. - // - // * launch-group - The Spot Instance launch group. - // - // * launch.block-device-mapping.delete-on-termination - Indicates whether - // the EBS volume is deleted on instance termination. - // - // * launch.block-device-mapping.device-name - The device name for the volume - // in the block device mapping (for example, /dev/sdh or xvdh). - // - // * launch.block-device-mapping.snapshot-id - The ID of the snapshot for - // the EBS volume. - // - // * launch.block-device-mapping.volume-size - The size of the EBS volume, - // in GiB. - // - // * launch.block-device-mapping.volume-type - The type of EBS volume: gp2 - // for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput - // Optimized HDD, sc1for Cold HDD, or standard for Magnetic. - // - // * launch.group-id - The ID of the security group for the instance. - // - // * launch.group-name - The name of the security group for the instance. - // - // * launch.image-id - The ID of the AMI. - // - // * launch.instance-type - The type of instance (for example, m3.medium). - // - // * launch.kernel-id - The kernel ID. - // - // * launch.key-name - The name of the key pair the instance launched with. - // - // * launch.monitoring-enabled - Whether detailed monitoring is enabled for - // the Spot Instance. - // - // * launch.ramdisk-id - The RAM disk ID. - // - // * launched-availability-zone - The Availability Zone in which the request - // is launched. - // - // * network-interface.addresses.primary - Indicates whether the IP address - // is the primary private IP address. - // - // * network-interface.delete-on-termination - Indicates whether the network - // interface is deleted when the instance is terminated. - // - // * network-interface.description - A description of the network interface. - // - // * network-interface.device-index - The index of the device for the network - // interface attachment on the instance. - // - // * network-interface.group-id - The ID of the security group associated - // with the network interface. - // - // * network-interface.network-interface-id - The ID of the network interface. - // - // * network-interface.private-ip-address - The primary private IP address - // of the network interface. - // - // * network-interface.subnet-id - The ID of the subnet for the instance. - // - // * product-description - The product description associated with the instance - // (Linux/UNIX | Windows). - // - // * spot-instance-request-id - The Spot Instance request ID. - // - // * spot-price - The maximum hourly price for any Spot Instance launched - // to fulfill the request. - // - // * state - The state of the Spot Instance request (open | active | closed - // | cancelled | failed). Spot request status information can help you track - // your Amazon EC2 Spot Instance requests. For more information, see Spot - // Request Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) - // in the Amazon EC2 User Guide for Linux Instances. - // - // * status-code - The short code describing the most recent evaluation of - // your Spot Instance request. - // - // * status-message - The message explaining the status of the Spot Instance - // request. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * type - The type of Spot Instance request (one-time | persistent). - // - // * valid-from - The start date of the request. - // - // * valid-until - The end date of the request. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more Spot Instance request IDs. - SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list"` -} - -// String returns the string representation -func (s DescribeSpotInstanceRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotInstanceRequestsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotInstanceRequestsInput) SetDryRun(v bool) *DescribeSpotInstanceRequestsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSpotInstanceRequestsInput) SetFilters(v []*Filter) *DescribeSpotInstanceRequestsInput { - s.Filters = v - return s -} - -// SetSpotInstanceRequestIds sets the SpotInstanceRequestIds field's value. -func (s *DescribeSpotInstanceRequestsInput) SetSpotInstanceRequestIds(v []*string) *DescribeSpotInstanceRequestsInput { - s.SpotInstanceRequestIds = v - return s -} - -// Contains the output of DescribeSpotInstanceRequests. -type DescribeSpotInstanceRequestsOutput struct { - _ struct{} `type:"structure"` - - // One or more Spot Instance requests. - SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSpotInstanceRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotInstanceRequestsOutput) GoString() string { - return s.String() -} - -// SetSpotInstanceRequests sets the SpotInstanceRequests field's value. -func (s *DescribeSpotInstanceRequestsOutput) SetSpotInstanceRequests(v []*SpotInstanceRequest) *DescribeSpotInstanceRequestsOutput { - s.SpotInstanceRequests = v - return s -} - -// Contains the parameters for DescribeSpotPriceHistory. -type DescribeSpotPriceHistoryInput struct { - _ struct{} `type:"structure"` - - // Filters the results by the specified Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The date and time, up to the current date, from which to stop retrieving - // the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // One or more filters. - // - // * availability-zone - The Availability Zone for which prices should be - // returned. - // - // * instance-type - The type of instance (for example, m3.medium). - // - // * product-description - The product description for the Spot price (Linux/UNIX - // | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon - // VPC) | Windows (Amazon VPC)). - // - // * spot-price - The Spot price. The value must match exactly (or use wildcards; - // greater than or less than comparison is not supported). - // - // * timestamp - The time stamp of the Spot price history, in UTC format - // (for example, YYYY-MM-DDTHH:MM:SSZ). You can use wildcards (* and ?). - // Greater than or less than comparison is not supported. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // Filters the results by the specified instance types. - InstanceTypes []*string `locationName:"InstanceType" type:"list"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // Filters the results by the specified basic product descriptions. - ProductDescriptions []*string `locationName:"ProductDescription" type:"list"` - - // The date and time, up to the past 90 days, from which to start retrieving - // the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeSpotPriceHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotPriceHistoryInput) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *DescribeSpotPriceHistoryInput) SetAvailabilityZone(v string) *DescribeSpotPriceHistoryInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotPriceHistoryInput) SetDryRun(v bool) *DescribeSpotPriceHistoryInput { - s.DryRun = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeSpotPriceHistoryInput) SetEndTime(v time.Time) *DescribeSpotPriceHistoryInput { - s.EndTime = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSpotPriceHistoryInput) SetFilters(v []*Filter) *DescribeSpotPriceHistoryInput { - s.Filters = v - return s -} - -// SetInstanceTypes sets the InstanceTypes field's value. -func (s *DescribeSpotPriceHistoryInput) SetInstanceTypes(v []*string) *DescribeSpotPriceHistoryInput { - s.InstanceTypes = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSpotPriceHistoryInput) SetMaxResults(v int64) *DescribeSpotPriceHistoryInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotPriceHistoryInput) SetNextToken(v string) *DescribeSpotPriceHistoryInput { - s.NextToken = &v - return s -} - -// SetProductDescriptions sets the ProductDescriptions field's value. -func (s *DescribeSpotPriceHistoryInput) SetProductDescriptions(v []*string) *DescribeSpotPriceHistoryInput { - s.ProductDescriptions = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeSpotPriceHistoryInput) SetStartTime(v time.Time) *DescribeSpotPriceHistoryInput { - s.StartTime = &v - return s -} - -// Contains the output of DescribeSpotPriceHistory. -type DescribeSpotPriceHistoryOutput struct { - _ struct{} `type:"structure"` - - // The token required to retrieve the next set of results. This value is null - // or an empty string when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The historical Spot prices. - SpotPriceHistory []*SpotPrice `locationName:"spotPriceHistorySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSpotPriceHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotPriceHistoryOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotPriceHistoryOutput) SetNextToken(v string) *DescribeSpotPriceHistoryOutput { - s.NextToken = &v - return s -} - -// SetSpotPriceHistory sets the SpotPriceHistory field's value. -func (s *DescribeSpotPriceHistoryOutput) SetSpotPriceHistory(v []*SpotPrice) *DescribeSpotPriceHistoryOutput { - s.SpotPriceHistory = v - return s -} - -type DescribeStaleSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"5" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `min:"1" type:"string"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeStaleSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStaleSecurityGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStaleSecurityGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStaleSecurityGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeStaleSecurityGroupsInput) SetDryRun(v bool) *DescribeStaleSecurityGroupsInput { - s.DryRun = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeStaleSecurityGroupsInput) SetMaxResults(v int64) *DescribeStaleSecurityGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStaleSecurityGroupsInput) SetNextToken(v string) *DescribeStaleSecurityGroupsInput { - s.NextToken = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DescribeStaleSecurityGroupsInput) SetVpcId(v string) *DescribeStaleSecurityGroupsInput { - s.VpcId = &v - return s -} - -type DescribeStaleSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the stale security groups. - StaleSecurityGroupSet []*StaleSecurityGroup `locationName:"staleSecurityGroupSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeStaleSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStaleSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStaleSecurityGroupsOutput) SetNextToken(v string) *DescribeStaleSecurityGroupsOutput { - s.NextToken = &v - return s -} - -// SetStaleSecurityGroupSet sets the StaleSecurityGroupSet field's value. -func (s *DescribeStaleSecurityGroupsOutput) SetStaleSecurityGroupSet(v []*StaleSecurityGroup) *DescribeStaleSecurityGroupsOutput { - s.StaleSecurityGroupSet = v - return s -} - -// Contains the parameters for DescribeSubnets. -type DescribeSubnetsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availabilityZone - The Availability Zone for the subnet. You can also - // use availability-zone as the filter name. - // - // * available-ip-address-count - The number of IPv4 addresses in the subnet - // that are available. - // - // * cidrBlock - The IPv4 CIDR block of the subnet. The CIDR block you specify - // must exactly match the subnet's CIDR block for information to be returned - // for the subnet. You can also use cidr or cidr-block as the filter names. - // - // * defaultForAz - Indicates whether this is the default subnet for the - // Availability Zone. You can also use default-for-az as the filter name. - // - // * ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR block associated - // with the subnet. - // - // * ipv6-cidr-block-association.association-id - An association ID for an - // IPv6 CIDR block associated with the subnet. - // - // * ipv6-cidr-block-association.state - The state of an IPv6 CIDR block - // associated with the subnet. - // - // * state - The state of the subnet (pending | available). - // - // * subnet-id - The ID of the subnet. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC for the subnet. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more subnet IDs. - // - // Default: Describes all your subnets. - SubnetIds []*string `locationName:"SubnetId" locationNameList:"SubnetId" type:"list"` -} - -// String returns the string representation -func (s DescribeSubnetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSubnetsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSubnetsInput) SetDryRun(v bool) *DescribeSubnetsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSubnetsInput) SetFilters(v []*Filter) *DescribeSubnetsInput { - s.Filters = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *DescribeSubnetsInput) SetSubnetIds(v []*string) *DescribeSubnetsInput { - s.SubnetIds = v - return s -} - -// Contains the output of DescribeSubnets. -type DescribeSubnetsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more subnets. - Subnets []*Subnet `locationName:"subnetSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSubnetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSubnetsOutput) GoString() string { - return s.String() -} - -// SetSubnets sets the Subnets field's value. -func (s *DescribeSubnetsOutput) SetSubnets(v []*Subnet) *DescribeSubnetsOutput { - s.Subnets = v - return s -} - -// Contains the parameters for DescribeTags. -type DescribeTagsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * key - The tag key. - // - // * resource-id - The resource ID. - // - // * resource-type - The resource type (customer-gateway | dhcp-options | - // elastic-ip | fpga-image | image | instance | internet-gateway | launch-template - // | natgateway | network-acl | network-interface | reserved-instances | - // route-table | security-group | snapshot | spot-instances-request | subnet - // | volume | vpc | vpc-peering-connection | vpn-connection | vpn-gateway). - // - // * value - The tag value. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. This value can - // be between 5 and 1000. To retrieve the remaining results, make another call - // with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTagsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeTagsInput) SetDryRun(v bool) *DescribeTagsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeTagsInput) SetFilters(v []*Filter) *DescribeTagsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeTagsInput) SetMaxResults(v int64) *DescribeTagsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTagsInput) SetNextToken(v string) *DescribeTagsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeTags. -type DescribeTagsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return.. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of tags. - Tags []*TagDescription `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTagsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTagsOutput) SetNextToken(v string) *DescribeTagsOutput { - s.NextToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DescribeTagsOutput) SetTags(v []*TagDescription) *DescribeTagsOutput { - s.Tags = v - return s -} - -// Contains the parameters for DescribeVolumeAttribute. -type DescribeVolumeAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute of the volume. This parameter is required. - Attribute *string `type:"string" enum:"VolumeAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeVolumeAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumeAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeVolumeAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeVolumeAttributeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeVolumeAttributeInput) SetAttribute(v string) *DescribeVolumeAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVolumeAttributeInput) SetDryRun(v bool) *DescribeVolumeAttributeInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DescribeVolumeAttributeInput) SetVolumeId(v string) *DescribeVolumeAttributeInput { - s.VolumeId = &v - return s -} - -// Contains the output of DescribeVolumeAttribute. -type DescribeVolumeAttributeOutput struct { - _ struct{} `type:"structure"` - - // The state of autoEnableIO attribute. - AutoEnableIO *AttributeBooleanValue `locationName:"autoEnableIO" type:"structure"` - - // A list of product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // The ID of the volume. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s DescribeVolumeAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumeAttributeOutput) GoString() string { - return s.String() -} - -// SetAutoEnableIO sets the AutoEnableIO field's value. -func (s *DescribeVolumeAttributeOutput) SetAutoEnableIO(v *AttributeBooleanValue) *DescribeVolumeAttributeOutput { - s.AutoEnableIO = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeVolumeAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeVolumeAttributeOutput { - s.ProductCodes = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DescribeVolumeAttributeOutput) SetVolumeId(v string) *DescribeVolumeAttributeOutput { - s.VolumeId = &v - return s -} - -// Contains the parameters for DescribeVolumeStatus. -type DescribeVolumeStatusInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * action.code - The action code for the event (for example, enable-volume-io). - // - // * action.description - A description of the action. - // - // * action.event-id - The event ID associated with the action. - // - // * availability-zone - The Availability Zone of the instance. - // - // * event.description - A description of the event. - // - // * event.event-id - The event ID. - // - // * event.event-type - The event type (for io-enabled: passed | failed; - // for io-performance: io-performance:degraded | io-performance:severely-degraded - // | io-performance:stalled). - // - // * event.not-after - The latest end time for the event. - // - // * event.not-before - The earliest start time for the event. - // - // * volume-status.details-name - The cause for volume-status.status (io-enabled - // | io-performance). - // - // * volume-status.details-status - The status of volume-status.details-name - // (for io-enabled: passed | failed; for io-performance: normal | degraded - // | severely-degraded | stalled). - // - // * volume-status.status - The status of the volume (ok | impaired | warning - // | insufficient-data). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of volume results returned by DescribeVolumeStatus in - // paginated output. When this parameter is used, the request only returns MaxResults - // results in a single page along with a NextToken response element. The remaining - // results of the initial request can be seen by sending another request with - // the returned NextToken value. This value can be between 5 and 1000; if MaxResults - // is given a value larger than 1000, only 1000 results are returned. If this - // parameter is not used, then DescribeVolumeStatus returns all results. You - // cannot specify this parameter and the volume IDs parameter in the same request. - MaxResults *int64 `type:"integer"` - - // The NextToken value to include in a future DescribeVolumeStatus request. - // When the results of the request exceed MaxResults, this value can be used - // to retrieve the next page of results. This value is null when there are no - // more results to return. - NextToken *string `type:"string"` - - // One or more volume IDs. - // - // Default: Describes all your volumes. - VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumeStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumeStatusInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVolumeStatusInput) SetDryRun(v bool) *DescribeVolumeStatusInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVolumeStatusInput) SetFilters(v []*Filter) *DescribeVolumeStatusInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVolumeStatusInput) SetMaxResults(v int64) *DescribeVolumeStatusInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumeStatusInput) SetNextToken(v string) *DescribeVolumeStatusInput { - s.NextToken = &v - return s -} - -// SetVolumeIds sets the VolumeIds field's value. -func (s *DescribeVolumeStatusInput) SetVolumeIds(v []*string) *DescribeVolumeStatusInput { - s.VolumeIds = v - return s -} - -// Contains the output of DescribeVolumeStatus. -type DescribeVolumeStatusOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of volumes. - VolumeStatuses []*VolumeStatusItem `locationName:"volumeStatusSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumeStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumeStatusOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumeStatusOutput) SetNextToken(v string) *DescribeVolumeStatusOutput { - s.NextToken = &v - return s -} - -// SetVolumeStatuses sets the VolumeStatuses field's value. -func (s *DescribeVolumeStatusOutput) SetVolumeStatuses(v []*VolumeStatusItem) *DescribeVolumeStatusOutput { - s.VolumeStatuses = v - return s -} - -// Contains the parameters for DescribeVolumes. -type DescribeVolumesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * attachment.attach-time - The time stamp when the attachment initiated. - // - // * attachment.delete-on-termination - Whether the volume is deleted on - // instance termination. - // - // * attachment.device - The device name specified in the block device mapping - // (for example, /dev/sda1). - // - // * attachment.instance-id - The ID of the instance the volume is attached - // to. - // - // * attachment.status - The attachment state (attaching | attached | detaching). - // - // * availability-zone - The Availability Zone in which the volume was created. - // - // * create-time - The time stamp when the volume was created. - // - // * encrypted - The encryption status of the volume. - // - // * size - The size of the volume, in GiB. - // - // * snapshot-id - The snapshot from which the volume was created. - // - // * status - The status of the volume (creating | available | in-use | deleting - // | deleted | error). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * volume-id - The volume ID. - // - // * volume-type - The Amazon EBS volume type. This can be gp2 for General - // Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized - // HDD, sc1 for Cold HDD, or standard for Magnetic volumes. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of volume results returned by DescribeVolumes in paginated - // output. When this parameter is used, DescribeVolumes only returns MaxResults - // results in a single page along with a NextToken response element. The remaining - // results of the initial request can be seen by sending another DescribeVolumes - // request with the returned NextToken value. This value can be between 5 and - // 500; if MaxResults is given a value larger than 500, only 500 results are - // returned. If this parameter is not used, then DescribeVolumes returns all - // results. You cannot specify this parameter and the volume IDs parameter in - // the same request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The NextToken value returned from a previous paginated DescribeVolumes request - // where MaxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // NextToken value. This value is null when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // One or more volume IDs. - VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVolumesInput) SetDryRun(v bool) *DescribeVolumesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVolumesInput) SetFilters(v []*Filter) *DescribeVolumesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVolumesInput) SetMaxResults(v int64) *DescribeVolumesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumesInput) SetNextToken(v string) *DescribeVolumesInput { - s.NextToken = &v - return s -} - -// SetVolumeIds sets the VolumeIds field's value. -func (s *DescribeVolumesInput) SetVolumeIds(v []*string) *DescribeVolumesInput { - s.VolumeIds = v - return s -} - -type DescribeVolumesModificationsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. Supported filters: volume-id, modification-state, target-size, - // target-iops, target-volume-type, original-size, original-iops, original-volume-type, - // start-time. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results (up to a limit of 500) to be returned in a - // paginated request. - MaxResults *int64 `type:"integer"` - - // The nextToken value returned by a previous paginated request. - NextToken *string `type:"string"` - - // One or more volume IDs for which in-progress modifications will be described. - VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumesModificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumesModificationsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVolumesModificationsInput) SetDryRun(v bool) *DescribeVolumesModificationsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVolumesModificationsInput) SetFilters(v []*Filter) *DescribeVolumesModificationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVolumesModificationsInput) SetMaxResults(v int64) *DescribeVolumesModificationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumesModificationsInput) SetNextToken(v string) *DescribeVolumesModificationsInput { - s.NextToken = &v - return s -} - -// SetVolumeIds sets the VolumeIds field's value. -func (s *DescribeVolumesModificationsInput) SetVolumeIds(v []*string) *DescribeVolumesModificationsInput { - s.VolumeIds = v - return s -} - -type DescribeVolumesModificationsOutput struct { - _ struct{} `type:"structure"` - - // Token for pagination, null if there are no more results - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of returned VolumeModification objects. - VolumesModifications []*VolumeModification `locationName:"volumeModificationSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumesModificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumesModificationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumesModificationsOutput) SetNextToken(v string) *DescribeVolumesModificationsOutput { - s.NextToken = &v - return s -} - -// SetVolumesModifications sets the VolumesModifications field's value. -func (s *DescribeVolumesModificationsOutput) SetVolumesModifications(v []*VolumeModification) *DescribeVolumesModificationsOutput { - s.VolumesModifications = v - return s -} - -// Contains the output of DescribeVolumes. -type DescribeVolumesOutput struct { - _ struct{} `type:"structure"` - - // The NextToken value to include in a future DescribeVolumes request. When - // the results of a DescribeVolumes request exceed MaxResults, this value can - // be used to retrieve the next page of results. This value is null when there - // are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the volumes. - Volumes []*Volume `locationName:"volumeSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumesOutput) SetNextToken(v string) *DescribeVolumesOutput { - s.NextToken = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *DescribeVolumesOutput) SetVolumes(v []*Volume) *DescribeVolumesOutput { - s.Volumes = v - return s -} - -// Contains the parameters for DescribeVpcAttribute. -type DescribeVpcAttributeInput struct { - _ struct{} `type:"structure"` - - // The VPC attribute. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"VpcAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeVpcAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeVpcAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeVpcAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeVpcAttributeInput) SetAttribute(v string) *DescribeVpcAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcAttributeInput) SetDryRun(v bool) *DescribeVpcAttributeInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DescribeVpcAttributeInput) SetVpcId(v string) *DescribeVpcAttributeInput { - s.VpcId = &v - return s -} - -// Contains the output of DescribeVpcAttribute. -type DescribeVpcAttributeOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the instances launched in the VPC get DNS hostnames. If - // this attribute is true, instances in the VPC get DNS hostnames; otherwise, - // they do not. - EnableDnsHostnames *AttributeBooleanValue `locationName:"enableDnsHostnames" type:"structure"` - - // Indicates whether DNS resolution is enabled for the VPC. If this attribute - // is true, the Amazon DNS server resolves DNS hostnames for your instances - // to their corresponding IP addresses; otherwise, it does not. - EnableDnsSupport *AttributeBooleanValue `locationName:"enableDnsSupport" type:"structure"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s DescribeVpcAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcAttributeOutput) GoString() string { - return s.String() -} - -// SetEnableDnsHostnames sets the EnableDnsHostnames field's value. -func (s *DescribeVpcAttributeOutput) SetEnableDnsHostnames(v *AttributeBooleanValue) *DescribeVpcAttributeOutput { - s.EnableDnsHostnames = v - return s -} - -// SetEnableDnsSupport sets the EnableDnsSupport field's value. -func (s *DescribeVpcAttributeOutput) SetEnableDnsSupport(v *AttributeBooleanValue) *DescribeVpcAttributeOutput { - s.EnableDnsSupport = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DescribeVpcAttributeOutput) SetVpcId(v string) *DescribeVpcAttributeOutput { - s.VpcId = &v - return s -} - -// Contains the parameters for DescribeVpcClassicLinkDnsSupport. -type DescribeVpcClassicLinkDnsSupportInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `locationName:"maxResults" min:"5" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // One or more VPC IDs. - VpcIds []*string `locationNameList:"VpcId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcClassicLinkDnsSupportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcClassicLinkDnsSupportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeVpcClassicLinkDnsSupportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeVpcClassicLinkDnsSupportInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcClassicLinkDnsSupportInput) SetMaxResults(v int64) *DescribeVpcClassicLinkDnsSupportInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcClassicLinkDnsSupportInput) SetNextToken(v string) *DescribeVpcClassicLinkDnsSupportInput { - s.NextToken = &v - return s -} - -// SetVpcIds sets the VpcIds field's value. -func (s *DescribeVpcClassicLinkDnsSupportInput) SetVpcIds(v []*string) *DescribeVpcClassicLinkDnsSupportInput { - s.VpcIds = v - return s -} - -// Contains the output of DescribeVpcClassicLinkDnsSupport. -type DescribeVpcClassicLinkDnsSupportOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Information about the ClassicLink DNS support status of the VPCs. - Vpcs []*ClassicLinkDnsSupport `locationName:"vpcs" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcClassicLinkDnsSupportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcClassicLinkDnsSupportOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcClassicLinkDnsSupportOutput) SetNextToken(v string) *DescribeVpcClassicLinkDnsSupportOutput { - s.NextToken = &v - return s -} - -// SetVpcs sets the Vpcs field's value. -func (s *DescribeVpcClassicLinkDnsSupportOutput) SetVpcs(v []*ClassicLinkDnsSupport) *DescribeVpcClassicLinkDnsSupportOutput { - s.Vpcs = v - return s -} - -// Contains the parameters for DescribeVpcClassicLink. -type DescribeVpcClassicLinkInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * is-classic-link-enabled - Whether the VPC is enabled for ClassicLink - // (true | false). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPCs for which you want to describe the ClassicLink status. - VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcClassicLinkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcClassicLinkInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcClassicLinkInput) SetDryRun(v bool) *DescribeVpcClassicLinkInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcClassicLinkInput) SetFilters(v []*Filter) *DescribeVpcClassicLinkInput { - s.Filters = v - return s -} - -// SetVpcIds sets the VpcIds field's value. -func (s *DescribeVpcClassicLinkInput) SetVpcIds(v []*string) *DescribeVpcClassicLinkInput { - s.VpcIds = v - return s -} - -// Contains the output of DescribeVpcClassicLink. -type DescribeVpcClassicLinkOutput struct { - _ struct{} `type:"structure"` - - // The ClassicLink status of one or more VPCs. - Vpcs []*VpcClassicLink `locationName:"vpcSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcClassicLinkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcClassicLinkOutput) GoString() string { - return s.String() -} - -// SetVpcs sets the Vpcs field's value. -func (s *DescribeVpcClassicLinkOutput) SetVpcs(v []*VpcClassicLink) *DescribeVpcClassicLinkOutput { - s.Vpcs = v - return s -} - -type DescribeVpcEndpointConnectionNotificationsInput struct { - _ struct{} `type:"structure"` - - // The ID of the notification. - ConnectionNotificationId *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * connection-notification-arn - The ARN of SNS topic for the notification. - // - // * connection-notification-id - The ID of the notification. - // - // * connection-notification-state - The state of the notification (Enabled - // | Disabled). - // - // * connection-notification-type - The type of notification (Topic). - // - // * service-id - The ID of the endpoint service. - // - // * vpc-endpoint-id - The ID of the VPC endpoint. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another request with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The token to request the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeVpcEndpointConnectionNotificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointConnectionNotificationsInput) GoString() string { - return s.String() -} - -// SetConnectionNotificationId sets the ConnectionNotificationId field's value. -func (s *DescribeVpcEndpointConnectionNotificationsInput) SetConnectionNotificationId(v string) *DescribeVpcEndpointConnectionNotificationsInput { - s.ConnectionNotificationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcEndpointConnectionNotificationsInput) SetDryRun(v bool) *DescribeVpcEndpointConnectionNotificationsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcEndpointConnectionNotificationsInput) SetFilters(v []*Filter) *DescribeVpcEndpointConnectionNotificationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcEndpointConnectionNotificationsInput) SetMaxResults(v int64) *DescribeVpcEndpointConnectionNotificationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointConnectionNotificationsInput) SetNextToken(v string) *DescribeVpcEndpointConnectionNotificationsInput { - s.NextToken = &v - return s -} - -type DescribeVpcEndpointConnectionNotificationsOutput struct { - _ struct{} `type:"structure"` - - // One or more notifications. - ConnectionNotificationSet []*ConnectionNotification `locationName:"connectionNotificationSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeVpcEndpointConnectionNotificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointConnectionNotificationsOutput) GoString() string { - return s.String() -} - -// SetConnectionNotificationSet sets the ConnectionNotificationSet field's value. -func (s *DescribeVpcEndpointConnectionNotificationsOutput) SetConnectionNotificationSet(v []*ConnectionNotification) *DescribeVpcEndpointConnectionNotificationsOutput { - s.ConnectionNotificationSet = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointConnectionNotificationsOutput) SetNextToken(v string) *DescribeVpcEndpointConnectionNotificationsOutput { - s.NextToken = &v - return s -} - -type DescribeVpcEndpointConnectionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * service-id - The ID of the service. - // - // * vpc-endpoint-owner - The AWS account number of the owner of the endpoint. - // - // * vpc-endpoint-state - The state of the endpoint (pendingAcceptance | - // pending | available | deleting | deleted | rejected | failed). - // - // * vpc-endpoint-id - The ID of the endpoint. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeVpcEndpointConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointConnectionsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcEndpointConnectionsInput) SetDryRun(v bool) *DescribeVpcEndpointConnectionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcEndpointConnectionsInput) SetFilters(v []*Filter) *DescribeVpcEndpointConnectionsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcEndpointConnectionsInput) SetMaxResults(v int64) *DescribeVpcEndpointConnectionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointConnectionsInput) SetNextToken(v string) *DescribeVpcEndpointConnectionsInput { - s.NextToken = &v - return s -} - -type DescribeVpcEndpointConnectionsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about one or more VPC endpoint connections. - VpcEndpointConnections []*VpcEndpointConnection `locationName:"vpcEndpointConnectionSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointConnectionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointConnectionsOutput) SetNextToken(v string) *DescribeVpcEndpointConnectionsOutput { - s.NextToken = &v - return s -} - -// SetVpcEndpointConnections sets the VpcEndpointConnections field's value. -func (s *DescribeVpcEndpointConnectionsOutput) SetVpcEndpointConnections(v []*VpcEndpointConnection) *DescribeVpcEndpointConnectionsOutput { - s.VpcEndpointConnections = v - return s -} - -type DescribeVpcEndpointServiceConfigurationsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * service-name - The name of the service. - // - // * service-id - The ID of the service. - // - // * service-state - The state of the service (Pending | Available | Deleting - // | Deleted | Failed). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` - - // The IDs of one or more services. - ServiceIds []*string `locationName:"ServiceId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointServiceConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointServiceConfigurationsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcEndpointServiceConfigurationsInput) SetDryRun(v bool) *DescribeVpcEndpointServiceConfigurationsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcEndpointServiceConfigurationsInput) SetFilters(v []*Filter) *DescribeVpcEndpointServiceConfigurationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcEndpointServiceConfigurationsInput) SetMaxResults(v int64) *DescribeVpcEndpointServiceConfigurationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointServiceConfigurationsInput) SetNextToken(v string) *DescribeVpcEndpointServiceConfigurationsInput { - s.NextToken = &v - return s -} - -// SetServiceIds sets the ServiceIds field's value. -func (s *DescribeVpcEndpointServiceConfigurationsInput) SetServiceIds(v []*string) *DescribeVpcEndpointServiceConfigurationsInput { - s.ServiceIds = v - return s -} - -type DescribeVpcEndpointServiceConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about one or more services. - ServiceConfigurations []*ServiceConfiguration `locationName:"serviceConfigurationSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointServiceConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointServiceConfigurationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointServiceConfigurationsOutput) SetNextToken(v string) *DescribeVpcEndpointServiceConfigurationsOutput { - s.NextToken = &v - return s -} - -// SetServiceConfigurations sets the ServiceConfigurations field's value. -func (s *DescribeVpcEndpointServiceConfigurationsOutput) SetServiceConfigurations(v []*ServiceConfiguration) *DescribeVpcEndpointServiceConfigurationsOutput { - s.ServiceConfigurations = v - return s -} - -type DescribeVpcEndpointServicePermissionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * principal - The ARN of the principal. - // - // * principal-type - The principal type (All | Service | OrganizationUnit - // | Account | User | Role). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` - - // The ID of the service. - // - // ServiceId is a required field - ServiceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeVpcEndpointServicePermissionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointServicePermissionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeVpcEndpointServicePermissionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeVpcEndpointServicePermissionsInput"} - if s.ServiceId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcEndpointServicePermissionsInput) SetDryRun(v bool) *DescribeVpcEndpointServicePermissionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcEndpointServicePermissionsInput) SetFilters(v []*Filter) *DescribeVpcEndpointServicePermissionsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcEndpointServicePermissionsInput) SetMaxResults(v int64) *DescribeVpcEndpointServicePermissionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointServicePermissionsInput) SetNextToken(v string) *DescribeVpcEndpointServicePermissionsInput { - s.NextToken = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *DescribeVpcEndpointServicePermissionsInput) SetServiceId(v string) *DescribeVpcEndpointServicePermissionsInput { - s.ServiceId = &v - return s -} - -type DescribeVpcEndpointServicePermissionsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more allowed principals. - AllowedPrincipals []*AllowedPrincipal `locationName:"allowedPrincipals" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeVpcEndpointServicePermissionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointServicePermissionsOutput) GoString() string { - return s.String() -} - -// SetAllowedPrincipals sets the AllowedPrincipals field's value. -func (s *DescribeVpcEndpointServicePermissionsOutput) SetAllowedPrincipals(v []*AllowedPrincipal) *DescribeVpcEndpointServicePermissionsOutput { - s.AllowedPrincipals = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointServicePermissionsOutput) SetNextToken(v string) *DescribeVpcEndpointServicePermissionsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeVpcEndpointServices. -type DescribeVpcEndpointServicesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * service-name: The name of the service. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - MaxResults *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `type:"string"` - - // One or more service names. - ServiceNames []*string `locationName:"ServiceName" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointServicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointServicesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcEndpointServicesInput) SetDryRun(v bool) *DescribeVpcEndpointServicesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcEndpointServicesInput) SetFilters(v []*Filter) *DescribeVpcEndpointServicesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcEndpointServicesInput) SetMaxResults(v int64) *DescribeVpcEndpointServicesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointServicesInput) SetNextToken(v string) *DescribeVpcEndpointServicesInput { - s.NextToken = &v - return s -} - -// SetServiceNames sets the ServiceNames field's value. -func (s *DescribeVpcEndpointServicesInput) SetServiceNames(v []*string) *DescribeVpcEndpointServicesInput { - s.ServiceNames = v - return s -} - -// Contains the output of DescribeVpcEndpointServices. -type DescribeVpcEndpointServicesOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the service. - ServiceDetails []*ServiceDetail `locationName:"serviceDetailSet" locationNameList:"item" type:"list"` - - // A list of supported services. - ServiceNames []*string `locationName:"serviceNameSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointServicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointServicesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointServicesOutput) SetNextToken(v string) *DescribeVpcEndpointServicesOutput { - s.NextToken = &v - return s -} - -// SetServiceDetails sets the ServiceDetails field's value. -func (s *DescribeVpcEndpointServicesOutput) SetServiceDetails(v []*ServiceDetail) *DescribeVpcEndpointServicesOutput { - s.ServiceDetails = v - return s -} - -// SetServiceNames sets the ServiceNames field's value. -func (s *DescribeVpcEndpointServicesOutput) SetServiceNames(v []*string) *DescribeVpcEndpointServicesOutput { - s.ServiceNames = v - return s -} - -// Contains the parameters for DescribeVpcEndpoints. -type DescribeVpcEndpointsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * service-name: The name of the service. - // - // * vpc-id: The ID of the VPC in which the endpoint resides. - // - // * vpc-endpoint-id: The ID of the endpoint. - // - // * vpc-endpoint-state: The state of the endpoint. (pending | available - // | deleting | deleted) - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - MaxResults *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `type:"string"` - - // One or more endpoint IDs. - VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcEndpointsInput) SetDryRun(v bool) *DescribeVpcEndpointsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcEndpointsInput) SetFilters(v []*Filter) *DescribeVpcEndpointsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcEndpointsInput) SetMaxResults(v int64) *DescribeVpcEndpointsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointsInput) SetNextToken(v string) *DescribeVpcEndpointsInput { - s.NextToken = &v - return s -} - -// SetVpcEndpointIds sets the VpcEndpointIds field's value. -func (s *DescribeVpcEndpointsInput) SetVpcEndpointIds(v []*string) *DescribeVpcEndpointsInput { - s.VpcEndpointIds = v - return s -} - -// Contains the output of DescribeVpcEndpoints. -type DescribeVpcEndpointsOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the endpoints. - VpcEndpoints []*VpcEndpoint `locationName:"vpcEndpointSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointsOutput) SetNextToken(v string) *DescribeVpcEndpointsOutput { - s.NextToken = &v - return s -} - -// SetVpcEndpoints sets the VpcEndpoints field's value. -func (s *DescribeVpcEndpointsOutput) SetVpcEndpoints(v []*VpcEndpoint) *DescribeVpcEndpointsOutput { - s.VpcEndpoints = v - return s -} - -// Contains the parameters for DescribeVpcPeeringConnections. -type DescribeVpcPeeringConnectionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * accepter-vpc-info.cidr-block - The IPv4 CIDR block of the accepter VPC. - // - // * accepter-vpc-info.owner-id - The AWS account ID of the owner of the - // accepter VPC. - // - // * accepter-vpc-info.vpc-id - The ID of the accepter VPC. - // - // * expiration-time - The expiration date and time for the VPC peering connection. - // - // * requester-vpc-info.cidr-block - The IPv4 CIDR block of the requester's - // VPC. - // - // * requester-vpc-info.owner-id - The AWS account ID of the owner of the - // requester VPC. - // - // * requester-vpc-info.vpc-id - The ID of the requester VPC. - // - // * status-code - The status of the VPC peering connection (pending-acceptance - // | failed | expired | provisioning | active | deleting | deleted | rejected). - // - // * status-message - A message that provides more information about the - // status of the VPC peering connection, if applicable. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-peering-connection-id - The ID of the VPC peering connection. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPC peering connection IDs. - // - // Default: Describes all your VPC peering connections. - VpcPeeringConnectionIds []*string `locationName:"VpcPeeringConnectionId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcPeeringConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcPeeringConnectionsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcPeeringConnectionsInput) SetDryRun(v bool) *DescribeVpcPeeringConnectionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcPeeringConnectionsInput) SetFilters(v []*Filter) *DescribeVpcPeeringConnectionsInput { - s.Filters = v - return s -} - -// SetVpcPeeringConnectionIds sets the VpcPeeringConnectionIds field's value. -func (s *DescribeVpcPeeringConnectionsInput) SetVpcPeeringConnectionIds(v []*string) *DescribeVpcPeeringConnectionsInput { - s.VpcPeeringConnectionIds = v - return s -} - -// Contains the output of DescribeVpcPeeringConnections. -type DescribeVpcPeeringConnectionsOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC peering connections. - VpcPeeringConnections []*VpcPeeringConnection `locationName:"vpcPeeringConnectionSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcPeeringConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcPeeringConnectionsOutput) GoString() string { - return s.String() -} - -// SetVpcPeeringConnections sets the VpcPeeringConnections field's value. -func (s *DescribeVpcPeeringConnectionsOutput) SetVpcPeeringConnections(v []*VpcPeeringConnection) *DescribeVpcPeeringConnectionsOutput { - s.VpcPeeringConnections = v - return s -} - -// Contains the parameters for DescribeVpcs. -type DescribeVpcsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * cidr - The primary IPv4 CIDR block of the VPC. The CIDR block you specify - // must exactly match the VPC's CIDR block for information to be returned - // for the VPC. Must contain the slash followed by one or two digits (for - // example, /28). - // - // * cidr-block-association.cidr-block - An IPv4 CIDR block associated with - // the VPC. - // - // * cidr-block-association.association-id - The association ID for an IPv4 - // CIDR block associated with the VPC. - // - // * cidr-block-association.state - The state of an IPv4 CIDR block associated - // with the VPC. - // - // * dhcp-options-id - The ID of a set of DHCP options. - // - // * ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR block associated - // with the VPC. - // - // * ipv6-cidr-block-association.association-id - The association ID for - // an IPv6 CIDR block associated with the VPC. - // - // * ipv6-cidr-block-association.state - The state of an IPv6 CIDR block - // associated with the VPC. - // - // * isDefault - Indicates whether the VPC is the default VPC. - // - // * state - The state of the VPC (pending | available). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPC IDs. - // - // Default: Describes all your VPCs. - VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcsInput) SetDryRun(v bool) *DescribeVpcsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcsInput) SetFilters(v []*Filter) *DescribeVpcsInput { - s.Filters = v - return s -} - -// SetVpcIds sets the VpcIds field's value. -func (s *DescribeVpcsInput) SetVpcIds(v []*string) *DescribeVpcsInput { - s.VpcIds = v - return s -} - -// Contains the output of DescribeVpcs. -type DescribeVpcsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more VPCs. - Vpcs []*Vpc `locationName:"vpcSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcsOutput) GoString() string { - return s.String() -} - -// SetVpcs sets the Vpcs field's value. -func (s *DescribeVpcsOutput) SetVpcs(v []*Vpc) *DescribeVpcsOutput { - s.Vpcs = v - return s -} - -// Contains the parameters for DescribeVpnConnections. -type DescribeVpnConnectionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * customer-gateway-configuration - The configuration information for the - // customer gateway. - // - // * customer-gateway-id - The ID of a customer gateway associated with the - // VPN connection. - // - // * state - The state of the VPN connection (pending | available | deleting - // | deleted). - // - // * option.static-routes-only - Indicates whether the connection has static - // routes only. Used for devices that do not support Border Gateway Protocol - // (BGP). - // - // * route.destination-cidr-block - The destination CIDR block. This corresponds - // to the subnet used in a customer data center. - // - // * bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP - // device. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * type - The type of VPN connection. Currently the only supported type - // is ipsec.1. - // - // * vpn-connection-id - The ID of the VPN connection. - // - // * vpn-gateway-id - The ID of a virtual private gateway associated with - // the VPN connection. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPN connection IDs. - // - // Default: Describes your VPN connections. - VpnConnectionIds []*string `locationName:"VpnConnectionId" locationNameList:"VpnConnectionId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpnConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpnConnectionsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpnConnectionsInput) SetDryRun(v bool) *DescribeVpnConnectionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpnConnectionsInput) SetFilters(v []*Filter) *DescribeVpnConnectionsInput { - s.Filters = v - return s -} - -// SetVpnConnectionIds sets the VpnConnectionIds field's value. -func (s *DescribeVpnConnectionsInput) SetVpnConnectionIds(v []*string) *DescribeVpnConnectionsInput { - s.VpnConnectionIds = v - return s -} - -// Contains the output of DescribeVpnConnections. -type DescribeVpnConnectionsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more VPN connections. - VpnConnections []*VpnConnection `locationName:"vpnConnectionSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpnConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpnConnectionsOutput) GoString() string { - return s.String() -} - -// SetVpnConnections sets the VpnConnections field's value. -func (s *DescribeVpnConnectionsOutput) SetVpnConnections(v []*VpnConnection) *DescribeVpnConnectionsOutput { - s.VpnConnections = v - return s -} - -// Contains the parameters for DescribeVpnGateways. -type DescribeVpnGatewaysInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * amazon-side-asn - The Autonomous System Number (ASN) for the Amazon - // side of the gateway. - // - // * attachment.state - The current state of the attachment between the gateway - // and the VPC (attaching | attached | detaching | detached). - // - // * attachment.vpc-id - The ID of an attached VPC. - // - // * availability-zone - The Availability Zone for the virtual private gateway - // (if applicable). - // - // * state - The state of the virtual private gateway (pending | available - // | deleting | deleted). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * type - The type of virtual private gateway. Currently the only supported - // type is ipsec.1. - // - // * vpn-gateway-id - The ID of the virtual private gateway. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more virtual private gateway IDs. - // - // Default: Describes all your virtual private gateways. - VpnGatewayIds []*string `locationName:"VpnGatewayId" locationNameList:"VpnGatewayId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpnGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpnGatewaysInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpnGatewaysInput) SetDryRun(v bool) *DescribeVpnGatewaysInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpnGatewaysInput) SetFilters(v []*Filter) *DescribeVpnGatewaysInput { - s.Filters = v - return s -} - -// SetVpnGatewayIds sets the VpnGatewayIds field's value. -func (s *DescribeVpnGatewaysInput) SetVpnGatewayIds(v []*string) *DescribeVpnGatewaysInput { - s.VpnGatewayIds = v - return s -} - -// Contains the output of DescribeVpnGateways. -type DescribeVpnGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more virtual private gateways. - VpnGateways []*VpnGateway `locationName:"vpnGatewaySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpnGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpnGatewaysOutput) GoString() string { - return s.String() -} - -// SetVpnGateways sets the VpnGateways field's value. -func (s *DescribeVpnGatewaysOutput) SetVpnGateways(v []*VpnGateway) *DescribeVpnGatewaysOutput { - s.VpnGateways = v - return s -} - -// Contains the parameters for DetachClassicLinkVpc. -type DetachClassicLinkVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance to unlink from the VPC. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The ID of the VPC to which the instance is linked. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachClassicLinkVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachClassicLinkVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachClassicLinkVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachClassicLinkVpcInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachClassicLinkVpcInput) SetDryRun(v bool) *DetachClassicLinkVpcInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DetachClassicLinkVpcInput) SetInstanceId(v string) *DetachClassicLinkVpcInput { - s.InstanceId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DetachClassicLinkVpcInput) SetVpcId(v string) *DetachClassicLinkVpcInput { - s.VpcId = &v - return s -} - -// Contains the output of DetachClassicLinkVpc. -type DetachClassicLinkVpcOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DetachClassicLinkVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachClassicLinkVpcOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DetachClassicLinkVpcOutput) SetReturn(v bool) *DetachClassicLinkVpcOutput { - s.Return = &v - return s -} - -// Contains the parameters for DetachInternetGateway. -type DetachInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the Internet gateway. - // - // InternetGatewayId is a required field - InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachInternetGatewayInput"} - if s.InternetGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("InternetGatewayId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachInternetGatewayInput) SetDryRun(v bool) *DetachInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *DetachInternetGatewayInput) SetInternetGatewayId(v string) *DetachInternetGatewayInput { - s.InternetGatewayId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DetachInternetGatewayInput) SetVpcId(v string) *DetachInternetGatewayInput { - s.VpcId = &v - return s -} - -type DetachInternetGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachInternetGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DetachNetworkInterface. -type DetachNetworkInterfaceInput struct { - _ struct{} `type:"structure"` - - // The ID of the attachment. - // - // AttachmentId is a required field - AttachmentId *string `locationName:"attachmentId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether to force a detachment. - Force *bool `locationName:"force" type:"boolean"` -} - -// String returns the string representation -func (s DetachNetworkInterfaceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachNetworkInterfaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachNetworkInterfaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachNetworkInterfaceInput"} - if s.AttachmentId == nil { - invalidParams.Add(request.NewErrParamRequired("AttachmentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *DetachNetworkInterfaceInput) SetAttachmentId(v string) *DetachNetworkInterfaceInput { - s.AttachmentId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachNetworkInterfaceInput) SetDryRun(v bool) *DetachNetworkInterfaceInput { - s.DryRun = &v - return s -} - -// SetForce sets the Force field's value. -func (s *DetachNetworkInterfaceInput) SetForce(v bool) *DetachNetworkInterfaceInput { - s.Force = &v - return s -} - -type DetachNetworkInterfaceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachNetworkInterfaceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachNetworkInterfaceOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DetachVolume. -type DetachVolumeInput struct { - _ struct{} `type:"structure"` - - // The device name. - Device *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Forces detachment if the previous detachment attempt did not occur cleanly - // (for example, logging into an instance, unmounting the volume, and detaching - // normally). This option can lead to data loss or a corrupted file system. - // Use this option only as a last resort to detach a volume from a failed instance. - // The instance won't have an opportunity to flush file system caches or file - // system metadata. If you use this option, you must perform file system check - // and repair procedures. - Force *bool `type:"boolean"` - - // The ID of the instance. - InstanceId *string `type:"string"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDevice sets the Device field's value. -func (s *DetachVolumeInput) SetDevice(v string) *DetachVolumeInput { - s.Device = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachVolumeInput) SetDryRun(v bool) *DetachVolumeInput { - s.DryRun = &v - return s -} - -// SetForce sets the Force field's value. -func (s *DetachVolumeInput) SetForce(v bool) *DetachVolumeInput { - s.Force = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DetachVolumeInput) SetInstanceId(v string) *DetachVolumeInput { - s.InstanceId = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DetachVolumeInput) SetVolumeId(v string) *DetachVolumeInput { - s.VolumeId = &v - return s -} - -// Contains the parameters for DetachVpnGateway. -type DetachVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` - - // The ID of the virtual private gateway. - // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachVpnGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachVpnGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachVpnGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachVpnGatewayInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - if s.VpnGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachVpnGatewayInput) SetDryRun(v bool) *DetachVpnGatewayInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DetachVpnGatewayInput) SetVpcId(v string) *DetachVpnGatewayInput { - s.VpcId = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *DetachVpnGatewayInput) SetVpnGatewayId(v string) *DetachVpnGatewayInput { - s.VpnGatewayId = &v - return s -} - -type DetachVpnGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachVpnGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachVpnGatewayOutput) GoString() string { - return s.String() -} - -// Describes a DHCP configuration option. -type DhcpConfiguration struct { - _ struct{} `type:"structure"` - - // The name of a DHCP option. - Key *string `locationName:"key" type:"string"` - - // One or more values for the DHCP option. - Values []*AttributeValue `locationName:"valueSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DhcpConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DhcpConfiguration) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *DhcpConfiguration) SetKey(v string) *DhcpConfiguration { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *DhcpConfiguration) SetValues(v []*AttributeValue) *DhcpConfiguration { - s.Values = v - return s -} - -// Describes a set of DHCP options. -type DhcpOptions struct { - _ struct{} `type:"structure"` - - // One or more DHCP options in the set. - DhcpConfigurations []*DhcpConfiguration `locationName:"dhcpConfigurationSet" locationNameList:"item" type:"list"` - - // The ID of the set of DHCP options. - DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` - - // Any tags assigned to the DHCP options set. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DhcpOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DhcpOptions) GoString() string { - return s.String() -} - -// SetDhcpConfigurations sets the DhcpConfigurations field's value. -func (s *DhcpOptions) SetDhcpConfigurations(v []*DhcpConfiguration) *DhcpOptions { - s.DhcpConfigurations = v - return s -} - -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *DhcpOptions) SetDhcpOptionsId(v string) *DhcpOptions { - s.DhcpOptionsId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DhcpOptions) SetTags(v []*Tag) *DhcpOptions { - s.Tags = v - return s -} - -// Contains the parameters for DisableVgwRoutePropagation. -type DisableVgwRoutePropagationInput struct { - _ struct{} `type:"structure"` - - // The ID of the virtual private gateway. - // - // GatewayId is a required field - GatewayId *string `type:"string" required:"true"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableVgwRoutePropagationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVgwRoutePropagationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableVgwRoutePropagationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableVgwRoutePropagationInput"} - if s.GatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("GatewayId")) - } - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGatewayId sets the GatewayId field's value. -func (s *DisableVgwRoutePropagationInput) SetGatewayId(v string) *DisableVgwRoutePropagationInput { - s.GatewayId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *DisableVgwRoutePropagationInput) SetRouteTableId(v string) *DisableVgwRoutePropagationInput { - s.RouteTableId = &v - return s -} - -type DisableVgwRoutePropagationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableVgwRoutePropagationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVgwRoutePropagationOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DisableVpcClassicLinkDnsSupport. -type DisableVpcClassicLinkDnsSupportInput struct { - _ struct{} `type:"structure"` - - // The ID of the VPC. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s DisableVpcClassicLinkDnsSupportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVpcClassicLinkDnsSupportInput) GoString() string { - return s.String() -} - -// SetVpcId sets the VpcId field's value. -func (s *DisableVpcClassicLinkDnsSupportInput) SetVpcId(v string) *DisableVpcClassicLinkDnsSupportInput { - s.VpcId = &v - return s -} - -// Contains the output of DisableVpcClassicLinkDnsSupport. -type DisableVpcClassicLinkDnsSupportOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DisableVpcClassicLinkDnsSupportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVpcClassicLinkDnsSupportOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DisableVpcClassicLinkDnsSupportOutput) SetReturn(v bool) *DisableVpcClassicLinkDnsSupportOutput { - s.Return = &v - return s -} - -// Contains the parameters for DisableVpcClassicLink. -type DisableVpcClassicLinkInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableVpcClassicLinkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVpcClassicLinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableVpcClassicLinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableVpcClassicLinkInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DisableVpcClassicLinkInput) SetDryRun(v bool) *DisableVpcClassicLinkInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DisableVpcClassicLinkInput) SetVpcId(v string) *DisableVpcClassicLinkInput { - s.VpcId = &v - return s -} - -// Contains the output of DisableVpcClassicLink. -type DisableVpcClassicLinkOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DisableVpcClassicLinkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVpcClassicLinkOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DisableVpcClassicLinkOutput) SetReturn(v bool) *DisableVpcClassicLinkOutput { - s.Return = &v - return s -} - -// Contains the parameters for DisassociateAddress. -type DisassociateAddressInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The association ID. Required for EC2-VPC. - AssociationId *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. - PublicIp *string `type:"string"` -} - -// String returns the string representation -func (s DisassociateAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateAddressInput) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateAddressInput) SetAssociationId(v string) *DisassociateAddressInput { - s.AssociationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DisassociateAddressInput) SetDryRun(v bool) *DisassociateAddressInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *DisassociateAddressInput) SetPublicIp(v string) *DisassociateAddressInput { - s.PublicIp = &v - return s -} - -type DisassociateAddressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisassociateAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateAddressOutput) GoString() string { - return s.String() -} - -type DisassociateIamInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The ID of the IAM instance profile association. - // - // AssociationId is a required field - AssociationId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisassociateIamInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateIamInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateIamInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateIamInstanceProfileInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateIamInstanceProfileInput) SetAssociationId(v string) *DisassociateIamInstanceProfileInput { - s.AssociationId = &v - return s -} - -type DisassociateIamInstanceProfileOutput struct { - _ struct{} `type:"structure"` - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` -} - -// String returns the string representation -func (s DisassociateIamInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateIamInstanceProfileOutput) GoString() string { - return s.String() -} - -// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. -func (s *DisassociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *DisassociateIamInstanceProfileOutput { - s.IamInstanceProfileAssociation = v - return s -} - -// Contains the parameters for DisassociateRouteTable. -type DisassociateRouteTableInput struct { - _ struct{} `type:"structure"` - - // The association ID representing the current association between the route - // table and subnet. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DisassociateRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateRouteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateRouteTableInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateRouteTableInput) SetAssociationId(v string) *DisassociateRouteTableInput { - s.AssociationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DisassociateRouteTableInput) SetDryRun(v bool) *DisassociateRouteTableInput { - s.DryRun = &v - return s -} - -type DisassociateRouteTableOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisassociateRouteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateRouteTableOutput) GoString() string { - return s.String() -} - -type DisassociateSubnetCidrBlockInput struct { - _ struct{} `type:"structure"` - - // The association ID for the CIDR block. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisassociateSubnetCidrBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateSubnetCidrBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateSubnetCidrBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateSubnetCidrBlockInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateSubnetCidrBlockInput) SetAssociationId(v string) *DisassociateSubnetCidrBlockInput { - s.AssociationId = &v - return s -} - -type DisassociateSubnetCidrBlockOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *SubnetIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s DisassociateSubnetCidrBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateSubnetCidrBlockOutput) GoString() string { - return s.String() -} - -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *DisassociateSubnetCidrBlockOutput) SetIpv6CidrBlockAssociation(v *SubnetIpv6CidrBlockAssociation) *DisassociateSubnetCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *DisassociateSubnetCidrBlockOutput) SetSubnetId(v string) *DisassociateSubnetCidrBlockOutput { - s.SubnetId = &v - return s -} - -type DisassociateVpcCidrBlockInput struct { - _ struct{} `type:"structure"` - - // The association ID for the CIDR block. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisassociateVpcCidrBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateVpcCidrBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateVpcCidrBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateVpcCidrBlockInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateVpcCidrBlockInput) SetAssociationId(v string) *DisassociateVpcCidrBlockInput { - s.AssociationId = &v - return s -} - -type DisassociateVpcCidrBlockOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPv4 CIDR block association. - CidrBlockAssociation *VpcCidrBlockAssociation `locationName:"cidrBlockAssociation" type:"structure"` - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *VpcIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s DisassociateVpcCidrBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateVpcCidrBlockOutput) GoString() string { - return s.String() -} - -// SetCidrBlockAssociation sets the CidrBlockAssociation field's value. -func (s *DisassociateVpcCidrBlockOutput) SetCidrBlockAssociation(v *VpcCidrBlockAssociation) *DisassociateVpcCidrBlockOutput { - s.CidrBlockAssociation = v - return s -} - -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *DisassociateVpcCidrBlockOutput) SetIpv6CidrBlockAssociation(v *VpcIpv6CidrBlockAssociation) *DisassociateVpcCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DisassociateVpcCidrBlockOutput) SetVpcId(v string) *DisassociateVpcCidrBlockOutput { - s.VpcId = &v - return s -} - -// Describes a disk image. -type DiskImage struct { - _ struct{} `type:"structure"` - - // A description of the disk image. - Description *string `type:"string"` - - // Information about the disk image. - Image *DiskImageDetail `type:"structure"` - - // Information about the volume. - Volume *VolumeDetail `type:"structure"` -} - -// String returns the string representation -func (s DiskImage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiskImage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DiskImage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DiskImage"} - if s.Image != nil { - if err := s.Image.Validate(); err != nil { - invalidParams.AddNested("Image", err.(request.ErrInvalidParams)) - } - } - if s.Volume != nil { - if err := s.Volume.Validate(); err != nil { - invalidParams.AddNested("Volume", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *DiskImage) SetDescription(v string) *DiskImage { - s.Description = &v - return s -} - -// SetImage sets the Image field's value. -func (s *DiskImage) SetImage(v *DiskImageDetail) *DiskImage { - s.Image = v - return s -} - -// SetVolume sets the Volume field's value. -func (s *DiskImage) SetVolume(v *VolumeDetail) *DiskImage { - s.Volume = v - return s -} - -// Describes a disk image. -type DiskImageDescription struct { - _ struct{} `type:"structure"` - - // The checksum computed for the disk image. - Checksum *string `locationName:"checksum" type:"string"` - - // The disk image format. - Format *string `locationName:"format" type:"string" enum:"DiskImageFormat"` - - // A presigned URL for the import manifest stored in Amazon S3. For information - // about creating a presigned URL for an Amazon S3 object, read the "Query String - // Request Authentication Alternative" section of the Authenticating REST Requests - // (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) - // topic in the Amazon Simple Storage Service Developer Guide. - // - // For information about the import manifest referenced by this API action, - // see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). - ImportManifestUrl *string `locationName:"importManifestUrl" type:"string"` - - // The size of the disk image, in GiB. - Size *int64 `locationName:"size" type:"long"` -} - -// String returns the string representation -func (s DiskImageDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiskImageDescription) GoString() string { - return s.String() -} - -// SetChecksum sets the Checksum field's value. -func (s *DiskImageDescription) SetChecksum(v string) *DiskImageDescription { - s.Checksum = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *DiskImageDescription) SetFormat(v string) *DiskImageDescription { - s.Format = &v - return s -} - -// SetImportManifestUrl sets the ImportManifestUrl field's value. -func (s *DiskImageDescription) SetImportManifestUrl(v string) *DiskImageDescription { - s.ImportManifestUrl = &v - return s -} - -// SetSize sets the Size field's value. -func (s *DiskImageDescription) SetSize(v int64) *DiskImageDescription { - s.Size = &v - return s -} - -// Describes a disk image. -type DiskImageDetail struct { - _ struct{} `type:"structure"` - - // The size of the disk image, in GiB. - // - // Bytes is a required field - Bytes *int64 `locationName:"bytes" type:"long" required:"true"` - - // The disk image format. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true" enum:"DiskImageFormat"` - - // A presigned URL for the import manifest stored in Amazon S3 and presented - // here as an Amazon S3 presigned URL. For information about creating a presigned - // URL for an Amazon S3 object, read the "Query String Request Authentication - // Alternative" section of the Authenticating REST Requests (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) - // topic in the Amazon Simple Storage Service Developer Guide. - // - // For information about the import manifest referenced by this API action, - // see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). - // - // ImportManifestUrl is a required field - ImportManifestUrl *string `locationName:"importManifestUrl" type:"string" required:"true"` -} - -// String returns the string representation -func (s DiskImageDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiskImageDetail) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DiskImageDetail) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DiskImageDetail"} - if s.Bytes == nil { - invalidParams.Add(request.NewErrParamRequired("Bytes")) - } - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.ImportManifestUrl == nil { - invalidParams.Add(request.NewErrParamRequired("ImportManifestUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBytes sets the Bytes field's value. -func (s *DiskImageDetail) SetBytes(v int64) *DiskImageDetail { - s.Bytes = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *DiskImageDetail) SetFormat(v string) *DiskImageDetail { - s.Format = &v - return s -} - -// SetImportManifestUrl sets the ImportManifestUrl field's value. -func (s *DiskImageDetail) SetImportManifestUrl(v string) *DiskImageDetail { - s.ImportManifestUrl = &v - return s -} - -// Describes a disk image volume. -type DiskImageVolumeDescription struct { - _ struct{} `type:"structure"` - - // The volume identifier. - Id *string `locationName:"id" type:"string"` - - // The size of the volume, in GiB. - Size *int64 `locationName:"size" type:"long"` -} - -// String returns the string representation -func (s DiskImageVolumeDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiskImageVolumeDescription) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *DiskImageVolumeDescription) SetId(v string) *DiskImageVolumeDescription { - s.Id = &v - return s -} - -// SetSize sets the Size field's value. -func (s *DiskImageVolumeDescription) SetSize(v int64) *DiskImageVolumeDescription { - s.Size = &v - return s -} - -// Describes a DNS entry. -type DnsEntry struct { - _ struct{} `type:"structure"` - - // The DNS name. - DnsName *string `locationName:"dnsName" type:"string"` - - // The ID of the private hosted zone. - HostedZoneId *string `locationName:"hostedZoneId" type:"string"` -} - -// String returns the string representation -func (s DnsEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DnsEntry) GoString() string { - return s.String() -} - -// SetDnsName sets the DnsName field's value. -func (s *DnsEntry) SetDnsName(v string) *DnsEntry { - s.DnsName = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *DnsEntry) SetHostedZoneId(v string) *DnsEntry { - s.HostedZoneId = &v - return s -} - -// Describes a block device for an EBS volume. -type EbsBlockDevice struct { - _ struct{} `type:"structure"` - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // Indicates whether the EBS volume is encrypted. Encrypted volumes can only - // be attached to instances that support Amazon EBS encryption. If you are creating - // a volume from a snapshot, you can't specify an encryption value. This is - // because only blank volumes can be encrypted on creation. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1, this represents the number of IOPS that are provisioned for the - // volume. For gp2, this represents the baseline performance of the volume and - // the rate at which the volume accumulates I/O credits for bursting. For more - // information about General Purpose SSD baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops *int64 `locationName:"iops" type:"integer"` - - // Identifier (key ID, key alias, ID ARN, or alias ARN) for a user-managed CMK - // under which the EBS volume is encrypted. - // - // Note: This parameter is only supported on BlockDeviceMapping objects called - // by RunInstances (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html), - // RequestSpotFleet (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html), - // and RequestSpotInstances (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html). - KmsKeyId *string `type:"string"` - - // The ID of the snapshot. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // The size of the volume, in GiB. - // - // Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned - // IOPS SSD (io1), 500-16384 for Throughput Optimized HDD (st1), 500-16384 for - // Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify - // a snapshot, the volume size must be equal to or larger than the snapshot - // size. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - VolumeSize *int64 `locationName:"volumeSize" type:"integer"` - - // The volume type: gp2, io1, st1, sc1, or standard. - // - // Default: standard - VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s EbsBlockDevice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsBlockDevice) GoString() string { - return s.String() -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *EbsBlockDevice) SetDeleteOnTermination(v bool) *EbsBlockDevice { - s.DeleteOnTermination = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *EbsBlockDevice) SetEncrypted(v bool) *EbsBlockDevice { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *EbsBlockDevice) SetIops(v int64) *EbsBlockDevice { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *EbsBlockDevice) SetKmsKeyId(v string) *EbsBlockDevice { - s.KmsKeyId = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *EbsBlockDevice) SetSnapshotId(v string) *EbsBlockDevice { - s.SnapshotId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *EbsBlockDevice) SetVolumeSize(v int64) *EbsBlockDevice { - s.VolumeSize = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *EbsBlockDevice) SetVolumeType(v string) *EbsBlockDevice { - s.VolumeType = &v - return s -} - -// Describes a parameter used to set up an EBS volume in a block device mapping. -type EbsInstanceBlockDevice struct { - _ struct{} `type:"structure"` - - // The time stamp when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The attachment state. - Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` - - // The ID of the EBS volume. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s EbsInstanceBlockDevice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsInstanceBlockDevice) GoString() string { - return s.String() -} - -// SetAttachTime sets the AttachTime field's value. -func (s *EbsInstanceBlockDevice) SetAttachTime(v time.Time) *EbsInstanceBlockDevice { - s.AttachTime = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *EbsInstanceBlockDevice) SetDeleteOnTermination(v bool) *EbsInstanceBlockDevice { - s.DeleteOnTermination = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EbsInstanceBlockDevice) SetStatus(v string) *EbsInstanceBlockDevice { - s.Status = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *EbsInstanceBlockDevice) SetVolumeId(v string) *EbsInstanceBlockDevice { - s.VolumeId = &v - return s -} - -// Describes information used to set up an EBS volume specified in a block device -// mapping. -type EbsInstanceBlockDeviceSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The ID of the EBS volume. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s EbsInstanceBlockDeviceSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsInstanceBlockDeviceSpecification) GoString() string { - return s.String() -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *EbsInstanceBlockDeviceSpecification) SetDeleteOnTermination(v bool) *EbsInstanceBlockDeviceSpecification { - s.DeleteOnTermination = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *EbsInstanceBlockDeviceSpecification) SetVolumeId(v string) *EbsInstanceBlockDeviceSpecification { - s.VolumeId = &v - return s -} - -// Describes an egress-only Internet gateway. -type EgressOnlyInternetGateway struct { - _ struct{} `type:"structure"` - - // Information about the attachment of the egress-only Internet gateway. - Attachments []*InternetGatewayAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` - - // The ID of the egress-only Internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` -} - -// String returns the string representation -func (s EgressOnlyInternetGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EgressOnlyInternetGateway) GoString() string { - return s.String() -} - -// SetAttachments sets the Attachments field's value. -func (s *EgressOnlyInternetGateway) SetAttachments(v []*InternetGatewayAttachment) *EgressOnlyInternetGateway { - s.Attachments = v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *EgressOnlyInternetGateway) SetEgressOnlyInternetGatewayId(v string) *EgressOnlyInternetGateway { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// Describes the association between an instance and an Elastic GPU. -type ElasticGpuAssociation struct { - _ struct{} `type:"structure"` - - // The ID of the association. - ElasticGpuAssociationId *string `locationName:"elasticGpuAssociationId" type:"string"` - - // The state of the association between the instance and the Elastic GPU. - ElasticGpuAssociationState *string `locationName:"elasticGpuAssociationState" type:"string"` - - // The time the Elastic GPU was associated with the instance. - ElasticGpuAssociationTime *string `locationName:"elasticGpuAssociationTime" type:"string"` - - // The ID of the Elastic GPU. - ElasticGpuId *string `locationName:"elasticGpuId" type:"string"` -} - -// String returns the string representation -func (s ElasticGpuAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticGpuAssociation) GoString() string { - return s.String() -} - -// SetElasticGpuAssociationId sets the ElasticGpuAssociationId field's value. -func (s *ElasticGpuAssociation) SetElasticGpuAssociationId(v string) *ElasticGpuAssociation { - s.ElasticGpuAssociationId = &v - return s -} - -// SetElasticGpuAssociationState sets the ElasticGpuAssociationState field's value. -func (s *ElasticGpuAssociation) SetElasticGpuAssociationState(v string) *ElasticGpuAssociation { - s.ElasticGpuAssociationState = &v - return s -} - -// SetElasticGpuAssociationTime sets the ElasticGpuAssociationTime field's value. -func (s *ElasticGpuAssociation) SetElasticGpuAssociationTime(v string) *ElasticGpuAssociation { - s.ElasticGpuAssociationTime = &v - return s -} - -// SetElasticGpuId sets the ElasticGpuId field's value. -func (s *ElasticGpuAssociation) SetElasticGpuId(v string) *ElasticGpuAssociation { - s.ElasticGpuId = &v - return s -} - -// Describes the status of an Elastic GPU. -type ElasticGpuHealth struct { - _ struct{} `type:"structure"` - - // The health status. - Status *string `locationName:"status" type:"string" enum:"ElasticGpuStatus"` -} - -// String returns the string representation -func (s ElasticGpuHealth) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticGpuHealth) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *ElasticGpuHealth) SetStatus(v string) *ElasticGpuHealth { - s.Status = &v - return s -} - -// A specification for an Elastic GPU. -type ElasticGpuSpecification struct { - _ struct{} `type:"structure"` - - // The type of Elastic GPU. - // - // Type is a required field - Type *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ElasticGpuSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticGpuSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ElasticGpuSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ElasticGpuSpecification"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetType sets the Type field's value. -func (s *ElasticGpuSpecification) SetType(v string) *ElasticGpuSpecification { - s.Type = &v - return s -} - -// Describes an elastic GPU. -type ElasticGpuSpecificationResponse struct { - _ struct{} `type:"structure"` - - // The elastic GPU type. - Type *string `locationName:"type" type:"string"` -} - -// String returns the string representation -func (s ElasticGpuSpecificationResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticGpuSpecificationResponse) GoString() string { - return s.String() -} - -// SetType sets the Type field's value. -func (s *ElasticGpuSpecificationResponse) SetType(v string) *ElasticGpuSpecificationResponse { - s.Type = &v - return s -} - -// Describes an Elastic GPU. -type ElasticGpus struct { - _ struct{} `type:"structure"` - - // The Availability Zone in the which the Elastic GPU resides. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The status of the Elastic GPU. - ElasticGpuHealth *ElasticGpuHealth `locationName:"elasticGpuHealth" type:"structure"` - - // The ID of the Elastic GPU. - ElasticGpuId *string `locationName:"elasticGpuId" type:"string"` - - // The state of the Elastic GPU. - ElasticGpuState *string `locationName:"elasticGpuState" type:"string" enum:"ElasticGpuState"` - - // The type of Elastic GPU. - ElasticGpuType *string `locationName:"elasticGpuType" type:"string"` - - // The ID of the instance to which the Elastic GPU is attached. - InstanceId *string `locationName:"instanceId" type:"string"` -} - -// String returns the string representation -func (s ElasticGpus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ElasticGpus) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ElasticGpus) SetAvailabilityZone(v string) *ElasticGpus { - s.AvailabilityZone = &v - return s -} - -// SetElasticGpuHealth sets the ElasticGpuHealth field's value. -func (s *ElasticGpus) SetElasticGpuHealth(v *ElasticGpuHealth) *ElasticGpus { - s.ElasticGpuHealth = v - return s -} - -// SetElasticGpuId sets the ElasticGpuId field's value. -func (s *ElasticGpus) SetElasticGpuId(v string) *ElasticGpus { - s.ElasticGpuId = &v - return s -} - -// SetElasticGpuState sets the ElasticGpuState field's value. -func (s *ElasticGpus) SetElasticGpuState(v string) *ElasticGpus { - s.ElasticGpuState = &v - return s -} - -// SetElasticGpuType sets the ElasticGpuType field's value. -func (s *ElasticGpus) SetElasticGpuType(v string) *ElasticGpus { - s.ElasticGpuType = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ElasticGpus) SetInstanceId(v string) *ElasticGpus { - s.InstanceId = &v - return s -} - -// Contains the parameters for EnableVgwRoutePropagation. -type EnableVgwRoutePropagationInput struct { - _ struct{} `type:"structure"` - - // The ID of the virtual private gateway. - // - // GatewayId is a required field - GatewayId *string `type:"string" required:"true"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableVgwRoutePropagationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVgwRoutePropagationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableVgwRoutePropagationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableVgwRoutePropagationInput"} - if s.GatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("GatewayId")) - } - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGatewayId sets the GatewayId field's value. -func (s *EnableVgwRoutePropagationInput) SetGatewayId(v string) *EnableVgwRoutePropagationInput { - s.GatewayId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *EnableVgwRoutePropagationInput) SetRouteTableId(v string) *EnableVgwRoutePropagationInput { - s.RouteTableId = &v - return s -} - -type EnableVgwRoutePropagationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableVgwRoutePropagationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVgwRoutePropagationOutput) GoString() string { - return s.String() -} - -// Contains the parameters for EnableVolumeIO. -type EnableVolumeIOInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `locationName:"volumeId" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableVolumeIOInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVolumeIOInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableVolumeIOInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableVolumeIOInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *EnableVolumeIOInput) SetDryRun(v bool) *EnableVolumeIOInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *EnableVolumeIOInput) SetVolumeId(v string) *EnableVolumeIOInput { - s.VolumeId = &v - return s -} - -type EnableVolumeIOOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableVolumeIOOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVolumeIOOutput) GoString() string { - return s.String() -} - -// Contains the parameters for EnableVpcClassicLinkDnsSupport. -type EnableVpcClassicLinkDnsSupportInput struct { - _ struct{} `type:"structure"` - - // The ID of the VPC. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s EnableVpcClassicLinkDnsSupportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVpcClassicLinkDnsSupportInput) GoString() string { - return s.String() -} - -// SetVpcId sets the VpcId field's value. -func (s *EnableVpcClassicLinkDnsSupportInput) SetVpcId(v string) *EnableVpcClassicLinkDnsSupportInput { - s.VpcId = &v - return s -} - -// Contains the output of EnableVpcClassicLinkDnsSupport. -type EnableVpcClassicLinkDnsSupportOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s EnableVpcClassicLinkDnsSupportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVpcClassicLinkDnsSupportOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *EnableVpcClassicLinkDnsSupportOutput) SetReturn(v bool) *EnableVpcClassicLinkDnsSupportOutput { - s.Return = &v - return s -} - -// Contains the parameters for EnableVpcClassicLink. -type EnableVpcClassicLinkInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableVpcClassicLinkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVpcClassicLinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableVpcClassicLinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableVpcClassicLinkInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *EnableVpcClassicLinkInput) SetDryRun(v bool) *EnableVpcClassicLinkInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *EnableVpcClassicLinkInput) SetVpcId(v string) *EnableVpcClassicLinkInput { - s.VpcId = &v - return s -} - -// Contains the output of EnableVpcClassicLink. -type EnableVpcClassicLinkOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s EnableVpcClassicLinkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVpcClassicLinkOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *EnableVpcClassicLinkOutput) SetReturn(v bool) *EnableVpcClassicLinkOutput { - s.Return = &v - return s -} - -// Describes a Spot Fleet event. -type EventInformation struct { - _ struct{} `type:"structure"` - - // The description of the event. - EventDescription *string `locationName:"eventDescription" type:"string"` - - // The event. - // - // The following are the error events: - // - // * iamFleetRoleInvalid - The Spot Fleet did not have the required permissions - // either to launch or terminate an instance. - // - // * launchSpecTemporarilyBlacklisted - The configuration is not valid and - // several attempts to launch instances have failed. For more information, - // see the description of the event. - // - // * spotFleetRequestConfigurationInvalid - The configuration is not valid. - // For more information, see the description of the event. - // - // * spotInstanceCountLimitExceeded - You've reached the limit on the number - // of Spot Instances that you can launch. - // - // The following are the fleetRequestChange events: - // - // * active - The Spot Fleet has been validated and Amazon EC2 is attempting - // to maintain the target number of running Spot Instances. - // - // * cancelled - The Spot Fleet is canceled and has no running Spot Instances. - // The Spot Fleet will be deleted two days after its instances were terminated. - // - // * cancelled_running - The Spot Fleet is canceled and does not launch additional - // Spot Instances. Existing Spot Instances continue to run until they are - // interrupted or terminated. - // - // * cancelled_terminating - The Spot Fleet is canceled and its Spot Instances - // are terminating. - // - // * expired - The Spot Fleet request has expired. A subsequent event indicates - // that the instances were terminated, if the request was created with TerminateInstancesWithExpiration - // set. - // - // * modify_in_progress - A request to modify the Spot Fleet request was - // accepted and is in progress. - // - // * modify_successful - The Spot Fleet request was modified. - // - // * price_update - The price for a launch configuration was adjusted because - // it was too high. This change is permanent. - // - // * submitted - The Spot Fleet request is being evaluated and Amazon EC2 - // is preparing to launch the target number of Spot Instances. - // - // The following are the instanceChange events: - // - // * launched - A request was fulfilled and a new instance was launched. - // - // * terminated - An instance was terminated by the user. - // - // The following are the Information events: - // - // * launchSpecUnusable - The price in a launch specification is not valid - // because it is below the Spot price or the Spot price is above the On-Demand - // price. - // - // * fleetProgressHalted - The price in every launch specification is not - // valid. A launch specification might become valid if the Spot price changes. - EventSubType *string `locationName:"eventSubType" type:"string"` - - // The ID of the instance. This information is available only for instanceChange - // events. - InstanceId *string `locationName:"instanceId" type:"string"` -} - -// String returns the string representation -func (s EventInformation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventInformation) GoString() string { - return s.String() -} - -// SetEventDescription sets the EventDescription field's value. -func (s *EventInformation) SetEventDescription(v string) *EventInformation { - s.EventDescription = &v - return s -} - -// SetEventSubType sets the EventSubType field's value. -func (s *EventInformation) SetEventSubType(v string) *EventInformation { - s.EventSubType = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *EventInformation) SetInstanceId(v string) *EventInformation { - s.InstanceId = &v - return s -} - -// Describes an instance export task. -type ExportTask struct { - _ struct{} `type:"structure"` - - // A description of the resource being exported. - Description *string `locationName:"description" type:"string"` - - // The ID of the export task. - ExportTaskId *string `locationName:"exportTaskId" type:"string"` - - // Information about the export task. - ExportToS3Task *ExportToS3Task `locationName:"exportToS3" type:"structure"` - - // Information about the instance to export. - InstanceExportDetails *InstanceExportDetails `locationName:"instanceExport" type:"structure"` - - // The state of the export task. - State *string `locationName:"state" type:"string" enum:"ExportTaskState"` - - // The status message related to the export task. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s ExportTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportTask) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ExportTask) SetDescription(v string) *ExportTask { - s.Description = &v - return s -} - -// SetExportTaskId sets the ExportTaskId field's value. -func (s *ExportTask) SetExportTaskId(v string) *ExportTask { - s.ExportTaskId = &v - return s -} - -// SetExportToS3Task sets the ExportToS3Task field's value. -func (s *ExportTask) SetExportToS3Task(v *ExportToS3Task) *ExportTask { - s.ExportToS3Task = v - return s -} - -// SetInstanceExportDetails sets the InstanceExportDetails field's value. -func (s *ExportTask) SetInstanceExportDetails(v *InstanceExportDetails) *ExportTask { - s.InstanceExportDetails = v - return s -} - -// SetState sets the State field's value. -func (s *ExportTask) SetState(v string) *ExportTask { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ExportTask) SetStatusMessage(v string) *ExportTask { - s.StatusMessage = &v - return s -} - -// Describes the format and location for an instance export task. -type ExportToS3Task struct { - _ struct{} `type:"structure"` - - // The container format used to combine disk images with metadata (such as OVF). - // If absent, only the disk image is exported. - ContainerFormat *string `locationName:"containerFormat" type:"string" enum:"ContainerFormat"` - - // The format for the exported image. - DiskImageFormat *string `locationName:"diskImageFormat" type:"string" enum:"DiskImageFormat"` - - // The S3 bucket for the destination image. The destination bucket must exist - // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. - S3Bucket *string `locationName:"s3Bucket" type:"string"` - - // The encryption key for your S3 bucket. - S3Key *string `locationName:"s3Key" type:"string"` -} - -// String returns the string representation -func (s ExportToS3Task) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportToS3Task) GoString() string { - return s.String() -} - -// SetContainerFormat sets the ContainerFormat field's value. -func (s *ExportToS3Task) SetContainerFormat(v string) *ExportToS3Task { - s.ContainerFormat = &v - return s -} - -// SetDiskImageFormat sets the DiskImageFormat field's value. -func (s *ExportToS3Task) SetDiskImageFormat(v string) *ExportToS3Task { - s.DiskImageFormat = &v - return s -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *ExportToS3Task) SetS3Bucket(v string) *ExportToS3Task { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *ExportToS3Task) SetS3Key(v string) *ExportToS3Task { - s.S3Key = &v - return s -} - -// Describes an instance export task. -type ExportToS3TaskSpecification struct { - _ struct{} `type:"structure"` - - // The container format used to combine disk images with metadata (such as OVF). - // If absent, only the disk image is exported. - ContainerFormat *string `locationName:"containerFormat" type:"string" enum:"ContainerFormat"` - - // The format for the exported image. - DiskImageFormat *string `locationName:"diskImageFormat" type:"string" enum:"DiskImageFormat"` - - // The S3 bucket for the destination image. The destination bucket must exist - // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. - S3Bucket *string `locationName:"s3Bucket" type:"string"` - - // The image is written to a single object in the S3 bucket at the S3 key s3prefix - // + exportTaskId + '.' + diskImageFormat. - S3Prefix *string `locationName:"s3Prefix" type:"string"` -} - -// String returns the string representation -func (s ExportToS3TaskSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportToS3TaskSpecification) GoString() string { - return s.String() -} - -// SetContainerFormat sets the ContainerFormat field's value. -func (s *ExportToS3TaskSpecification) SetContainerFormat(v string) *ExportToS3TaskSpecification { - s.ContainerFormat = &v - return s -} - -// SetDiskImageFormat sets the DiskImageFormat field's value. -func (s *ExportToS3TaskSpecification) SetDiskImageFormat(v string) *ExportToS3TaskSpecification { - s.DiskImageFormat = &v - return s -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *ExportToS3TaskSpecification) SetS3Bucket(v string) *ExportToS3TaskSpecification { - s.S3Bucket = &v - return s -} - -// SetS3Prefix sets the S3Prefix field's value. -func (s *ExportToS3TaskSpecification) SetS3Prefix(v string) *ExportToS3TaskSpecification { - s.S3Prefix = &v - return s -} - -// A filter name and value pair that is used to return a more specific list -// of results from a describe operation. Filters can be used to match a set -// of resources by specific criteria, such as tags, attributes, or IDs. The -// filters supported by a describe operation are documented with the describe -// operation. For example: -// -// * DescribeAvailabilityZones -// -// * DescribeImages -// -// * DescribeInstances -// -// * DescribeKeyPairs -// -// * DescribeSecurityGroups -// -// * DescribeSnapshots -// -// * DescribeSubnets -// -// * DescribeTags -// -// * DescribeVolumes -// -// * DescribeVpcs -type Filter struct { - _ struct{} `type:"structure"` - - // The name of the filter. Filter names are case-sensitive. - Name *string `type:"string"` - - // One or more filter values. Filter values are case-sensitive. - Values []*string `locationName:"Value" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s Filter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Filter) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Filter) SetName(v string) *Filter { - s.Name = &v - return s -} - -// SetValues sets the Values field's value. -func (s *Filter) SetValues(v []*string) *Filter { - s.Values = v - return s -} - -// Describes an EC2 Fleet. -type FleetData struct { - _ struct{} `type:"structure"` - - // The progress of the EC2 Fleet. If there is an error, the status is error. - // After all requests are placed, the status is pending_fulfillment. If the - // size of the EC2 Fleet is equal to or greater than its target capacity, the - // status is fulfilled. If the size of the EC2 Fleet is decreased, the status - // is pending_termination while instances are terminating. - ActivityStatus *string `locationName:"activityStatus" type:"string" enum:"FleetActivityStatus"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraints: Maximum 64 ASCII characters - ClientToken *string `locationName:"clientToken" type:"string"` - - // The creation date and time of the EC2 Fleet. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether running instances should be terminated if the target capacity - // of the EC2 Fleet is decreased below the current size of the EC2 Fleet. - ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"FleetExcessCapacityTerminationPolicy"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` - - // The state of the EC2 Fleet. - FleetState *string `locationName:"fleetState" type:"string" enum:"FleetStateCode"` - - // The number of units fulfilled by this request compared to the set target - // capacity. - FulfilledCapacity *float64 `locationName:"fulfilledCapacity" type:"double"` - - // The number of units fulfilled by this request compared to the set target - // On-Demand capacity. - FulfilledOnDemandCapacity *float64 `locationName:"fulfilledOnDemandCapacity" type:"double"` - - // The launch template and overrides. - LaunchTemplateConfigs []*FleetLaunchTemplateConfig `locationName:"launchTemplateConfigs" locationNameList:"item" type:"list"` - - // Indicates whether EC2 Fleet should replace unhealthy instances. - ReplaceUnhealthyInstances *bool `locationName:"replaceUnhealthyInstances" type:"boolean"` - - // The configuration of Spot Instances in an EC2 Fleet. - SpotOptions *SpotOptions `locationName:"spotOptions" type:"structure"` - - // The tags for an EC2 Fleet resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The number of units to request. You can choose to set the target capacity - // in terms of instances or a performance characteristic that is important to - // your application workload, such as vCPUs, memory, or I/O. If the request - // type is maintain, you can specify a target capacity of 0 and add capacity - // later. - TargetCapacitySpecification *TargetCapacitySpecification `locationName:"targetCapacitySpecification" type:"structure"` - - // Indicates whether running instances should be terminated when the EC2 Fleet - // expires. - TerminateInstancesWithExpiration *bool `locationName:"terminateInstancesWithExpiration" type:"boolean"` - - // The type of request. Indicates whether the EC2 Fleet only requests the target - // capacity, or also attempts to maintain it. If you request a certain target - // capacity, EC2 Fleet only places the required requests; it does not attempt - // to replenish instances if capacity is diminished, and does not submit requests - // in alternative capacity pools if capacity is unavailable. To maintain a certain - // target capacity, EC2 Fleet places the required requests to meet this target - // capacity. It also automatically replenishes any interrupted Spot Instances. - // Default: maintain. - Type *string `locationName:"type" type:"string" enum:"FleetType"` - - // The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // The default is to start fulfilling the request immediately. - ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` - - // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // At this point, no new instance requests are placed or able to fulfill the - // request. The default end date is 7 days from the current date. - ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s FleetData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FleetData) GoString() string { - return s.String() -} - -// SetActivityStatus sets the ActivityStatus field's value. -func (s *FleetData) SetActivityStatus(v string) *FleetData { - s.ActivityStatus = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *FleetData) SetClientToken(v string) *FleetData { - s.ClientToken = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *FleetData) SetCreateTime(v time.Time) *FleetData { - s.CreateTime = &v - return s -} - -// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. -func (s *FleetData) SetExcessCapacityTerminationPolicy(v string) *FleetData { - s.ExcessCapacityTerminationPolicy = &v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *FleetData) SetFleetId(v string) *FleetData { - s.FleetId = &v - return s -} - -// SetFleetState sets the FleetState field's value. -func (s *FleetData) SetFleetState(v string) *FleetData { - s.FleetState = &v - return s -} - -// SetFulfilledCapacity sets the FulfilledCapacity field's value. -func (s *FleetData) SetFulfilledCapacity(v float64) *FleetData { - s.FulfilledCapacity = &v - return s -} - -// SetFulfilledOnDemandCapacity sets the FulfilledOnDemandCapacity field's value. -func (s *FleetData) SetFulfilledOnDemandCapacity(v float64) *FleetData { - s.FulfilledOnDemandCapacity = &v - return s -} - -// SetLaunchTemplateConfigs sets the LaunchTemplateConfigs field's value. -func (s *FleetData) SetLaunchTemplateConfigs(v []*FleetLaunchTemplateConfig) *FleetData { - s.LaunchTemplateConfigs = v - return s -} - -// SetReplaceUnhealthyInstances sets the ReplaceUnhealthyInstances field's value. -func (s *FleetData) SetReplaceUnhealthyInstances(v bool) *FleetData { - s.ReplaceUnhealthyInstances = &v - return s -} - -// SetSpotOptions sets the SpotOptions field's value. -func (s *FleetData) SetSpotOptions(v *SpotOptions) *FleetData { - s.SpotOptions = v - return s -} - -// SetTags sets the Tags field's value. -func (s *FleetData) SetTags(v []*Tag) *FleetData { - s.Tags = v - return s -} - -// SetTargetCapacitySpecification sets the TargetCapacitySpecification field's value. -func (s *FleetData) SetTargetCapacitySpecification(v *TargetCapacitySpecification) *FleetData { - s.TargetCapacitySpecification = v - return s -} - -// SetTerminateInstancesWithExpiration sets the TerminateInstancesWithExpiration field's value. -func (s *FleetData) SetTerminateInstancesWithExpiration(v bool) *FleetData { - s.TerminateInstancesWithExpiration = &v - return s -} - -// SetType sets the Type field's value. -func (s *FleetData) SetType(v string) *FleetData { - s.Type = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *FleetData) SetValidFrom(v time.Time) *FleetData { - s.ValidFrom = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *FleetData) SetValidUntil(v time.Time) *FleetData { - s.ValidUntil = &v - return s -} - -// Describes a launch template and overrides. -type FleetLaunchTemplateConfig struct { - _ struct{} `type:"structure"` - - // The launch template. - LaunchTemplateSpecification *FleetLaunchTemplateSpecification `locationName:"launchTemplateSpecification" type:"structure"` - - // Any parameters that you specify override the same parameters in the launch - // template. - Overrides []*FleetLaunchTemplateOverrides `locationName:"overrides" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s FleetLaunchTemplateConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FleetLaunchTemplateConfig) GoString() string { - return s.String() -} - -// SetLaunchTemplateSpecification sets the LaunchTemplateSpecification field's value. -func (s *FleetLaunchTemplateConfig) SetLaunchTemplateSpecification(v *FleetLaunchTemplateSpecification) *FleetLaunchTemplateConfig { - s.LaunchTemplateSpecification = v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *FleetLaunchTemplateConfig) SetOverrides(v []*FleetLaunchTemplateOverrides) *FleetLaunchTemplateConfig { - s.Overrides = v - return s -} - -// Describes a launch template and overrides. -type FleetLaunchTemplateConfigRequest struct { - _ struct{} `type:"structure"` - - // The launch template to use. You must specify either the launch template ID - // or launch template name in the request. - LaunchTemplateSpecification *FleetLaunchTemplateSpecificationRequest `type:"structure"` - - // Any parameters that you specify override the same parameters in the launch - // template. - Overrides []*FleetLaunchTemplateOverridesRequest `locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s FleetLaunchTemplateConfigRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FleetLaunchTemplateConfigRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FleetLaunchTemplateConfigRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FleetLaunchTemplateConfigRequest"} - if s.LaunchTemplateSpecification != nil { - if err := s.LaunchTemplateSpecification.Validate(); err != nil { - invalidParams.AddNested("LaunchTemplateSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLaunchTemplateSpecification sets the LaunchTemplateSpecification field's value. -func (s *FleetLaunchTemplateConfigRequest) SetLaunchTemplateSpecification(v *FleetLaunchTemplateSpecificationRequest) *FleetLaunchTemplateConfigRequest { - s.LaunchTemplateSpecification = v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *FleetLaunchTemplateConfigRequest) SetOverrides(v []*FleetLaunchTemplateOverridesRequest) *FleetLaunchTemplateConfigRequest { - s.Overrides = v - return s -} - -// Describes overrides for a launch template. -type FleetLaunchTemplateOverrides struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which to launch the instances. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The maximum price per unit hour that you are willing to pay for a Spot Instance. - MaxPrice *string `locationName:"maxPrice" type:"string"` - - // The ID of the subnet in which to launch the instances. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The number of units provided by the specified instance type. - WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"` -} - -// String returns the string representation -func (s FleetLaunchTemplateOverrides) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FleetLaunchTemplateOverrides) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *FleetLaunchTemplateOverrides) SetAvailabilityZone(v string) *FleetLaunchTemplateOverrides { - s.AvailabilityZone = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *FleetLaunchTemplateOverrides) SetInstanceType(v string) *FleetLaunchTemplateOverrides { - s.InstanceType = &v - return s -} - -// SetMaxPrice sets the MaxPrice field's value. -func (s *FleetLaunchTemplateOverrides) SetMaxPrice(v string) *FleetLaunchTemplateOverrides { - s.MaxPrice = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *FleetLaunchTemplateOverrides) SetSubnetId(v string) *FleetLaunchTemplateOverrides { - s.SubnetId = &v - return s -} - -// SetWeightedCapacity sets the WeightedCapacity field's value. -func (s *FleetLaunchTemplateOverrides) SetWeightedCapacity(v float64) *FleetLaunchTemplateOverrides { - s.WeightedCapacity = &v - return s -} - -// Describes overrides for a launch template. -type FleetLaunchTemplateOverridesRequest struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which to launch the instances. - AvailabilityZone *string `type:"string"` - - // The instance type. - InstanceType *string `type:"string" enum:"InstanceType"` - - // The maximum price per unit hour that you are willing to pay for a Spot Instance. - MaxPrice *string `type:"string"` - - // The ID of the subnet in which to launch the instances. - SubnetId *string `type:"string"` - - // The number of units provided by the specified instance type. - WeightedCapacity *float64 `type:"double"` -} - -// String returns the string representation -func (s FleetLaunchTemplateOverridesRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FleetLaunchTemplateOverridesRequest) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *FleetLaunchTemplateOverridesRequest) SetAvailabilityZone(v string) *FleetLaunchTemplateOverridesRequest { - s.AvailabilityZone = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *FleetLaunchTemplateOverridesRequest) SetInstanceType(v string) *FleetLaunchTemplateOverridesRequest { - s.InstanceType = &v - return s -} - -// SetMaxPrice sets the MaxPrice field's value. -func (s *FleetLaunchTemplateOverridesRequest) SetMaxPrice(v string) *FleetLaunchTemplateOverridesRequest { - s.MaxPrice = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *FleetLaunchTemplateOverridesRequest) SetSubnetId(v string) *FleetLaunchTemplateOverridesRequest { - s.SubnetId = &v - return s -} - -// SetWeightedCapacity sets the WeightedCapacity field's value. -func (s *FleetLaunchTemplateOverridesRequest) SetWeightedCapacity(v float64) *FleetLaunchTemplateOverridesRequest { - s.WeightedCapacity = &v - return s -} - -// Describes a launch template. -type FleetLaunchTemplateSpecification struct { - _ struct{} `type:"structure"` - - // The ID of the launch template. You must specify either a template ID or a - // template name. - LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` - - // The name of the launch template. You must specify either a template name - // or a template ID. - LaunchTemplateName *string `locationName:"launchTemplateName" min:"3" type:"string"` - - // The version number. By default, the default version of the launch template - // is used. - Version *string `locationName:"version" type:"string"` -} - -// String returns the string representation -func (s FleetLaunchTemplateSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FleetLaunchTemplateSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FleetLaunchTemplateSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FleetLaunchTemplateSpecification"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *FleetLaunchTemplateSpecification) SetLaunchTemplateId(v string) *FleetLaunchTemplateSpecification { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *FleetLaunchTemplateSpecification) SetLaunchTemplateName(v string) *FleetLaunchTemplateSpecification { - s.LaunchTemplateName = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *FleetLaunchTemplateSpecification) SetVersion(v string) *FleetLaunchTemplateSpecification { - s.Version = &v - return s -} - -// The launch template to use. You must specify either the launch template ID -// or launch template name in the request. -type FleetLaunchTemplateSpecificationRequest struct { - _ struct{} `type:"structure"` - - // The ID of the launch template. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. - LaunchTemplateName *string `min:"3" type:"string"` - - // The version number of the launch template. - Version *string `type:"string"` -} - -// String returns the string representation -func (s FleetLaunchTemplateSpecificationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FleetLaunchTemplateSpecificationRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FleetLaunchTemplateSpecificationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FleetLaunchTemplateSpecificationRequest"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *FleetLaunchTemplateSpecificationRequest) SetLaunchTemplateId(v string) *FleetLaunchTemplateSpecificationRequest { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *FleetLaunchTemplateSpecificationRequest) SetLaunchTemplateName(v string) *FleetLaunchTemplateSpecificationRequest { - s.LaunchTemplateName = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *FleetLaunchTemplateSpecificationRequest) SetVersion(v string) *FleetLaunchTemplateSpecificationRequest { - s.Version = &v - return s -} - -// Describes a flow log. -type FlowLog struct { - _ struct{} `type:"structure"` - - // The date and time the flow log was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // Information about the error that occurred. Rate limited indicates that CloudWatch - // logs throttling has been applied for one or more network interfaces, or that - // you've reached the limit on the number of CloudWatch Logs log groups that - // you can create. Access error indicates that the IAM role associated with - // the flow log does not have sufficient permissions to publish to CloudWatch - // Logs. Unknown error indicates an internal error. - DeliverLogsErrorMessage *string `locationName:"deliverLogsErrorMessage" type:"string"` - - // The ARN of the IAM role that posts logs to CloudWatch Logs. - DeliverLogsPermissionArn *string `locationName:"deliverLogsPermissionArn" type:"string"` - - // The status of the logs delivery (SUCCESS | FAILED). - DeliverLogsStatus *string `locationName:"deliverLogsStatus" type:"string"` - - // The flow log ID. - FlowLogId *string `locationName:"flowLogId" type:"string"` - - // The status of the flow log (ACTIVE). - FlowLogStatus *string `locationName:"flowLogStatus" type:"string"` - - // The name of the flow log group. - LogGroupName *string `locationName:"logGroupName" type:"string"` - - // The ID of the resource on which the flow log was created. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of traffic captured for the flow log. - TrafficType *string `locationName:"trafficType" type:"string" enum:"TrafficType"` -} - -// String returns the string representation -func (s FlowLog) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FlowLog) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *FlowLog) SetCreationTime(v time.Time) *FlowLog { - s.CreationTime = &v - return s -} - -// SetDeliverLogsErrorMessage sets the DeliverLogsErrorMessage field's value. -func (s *FlowLog) SetDeliverLogsErrorMessage(v string) *FlowLog { - s.DeliverLogsErrorMessage = &v - return s -} - -// SetDeliverLogsPermissionArn sets the DeliverLogsPermissionArn field's value. -func (s *FlowLog) SetDeliverLogsPermissionArn(v string) *FlowLog { - s.DeliverLogsPermissionArn = &v - return s -} - -// SetDeliverLogsStatus sets the DeliverLogsStatus field's value. -func (s *FlowLog) SetDeliverLogsStatus(v string) *FlowLog { - s.DeliverLogsStatus = &v - return s -} - -// SetFlowLogId sets the FlowLogId field's value. -func (s *FlowLog) SetFlowLogId(v string) *FlowLog { - s.FlowLogId = &v - return s -} - -// SetFlowLogStatus sets the FlowLogStatus field's value. -func (s *FlowLog) SetFlowLogStatus(v string) *FlowLog { - s.FlowLogStatus = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *FlowLog) SetLogGroupName(v string) *FlowLog { - s.LogGroupName = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *FlowLog) SetResourceId(v string) *FlowLog { - s.ResourceId = &v - return s -} - -// SetTrafficType sets the TrafficType field's value. -func (s *FlowLog) SetTrafficType(v string) *FlowLog { - s.TrafficType = &v - return s -} - -// Describes an Amazon FPGA image (AFI). -type FpgaImage struct { - _ struct{} `type:"structure"` - - // The date and time the AFI was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // The description of the AFI. - Description *string `locationName:"description" type:"string"` - - // The global FPGA image identifier (AGFI ID). - FpgaImageGlobalId *string `locationName:"fpgaImageGlobalId" type:"string"` - - // The FPGA image identifier (AFI ID). - FpgaImageId *string `locationName:"fpgaImageId" type:"string"` - - // The name of the AFI. - Name *string `locationName:"name" type:"string"` - - // The alias of the AFI owner. Possible values include self, amazon, and aws-marketplace. - OwnerAlias *string `locationName:"ownerAlias" type:"string"` - - // The AWS account ID of the AFI owner. - OwnerId *string `locationName:"ownerId" type:"string"` - - // Information about the PCI bus. - PciId *PciId `locationName:"pciId" type:"structure"` - - // The product codes for the AFI. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // Indicates whether the AFI is public. - Public *bool `locationName:"public" type:"boolean"` - - // The version of the AWS Shell that was used to create the bitstream. - ShellVersion *string `locationName:"shellVersion" type:"string"` - - // Information about the state of the AFI. - State *FpgaImageState `locationName:"state" type:"structure"` - - // Any tags assigned to the AFI. - Tags []*Tag `locationName:"tags" locationNameList:"item" type:"list"` - - // The time of the most recent update to the AFI. - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s FpgaImage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FpgaImage) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *FpgaImage) SetCreateTime(v time.Time) *FpgaImage { - s.CreateTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *FpgaImage) SetDescription(v string) *FpgaImage { - s.Description = &v - return s -} - -// SetFpgaImageGlobalId sets the FpgaImageGlobalId field's value. -func (s *FpgaImage) SetFpgaImageGlobalId(v string) *FpgaImage { - s.FpgaImageGlobalId = &v - return s -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *FpgaImage) SetFpgaImageId(v string) *FpgaImage { - s.FpgaImageId = &v - return s -} - -// SetName sets the Name field's value. -func (s *FpgaImage) SetName(v string) *FpgaImage { - s.Name = &v - return s -} - -// SetOwnerAlias sets the OwnerAlias field's value. -func (s *FpgaImage) SetOwnerAlias(v string) *FpgaImage { - s.OwnerAlias = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *FpgaImage) SetOwnerId(v string) *FpgaImage { - s.OwnerId = &v - return s -} - -// SetPciId sets the PciId field's value. -func (s *FpgaImage) SetPciId(v *PciId) *FpgaImage { - s.PciId = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *FpgaImage) SetProductCodes(v []*ProductCode) *FpgaImage { - s.ProductCodes = v - return s -} - -// SetPublic sets the Public field's value. -func (s *FpgaImage) SetPublic(v bool) *FpgaImage { - s.Public = &v - return s -} - -// SetShellVersion sets the ShellVersion field's value. -func (s *FpgaImage) SetShellVersion(v string) *FpgaImage { - s.ShellVersion = &v - return s -} - -// SetState sets the State field's value. -func (s *FpgaImage) SetState(v *FpgaImageState) *FpgaImage { - s.State = v - return s -} - -// SetTags sets the Tags field's value. -func (s *FpgaImage) SetTags(v []*Tag) *FpgaImage { - s.Tags = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *FpgaImage) SetUpdateTime(v time.Time) *FpgaImage { - s.UpdateTime = &v - return s -} - -// Describes an Amazon FPGA image (AFI) attribute. -type FpgaImageAttribute struct { - _ struct{} `type:"structure"` - - // The description of the AFI. - Description *string `locationName:"description" type:"string"` - - // The ID of the AFI. - FpgaImageId *string `locationName:"fpgaImageId" type:"string"` - - // One or more load permissions. - LoadPermissions []*LoadPermission `locationName:"loadPermissions" locationNameList:"item" type:"list"` - - // The name of the AFI. - Name *string `locationName:"name" type:"string"` - - // One or more product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s FpgaImageAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FpgaImageAttribute) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *FpgaImageAttribute) SetDescription(v string) *FpgaImageAttribute { - s.Description = &v - return s -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *FpgaImageAttribute) SetFpgaImageId(v string) *FpgaImageAttribute { - s.FpgaImageId = &v - return s -} - -// SetLoadPermissions sets the LoadPermissions field's value. -func (s *FpgaImageAttribute) SetLoadPermissions(v []*LoadPermission) *FpgaImageAttribute { - s.LoadPermissions = v - return s -} - -// SetName sets the Name field's value. -func (s *FpgaImageAttribute) SetName(v string) *FpgaImageAttribute { - s.Name = &v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *FpgaImageAttribute) SetProductCodes(v []*ProductCode) *FpgaImageAttribute { - s.ProductCodes = v - return s -} - -// Describes the state of the bitstream generation process for an Amazon FPGA -// image (AFI). -type FpgaImageState struct { - _ struct{} `type:"structure"` - - // The state. The following are the possible values: - // - // * pending - AFI bitstream generation is in progress. - // - // * available - The AFI is available for use. - // - // * failed - AFI bitstream generation failed. - // - // * unavailable - The AFI is no longer available for use. - Code *string `locationName:"code" type:"string" enum:"FpgaImageStateCode"` - - // If the state is failed, this is the error message. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s FpgaImageState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FpgaImageState) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *FpgaImageState) SetCode(v string) *FpgaImageState { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *FpgaImageState) SetMessage(v string) *FpgaImageState { - s.Message = &v - return s -} - -// Contains the parameters for GetConsoleOutput. -type GetConsoleOutputInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // When enabled, retrieves the latest console output for the instance. - // - // Default: disabled (false) - Latest *bool `type:"boolean"` -} - -// String returns the string representation -func (s GetConsoleOutputInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetConsoleOutputInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConsoleOutputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConsoleOutputInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetConsoleOutputInput) SetDryRun(v bool) *GetConsoleOutputInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetConsoleOutputInput) SetInstanceId(v string) *GetConsoleOutputInput { - s.InstanceId = &v - return s -} - -// SetLatest sets the Latest field's value. -func (s *GetConsoleOutputInput) SetLatest(v bool) *GetConsoleOutputInput { - s.Latest = &v - return s -} - -// Contains the output of GetConsoleOutput. -type GetConsoleOutputOutput struct { - _ struct{} `type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The console output, base64-encoded. If you are using a command line tool, - // the tool decodes the output for you. - Output *string `locationName:"output" type:"string"` - - // The time at which the output was last updated. - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s GetConsoleOutputOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetConsoleOutputOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetConsoleOutputOutput) SetInstanceId(v string) *GetConsoleOutputOutput { - s.InstanceId = &v - return s -} - -// SetOutput sets the Output field's value. -func (s *GetConsoleOutputOutput) SetOutput(v string) *GetConsoleOutputOutput { - s.Output = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *GetConsoleOutputOutput) SetTimestamp(v time.Time) *GetConsoleOutputOutput { - s.Timestamp = &v - return s -} - -// Contains the parameters for the request. -type GetConsoleScreenshotInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // When set to true, acts as keystroke input and wakes up an instance that's - // in standby or "sleep" mode. - WakeUp *bool `type:"boolean"` -} - -// String returns the string representation -func (s GetConsoleScreenshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetConsoleScreenshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConsoleScreenshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConsoleScreenshotInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetConsoleScreenshotInput) SetDryRun(v bool) *GetConsoleScreenshotInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetConsoleScreenshotInput) SetInstanceId(v string) *GetConsoleScreenshotInput { - s.InstanceId = &v - return s -} - -// SetWakeUp sets the WakeUp field's value. -func (s *GetConsoleScreenshotInput) SetWakeUp(v bool) *GetConsoleScreenshotInput { - s.WakeUp = &v - return s -} - -// Contains the output of the request. -type GetConsoleScreenshotOutput struct { - _ struct{} `type:"structure"` - - // The data that comprises the image. - ImageData *string `locationName:"imageData" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` -} - -// String returns the string representation -func (s GetConsoleScreenshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetConsoleScreenshotOutput) GoString() string { - return s.String() -} - -// SetImageData sets the ImageData field's value. -func (s *GetConsoleScreenshotOutput) SetImageData(v string) *GetConsoleScreenshotOutput { - s.ImageData = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetConsoleScreenshotOutput) SetInstanceId(v string) *GetConsoleScreenshotOutput { - s.InstanceId = &v - return s -} - -type GetHostReservationPurchasePreviewInput struct { - _ struct{} `type:"structure"` - - // The ID/s of the Dedicated Host/s that the reservation will be associated - // with. - // - // HostIdSet is a required field - HostIdSet []*string `locationNameList:"item" type:"list" required:"true"` - - // The offering ID of the reservation. - // - // OfferingId is a required field - OfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetHostReservationPurchasePreviewInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostReservationPurchasePreviewInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetHostReservationPurchasePreviewInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetHostReservationPurchasePreviewInput"} - if s.HostIdSet == nil { - invalidParams.Add(request.NewErrParamRequired("HostIdSet")) - } - if s.OfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("OfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostIdSet sets the HostIdSet field's value. -func (s *GetHostReservationPurchasePreviewInput) SetHostIdSet(v []*string) *GetHostReservationPurchasePreviewInput { - s.HostIdSet = v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *GetHostReservationPurchasePreviewInput) SetOfferingId(v string) *GetHostReservationPurchasePreviewInput { - s.OfferingId = &v - return s -} - -type GetHostReservationPurchasePreviewOutput struct { - _ struct{} `type:"structure"` - - // The currency in which the totalUpfrontPrice and totalHourlyPrice amounts - // are specified. At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The purchase information of the Dedicated Host Reservation and the Dedicated - // Hosts associated with it. - Purchase []*Purchase `locationName:"purchase" locationNameList:"item" type:"list"` - - // The potential total hourly price of the reservation per hour. - TotalHourlyPrice *string `locationName:"totalHourlyPrice" type:"string"` - - // The potential total upfront price. This is billed immediately. - TotalUpfrontPrice *string `locationName:"totalUpfrontPrice" type:"string"` -} - -// String returns the string representation -func (s GetHostReservationPurchasePreviewOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostReservationPurchasePreviewOutput) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *GetHostReservationPurchasePreviewOutput) SetCurrencyCode(v string) *GetHostReservationPurchasePreviewOutput { - s.CurrencyCode = &v - return s -} - -// SetPurchase sets the Purchase field's value. -func (s *GetHostReservationPurchasePreviewOutput) SetPurchase(v []*Purchase) *GetHostReservationPurchasePreviewOutput { - s.Purchase = v - return s -} - -// SetTotalHourlyPrice sets the TotalHourlyPrice field's value. -func (s *GetHostReservationPurchasePreviewOutput) SetTotalHourlyPrice(v string) *GetHostReservationPurchasePreviewOutput { - s.TotalHourlyPrice = &v - return s -} - -// SetTotalUpfrontPrice sets the TotalUpfrontPrice field's value. -func (s *GetHostReservationPurchasePreviewOutput) SetTotalUpfrontPrice(v string) *GetHostReservationPurchasePreviewOutput { - s.TotalUpfrontPrice = &v - return s -} - -type GetLaunchTemplateDataInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetLaunchTemplateDataInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetLaunchTemplateDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetLaunchTemplateDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetLaunchTemplateDataInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetLaunchTemplateDataInput) SetDryRun(v bool) *GetLaunchTemplateDataInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetLaunchTemplateDataInput) SetInstanceId(v string) *GetLaunchTemplateDataInput { - s.InstanceId = &v - return s -} - -type GetLaunchTemplateDataOutput struct { - _ struct{} `type:"structure"` - - // The instance data. - LaunchTemplateData *ResponseLaunchTemplateData `locationName:"launchTemplateData" type:"structure"` -} - -// String returns the string representation -func (s GetLaunchTemplateDataOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetLaunchTemplateDataOutput) GoString() string { - return s.String() -} - -// SetLaunchTemplateData sets the LaunchTemplateData field's value. -func (s *GetLaunchTemplateDataOutput) SetLaunchTemplateData(v *ResponseLaunchTemplateData) *GetLaunchTemplateDataOutput { - s.LaunchTemplateData = v - return s -} - -// Contains the parameters for GetPasswordData. -type GetPasswordDataInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the Windows instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPasswordDataInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPasswordDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPasswordDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPasswordDataInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetPasswordDataInput) SetDryRun(v bool) *GetPasswordDataInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetPasswordDataInput) SetInstanceId(v string) *GetPasswordDataInput { - s.InstanceId = &v - return s -} - -// Contains the output of GetPasswordData. -type GetPasswordDataOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Windows instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The password of the instance. Returns an empty string if the password is - // not available. - PasswordData *string `locationName:"passwordData" type:"string"` - - // The time the data was last updated. - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s GetPasswordDataOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPasswordDataOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetPasswordDataOutput) SetInstanceId(v string) *GetPasswordDataOutput { - s.InstanceId = &v - return s -} - -// SetPasswordData sets the PasswordData field's value. -func (s *GetPasswordDataOutput) SetPasswordData(v string) *GetPasswordDataOutput { - s.PasswordData = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *GetPasswordDataOutput) SetTimestamp(v time.Time) *GetPasswordDataOutput { - s.Timestamp = &v - return s -} - -// Contains the parameters for GetReservedInstanceExchangeQuote. -type GetReservedInstancesExchangeQuoteInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The IDs of the Convertible Reserved Instances to exchange. - // - // ReservedInstanceIds is a required field - ReservedInstanceIds []*string `locationName:"ReservedInstanceId" locationNameList:"ReservedInstanceId" type:"list" required:"true"` - - // The configuration of the target Convertible Reserved Instance to exchange - // for your current Convertible Reserved Instances. - TargetConfigurations []*TargetConfigurationRequest `locationName:"TargetConfiguration" locationNameList:"TargetConfigurationRequest" type:"list"` -} - -// String returns the string representation -func (s GetReservedInstancesExchangeQuoteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetReservedInstancesExchangeQuoteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReservedInstancesExchangeQuoteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReservedInstancesExchangeQuoteInput"} - if s.ReservedInstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstanceIds")) - } - if s.TargetConfigurations != nil { - for i, v := range s.TargetConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetReservedInstancesExchangeQuoteInput) SetDryRun(v bool) *GetReservedInstancesExchangeQuoteInput { - s.DryRun = &v - return s -} - -// SetReservedInstanceIds sets the ReservedInstanceIds field's value. -func (s *GetReservedInstancesExchangeQuoteInput) SetReservedInstanceIds(v []*string) *GetReservedInstancesExchangeQuoteInput { - s.ReservedInstanceIds = v - return s -} - -// SetTargetConfigurations sets the TargetConfigurations field's value. -func (s *GetReservedInstancesExchangeQuoteInput) SetTargetConfigurations(v []*TargetConfigurationRequest) *GetReservedInstancesExchangeQuoteInput { - s.TargetConfigurations = v - return s -} - -// Contains the output of GetReservedInstancesExchangeQuote. -type GetReservedInstancesExchangeQuoteOutput struct { - _ struct{} `type:"structure"` - - // The currency of the transaction. - CurrencyCode *string `locationName:"currencyCode" type:"string"` - - // If true, the exchange is valid. If false, the exchange cannot be completed. - IsValidExchange *bool `locationName:"isValidExchange" type:"boolean"` - - // The new end date of the reservation term. - OutputReservedInstancesWillExpireAt *time.Time `locationName:"outputReservedInstancesWillExpireAt" type:"timestamp" timestampFormat:"iso8601"` - - // The total true upfront charge for the exchange. - PaymentDue *string `locationName:"paymentDue" type:"string"` - - // The cost associated with the Reserved Instance. - ReservedInstanceValueRollup *ReservationValue `locationName:"reservedInstanceValueRollup" type:"structure"` - - // The configuration of your Convertible Reserved Instances. - ReservedInstanceValueSet []*ReservedInstanceReservationValue `locationName:"reservedInstanceValueSet" locationNameList:"item" type:"list"` - - // The cost associated with the Reserved Instance. - TargetConfigurationValueRollup *ReservationValue `locationName:"targetConfigurationValueRollup" type:"structure"` - - // The values of the target Convertible Reserved Instances. - TargetConfigurationValueSet []*TargetReservationValue `locationName:"targetConfigurationValueSet" locationNameList:"item" type:"list"` - - // Describes the reason why the exchange cannot be completed. - ValidationFailureReason *string `locationName:"validationFailureReason" type:"string"` -} - -// String returns the string representation -func (s GetReservedInstancesExchangeQuoteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetReservedInstancesExchangeQuoteOutput) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetCurrencyCode(v string) *GetReservedInstancesExchangeQuoteOutput { - s.CurrencyCode = &v - return s -} - -// SetIsValidExchange sets the IsValidExchange field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetIsValidExchange(v bool) *GetReservedInstancesExchangeQuoteOutput { - s.IsValidExchange = &v - return s -} - -// SetOutputReservedInstancesWillExpireAt sets the OutputReservedInstancesWillExpireAt field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetOutputReservedInstancesWillExpireAt(v time.Time) *GetReservedInstancesExchangeQuoteOutput { - s.OutputReservedInstancesWillExpireAt = &v - return s -} - -// SetPaymentDue sets the PaymentDue field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetPaymentDue(v string) *GetReservedInstancesExchangeQuoteOutput { - s.PaymentDue = &v - return s -} - -// SetReservedInstanceValueRollup sets the ReservedInstanceValueRollup field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetReservedInstanceValueRollup(v *ReservationValue) *GetReservedInstancesExchangeQuoteOutput { - s.ReservedInstanceValueRollup = v - return s -} - -// SetReservedInstanceValueSet sets the ReservedInstanceValueSet field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetReservedInstanceValueSet(v []*ReservedInstanceReservationValue) *GetReservedInstancesExchangeQuoteOutput { - s.ReservedInstanceValueSet = v - return s -} - -// SetTargetConfigurationValueRollup sets the TargetConfigurationValueRollup field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetTargetConfigurationValueRollup(v *ReservationValue) *GetReservedInstancesExchangeQuoteOutput { - s.TargetConfigurationValueRollup = v - return s -} - -// SetTargetConfigurationValueSet sets the TargetConfigurationValueSet field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetTargetConfigurationValueSet(v []*TargetReservationValue) *GetReservedInstancesExchangeQuoteOutput { - s.TargetConfigurationValueSet = v - return s -} - -// SetValidationFailureReason sets the ValidationFailureReason field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetValidationFailureReason(v string) *GetReservedInstancesExchangeQuoteOutput { - s.ValidationFailureReason = &v - return s -} - -// Describes a security group. -type GroupIdentifier struct { - _ struct{} `type:"structure"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` - - // The name of the security group. - GroupName *string `locationName:"groupName" type:"string"` -} - -// String returns the string representation -func (s GroupIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GroupIdentifier) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *GroupIdentifier) SetGroupId(v string) *GroupIdentifier { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GroupIdentifier) SetGroupName(v string) *GroupIdentifier { - s.GroupName = &v - return s -} - -// Describes an event in the history of the Spot Fleet request. -type HistoryRecord struct { - _ struct{} `type:"structure"` - - // Information about the event. - // - // EventInformation is a required field - EventInformation *EventInformation `locationName:"eventInformation" type:"structure" required:"true"` - - // The event type. - // - // * error - An error with the Spot Fleet request. - // - // * fleetRequestChange - A change in the status or configuration of the - // Spot Fleet request. - // - // * instanceChange - An instance was launched or terminated. - // - // * Information - An informational event. - // - // EventType is a required field - EventType *string `locationName:"eventType" type:"string" required:"true" enum:"EventType"` - - // The date and time of the event, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // - // Timestamp is a required field - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s HistoryRecord) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HistoryRecord) GoString() string { - return s.String() -} - -// SetEventInformation sets the EventInformation field's value. -func (s *HistoryRecord) SetEventInformation(v *EventInformation) *HistoryRecord { - s.EventInformation = v - return s -} - -// SetEventType sets the EventType field's value. -func (s *HistoryRecord) SetEventType(v string) *HistoryRecord { - s.EventType = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *HistoryRecord) SetTimestamp(v time.Time) *HistoryRecord { - s.Timestamp = &v - return s -} - -// Describes an event in the history of the EC2 Fleet. -type HistoryRecordEntry struct { - _ struct{} `type:"structure"` - - // Information about the event. - EventInformation *EventInformation `locationName:"eventInformation" type:"structure"` - - // The event type. - EventType *string `locationName:"eventType" type:"string" enum:"FleetEventType"` - - // The date and time of the event, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s HistoryRecordEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HistoryRecordEntry) GoString() string { - return s.String() -} - -// SetEventInformation sets the EventInformation field's value. -func (s *HistoryRecordEntry) SetEventInformation(v *EventInformation) *HistoryRecordEntry { - s.EventInformation = v - return s -} - -// SetEventType sets the EventType field's value. -func (s *HistoryRecordEntry) SetEventType(v string) *HistoryRecordEntry { - s.EventType = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *HistoryRecordEntry) SetTimestamp(v time.Time) *HistoryRecordEntry { - s.Timestamp = &v - return s -} - -// Describes the properties of the Dedicated Host. -type Host struct { - _ struct{} `type:"structure"` - - // The time that the Dedicated Host was allocated. - AllocationTime *time.Time `locationName:"allocationTime" type:"timestamp" timestampFormat:"iso8601"` - - // Whether auto-placement is on or off. - AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` - - // The Availability Zone of the Dedicated Host. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of new instances that can be launched onto the Dedicated Host. - AvailableCapacity *AvailableCapacity `locationName:"availableCapacity" type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `locationName:"clientToken" type:"string"` - - // The ID of the Dedicated Host. - HostId *string `locationName:"hostId" type:"string"` - - // The hardware specifications of the Dedicated Host. - HostProperties *HostProperties `locationName:"hostProperties" type:"structure"` - - // The reservation ID of the Dedicated Host. This returns a null response if - // the Dedicated Host doesn't have an associated reservation. - HostReservationId *string `locationName:"hostReservationId" type:"string"` - - // The IDs and instance type that are currently running on the Dedicated Host. - Instances []*HostInstance `locationName:"instances" locationNameList:"item" type:"list"` - - // The time that the Dedicated Host was released. - ReleaseTime *time.Time `locationName:"releaseTime" type:"timestamp" timestampFormat:"iso8601"` - - // The Dedicated Host's state. - State *string `locationName:"state" type:"string" enum:"AllocationState"` -} - -// String returns the string representation -func (s Host) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Host) GoString() string { - return s.String() -} - -// SetAllocationTime sets the AllocationTime field's value. -func (s *Host) SetAllocationTime(v time.Time) *Host { - s.AllocationTime = &v - return s -} - -// SetAutoPlacement sets the AutoPlacement field's value. -func (s *Host) SetAutoPlacement(v string) *Host { - s.AutoPlacement = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Host) SetAvailabilityZone(v string) *Host { - s.AvailabilityZone = &v - return s -} - -// SetAvailableCapacity sets the AvailableCapacity field's value. -func (s *Host) SetAvailableCapacity(v *AvailableCapacity) *Host { - s.AvailableCapacity = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *Host) SetClientToken(v string) *Host { - s.ClientToken = &v - return s -} - -// SetHostId sets the HostId field's value. -func (s *Host) SetHostId(v string) *Host { - s.HostId = &v - return s -} - -// SetHostProperties sets the HostProperties field's value. -func (s *Host) SetHostProperties(v *HostProperties) *Host { - s.HostProperties = v - return s -} - -// SetHostReservationId sets the HostReservationId field's value. -func (s *Host) SetHostReservationId(v string) *Host { - s.HostReservationId = &v - return s -} - -// SetInstances sets the Instances field's value. -func (s *Host) SetInstances(v []*HostInstance) *Host { - s.Instances = v - return s -} - -// SetReleaseTime sets the ReleaseTime field's value. -func (s *Host) SetReleaseTime(v time.Time) *Host { - s.ReleaseTime = &v - return s -} - -// SetState sets the State field's value. -func (s *Host) SetState(v string) *Host { - s.State = &v - return s -} - -// Describes an instance running on a Dedicated Host. -type HostInstance struct { - _ struct{} `type:"structure"` - - // the IDs of instances that are running on the Dedicated Host. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The instance type size (for example, m3.medium) of the running instance. - InstanceType *string `locationName:"instanceType" type:"string"` -} - -// String returns the string representation -func (s HostInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostInstance) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *HostInstance) SetInstanceId(v string) *HostInstance { - s.InstanceId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *HostInstance) SetInstanceType(v string) *HostInstance { - s.InstanceType = &v - return s -} - -// Details about the Dedicated Host Reservation offering. -type HostOffering struct { - _ struct{} `type:"structure"` - - // The currency of the offering. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The duration of the offering (in seconds). - Duration *int64 `locationName:"duration" type:"integer"` - - // The hourly price of the offering. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The instance family of the offering. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The ID of the offering. - OfferingId *string `locationName:"offeringId" type:"string"` - - // The available payment option. - PaymentOption *string `locationName:"paymentOption" type:"string" enum:"PaymentOption"` - - // The upfront price of the offering. Does not apply to No Upfront offerings. - UpfrontPrice *string `locationName:"upfrontPrice" type:"string"` -} - -// String returns the string representation -func (s HostOffering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostOffering) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *HostOffering) SetCurrencyCode(v string) *HostOffering { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *HostOffering) SetDuration(v int64) *HostOffering { - s.Duration = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *HostOffering) SetHourlyPrice(v string) *HostOffering { - s.HourlyPrice = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *HostOffering) SetInstanceFamily(v string) *HostOffering { - s.InstanceFamily = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *HostOffering) SetOfferingId(v string) *HostOffering { - s.OfferingId = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *HostOffering) SetPaymentOption(v string) *HostOffering { - s.PaymentOption = &v - return s -} - -// SetUpfrontPrice sets the UpfrontPrice field's value. -func (s *HostOffering) SetUpfrontPrice(v string) *HostOffering { - s.UpfrontPrice = &v - return s -} - -// Describes properties of a Dedicated Host. -type HostProperties struct { - _ struct{} `type:"structure"` - - // The number of cores on the Dedicated Host. - Cores *int64 `locationName:"cores" type:"integer"` - - // The instance type size that the Dedicated Host supports (for example, m3.medium). - InstanceType *string `locationName:"instanceType" type:"string"` - - // The number of sockets on the Dedicated Host. - Sockets *int64 `locationName:"sockets" type:"integer"` - - // The number of vCPUs on the Dedicated Host. - TotalVCpus *int64 `locationName:"totalVCpus" type:"integer"` -} - -// String returns the string representation -func (s HostProperties) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostProperties) GoString() string { - return s.String() -} - -// SetCores sets the Cores field's value. -func (s *HostProperties) SetCores(v int64) *HostProperties { - s.Cores = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *HostProperties) SetInstanceType(v string) *HostProperties { - s.InstanceType = &v - return s -} - -// SetSockets sets the Sockets field's value. -func (s *HostProperties) SetSockets(v int64) *HostProperties { - s.Sockets = &v - return s -} - -// SetTotalVCpus sets the TotalVCpus field's value. -func (s *HostProperties) SetTotalVCpus(v int64) *HostProperties { - s.TotalVCpus = &v - return s -} - -// Details about the Dedicated Host Reservation and associated Dedicated Hosts. -type HostReservation struct { - _ struct{} `type:"structure"` - - // The number of Dedicated Hosts the reservation is associated with. - Count *int64 `locationName:"count" type:"integer"` - - // The currency in which the upfrontPrice and hourlyPrice amounts are specified. - // At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The length of the reservation's term, specified in seconds. Can be 31536000 - // (1 year) | 94608000 (3 years). - Duration *int64 `locationName:"duration" type:"integer"` - - // The date and time that the reservation ends. - End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"iso8601"` - - // The IDs of the Dedicated Hosts associated with the reservation. - HostIdSet []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"` - - // The ID of the reservation that specifies the associated Dedicated Hosts. - HostReservationId *string `locationName:"hostReservationId" type:"string"` - - // The hourly price of the reservation. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The instance family of the Dedicated Host Reservation. The instance family - // on the Dedicated Host must be the same in order for it to benefit from the - // reservation. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The ID of the reservation. This remains the same regardless of which Dedicated - // Hosts are associated with it. - OfferingId *string `locationName:"offeringId" type:"string"` - - // The payment option selected for this reservation. - PaymentOption *string `locationName:"paymentOption" type:"string" enum:"PaymentOption"` - - // The date and time that the reservation started. - Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"` - - // The state of the reservation. - State *string `locationName:"state" type:"string" enum:"ReservationState"` - - // The upfront price of the reservation. - UpfrontPrice *string `locationName:"upfrontPrice" type:"string"` -} - -// String returns the string representation -func (s HostReservation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostReservation) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *HostReservation) SetCount(v int64) *HostReservation { - s.Count = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *HostReservation) SetCurrencyCode(v string) *HostReservation { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *HostReservation) SetDuration(v int64) *HostReservation { - s.Duration = &v - return s -} - -// SetEnd sets the End field's value. -func (s *HostReservation) SetEnd(v time.Time) *HostReservation { - s.End = &v - return s -} - -// SetHostIdSet sets the HostIdSet field's value. -func (s *HostReservation) SetHostIdSet(v []*string) *HostReservation { - s.HostIdSet = v - return s -} - -// SetHostReservationId sets the HostReservationId field's value. -func (s *HostReservation) SetHostReservationId(v string) *HostReservation { - s.HostReservationId = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *HostReservation) SetHourlyPrice(v string) *HostReservation { - s.HourlyPrice = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *HostReservation) SetInstanceFamily(v string) *HostReservation { - s.InstanceFamily = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *HostReservation) SetOfferingId(v string) *HostReservation { - s.OfferingId = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *HostReservation) SetPaymentOption(v string) *HostReservation { - s.PaymentOption = &v - return s -} - -// SetStart sets the Start field's value. -func (s *HostReservation) SetStart(v time.Time) *HostReservation { - s.Start = &v - return s -} - -// SetState sets the State field's value. -func (s *HostReservation) SetState(v string) *HostReservation { - s.State = &v - return s -} - -// SetUpfrontPrice sets the UpfrontPrice field's value. -func (s *HostReservation) SetUpfrontPrice(v string) *HostReservation { - s.UpfrontPrice = &v - return s -} - -// Describes an IAM instance profile. -type IamInstanceProfile struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string `locationName:"arn" type:"string"` - - // The ID of the instance profile. - Id *string `locationName:"id" type:"string"` -} - -// String returns the string representation -func (s IamInstanceProfile) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IamInstanceProfile) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *IamInstanceProfile) SetArn(v string) *IamInstanceProfile { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *IamInstanceProfile) SetId(v string) *IamInstanceProfile { - s.Id = &v - return s -} - -// Describes an association between an IAM instance profile and an instance. -type IamInstanceProfileAssociation struct { - _ struct{} `type:"structure"` - - // The ID of the association. - AssociationId *string `locationName:"associationId" type:"string"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The state of the association. - State *string `locationName:"state" type:"string" enum:"IamInstanceProfileAssociationState"` - - // The time the IAM instance profile was associated with the instance. - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s IamInstanceProfileAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IamInstanceProfileAssociation) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *IamInstanceProfileAssociation) SetAssociationId(v string) *IamInstanceProfileAssociation { - s.AssociationId = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *IamInstanceProfileAssociation) SetIamInstanceProfile(v *IamInstanceProfile) *IamInstanceProfileAssociation { - s.IamInstanceProfile = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *IamInstanceProfileAssociation) SetInstanceId(v string) *IamInstanceProfileAssociation { - s.InstanceId = &v - return s -} - -// SetState sets the State field's value. -func (s *IamInstanceProfileAssociation) SetState(v string) *IamInstanceProfileAssociation { - s.State = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *IamInstanceProfileAssociation) SetTimestamp(v time.Time) *IamInstanceProfileAssociation { - s.Timestamp = &v - return s -} - -// Describes an IAM instance profile. -type IamInstanceProfileSpecification struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string `locationName:"arn" type:"string"` - - // The name of the instance profile. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s IamInstanceProfileSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IamInstanceProfileSpecification) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *IamInstanceProfileSpecification) SetArn(v string) *IamInstanceProfileSpecification { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *IamInstanceProfileSpecification) SetName(v string) *IamInstanceProfileSpecification { - s.Name = &v - return s -} - -// Describes the ICMP type and code. -type IcmpTypeCode struct { - _ struct{} `type:"structure"` - - // The ICMP code. A value of -1 means all codes for the specified ICMP type. - Code *int64 `locationName:"code" type:"integer"` - - // The ICMP type. A value of -1 means all types. - Type *int64 `locationName:"type" type:"integer"` -} - -// String returns the string representation -func (s IcmpTypeCode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IcmpTypeCode) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *IcmpTypeCode) SetCode(v int64) *IcmpTypeCode { - s.Code = &v - return s -} - -// SetType sets the Type field's value. -func (s *IcmpTypeCode) SetType(v int64) *IcmpTypeCode { - s.Type = &v - return s -} - -// Describes the ID format for a resource. -type IdFormat struct { - _ struct{} `type:"structure"` - - // The date in UTC at which you are permanently switched over to using longer - // IDs. If a deadline is not yet available for this resource type, this field - // is not returned. - Deadline *time.Time `locationName:"deadline" type:"timestamp" timestampFormat:"iso8601"` - - // The type of resource. - Resource *string `locationName:"resource" type:"string"` - - // Indicates whether longer IDs (17-character IDs) are enabled for the resource. - UseLongIds *bool `locationName:"useLongIds" type:"boolean"` -} - -// String returns the string representation -func (s IdFormat) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IdFormat) GoString() string { - return s.String() -} - -// SetDeadline sets the Deadline field's value. -func (s *IdFormat) SetDeadline(v time.Time) *IdFormat { - s.Deadline = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *IdFormat) SetResource(v string) *IdFormat { - s.Resource = &v - return s -} - -// SetUseLongIds sets the UseLongIds field's value. -func (s *IdFormat) SetUseLongIds(v bool) *IdFormat { - s.UseLongIds = &v - return s -} - -// Describes an image. -type Image struct { - _ struct{} `type:"structure"` - - // The architecture of the image. - Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - - // Any block device mapping entries. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // The date and time the image was created. - CreationDate *string `locationName:"creationDate" type:"string"` - - // The description of the AMI that was provided during image creation. - Description *string `locationName:"description" type:"string"` - - // Specifies whether enhanced networking with ENA is enabled. - EnaSupport *bool `locationName:"enaSupport" type:"boolean"` - - // The hypervisor type of the image. - Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The location of the AMI. - ImageLocation *string `locationName:"imageLocation" type:"string"` - - // The AWS account alias (for example, amazon, self) or the AWS account ID of - // the AMI owner. - ImageOwnerAlias *string `locationName:"imageOwnerAlias" type:"string"` - - // The type of image. - ImageType *string `locationName:"imageType" type:"string" enum:"ImageTypeValues"` - - // The kernel associated with the image, if any. Only applicable for machine - // images. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the AMI that was provided during image creation. - Name *string `locationName:"name" type:"string"` - - // The AWS account ID of the image owner. - OwnerId *string `locationName:"imageOwnerId" type:"string"` - - // The value is Windows for Windows AMIs; otherwise blank. - Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` - - // Any product codes associated with the AMI. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // Indicates whether the image has public launch permissions. The value is true - // if this image has public launch permissions or false if it has only implicit - // and explicit launch permissions. - Public *bool `locationName:"isPublic" type:"boolean"` - - // The RAM disk associated with the image, if any. Only applicable for machine - // images. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // The device name of the root device volume (for example, /dev/sda1). - RootDeviceName *string `locationName:"rootDeviceName" type:"string"` - - // The type of root device used by the AMI. The AMI can use an EBS volume or - // an instance store volume. - RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` - - // Specifies whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` - - // The current state of the AMI. If the state is available, the image is successfully - // registered and can be used to launch an instance. - State *string `locationName:"imageState" type:"string" enum:"ImageState"` - - // The reason for the state change. - StateReason *StateReason `locationName:"stateReason" type:"structure"` - - // Any tags assigned to the image. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of virtualization of the AMI. - VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"` -} - -// String returns the string representation -func (s Image) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Image) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *Image) SetArchitecture(v string) *Image { - s.Architecture = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *Image) SetBlockDeviceMappings(v []*BlockDeviceMapping) *Image { - s.BlockDeviceMappings = v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *Image) SetCreationDate(v string) *Image { - s.CreationDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Image) SetDescription(v string) *Image { - s.Description = &v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *Image) SetEnaSupport(v bool) *Image { - s.EnaSupport = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *Image) SetHypervisor(v string) *Image { - s.Hypervisor = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *Image) SetImageId(v string) *Image { - s.ImageId = &v - return s -} - -// SetImageLocation sets the ImageLocation field's value. -func (s *Image) SetImageLocation(v string) *Image { - s.ImageLocation = &v - return s -} - -// SetImageOwnerAlias sets the ImageOwnerAlias field's value. -func (s *Image) SetImageOwnerAlias(v string) *Image { - s.ImageOwnerAlias = &v - return s -} - -// SetImageType sets the ImageType field's value. -func (s *Image) SetImageType(v string) *Image { - s.ImageType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *Image) SetKernelId(v string) *Image { - s.KernelId = &v - return s -} - -// SetName sets the Name field's value. -func (s *Image) SetName(v string) *Image { - s.Name = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *Image) SetOwnerId(v string) *Image { - s.OwnerId = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *Image) SetPlatform(v string) *Image { - s.Platform = &v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *Image) SetProductCodes(v []*ProductCode) *Image { - s.ProductCodes = v - return s -} - -// SetPublic sets the Public field's value. -func (s *Image) SetPublic(v bool) *Image { - s.Public = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *Image) SetRamdiskId(v string) *Image { - s.RamdiskId = &v - return s -} - -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *Image) SetRootDeviceName(v string) *Image { - s.RootDeviceName = &v - return s -} - -// SetRootDeviceType sets the RootDeviceType field's value. -func (s *Image) SetRootDeviceType(v string) *Image { - s.RootDeviceType = &v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *Image) SetSriovNetSupport(v string) *Image { - s.SriovNetSupport = &v - return s -} - -// SetState sets the State field's value. -func (s *Image) SetState(v string) *Image { - s.State = &v - return s -} - -// SetStateReason sets the StateReason field's value. -func (s *Image) SetStateReason(v *StateReason) *Image { - s.StateReason = v - return s -} - -// SetTags sets the Tags field's value. -func (s *Image) SetTags(v []*Tag) *Image { - s.Tags = v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *Image) SetVirtualizationType(v string) *Image { - s.VirtualizationType = &v - return s -} - -// Describes the disk container object for an import image task. -type ImageDiskContainer struct { - _ struct{} `type:"structure"` - - // The description of the disk image. - Description *string `type:"string"` - - // The block device mapping for the disk. - DeviceName *string `type:"string"` - - // The format of the disk image being imported. - // - // Valid values: VHD | VMDK | OVA - Format *string `type:"string"` - - // The ID of the EBS snapshot to be used for importing the snapshot. - SnapshotId *string `type:"string"` - - // The URL to the Amazon S3-based disk image being imported. The URL can either - // be a https URL (https://..) or an Amazon S3 URL (s3://..) - Url *string `type:"string"` - - // The S3 bucket for the disk image. - UserBucket *UserBucket `type:"structure"` -} - -// String returns the string representation -func (s ImageDiskContainer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImageDiskContainer) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImageDiskContainer) SetDescription(v string) *ImageDiskContainer { - s.Description = &v - return s -} - -// SetDeviceName sets the DeviceName field's value. -func (s *ImageDiskContainer) SetDeviceName(v string) *ImageDiskContainer { - s.DeviceName = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *ImageDiskContainer) SetFormat(v string) *ImageDiskContainer { - s.Format = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *ImageDiskContainer) SetSnapshotId(v string) *ImageDiskContainer { - s.SnapshotId = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *ImageDiskContainer) SetUrl(v string) *ImageDiskContainer { - s.Url = &v - return s -} - -// SetUserBucket sets the UserBucket field's value. -func (s *ImageDiskContainer) SetUserBucket(v *UserBucket) *ImageDiskContainer { - s.UserBucket = v - return s -} - -// Contains the parameters for ImportImage. -type ImportImageInput struct { - _ struct{} `type:"structure"` - - // The architecture of the virtual machine. - // - // Valid values: i386 | x86_64 - Architecture *string `type:"string"` - - // The client-specific data. - ClientData *ClientData `type:"structure"` - - // The token to enable idempotency for VM import requests. - ClientToken *string `type:"string"` - - // A description string for the import image task. - Description *string `type:"string"` - - // Information about the disk containers. - DiskContainers []*ImageDiskContainer `locationName:"DiskContainer" locationNameList:"item" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The target hypervisor platform. - // - // Valid values: xen - Hypervisor *string `type:"string"` - - // The license type to be used for the Amazon Machine Image (AMI) after importing. - // - // Note: You may only use BYOL if you have existing licenses with rights to - // use these licenses in a third party cloud like AWS. For more information, - // see Prerequisites (http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#prerequisites-image) - // in the VM Import/Export User Guide. - // - // Valid values: AWS | BYOL - LicenseType *string `type:"string"` - - // The operating system of the virtual machine. - // - // Valid values: Windows | Linux - Platform *string `type:"string"` - - // The name of the role to use when not using the default role, 'vmimport'. - RoleName *string `type:"string"` -} - -// String returns the string representation -func (s ImportImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportImageInput) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportImageInput) SetArchitecture(v string) *ImportImageInput { - s.Architecture = &v - return s -} - -// SetClientData sets the ClientData field's value. -func (s *ImportImageInput) SetClientData(v *ClientData) *ImportImageInput { - s.ClientData = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *ImportImageInput) SetClientToken(v string) *ImportImageInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportImageInput) SetDescription(v string) *ImportImageInput { - s.Description = &v - return s -} - -// SetDiskContainers sets the DiskContainers field's value. -func (s *ImportImageInput) SetDiskContainers(v []*ImageDiskContainer) *ImportImageInput { - s.DiskContainers = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportImageInput) SetDryRun(v bool) *ImportImageInput { - s.DryRun = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *ImportImageInput) SetHypervisor(v string) *ImportImageInput { - s.Hypervisor = &v - return s -} - -// SetLicenseType sets the LicenseType field's value. -func (s *ImportImageInput) SetLicenseType(v string) *ImportImageInput { - s.LicenseType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportImageInput) SetPlatform(v string) *ImportImageInput { - s.Platform = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *ImportImageInput) SetRoleName(v string) *ImportImageInput { - s.RoleName = &v - return s -} - -// Contains the output for ImportImage. -type ImportImageOutput struct { - _ struct{} `type:"structure"` - - // The architecture of the virtual machine. - Architecture *string `locationName:"architecture" type:"string"` - - // A description of the import task. - Description *string `locationName:"description" type:"string"` - - // The target hypervisor of the import task. - Hypervisor *string `locationName:"hypervisor" type:"string"` - - // The ID of the Amazon Machine Image (AMI) created by the import task. - ImageId *string `locationName:"imageId" type:"string"` - - // The task ID of the import image task. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // The license type of the virtual machine. - LicenseType *string `locationName:"licenseType" type:"string"` - - // The operating system of the virtual machine. - Platform *string `locationName:"platform" type:"string"` - - // The progress of the task. - Progress *string `locationName:"progress" type:"string"` - - // Information about the snapshots. - SnapshotDetails []*SnapshotDetail `locationName:"snapshotDetailSet" locationNameList:"item" type:"list"` - - // A brief status of the task. - Status *string `locationName:"status" type:"string"` - - // A detailed status message of the import task. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s ImportImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportImageOutput) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportImageOutput) SetArchitecture(v string) *ImportImageOutput { - s.Architecture = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportImageOutput) SetDescription(v string) *ImportImageOutput { - s.Description = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *ImportImageOutput) SetHypervisor(v string) *ImportImageOutput { - s.Hypervisor = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ImportImageOutput) SetImageId(v string) *ImportImageOutput { - s.ImageId = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *ImportImageOutput) SetImportTaskId(v string) *ImportImageOutput { - s.ImportTaskId = &v - return s -} - -// SetLicenseType sets the LicenseType field's value. -func (s *ImportImageOutput) SetLicenseType(v string) *ImportImageOutput { - s.LicenseType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportImageOutput) SetPlatform(v string) *ImportImageOutput { - s.Platform = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *ImportImageOutput) SetProgress(v string) *ImportImageOutput { - s.Progress = &v - return s -} - -// SetSnapshotDetails sets the SnapshotDetails field's value. -func (s *ImportImageOutput) SetSnapshotDetails(v []*SnapshotDetail) *ImportImageOutput { - s.SnapshotDetails = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportImageOutput) SetStatus(v string) *ImportImageOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ImportImageOutput) SetStatusMessage(v string) *ImportImageOutput { - s.StatusMessage = &v - return s -} - -// Describes an import image task. -type ImportImageTask struct { - _ struct{} `type:"structure"` - - // The architecture of the virtual machine. - // - // Valid values: i386 | x86_64 - Architecture *string `locationName:"architecture" type:"string"` - - // A description of the import task. - Description *string `locationName:"description" type:"string"` - - // The target hypervisor for the import task. - // - // Valid values: xen - Hypervisor *string `locationName:"hypervisor" type:"string"` - - // The ID of the Amazon Machine Image (AMI) of the imported virtual machine. - ImageId *string `locationName:"imageId" type:"string"` - - // The ID of the import image task. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // The license type of the virtual machine. - LicenseType *string `locationName:"licenseType" type:"string"` - - // The description string for the import image task. - Platform *string `locationName:"platform" type:"string"` - - // The percentage of progress of the import image task. - Progress *string `locationName:"progress" type:"string"` - - // Information about the snapshots. - SnapshotDetails []*SnapshotDetail `locationName:"snapshotDetailSet" locationNameList:"item" type:"list"` - - // A brief status for the import image task. - Status *string `locationName:"status" type:"string"` - - // A descriptive status message for the import image task. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s ImportImageTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportImageTask) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportImageTask) SetArchitecture(v string) *ImportImageTask { - s.Architecture = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportImageTask) SetDescription(v string) *ImportImageTask { - s.Description = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *ImportImageTask) SetHypervisor(v string) *ImportImageTask { - s.Hypervisor = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ImportImageTask) SetImageId(v string) *ImportImageTask { - s.ImageId = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *ImportImageTask) SetImportTaskId(v string) *ImportImageTask { - s.ImportTaskId = &v - return s -} - -// SetLicenseType sets the LicenseType field's value. -func (s *ImportImageTask) SetLicenseType(v string) *ImportImageTask { - s.LicenseType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportImageTask) SetPlatform(v string) *ImportImageTask { - s.Platform = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *ImportImageTask) SetProgress(v string) *ImportImageTask { - s.Progress = &v - return s -} - -// SetSnapshotDetails sets the SnapshotDetails field's value. -func (s *ImportImageTask) SetSnapshotDetails(v []*SnapshotDetail) *ImportImageTask { - s.SnapshotDetails = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportImageTask) SetStatus(v string) *ImportImageTask { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ImportImageTask) SetStatusMessage(v string) *ImportImageTask { - s.StatusMessage = &v - return s -} - -// Contains the parameters for ImportInstance. -type ImportInstanceInput struct { - _ struct{} `type:"structure"` - - // A description for the instance being imported. - Description *string `locationName:"description" type:"string"` - - // The disk image. - DiskImages []*DiskImage `locationName:"diskImage" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The launch specification. - LaunchSpecification *ImportInstanceLaunchSpecification `locationName:"launchSpecification" type:"structure"` - - // The instance operating system. - // - // Platform is a required field - Platform *string `locationName:"platform" type:"string" required:"true" enum:"PlatformValues"` -} - -// String returns the string representation -func (s ImportInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportInstanceInput"} - if s.Platform == nil { - invalidParams.Add(request.NewErrParamRequired("Platform")) - } - if s.DiskImages != nil { - for i, v := range s.DiskImages { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DiskImages", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *ImportInstanceInput) SetDescription(v string) *ImportInstanceInput { - s.Description = &v - return s -} - -// SetDiskImages sets the DiskImages field's value. -func (s *ImportInstanceInput) SetDiskImages(v []*DiskImage) *ImportInstanceInput { - s.DiskImages = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportInstanceInput) SetDryRun(v bool) *ImportInstanceInput { - s.DryRun = &v - return s -} - -// SetLaunchSpecification sets the LaunchSpecification field's value. -func (s *ImportInstanceInput) SetLaunchSpecification(v *ImportInstanceLaunchSpecification) *ImportInstanceInput { - s.LaunchSpecification = v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportInstanceInput) SetPlatform(v string) *ImportInstanceInput { - s.Platform = &v - return s -} - -// Describes the launch specification for VM import. -type ImportInstanceLaunchSpecification struct { - _ struct{} `type:"structure"` - - // Reserved. - AdditionalInfo *string `locationName:"additionalInfo" type:"string"` - - // The architecture of the instance. - Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - - // One or more security group IDs. - GroupIds []*string `locationName:"GroupId" locationNameList:"SecurityGroupId" type:"list"` - - // One or more security group names. - GroupNames []*string `locationName:"GroupName" locationNameList:"SecurityGroup" type:"list"` - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"` - - // The instance type. For more information about the instance types that you - // can import, see Instance Types (http://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-instance-types) - // in the VM Import/Export User Guide. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // Indicates whether monitoring is enabled. - Monitoring *bool `locationName:"monitoring" type:"boolean"` - - // The placement information for the instance. - Placement *Placement `locationName:"placement" type:"structure"` - - // [EC2-VPC] An available IP address from the IP address range of the subnet. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // [EC2-VPC] The ID of the subnet in which to launch the instance. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The Base64-encoded user data to make available to the instance. - UserData *UserData `locationName:"userData" type:"structure"` -} - -// String returns the string representation -func (s ImportInstanceLaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceLaunchSpecification) GoString() string { - return s.String() -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *ImportInstanceLaunchSpecification) SetAdditionalInfo(v string) *ImportInstanceLaunchSpecification { - s.AdditionalInfo = &v - return s -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportInstanceLaunchSpecification) SetArchitecture(v string) *ImportInstanceLaunchSpecification { - s.Architecture = &v - return s -} - -// SetGroupIds sets the GroupIds field's value. -func (s *ImportInstanceLaunchSpecification) SetGroupIds(v []*string) *ImportInstanceLaunchSpecification { - s.GroupIds = v - return s -} - -// SetGroupNames sets the GroupNames field's value. -func (s *ImportInstanceLaunchSpecification) SetGroupNames(v []*string) *ImportInstanceLaunchSpecification { - s.GroupNames = v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *ImportInstanceLaunchSpecification) SetInstanceInitiatedShutdownBehavior(v string) *ImportInstanceLaunchSpecification { - s.InstanceInitiatedShutdownBehavior = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ImportInstanceLaunchSpecification) SetInstanceType(v string) *ImportInstanceLaunchSpecification { - s.InstanceType = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *ImportInstanceLaunchSpecification) SetMonitoring(v bool) *ImportInstanceLaunchSpecification { - s.Monitoring = &v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *ImportInstanceLaunchSpecification) SetPlacement(v *Placement) *ImportInstanceLaunchSpecification { - s.Placement = v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *ImportInstanceLaunchSpecification) SetPrivateIpAddress(v string) *ImportInstanceLaunchSpecification { - s.PrivateIpAddress = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *ImportInstanceLaunchSpecification) SetSubnetId(v string) *ImportInstanceLaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ImportInstanceLaunchSpecification) SetUserData(v *UserData) *ImportInstanceLaunchSpecification { - s.UserData = v - return s -} - -// Contains the output for ImportInstance. -type ImportInstanceOutput struct { - _ struct{} `type:"structure"` - - // Information about the conversion task. - ConversionTask *ConversionTask `locationName:"conversionTask" type:"structure"` -} - -// String returns the string representation -func (s ImportInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceOutput) GoString() string { - return s.String() -} - -// SetConversionTask sets the ConversionTask field's value. -func (s *ImportInstanceOutput) SetConversionTask(v *ConversionTask) *ImportInstanceOutput { - s.ConversionTask = v - return s -} - -// Describes an import instance task. -type ImportInstanceTaskDetails struct { - _ struct{} `type:"structure"` - - // A description of the task. - Description *string `locationName:"description" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The instance operating system. - Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` - - // One or more volumes. - Volumes []*ImportInstanceVolumeDetailItem `locationName:"volumes" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ImportInstanceTaskDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceTaskDetails) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportInstanceTaskDetails) SetDescription(v string) *ImportInstanceTaskDetails { - s.Description = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ImportInstanceTaskDetails) SetInstanceId(v string) *ImportInstanceTaskDetails { - s.InstanceId = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportInstanceTaskDetails) SetPlatform(v string) *ImportInstanceTaskDetails { - s.Platform = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *ImportInstanceTaskDetails) SetVolumes(v []*ImportInstanceVolumeDetailItem) *ImportInstanceTaskDetails { - s.Volumes = v - return s -} - -// Describes an import volume task. -type ImportInstanceVolumeDetailItem struct { - _ struct{} `type:"structure"` - - // The Availability Zone where the resulting instance will reside. - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // The number of bytes converted so far. - // - // BytesConverted is a required field - BytesConverted *int64 `locationName:"bytesConverted" type:"long" required:"true"` - - // A description of the task. - Description *string `locationName:"description" type:"string"` - - // The image. - // - // Image is a required field - Image *DiskImageDescription `locationName:"image" type:"structure" required:"true"` - - // The status of the import of this particular disk image. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true"` - - // The status information or errors related to the disk image. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The volume. - // - // Volume is a required field - Volume *DiskImageVolumeDescription `locationName:"volume" type:"structure" required:"true"` -} - -// String returns the string representation -func (s ImportInstanceVolumeDetailItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceVolumeDetailItem) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ImportInstanceVolumeDetailItem) SetAvailabilityZone(v string) *ImportInstanceVolumeDetailItem { - s.AvailabilityZone = &v - return s -} - -// SetBytesConverted sets the BytesConverted field's value. -func (s *ImportInstanceVolumeDetailItem) SetBytesConverted(v int64) *ImportInstanceVolumeDetailItem { - s.BytesConverted = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportInstanceVolumeDetailItem) SetDescription(v string) *ImportInstanceVolumeDetailItem { - s.Description = &v - return s -} - -// SetImage sets the Image field's value. -func (s *ImportInstanceVolumeDetailItem) SetImage(v *DiskImageDescription) *ImportInstanceVolumeDetailItem { - s.Image = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportInstanceVolumeDetailItem) SetStatus(v string) *ImportInstanceVolumeDetailItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ImportInstanceVolumeDetailItem) SetStatusMessage(v string) *ImportInstanceVolumeDetailItem { - s.StatusMessage = &v - return s -} - -// SetVolume sets the Volume field's value. -func (s *ImportInstanceVolumeDetailItem) SetVolume(v *DiskImageVolumeDescription) *ImportInstanceVolumeDetailItem { - s.Volume = v - return s -} - -// Contains the parameters for ImportKeyPair. -type ImportKeyPairInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // A unique name for the key pair. - // - // KeyName is a required field - KeyName *string `locationName:"keyName" type:"string" required:"true"` - - // The public key. For API calls, the text must be base64-encoded. For command - // line tools, base64 encoding is performed for you. - // - // PublicKeyMaterial is automatically base64 encoded/decoded by the SDK. - // - // PublicKeyMaterial is a required field - PublicKeyMaterial []byte `locationName:"publicKeyMaterial" type:"blob" required:"true"` -} - -// String returns the string representation -func (s ImportKeyPairInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportKeyPairInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportKeyPairInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportKeyPairInput"} - if s.KeyName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyName")) - } - if s.PublicKeyMaterial == nil { - invalidParams.Add(request.NewErrParamRequired("PublicKeyMaterial")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportKeyPairInput) SetDryRun(v bool) *ImportKeyPairInput { - s.DryRun = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *ImportKeyPairInput) SetKeyName(v string) *ImportKeyPairInput { - s.KeyName = &v - return s -} - -// SetPublicKeyMaterial sets the PublicKeyMaterial field's value. -func (s *ImportKeyPairInput) SetPublicKeyMaterial(v []byte) *ImportKeyPairInput { - s.PublicKeyMaterial = v - return s -} - -// Contains the output of ImportKeyPair. -type ImportKeyPairOutput struct { - _ struct{} `type:"structure"` - - // The MD5 public key fingerprint as specified in section 4 of RFC 4716. - KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` - - // The key pair name you provided. - KeyName *string `locationName:"keyName" type:"string"` -} - -// String returns the string representation -func (s ImportKeyPairOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportKeyPairOutput) GoString() string { - return s.String() -} - -// SetKeyFingerprint sets the KeyFingerprint field's value. -func (s *ImportKeyPairOutput) SetKeyFingerprint(v string) *ImportKeyPairOutput { - s.KeyFingerprint = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *ImportKeyPairOutput) SetKeyName(v string) *ImportKeyPairOutput { - s.KeyName = &v - return s -} - -// Contains the parameters for ImportSnapshot. -type ImportSnapshotInput struct { - _ struct{} `type:"structure"` - - // The client-specific data. - ClientData *ClientData `type:"structure"` - - // Token to enable idempotency for VM import requests. - ClientToken *string `type:"string"` - - // The description string for the import snapshot task. - Description *string `type:"string"` - - // Information about the disk container. - DiskContainer *SnapshotDiskContainer `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The name of the role to use when not using the default role, 'vmimport'. - RoleName *string `type:"string"` -} - -// String returns the string representation -func (s ImportSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportSnapshotInput) GoString() string { - return s.String() -} - -// SetClientData sets the ClientData field's value. -func (s *ImportSnapshotInput) SetClientData(v *ClientData) *ImportSnapshotInput { - s.ClientData = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *ImportSnapshotInput) SetClientToken(v string) *ImportSnapshotInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportSnapshotInput) SetDescription(v string) *ImportSnapshotInput { - s.Description = &v - return s -} - -// SetDiskContainer sets the DiskContainer field's value. -func (s *ImportSnapshotInput) SetDiskContainer(v *SnapshotDiskContainer) *ImportSnapshotInput { - s.DiskContainer = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportSnapshotInput) SetDryRun(v bool) *ImportSnapshotInput { - s.DryRun = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *ImportSnapshotInput) SetRoleName(v string) *ImportSnapshotInput { - s.RoleName = &v - return s -} - -// Contains the output for ImportSnapshot. -type ImportSnapshotOutput struct { - _ struct{} `type:"structure"` - - // A description of the import snapshot task. - Description *string `locationName:"description" type:"string"` - - // The ID of the import snapshot task. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // Information about the import snapshot task. - SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` -} - -// String returns the string representation -func (s ImportSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportSnapshotOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportSnapshotOutput) SetDescription(v string) *ImportSnapshotOutput { - s.Description = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *ImportSnapshotOutput) SetImportTaskId(v string) *ImportSnapshotOutput { - s.ImportTaskId = &v - return s -} - -// SetSnapshotTaskDetail sets the SnapshotTaskDetail field's value. -func (s *ImportSnapshotOutput) SetSnapshotTaskDetail(v *SnapshotTaskDetail) *ImportSnapshotOutput { - s.SnapshotTaskDetail = v - return s -} - -// Describes an import snapshot task. -type ImportSnapshotTask struct { - _ struct{} `type:"structure"` - - // A description of the import snapshot task. - Description *string `locationName:"description" type:"string"` - - // The ID of the import snapshot task. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // Describes an import snapshot task. - SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` -} - -// String returns the string representation -func (s ImportSnapshotTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportSnapshotTask) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportSnapshotTask) SetDescription(v string) *ImportSnapshotTask { - s.Description = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *ImportSnapshotTask) SetImportTaskId(v string) *ImportSnapshotTask { - s.ImportTaskId = &v - return s -} - -// SetSnapshotTaskDetail sets the SnapshotTaskDetail field's value. -func (s *ImportSnapshotTask) SetSnapshotTaskDetail(v *SnapshotTaskDetail) *ImportSnapshotTask { - s.SnapshotTaskDetail = v - return s -} - -// Contains the parameters for ImportVolume. -type ImportVolumeInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone for the resulting EBS volume. - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // A description of the volume. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The disk image. - // - // Image is a required field - Image *DiskImageDetail `locationName:"image" type:"structure" required:"true"` - - // The volume size. - // - // Volume is a required field - Volume *VolumeDetail `locationName:"volume" type:"structure" required:"true"` -} - -// String returns the string representation -func (s ImportVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportVolumeInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - if s.Image == nil { - invalidParams.Add(request.NewErrParamRequired("Image")) - } - if s.Volume == nil { - invalidParams.Add(request.NewErrParamRequired("Volume")) - } - if s.Image != nil { - if err := s.Image.Validate(); err != nil { - invalidParams.AddNested("Image", err.(request.ErrInvalidParams)) - } - } - if s.Volume != nil { - if err := s.Volume.Validate(); err != nil { - invalidParams.AddNested("Volume", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ImportVolumeInput) SetAvailabilityZone(v string) *ImportVolumeInput { - s.AvailabilityZone = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportVolumeInput) SetDescription(v string) *ImportVolumeInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportVolumeInput) SetDryRun(v bool) *ImportVolumeInput { - s.DryRun = &v - return s -} - -// SetImage sets the Image field's value. -func (s *ImportVolumeInput) SetImage(v *DiskImageDetail) *ImportVolumeInput { - s.Image = v - return s -} - -// SetVolume sets the Volume field's value. -func (s *ImportVolumeInput) SetVolume(v *VolumeDetail) *ImportVolumeInput { - s.Volume = v - return s -} - -// Contains the output for ImportVolume. -type ImportVolumeOutput struct { - _ struct{} `type:"structure"` - - // Information about the conversion task. - ConversionTask *ConversionTask `locationName:"conversionTask" type:"structure"` -} - -// String returns the string representation -func (s ImportVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportVolumeOutput) GoString() string { - return s.String() -} - -// SetConversionTask sets the ConversionTask field's value. -func (s *ImportVolumeOutput) SetConversionTask(v *ConversionTask) *ImportVolumeOutput { - s.ConversionTask = v - return s -} - -// Describes an import volume task. -type ImportVolumeTaskDetails struct { - _ struct{} `type:"structure"` - - // The Availability Zone where the resulting volume will reside. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of bytes converted so far. - BytesConverted *int64 `locationName:"bytesConverted" type:"long"` - - // The description you provided when starting the import volume task. - Description *string `locationName:"description" type:"string"` - - // The image. - Image *DiskImageDescription `locationName:"image" type:"structure"` - - // The volume. - Volume *DiskImageVolumeDescription `locationName:"volume" type:"structure"` -} - -// String returns the string representation -func (s ImportVolumeTaskDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportVolumeTaskDetails) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ImportVolumeTaskDetails) SetAvailabilityZone(v string) *ImportVolumeTaskDetails { - s.AvailabilityZone = &v - return s -} - -// SetBytesConverted sets the BytesConverted field's value. -func (s *ImportVolumeTaskDetails) SetBytesConverted(v int64) *ImportVolumeTaskDetails { - s.BytesConverted = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportVolumeTaskDetails) SetDescription(v string) *ImportVolumeTaskDetails { - s.Description = &v - return s -} - -// SetImage sets the Image field's value. -func (s *ImportVolumeTaskDetails) SetImage(v *DiskImageDescription) *ImportVolumeTaskDetails { - s.Image = v - return s -} - -// SetVolume sets the Volume field's value. -func (s *ImportVolumeTaskDetails) SetVolume(v *DiskImageVolumeDescription) *ImportVolumeTaskDetails { - s.Volume = v - return s -} - -// Describes an instance. -type Instance struct { - _ struct{} `type:"structure"` - - // The AMI launch index, which can be used to find this instance in the launch - // group. - AmiLaunchIndex *int64 `locationName:"amiLaunchIndex" type:"integer"` - - // The architecture of the image. - Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - - // Any block device mapping entries for the instance. - BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // The idempotency token you provided when you launched the instance, if applicable. - ClientToken *string `locationName:"clientToken" type:"string"` - - // The CPU options for the instance. - CpuOptions *CpuOptions `locationName:"cpuOptions" type:"structure"` - - // Indicates whether the instance is optimized for Amazon EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The Elastic GPU associated with the instance. - ElasticGpuAssociations []*ElasticGpuAssociation `locationName:"elasticGpuAssociationSet" locationNameList:"item" type:"list"` - - // Specifies whether enhanced networking with ENA is enabled. - EnaSupport *bool `locationName:"enaSupport" type:"boolean"` - - // The hypervisor type of the instance. - Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"` - - // The IAM instance profile associated with the instance, if applicable. - IamInstanceProfile *IamInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI used to launch the instance. - ImageId *string `locationName:"imageId" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // Indicates whether this is a Spot Instance or a Scheduled Instance. - InstanceLifecycle *string `locationName:"instanceLifecycle" type:"string" enum:"InstanceLifecycleType"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The kernel associated with this instance, if applicable. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair, if this instance was launched with an associated - // key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // The time the instance was launched. - LaunchTime *time.Time `locationName:"launchTime" type:"timestamp" timestampFormat:"iso8601"` - - // The monitoring for the instance. - Monitoring *Monitoring `locationName:"monitoring" type:"structure"` - - // [EC2-VPC] One or more network interfaces for the instance. - NetworkInterfaces []*InstanceNetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - - // The location where the instance launched, if applicable. - Placement *Placement `locationName:"placement" type:"structure"` - - // The value is Windows for Windows instances; otherwise blank. - Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` - - // (IPv4 only) The private DNS hostname name assigned to the instance. This - // DNS hostname can only be used inside the Amazon EC2 network. This name is - // not available until the instance enters the running state. - // - // [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private - // DNS hostnames if you've enabled DNS resolution and DNS hostnames in your - // VPC. If you are not using the Amazon-provided DNS server in your VPC, your - // custom domain name servers must resolve the hostname as appropriate. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The private IPv4 address assigned to the instance. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The product codes attached to this instance, if applicable. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // (IPv4 only) The public DNS name assigned to the instance. This name is not - // available until the instance enters the running state. For EC2-VPC, this - // name is only available if you've enabled DNS hostnames for your VPC. - PublicDnsName *string `locationName:"dnsName" type:"string"` - - // The public IPv4 address assigned to the instance, if applicable. - PublicIpAddress *string `locationName:"ipAddress" type:"string"` - - // The RAM disk associated with this instance, if applicable. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // The device name of the root device volume (for example, /dev/sda1). - RootDeviceName *string `locationName:"rootDeviceName" type:"string"` - - // The root device type used by the AMI. The AMI can use an EBS volume or an - // instance store volume. - RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` - - // One or more security groups for the instance. - SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // Specifies whether to enable an instance launched in a VPC to perform NAT. - // This controls whether source/destination checking is enabled on the instance. - // A value of true means that checking is enabled, and false means that checking - // is disabled. The value must be false for the instance to perform NAT. For - // more information, see NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) - // in the Amazon Virtual Private Cloud User Guide. - SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` - - // If the request is a Spot Instance request, the ID of the request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - - // Specifies whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` - - // The current state of the instance. - State *InstanceState `locationName:"instanceState" type:"structure"` - - // The reason for the most recent state transition. - StateReason *StateReason `locationName:"stateReason" type:"structure"` - - // The reason for the most recent state transition. This might be an empty string. - StateTransitionReason *string `locationName:"reason" type:"string"` - - // [EC2-VPC] The ID of the subnet in which the instance is running. - SubnetId *string `locationName:"subnetId" type:"string"` - - // Any tags assigned to the instance. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The virtualization type of the instance. - VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"` - - // [EC2-VPC] The ID of the VPC in which the instance is running. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s Instance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Instance) GoString() string { - return s.String() -} - -// SetAmiLaunchIndex sets the AmiLaunchIndex field's value. -func (s *Instance) SetAmiLaunchIndex(v int64) *Instance { - s.AmiLaunchIndex = &v - return s -} - -// SetArchitecture sets the Architecture field's value. -func (s *Instance) SetArchitecture(v string) *Instance { - s.Architecture = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *Instance) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *Instance { - s.BlockDeviceMappings = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *Instance) SetClientToken(v string) *Instance { - s.ClientToken = &v - return s -} - -// SetCpuOptions sets the CpuOptions field's value. -func (s *Instance) SetCpuOptions(v *CpuOptions) *Instance { - s.CpuOptions = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *Instance) SetEbsOptimized(v bool) *Instance { - s.EbsOptimized = &v - return s -} - -// SetElasticGpuAssociations sets the ElasticGpuAssociations field's value. -func (s *Instance) SetElasticGpuAssociations(v []*ElasticGpuAssociation) *Instance { - s.ElasticGpuAssociations = v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *Instance) SetEnaSupport(v bool) *Instance { - s.EnaSupport = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *Instance) SetHypervisor(v string) *Instance { - s.Hypervisor = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *Instance) SetIamInstanceProfile(v *IamInstanceProfile) *Instance { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *Instance) SetImageId(v string) *Instance { - s.ImageId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Instance) SetInstanceId(v string) *Instance { - s.InstanceId = &v - return s -} - -// SetInstanceLifecycle sets the InstanceLifecycle field's value. -func (s *Instance) SetInstanceLifecycle(v string) *Instance { - s.InstanceLifecycle = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *Instance) SetInstanceType(v string) *Instance { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *Instance) SetKernelId(v string) *Instance { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *Instance) SetKeyName(v string) *Instance { - s.KeyName = &v - return s -} - -// SetLaunchTime sets the LaunchTime field's value. -func (s *Instance) SetLaunchTime(v time.Time) *Instance { - s.LaunchTime = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *Instance) SetMonitoring(v *Monitoring) *Instance { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *Instance) SetNetworkInterfaces(v []*InstanceNetworkInterface) *Instance { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *Instance) SetPlacement(v *Placement) *Instance { - s.Placement = v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *Instance) SetPlatform(v string) *Instance { - s.Platform = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *Instance) SetPrivateDnsName(v string) *Instance { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *Instance) SetPrivateIpAddress(v string) *Instance { - s.PrivateIpAddress = &v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *Instance) SetProductCodes(v []*ProductCode) *Instance { - s.ProductCodes = v - return s -} - -// SetPublicDnsName sets the PublicDnsName field's value. -func (s *Instance) SetPublicDnsName(v string) *Instance { - s.PublicDnsName = &v - return s -} - -// SetPublicIpAddress sets the PublicIpAddress field's value. -func (s *Instance) SetPublicIpAddress(v string) *Instance { - s.PublicIpAddress = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *Instance) SetRamdiskId(v string) *Instance { - s.RamdiskId = &v - return s -} - -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *Instance) SetRootDeviceName(v string) *Instance { - s.RootDeviceName = &v - return s -} - -// SetRootDeviceType sets the RootDeviceType field's value. -func (s *Instance) SetRootDeviceType(v string) *Instance { - s.RootDeviceType = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *Instance) SetSecurityGroups(v []*GroupIdentifier) *Instance { - s.SecurityGroups = v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *Instance) SetSourceDestCheck(v bool) *Instance { - s.SourceDestCheck = &v - return s -} - -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *Instance) SetSpotInstanceRequestId(v string) *Instance { - s.SpotInstanceRequestId = &v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *Instance) SetSriovNetSupport(v string) *Instance { - s.SriovNetSupport = &v - return s -} - -// SetState sets the State field's value. -func (s *Instance) SetState(v *InstanceState) *Instance { - s.State = v - return s -} - -// SetStateReason sets the StateReason field's value. -func (s *Instance) SetStateReason(v *StateReason) *Instance { - s.StateReason = v - return s -} - -// SetStateTransitionReason sets the StateTransitionReason field's value. -func (s *Instance) SetStateTransitionReason(v string) *Instance { - s.StateTransitionReason = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *Instance) SetSubnetId(v string) *Instance { - s.SubnetId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Instance) SetTags(v []*Tag) *Instance { - s.Tags = v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *Instance) SetVirtualizationType(v string) *Instance { - s.VirtualizationType = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Instance) SetVpcId(v string) *Instance { - s.VpcId = &v - return s -} - -// Describes a block device mapping. -type InstanceBlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name (for example, /dev/sdh or xvdh). - DeviceName *string `locationName:"deviceName" type:"string"` - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsInstanceBlockDevice `locationName:"ebs" type:"structure"` -} - -// String returns the string representation -func (s InstanceBlockDeviceMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceBlockDeviceMapping) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *InstanceBlockDeviceMapping) SetDeviceName(v string) *InstanceBlockDeviceMapping { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *InstanceBlockDeviceMapping) SetEbs(v *EbsInstanceBlockDevice) *InstanceBlockDeviceMapping { - s.Ebs = v - return s -} - -// Describes a block device mapping entry. -type InstanceBlockDeviceMappingSpecification struct { - _ struct{} `type:"structure"` - - // The device name (for example, /dev/sdh or xvdh). - DeviceName *string `locationName:"deviceName" type:"string"` - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsInstanceBlockDeviceSpecification `locationName:"ebs" type:"structure"` - - // suppress the specified device included in the block device mapping. - NoDevice *string `locationName:"noDevice" type:"string"` - - // The virtual device name. - VirtualName *string `locationName:"virtualName" type:"string"` -} - -// String returns the string representation -func (s InstanceBlockDeviceMappingSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceBlockDeviceMappingSpecification) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *InstanceBlockDeviceMappingSpecification) SetDeviceName(v string) *InstanceBlockDeviceMappingSpecification { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *InstanceBlockDeviceMappingSpecification) SetEbs(v *EbsInstanceBlockDeviceSpecification) *InstanceBlockDeviceMappingSpecification { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *InstanceBlockDeviceMappingSpecification) SetNoDevice(v string) *InstanceBlockDeviceMappingSpecification { - s.NoDevice = &v - return s -} - -// SetVirtualName sets the VirtualName field's value. -func (s *InstanceBlockDeviceMappingSpecification) SetVirtualName(v string) *InstanceBlockDeviceMappingSpecification { - s.VirtualName = &v - return s -} - -// Information about the instance type that the Dedicated Host supports. -type InstanceCapacity struct { - _ struct{} `type:"structure"` - - // The number of instances that can still be launched onto the Dedicated Host. - AvailableCapacity *int64 `locationName:"availableCapacity" type:"integer"` - - // The instance type size supported by the Dedicated Host. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The total number of instances that can be launched onto the Dedicated Host. - TotalCapacity *int64 `locationName:"totalCapacity" type:"integer"` -} - -// String returns the string representation -func (s InstanceCapacity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceCapacity) GoString() string { - return s.String() -} - -// SetAvailableCapacity sets the AvailableCapacity field's value. -func (s *InstanceCapacity) SetAvailableCapacity(v int64) *InstanceCapacity { - s.AvailableCapacity = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceCapacity) SetInstanceType(v string) *InstanceCapacity { - s.InstanceType = &v - return s -} - -// SetTotalCapacity sets the TotalCapacity field's value. -func (s *InstanceCapacity) SetTotalCapacity(v int64) *InstanceCapacity { - s.TotalCapacity = &v - return s -} - -// Describes a Reserved Instance listing state. -type InstanceCount struct { - _ struct{} `type:"structure"` - - // The number of listed Reserved Instances in the state specified by the state. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The states of the listed Reserved Instances. - State *string `locationName:"state" type:"string" enum:"ListingState"` -} - -// String returns the string representation -func (s InstanceCount) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceCount) GoString() string { - return s.String() -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *InstanceCount) SetInstanceCount(v int64) *InstanceCount { - s.InstanceCount = &v - return s -} - -// SetState sets the State field's value. -func (s *InstanceCount) SetState(v string) *InstanceCount { - s.State = &v - return s -} - -// Describes the credit option for CPU usage of a T2 instance. -type InstanceCreditSpecification struct { - _ struct{} `type:"structure"` - - // The credit option for CPU usage of the instance. Valid values are standard - // and unlimited. - CpuCredits *string `locationName:"cpuCredits" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` -} - -// String returns the string representation -func (s InstanceCreditSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceCreditSpecification) GoString() string { - return s.String() -} - -// SetCpuCredits sets the CpuCredits field's value. -func (s *InstanceCreditSpecification) SetCpuCredits(v string) *InstanceCreditSpecification { - s.CpuCredits = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceCreditSpecification) SetInstanceId(v string) *InstanceCreditSpecification { - s.InstanceId = &v - return s -} - -// Describes the credit option for CPU usage of a T2 instance. -type InstanceCreditSpecificationRequest struct { - _ struct{} `type:"structure"` - - // The credit option for CPU usage of the instance. Valid values are standard - // and unlimited. - CpuCredits *string `type:"string"` - - // The ID of the instance. - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s InstanceCreditSpecificationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceCreditSpecificationRequest) GoString() string { - return s.String() -} - -// SetCpuCredits sets the CpuCredits field's value. -func (s *InstanceCreditSpecificationRequest) SetCpuCredits(v string) *InstanceCreditSpecificationRequest { - s.CpuCredits = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceCreditSpecificationRequest) SetInstanceId(v string) *InstanceCreditSpecificationRequest { - s.InstanceId = &v - return s -} - -// Describes an instance to export. -type InstanceExportDetails struct { - _ struct{} `type:"structure"` - - // The ID of the resource being exported. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The target virtualization environment. - TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` -} - -// String returns the string representation -func (s InstanceExportDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceExportDetails) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceExportDetails) SetInstanceId(v string) *InstanceExportDetails { - s.InstanceId = &v - return s -} - -// SetTargetEnvironment sets the TargetEnvironment field's value. -func (s *InstanceExportDetails) SetTargetEnvironment(v string) *InstanceExportDetails { - s.TargetEnvironment = &v - return s -} - -// Describes an IPv6 address. -type InstanceIpv6Address struct { - _ struct{} `type:"structure"` - - // The IPv6 address. - Ipv6Address *string `locationName:"ipv6Address" type:"string"` -} - -// String returns the string representation -func (s InstanceIpv6Address) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceIpv6Address) GoString() string { - return s.String() -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *InstanceIpv6Address) SetIpv6Address(v string) *InstanceIpv6Address { - s.Ipv6Address = &v - return s -} - -// Describes an IPv6 address. -type InstanceIpv6AddressRequest struct { - _ struct{} `type:"structure"` - - // The IPv6 address. - Ipv6Address *string `type:"string"` -} - -// String returns the string representation -func (s InstanceIpv6AddressRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceIpv6AddressRequest) GoString() string { - return s.String() -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *InstanceIpv6AddressRequest) SetIpv6Address(v string) *InstanceIpv6AddressRequest { - s.Ipv6Address = &v - return s -} - -// Describes the market (purchasing) option for the instances. -type InstanceMarketOptionsRequest struct { - _ struct{} `type:"structure"` - - // The market type. - MarketType *string `type:"string" enum:"MarketType"` - - // The options for Spot Instances. - SpotOptions *SpotMarketOptions `type:"structure"` -} - -// String returns the string representation -func (s InstanceMarketOptionsRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceMarketOptionsRequest) GoString() string { - return s.String() -} - -// SetMarketType sets the MarketType field's value. -func (s *InstanceMarketOptionsRequest) SetMarketType(v string) *InstanceMarketOptionsRequest { - s.MarketType = &v - return s -} - -// SetSpotOptions sets the SpotOptions field's value. -func (s *InstanceMarketOptionsRequest) SetSpotOptions(v *SpotMarketOptions) *InstanceMarketOptionsRequest { - s.SpotOptions = v - return s -} - -// Describes the monitoring of an instance. -type InstanceMonitoring struct { - _ struct{} `type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The monitoring for the instance. - Monitoring *Monitoring `locationName:"monitoring" type:"structure"` -} - -// String returns the string representation -func (s InstanceMonitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceMonitoring) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceMonitoring) SetInstanceId(v string) *InstanceMonitoring { - s.InstanceId = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *InstanceMonitoring) SetMonitoring(v *Monitoring) *InstanceMonitoring { - s.Monitoring = v - return s -} - -// Describes a network interface. -type InstanceNetworkInterface struct { - _ struct{} `type:"structure"` - - // The association information for an Elastic IPv4 associated with the network - // interface. - Association *InstanceNetworkInterfaceAssociation `locationName:"association" type:"structure"` - - // The network interface attachment. - Attachment *InstanceNetworkInterfaceAttachment `locationName:"attachment" type:"structure"` - - // The description. - Description *string `locationName:"description" type:"string"` - - // One or more security groups. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // One or more IPv6 addresses associated with the network interface. - Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6AddressesSet" locationNameList:"item" type:"list"` - - // The MAC address. - MacAddress *string `locationName:"macAddress" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the AWS account that created the network interface. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The private DNS name. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // One or more private IPv4 addresses associated with the network interface. - PrivateIpAddresses []*InstancePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` - - // Indicates whether to validate network traffic to or from this network interface. - SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` - - // The status of the network interface. - Status *string `locationName:"status" type:"string" enum:"NetworkInterfaceStatus"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s InstanceNetworkInterface) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworkInterface) GoString() string { - return s.String() -} - -// SetAssociation sets the Association field's value. -func (s *InstanceNetworkInterface) SetAssociation(v *InstanceNetworkInterfaceAssociation) *InstanceNetworkInterface { - s.Association = v - return s -} - -// SetAttachment sets the Attachment field's value. -func (s *InstanceNetworkInterface) SetAttachment(v *InstanceNetworkInterfaceAttachment) *InstanceNetworkInterface { - s.Attachment = v - return s -} - -// SetDescription sets the Description field's value. -func (s *InstanceNetworkInterface) SetDescription(v string) *InstanceNetworkInterface { - s.Description = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *InstanceNetworkInterface) SetGroups(v []*GroupIdentifier) *InstanceNetworkInterface { - s.Groups = v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *InstanceNetworkInterface) SetIpv6Addresses(v []*InstanceIpv6Address) *InstanceNetworkInterface { - s.Ipv6Addresses = v - return s -} - -// SetMacAddress sets the MacAddress field's value. -func (s *InstanceNetworkInterface) SetMacAddress(v string) *InstanceNetworkInterface { - s.MacAddress = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *InstanceNetworkInterface) SetNetworkInterfaceId(v string) *InstanceNetworkInterface { - s.NetworkInterfaceId = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *InstanceNetworkInterface) SetOwnerId(v string) *InstanceNetworkInterface { - s.OwnerId = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *InstanceNetworkInterface) SetPrivateDnsName(v string) *InstanceNetworkInterface { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *InstanceNetworkInterface) SetPrivateIpAddress(v string) *InstanceNetworkInterface { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *InstanceNetworkInterface) SetPrivateIpAddresses(v []*InstancePrivateIpAddress) *InstanceNetworkInterface { - s.PrivateIpAddresses = v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *InstanceNetworkInterface) SetSourceDestCheck(v bool) *InstanceNetworkInterface { - s.SourceDestCheck = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceNetworkInterface) SetStatus(v string) *InstanceNetworkInterface { - s.Status = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *InstanceNetworkInterface) SetSubnetId(v string) *InstanceNetworkInterface { - s.SubnetId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *InstanceNetworkInterface) SetVpcId(v string) *InstanceNetworkInterface { - s.VpcId = &v - return s -} - -// Describes association information for an Elastic IP address (IPv4). -type InstanceNetworkInterfaceAssociation struct { - _ struct{} `type:"structure"` - - // The ID of the owner of the Elastic IP address. - IpOwnerId *string `locationName:"ipOwnerId" type:"string"` - - // The public DNS name. - PublicDnsName *string `locationName:"publicDnsName" type:"string"` - - // The public IP address or Elastic IP address bound to the network interface. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s InstanceNetworkInterfaceAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworkInterfaceAssociation) GoString() string { - return s.String() -} - -// SetIpOwnerId sets the IpOwnerId field's value. -func (s *InstanceNetworkInterfaceAssociation) SetIpOwnerId(v string) *InstanceNetworkInterfaceAssociation { - s.IpOwnerId = &v - return s -} - -// SetPublicDnsName sets the PublicDnsName field's value. -func (s *InstanceNetworkInterfaceAssociation) SetPublicDnsName(v string) *InstanceNetworkInterfaceAssociation { - s.PublicDnsName = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *InstanceNetworkInterfaceAssociation) SetPublicIp(v string) *InstanceNetworkInterfaceAssociation { - s.PublicIp = &v - return s -} - -// Describes a network interface attachment. -type InstanceNetworkInterfaceAttachment struct { - _ struct{} `type:"structure"` - - // The time stamp when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` - - // Indicates whether the network interface is deleted when the instance is terminated. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The index of the device on the instance for the network interface attachment. - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` - - // The attachment state. - Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` -} - -// String returns the string representation -func (s InstanceNetworkInterfaceAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworkInterfaceAttachment) GoString() string { - return s.String() -} - -// SetAttachTime sets the AttachTime field's value. -func (s *InstanceNetworkInterfaceAttachment) SetAttachTime(v time.Time) *InstanceNetworkInterfaceAttachment { - s.AttachTime = &v - return s -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *InstanceNetworkInterfaceAttachment) SetAttachmentId(v string) *InstanceNetworkInterfaceAttachment { - s.AttachmentId = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *InstanceNetworkInterfaceAttachment) SetDeleteOnTermination(v bool) *InstanceNetworkInterfaceAttachment { - s.DeleteOnTermination = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *InstanceNetworkInterfaceAttachment) SetDeviceIndex(v int64) *InstanceNetworkInterfaceAttachment { - s.DeviceIndex = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceNetworkInterfaceAttachment) SetStatus(v string) *InstanceNetworkInterfaceAttachment { - s.Status = &v - return s -} - -// Describes a network interface. -type InstanceNetworkInterfaceSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether to assign a public IPv4 address to an instance you launch - // in a VPC. The public IP address can only be assigned to a network interface - // for eth0, and can only be assigned to a new network interface, not an existing - // one. You cannot specify more than one network interface in the request. If - // launching into a default subnet, the default value is true. - AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"` - - // If set to true, the interface is deleted when the instance is terminated. - // You can specify true only if creating a new network interface when launching - // an instance. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The description of the network interface. Applies only if creating a network - // interface when launching an instance. - Description *string `locationName:"description" type:"string"` - - // The index of the device on the instance for the network interface attachment. - // If you are specifying a network interface in a RunInstances request, you - // must provide the device index. - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` - - // The IDs of the security groups for the network interface. Applies only if - // creating a network interface when launching an instance. - Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // A number of IPv6 addresses to assign to the network interface. Amazon EC2 - // chooses the IPv6 addresses from the range of the subnet. You cannot specify - // this option and the option to assign specific IPv6 addresses in the same - // request. You can specify this option if you've specified a minimum number - // of instances to launch. - Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"` - - // One or more IPv6 addresses to assign to the network interface. You cannot - // specify this option and the option to assign a number of IPv6 addresses in - // the same request. You cannot specify this option if you've specified a minimum - // number of instances to launch. - Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6AddressesSet" queryName:"Ipv6Addresses" locationNameList:"item" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The private IPv4 address of the network interface. Applies only if creating - // a network interface when launching an instance. You cannot specify this option - // if you're launching more than one instance in a RunInstances request. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // One or more private IPv4 addresses to assign to the network interface. Only - // one private IPv4 address can be designated as primary. You cannot specify - // this option if you're launching more than one instance in a RunInstances - // request. - PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddressesSet" queryName:"PrivateIpAddresses" locationNameList:"item" type:"list"` - - // The number of secondary private IPv4 addresses. You can't specify this option - // and specify more than one private IP address using the private IP addresses - // option. You cannot specify this option if you're launching more than one - // instance in a RunInstances request. - SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` - - // The ID of the subnet associated with the network string. Applies only if - // creating a network interface when launching an instance. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s InstanceNetworkInterfaceSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworkInterfaceSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceNetworkInterfaceSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceNetworkInterfaceSpecification"} - if s.PrivateIpAddresses != nil { - for i, v := range s.PrivateIpAddresses { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PrivateIpAddresses", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. -func (s *InstanceNetworkInterfaceSpecification) SetAssociatePublicIpAddress(v bool) *InstanceNetworkInterfaceSpecification { - s.AssociatePublicIpAddress = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *InstanceNetworkInterfaceSpecification) SetDeleteOnTermination(v bool) *InstanceNetworkInterfaceSpecification { - s.DeleteOnTermination = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *InstanceNetworkInterfaceSpecification) SetDescription(v string) *InstanceNetworkInterfaceSpecification { - s.Description = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *InstanceNetworkInterfaceSpecification) SetDeviceIndex(v int64) *InstanceNetworkInterfaceSpecification { - s.DeviceIndex = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *InstanceNetworkInterfaceSpecification) SetGroups(v []*string) *InstanceNetworkInterfaceSpecification { - s.Groups = v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *InstanceNetworkInterfaceSpecification) SetIpv6AddressCount(v int64) *InstanceNetworkInterfaceSpecification { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *InstanceNetworkInterfaceSpecification) SetIpv6Addresses(v []*InstanceIpv6Address) *InstanceNetworkInterfaceSpecification { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *InstanceNetworkInterfaceSpecification) SetNetworkInterfaceId(v string) *InstanceNetworkInterfaceSpecification { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *InstanceNetworkInterfaceSpecification) SetPrivateIpAddress(v string) *InstanceNetworkInterfaceSpecification { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *InstanceNetworkInterfaceSpecification) SetPrivateIpAddresses(v []*PrivateIpAddressSpecification) *InstanceNetworkInterfaceSpecification { - s.PrivateIpAddresses = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *InstanceNetworkInterfaceSpecification) SetSecondaryPrivateIpAddressCount(v int64) *InstanceNetworkInterfaceSpecification { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *InstanceNetworkInterfaceSpecification) SetSubnetId(v string) *InstanceNetworkInterfaceSpecification { - s.SubnetId = &v - return s -} - -// Describes a private IPv4 address. -type InstancePrivateIpAddress struct { - _ struct{} `type:"structure"` - - // The association information for an Elastic IP address for the network interface. - Association *InstanceNetworkInterfaceAssociation `locationName:"association" type:"structure"` - - // Indicates whether this IPv4 address is the primary private IP address of - // the network interface. - Primary *bool `locationName:"primary" type:"boolean"` - - // The private IPv4 DNS name. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The private IPv4 address of the network interface. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` -} - -// String returns the string representation -func (s InstancePrivateIpAddress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstancePrivateIpAddress) GoString() string { - return s.String() -} - -// SetAssociation sets the Association field's value. -func (s *InstancePrivateIpAddress) SetAssociation(v *InstanceNetworkInterfaceAssociation) *InstancePrivateIpAddress { - s.Association = v - return s -} - -// SetPrimary sets the Primary field's value. -func (s *InstancePrivateIpAddress) SetPrimary(v bool) *InstancePrivateIpAddress { - s.Primary = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *InstancePrivateIpAddress) SetPrivateDnsName(v string) *InstancePrivateIpAddress { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *InstancePrivateIpAddress) SetPrivateIpAddress(v string) *InstancePrivateIpAddress { - s.PrivateIpAddress = &v - return s -} - -// Describes the current state of an instance. -type InstanceState struct { - _ struct{} `type:"structure"` - - // The low byte represents the state. The high byte is an opaque internal value - // and should be ignored. - // - // * 0 : pending - // - // * 16 : running - // - // * 32 : shutting-down - // - // * 48 : terminated - // - // * 64 : stopping - // - // * 80 : stopped - Code *int64 `locationName:"code" type:"integer"` - - // The current state of the instance. - Name *string `locationName:"name" type:"string" enum:"InstanceStateName"` -} - -// String returns the string representation -func (s InstanceState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceState) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *InstanceState) SetCode(v int64) *InstanceState { - s.Code = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceState) SetName(v string) *InstanceState { - s.Name = &v - return s -} - -// Describes an instance state change. -type InstanceStateChange struct { - _ struct{} `type:"structure"` - - // The current state of the instance. - CurrentState *InstanceState `locationName:"currentState" type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The previous state of the instance. - PreviousState *InstanceState `locationName:"previousState" type:"structure"` -} - -// String returns the string representation -func (s InstanceStateChange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStateChange) GoString() string { - return s.String() -} - -// SetCurrentState sets the CurrentState field's value. -func (s *InstanceStateChange) SetCurrentState(v *InstanceState) *InstanceStateChange { - s.CurrentState = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceStateChange) SetInstanceId(v string) *InstanceStateChange { - s.InstanceId = &v - return s -} - -// SetPreviousState sets the PreviousState field's value. -func (s *InstanceStateChange) SetPreviousState(v *InstanceState) *InstanceStateChange { - s.PreviousState = v - return s -} - -// Describes the status of an instance. -type InstanceStatus struct { - _ struct{} `type:"structure"` - - // The Availability Zone of the instance. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // Any scheduled events associated with the instance. - Events []*InstanceStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The intended state of the instance. DescribeInstanceStatus requires that - // an instance be in the running state. - InstanceState *InstanceState `locationName:"instanceState" type:"structure"` - - // Reports impaired functionality that stems from issues internal to the instance, - // such as impaired reachability. - InstanceStatus *InstanceStatusSummary `locationName:"instanceStatus" type:"structure"` - - // Reports impaired functionality that stems from issues related to the systems - // that support an instance, such as hardware failures and network connectivity - // problems. - SystemStatus *InstanceStatusSummary `locationName:"systemStatus" type:"structure"` -} - -// String returns the string representation -func (s InstanceStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStatus) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *InstanceStatus) SetAvailabilityZone(v string) *InstanceStatus { - s.AvailabilityZone = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *InstanceStatus) SetEvents(v []*InstanceStatusEvent) *InstanceStatus { - s.Events = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceStatus) SetInstanceId(v string) *InstanceStatus { - s.InstanceId = &v - return s -} - -// SetInstanceState sets the InstanceState field's value. -func (s *InstanceStatus) SetInstanceState(v *InstanceState) *InstanceStatus { - s.InstanceState = v - return s -} - -// SetInstanceStatus sets the InstanceStatus field's value. -func (s *InstanceStatus) SetInstanceStatus(v *InstanceStatusSummary) *InstanceStatus { - s.InstanceStatus = v - return s -} - -// SetSystemStatus sets the SystemStatus field's value. -func (s *InstanceStatus) SetSystemStatus(v *InstanceStatusSummary) *InstanceStatus { - s.SystemStatus = v - return s -} - -// Describes the instance status. -type InstanceStatusDetails struct { - _ struct{} `type:"structure"` - - // The time when a status check failed. For an instance that was launched and - // impaired, this is the time when the instance was launched. - ImpairedSince *time.Time `locationName:"impairedSince" type:"timestamp" timestampFormat:"iso8601"` - - // The type of instance status. - Name *string `locationName:"name" type:"string" enum:"StatusName"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"StatusType"` -} - -// String returns the string representation -func (s InstanceStatusDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStatusDetails) GoString() string { - return s.String() -} - -// SetImpairedSince sets the ImpairedSince field's value. -func (s *InstanceStatusDetails) SetImpairedSince(v time.Time) *InstanceStatusDetails { - s.ImpairedSince = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceStatusDetails) SetName(v string) *InstanceStatusDetails { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceStatusDetails) SetStatus(v string) *InstanceStatusDetails { - s.Status = &v - return s -} - -// Describes a scheduled event for an instance. -type InstanceStatusEvent struct { - _ struct{} `type:"structure"` - - // The event code. - Code *string `locationName:"code" type:"string" enum:"EventCode"` - - // A description of the event. - // - // After a scheduled event is completed, it can still be described for up to - // a week. If the event has been completed, this description starts with the - // following text: [Completed]. - Description *string `locationName:"description" type:"string"` - - // The latest scheduled end time for the event. - NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The earliest scheduled start time for the event. - NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s InstanceStatusEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStatusEvent) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *InstanceStatusEvent) SetCode(v string) *InstanceStatusEvent { - s.Code = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *InstanceStatusEvent) SetDescription(v string) *InstanceStatusEvent { - s.Description = &v - return s -} - -// SetNotAfter sets the NotAfter field's value. -func (s *InstanceStatusEvent) SetNotAfter(v time.Time) *InstanceStatusEvent { - s.NotAfter = &v - return s -} - -// SetNotBefore sets the NotBefore field's value. -func (s *InstanceStatusEvent) SetNotBefore(v time.Time) *InstanceStatusEvent { - s.NotBefore = &v - return s -} - -// Describes the status of an instance. -type InstanceStatusSummary struct { - _ struct{} `type:"structure"` - - // The system instance health or application instance health. - Details []*InstanceStatusDetails `locationName:"details" locationNameList:"item" type:"list"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"SummaryStatus"` -} - -// String returns the string representation -func (s InstanceStatusSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStatusSummary) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *InstanceStatusSummary) SetDetails(v []*InstanceStatusDetails) *InstanceStatusSummary { - s.Details = v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceStatusSummary) SetStatus(v string) *InstanceStatusSummary { - s.Status = &v - return s -} - -// Describes an Internet gateway. -type InternetGateway struct { - _ struct{} `type:"structure"` - - // Any VPCs attached to the Internet gateway. - Attachments []*InternetGatewayAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` - - // The ID of the Internet gateway. - InternetGatewayId *string `locationName:"internetGatewayId" type:"string"` - - // Any tags assigned to the Internet gateway. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s InternetGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InternetGateway) GoString() string { - return s.String() -} - -// SetAttachments sets the Attachments field's value. -func (s *InternetGateway) SetAttachments(v []*InternetGatewayAttachment) *InternetGateway { - s.Attachments = v - return s -} - -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *InternetGateway) SetInternetGatewayId(v string) *InternetGateway { - s.InternetGatewayId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *InternetGateway) SetTags(v []*Tag) *InternetGateway { - s.Tags = v - return s -} - -// Describes the attachment of a VPC to an Internet gateway or an egress-only -// Internet gateway. -type InternetGatewayAttachment struct { - _ struct{} `type:"structure"` - - // The current state of the attachment. For an Internet gateway, the state is - // available when attached to a VPC; otherwise, this value is not returned. - State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s InternetGatewayAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InternetGatewayAttachment) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *InternetGatewayAttachment) SetState(v string) *InternetGatewayAttachment { - s.State = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *InternetGatewayAttachment) SetVpcId(v string) *InternetGatewayAttachment { - s.VpcId = &v - return s -} - -// Describes a set of permissions for a security group rule. -type IpPermission struct { - _ struct{} `type:"structure"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 - // type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify - // all ICMP/ICMPv6 types, you must specify all codes. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). - // - // [EC2-VPC only] Use -1 to specify all protocols. When authorizing security - // group rules, specifying -1 or a protocol number other than tcp, udp, icmp, - // or 58 (ICMPv6) allows traffic on all ports, regardless of any port range - // you specify. For tcp, udp, and icmp, you must specify a port range. For 58 - // (ICMPv6), you can optionally specify a port range; if you don't, traffic - // for all types and codes is allowed when authorizing rules. - IpProtocol *string `locationName:"ipProtocol" type:"string"` - - // One or more IPv4 ranges. - IpRanges []*IpRange `locationName:"ipRanges" locationNameList:"item" type:"list"` - - // [EC2-VPC only] One or more IPv6 ranges. - Ipv6Ranges []*Ipv6Range `locationName:"ipv6Ranges" locationNameList:"item" type:"list"` - - // (EC2-VPC only; valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress - // and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. - // In an AuthorizeSecurityGroupEgress request, this is the AWS service that - // you want to access through a VPC endpoint from instances associated with - // the security group. - PrefixListIds []*PrefixListId `locationName:"prefixListIds" locationNameList:"item" type:"list"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. - // A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type. - // If you specify all ICMP/ICMPv6 types, you must specify all codes. - ToPort *int64 `locationName:"toPort" type:"integer"` - - // One or more security group and AWS account ID pairs. - UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s IpPermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IpPermission) GoString() string { - return s.String() -} - -// SetFromPort sets the FromPort field's value. -func (s *IpPermission) SetFromPort(v int64) *IpPermission { - s.FromPort = &v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *IpPermission) SetIpProtocol(v string) *IpPermission { - s.IpProtocol = &v - return s -} - -// SetIpRanges sets the IpRanges field's value. -func (s *IpPermission) SetIpRanges(v []*IpRange) *IpPermission { - s.IpRanges = v - return s -} - -// SetIpv6Ranges sets the Ipv6Ranges field's value. -func (s *IpPermission) SetIpv6Ranges(v []*Ipv6Range) *IpPermission { - s.Ipv6Ranges = v - return s -} - -// SetPrefixListIds sets the PrefixListIds field's value. -func (s *IpPermission) SetPrefixListIds(v []*PrefixListId) *IpPermission { - s.PrefixListIds = v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *IpPermission) SetToPort(v int64) *IpPermission { - s.ToPort = &v - return s -} - -// SetUserIdGroupPairs sets the UserIdGroupPairs field's value. -func (s *IpPermission) SetUserIdGroupPairs(v []*UserIdGroupPair) *IpPermission { - s.UserIdGroupPairs = v - return s -} - -// Describes an IPv4 range. -type IpRange struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR range. You can either specify a CIDR range or a source security - // group, not both. To specify a single IPv4 address, use the /32 prefix length. - CidrIp *string `locationName:"cidrIp" type:"string"` - - // A description for the security group rule that references this IPv4 address - // range. - // - // Constraints: Up to 255 characters in length. Allowed characters are a-z, - // A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$* - Description *string `locationName:"description" type:"string"` -} - -// String returns the string representation -func (s IpRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IpRange) GoString() string { - return s.String() -} - -// SetCidrIp sets the CidrIp field's value. -func (s *IpRange) SetCidrIp(v string) *IpRange { - s.CidrIp = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *IpRange) SetDescription(v string) *IpRange { - s.Description = &v - return s -} - -// Describes an IPv6 CIDR block. -type Ipv6CidrBlock struct { - _ struct{} `type:"structure"` - - // The IPv6 CIDR block. - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` -} - -// String returns the string representation -func (s Ipv6CidrBlock) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Ipv6CidrBlock) GoString() string { - return s.String() -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *Ipv6CidrBlock) SetIpv6CidrBlock(v string) *Ipv6CidrBlock { - s.Ipv6CidrBlock = &v - return s -} - -// [EC2-VPC only] Describes an IPv6 range. -type Ipv6Range struct { - _ struct{} `type:"structure"` - - // The IPv6 CIDR range. You can either specify a CIDR range or a source security - // group, not both. To specify a single IPv6 address, use the /128 prefix length. - CidrIpv6 *string `locationName:"cidrIpv6" type:"string"` - - // A description for the security group rule that references this IPv6 address - // range. - // - // Constraints: Up to 255 characters in length. Allowed characters are a-z, - // A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$* - Description *string `locationName:"description" type:"string"` -} - -// String returns the string representation -func (s Ipv6Range) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Ipv6Range) GoString() string { - return s.String() -} - -// SetCidrIpv6 sets the CidrIpv6 field's value. -func (s *Ipv6Range) SetCidrIpv6(v string) *Ipv6Range { - s.CidrIpv6 = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Ipv6Range) SetDescription(v string) *Ipv6Range { - s.Description = &v - return s -} - -// Describes a key pair. -type KeyPairInfo struct { - _ struct{} `type:"structure"` - - // If you used CreateKeyPair to create the key pair, this is the SHA-1 digest - // of the DER encoded private key. If you used ImportKeyPair to provide AWS - // the public key, this is the MD5 public key fingerprint as specified in section - // 4 of RFC4716. - KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` -} - -// String returns the string representation -func (s KeyPairInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyPairInfo) GoString() string { - return s.String() -} - -// SetKeyFingerprint sets the KeyFingerprint field's value. -func (s *KeyPairInfo) SetKeyFingerprint(v string) *KeyPairInfo { - s.KeyFingerprint = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *KeyPairInfo) SetKeyName(v string) *KeyPairInfo { - s.KeyName = &v - return s -} - -// Describes a launch permission. -type LaunchPermission struct { - _ struct{} `type:"structure"` - - // The name of the group. - Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` - - // The AWS account ID. - UserId *string `locationName:"userId" type:"string"` -} - -// String returns the string representation -func (s LaunchPermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchPermission) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *LaunchPermission) SetGroup(v string) *LaunchPermission { - s.Group = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *LaunchPermission) SetUserId(v string) *LaunchPermission { - s.UserId = &v - return s -} - -// Describes a launch permission modification. -type LaunchPermissionModifications struct { - _ struct{} `type:"structure"` - - // The AWS account ID to add to the list of launch permissions for the AMI. - Add []*LaunchPermission `locationNameList:"item" type:"list"` - - // The AWS account ID to remove from the list of launch permissions for the - // AMI. - Remove []*LaunchPermission `locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s LaunchPermissionModifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchPermissionModifications) GoString() string { - return s.String() -} - -// SetAdd sets the Add field's value. -func (s *LaunchPermissionModifications) SetAdd(v []*LaunchPermission) *LaunchPermissionModifications { - s.Add = v - return s -} - -// SetRemove sets the Remove field's value. -func (s *LaunchPermissionModifications) SetRemove(v []*LaunchPermission) *LaunchPermissionModifications { - s.Remove = v - return s -} - -// Describes the launch specification for an instance. -type LaunchSpecification struct { - _ struct{} `type:"structure"` - - // Deprecated. - AddressingType *string `locationName:"addressingType" type:"string"` - - // One or more block device mapping entries. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // Indicates whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - // - // Default: false - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The ID of the kernel. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // Describes the monitoring of an instance. - Monitoring *RunInstancesMonitoringEnabled `locationName:"monitoring" type:"structure"` - - // One or more network interfaces. If you specify a network interface, you must - // specify subnet IDs and security group IDs using the network interface. - NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - - // The placement information for the instance. - Placement *SpotPlacement `locationName:"placement" type:"structure"` - - // The ID of the RAM disk. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // One or more security groups. When requesting instances in a VPC, you must - // specify the IDs of the security groups. When requesting instances in EC2-Classic, - // you can specify the names or the IDs of the security groups. - SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The ID of the subnet in which to launch the instance. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The Base64-encoded user data for the instance. - UserData *string `locationName:"userData" type:"string"` -} - -// String returns the string representation -func (s LaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchSpecification) GoString() string { - return s.String() -} - -// SetAddressingType sets the AddressingType field's value. -func (s *LaunchSpecification) SetAddressingType(v string) *LaunchSpecification { - s.AddressingType = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *LaunchSpecification) SetBlockDeviceMappings(v []*BlockDeviceMapping) *LaunchSpecification { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *LaunchSpecification) SetEbsOptimized(v bool) *LaunchSpecification { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *LaunchSpecification) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *LaunchSpecification { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *LaunchSpecification) SetImageId(v string) *LaunchSpecification { - s.ImageId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *LaunchSpecification) SetInstanceType(v string) *LaunchSpecification { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *LaunchSpecification) SetKernelId(v string) *LaunchSpecification { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *LaunchSpecification) SetKeyName(v string) *LaunchSpecification { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *LaunchSpecification) SetMonitoring(v *RunInstancesMonitoringEnabled) *LaunchSpecification { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *LaunchSpecification) SetNetworkInterfaces(v []*InstanceNetworkInterfaceSpecification) *LaunchSpecification { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *LaunchSpecification) SetPlacement(v *SpotPlacement) *LaunchSpecification { - s.Placement = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *LaunchSpecification) SetRamdiskId(v string) *LaunchSpecification { - s.RamdiskId = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *LaunchSpecification) SetSecurityGroups(v []*GroupIdentifier) *LaunchSpecification { - s.SecurityGroups = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *LaunchSpecification) SetSubnetId(v string) *LaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *LaunchSpecification) SetUserData(v string) *LaunchSpecification { - s.UserData = &v - return s -} - -// Describes a launch template. -type LaunchTemplate struct { - _ struct{} `type:"structure"` - - // The time launch template was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // The principal that created the launch template. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The version number of the default version of the launch template. - DefaultVersionNumber *int64 `locationName:"defaultVersionNumber" type:"long"` - - // The version number of the latest version of the launch template. - LatestVersionNumber *int64 `locationName:"latestVersionNumber" type:"long"` - - // The ID of the launch template. - LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` - - // The name of the launch template. - LaunchTemplateName *string `locationName:"launchTemplateName" min:"3" type:"string"` - - // The tags for the launch template. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s LaunchTemplate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplate) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *LaunchTemplate) SetCreateTime(v time.Time) *LaunchTemplate { - s.CreateTime = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *LaunchTemplate) SetCreatedBy(v string) *LaunchTemplate { - s.CreatedBy = &v - return s -} - -// SetDefaultVersionNumber sets the DefaultVersionNumber field's value. -func (s *LaunchTemplate) SetDefaultVersionNumber(v int64) *LaunchTemplate { - s.DefaultVersionNumber = &v - return s -} - -// SetLatestVersionNumber sets the LatestVersionNumber field's value. -func (s *LaunchTemplate) SetLatestVersionNumber(v int64) *LaunchTemplate { - s.LatestVersionNumber = &v - return s -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *LaunchTemplate) SetLaunchTemplateId(v string) *LaunchTemplate { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *LaunchTemplate) SetLaunchTemplateName(v string) *LaunchTemplate { - s.LaunchTemplateName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *LaunchTemplate) SetTags(v []*Tag) *LaunchTemplate { - s.Tags = v - return s -} - -// Describes a block device mapping. -type LaunchTemplateBlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name. - DeviceName *string `locationName:"deviceName" type:"string"` - - // Information about the block device for an EBS volume. - Ebs *LaunchTemplateEbsBlockDevice `locationName:"ebs" type:"structure"` - - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice *string `locationName:"noDevice" type:"string"` - - // The virtual device name (ephemeralN). - VirtualName *string `locationName:"virtualName" type:"string"` -} - -// String returns the string representation -func (s LaunchTemplateBlockDeviceMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateBlockDeviceMapping) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *LaunchTemplateBlockDeviceMapping) SetDeviceName(v string) *LaunchTemplateBlockDeviceMapping { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *LaunchTemplateBlockDeviceMapping) SetEbs(v *LaunchTemplateEbsBlockDevice) *LaunchTemplateBlockDeviceMapping { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *LaunchTemplateBlockDeviceMapping) SetNoDevice(v string) *LaunchTemplateBlockDeviceMapping { - s.NoDevice = &v - return s -} - -// SetVirtualName sets the VirtualName field's value. -func (s *LaunchTemplateBlockDeviceMapping) SetVirtualName(v string) *LaunchTemplateBlockDeviceMapping { - s.VirtualName = &v - return s -} - -// Describes a block device mapping. -type LaunchTemplateBlockDeviceMappingRequest struct { - _ struct{} `type:"structure"` - - // The device name (for example, /dev/sdh or xvdh). - DeviceName *string `type:"string"` - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *LaunchTemplateEbsBlockDeviceRequest `type:"structure"` - - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice *string `type:"string"` - - // The virtual device name (ephemeralN). Instance store volumes are numbered - // starting from 0. An instance type with 2 available instance store volumes - // can specify mappings for ephemeral0 and ephemeral1. The number of available - // instance store volumes depends on the instance type. After you connect to - // the instance, you must mount the volume. - VirtualName *string `type:"string"` -} - -// String returns the string representation -func (s LaunchTemplateBlockDeviceMappingRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateBlockDeviceMappingRequest) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *LaunchTemplateBlockDeviceMappingRequest) SetDeviceName(v string) *LaunchTemplateBlockDeviceMappingRequest { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *LaunchTemplateBlockDeviceMappingRequest) SetEbs(v *LaunchTemplateEbsBlockDeviceRequest) *LaunchTemplateBlockDeviceMappingRequest { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *LaunchTemplateBlockDeviceMappingRequest) SetNoDevice(v string) *LaunchTemplateBlockDeviceMappingRequest { - s.NoDevice = &v - return s -} - -// SetVirtualName sets the VirtualName field's value. -func (s *LaunchTemplateBlockDeviceMappingRequest) SetVirtualName(v string) *LaunchTemplateBlockDeviceMappingRequest { - s.VirtualName = &v - return s -} - -// Describes a launch template and overrides. -type LaunchTemplateConfig struct { - _ struct{} `type:"structure"` - - // The launch template. - LaunchTemplateSpecification *FleetLaunchTemplateSpecification `locationName:"launchTemplateSpecification" type:"structure"` - - // Any parameters that you specify override the same parameters in the launch - // template. - Overrides []*LaunchTemplateOverrides `locationName:"overrides" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s LaunchTemplateConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LaunchTemplateConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LaunchTemplateConfig"} - if s.LaunchTemplateSpecification != nil { - if err := s.LaunchTemplateSpecification.Validate(); err != nil { - invalidParams.AddNested("LaunchTemplateSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLaunchTemplateSpecification sets the LaunchTemplateSpecification field's value. -func (s *LaunchTemplateConfig) SetLaunchTemplateSpecification(v *FleetLaunchTemplateSpecification) *LaunchTemplateConfig { - s.LaunchTemplateSpecification = v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *LaunchTemplateConfig) SetOverrides(v []*LaunchTemplateOverrides) *LaunchTemplateConfig { - s.Overrides = v - return s -} - -// Describes a block device for an EBS volume. -type LaunchTemplateEbsBlockDevice struct { - _ struct{} `type:"structure"` - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // Indicates whether the EBS volume is encrypted. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - Iops *int64 `locationName:"iops" type:"integer"` - - // The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The ID of the snapshot. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // The size of the volume, in GiB. - VolumeSize *int64 `locationName:"volumeSize" type:"integer"` - - // The volume type. - VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s LaunchTemplateEbsBlockDevice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateEbsBlockDevice) GoString() string { - return s.String() -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *LaunchTemplateEbsBlockDevice) SetDeleteOnTermination(v bool) *LaunchTemplateEbsBlockDevice { - s.DeleteOnTermination = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *LaunchTemplateEbsBlockDevice) SetEncrypted(v bool) *LaunchTemplateEbsBlockDevice { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *LaunchTemplateEbsBlockDevice) SetIops(v int64) *LaunchTemplateEbsBlockDevice { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *LaunchTemplateEbsBlockDevice) SetKmsKeyId(v string) *LaunchTemplateEbsBlockDevice { - s.KmsKeyId = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *LaunchTemplateEbsBlockDevice) SetSnapshotId(v string) *LaunchTemplateEbsBlockDevice { - s.SnapshotId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *LaunchTemplateEbsBlockDevice) SetVolumeSize(v int64) *LaunchTemplateEbsBlockDevice { - s.VolumeSize = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *LaunchTemplateEbsBlockDevice) SetVolumeType(v string) *LaunchTemplateEbsBlockDevice { - s.VolumeType = &v - return s -} - -// The parameters for a block device for an EBS volume. -type LaunchTemplateEbsBlockDeviceRequest struct { - _ struct{} `type:"structure"` - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool `type:"boolean"` - - // Indicates whether the EBS volume is encrypted. Encrypted volumes can only - // be attached to instances that support Amazon EBS encryption. If you are creating - // a volume from a snapshot, you can't specify an encryption value. - Encrypted *bool `type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1, this represents the number of IOPS that are provisioned for the - // volume. For gp2, this represents the baseline performance of the volume and - // the rate at which the volume accumulates I/O credits for bursting. For more - // information about General Purpose SSD baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud - // User Guide. - // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops *int64 `type:"integer"` - - // The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption. - KmsKeyId *string `type:"string"` - - // The ID of the snapshot. - SnapshotId *string `type:"string"` - - // The size of the volume, in GiB. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - VolumeSize *int64 `type:"integer"` - - // The volume type. - VolumeType *string `type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s LaunchTemplateEbsBlockDeviceRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateEbsBlockDeviceRequest) GoString() string { - return s.String() -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *LaunchTemplateEbsBlockDeviceRequest) SetDeleteOnTermination(v bool) *LaunchTemplateEbsBlockDeviceRequest { - s.DeleteOnTermination = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *LaunchTemplateEbsBlockDeviceRequest) SetEncrypted(v bool) *LaunchTemplateEbsBlockDeviceRequest { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *LaunchTemplateEbsBlockDeviceRequest) SetIops(v int64) *LaunchTemplateEbsBlockDeviceRequest { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *LaunchTemplateEbsBlockDeviceRequest) SetKmsKeyId(v string) *LaunchTemplateEbsBlockDeviceRequest { - s.KmsKeyId = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *LaunchTemplateEbsBlockDeviceRequest) SetSnapshotId(v string) *LaunchTemplateEbsBlockDeviceRequest { - s.SnapshotId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *LaunchTemplateEbsBlockDeviceRequest) SetVolumeSize(v int64) *LaunchTemplateEbsBlockDeviceRequest { - s.VolumeSize = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *LaunchTemplateEbsBlockDeviceRequest) SetVolumeType(v string) *LaunchTemplateEbsBlockDeviceRequest { - s.VolumeType = &v - return s -} - -// Describes an IAM instance profile. -type LaunchTemplateIamInstanceProfileSpecification struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string `locationName:"arn" type:"string"` - - // The name of the instance profile. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s LaunchTemplateIamInstanceProfileSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateIamInstanceProfileSpecification) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *LaunchTemplateIamInstanceProfileSpecification) SetArn(v string) *LaunchTemplateIamInstanceProfileSpecification { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *LaunchTemplateIamInstanceProfileSpecification) SetName(v string) *LaunchTemplateIamInstanceProfileSpecification { - s.Name = &v - return s -} - -// An IAM instance profile. -type LaunchTemplateIamInstanceProfileSpecificationRequest struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string `type:"string"` - - // The name of the instance profile. - Name *string `type:"string"` -} - -// String returns the string representation -func (s LaunchTemplateIamInstanceProfileSpecificationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateIamInstanceProfileSpecificationRequest) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *LaunchTemplateIamInstanceProfileSpecificationRequest) SetArn(v string) *LaunchTemplateIamInstanceProfileSpecificationRequest { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *LaunchTemplateIamInstanceProfileSpecificationRequest) SetName(v string) *LaunchTemplateIamInstanceProfileSpecificationRequest { - s.Name = &v - return s -} - -// The market (purchasing) option for the instances. -type LaunchTemplateInstanceMarketOptions struct { - _ struct{} `type:"structure"` - - // The market type. - MarketType *string `locationName:"marketType" type:"string" enum:"MarketType"` - - // The options for Spot Instances. - SpotOptions *LaunchTemplateSpotMarketOptions `locationName:"spotOptions" type:"structure"` -} - -// String returns the string representation -func (s LaunchTemplateInstanceMarketOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateInstanceMarketOptions) GoString() string { - return s.String() -} - -// SetMarketType sets the MarketType field's value. -func (s *LaunchTemplateInstanceMarketOptions) SetMarketType(v string) *LaunchTemplateInstanceMarketOptions { - s.MarketType = &v - return s -} - -// SetSpotOptions sets the SpotOptions field's value. -func (s *LaunchTemplateInstanceMarketOptions) SetSpotOptions(v *LaunchTemplateSpotMarketOptions) *LaunchTemplateInstanceMarketOptions { - s.SpotOptions = v - return s -} - -// The market (purchasing) option for the instances. -type LaunchTemplateInstanceMarketOptionsRequest struct { - _ struct{} `type:"structure"` - - // The market type. - MarketType *string `type:"string" enum:"MarketType"` - - // The options for Spot Instances. - SpotOptions *LaunchTemplateSpotMarketOptionsRequest `type:"structure"` -} - -// String returns the string representation -func (s LaunchTemplateInstanceMarketOptionsRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateInstanceMarketOptionsRequest) GoString() string { - return s.String() -} - -// SetMarketType sets the MarketType field's value. -func (s *LaunchTemplateInstanceMarketOptionsRequest) SetMarketType(v string) *LaunchTemplateInstanceMarketOptionsRequest { - s.MarketType = &v - return s -} - -// SetSpotOptions sets the SpotOptions field's value. -func (s *LaunchTemplateInstanceMarketOptionsRequest) SetSpotOptions(v *LaunchTemplateSpotMarketOptionsRequest) *LaunchTemplateInstanceMarketOptionsRequest { - s.SpotOptions = v - return s -} - -// Describes a network interface. -type LaunchTemplateInstanceNetworkInterfaceSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether to associate a public IPv4 address with eth0 for a new - // network interface. - AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"` - - // Indicates whether the network interface is deleted when the instance is terminated. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // A description for the network interface. - Description *string `locationName:"description" type:"string"` - - // The device index for the network interface attachment. - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` - - // The IDs of one or more security groups. - Groups []*string `locationName:"groupSet" locationNameList:"groupId" type:"list"` - - // The number of IPv6 addresses for the network interface. - Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"` - - // The IPv6 addresses for the network interface. - Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6AddressesSet" locationNameList:"item" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The primary private IPv4 address of the network interface. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // One or more private IPv4 addresses. - PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` - - // The number of secondary private IPv4 addresses for the network interface. - SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` - - // The ID of the subnet for the network interface. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s LaunchTemplateInstanceNetworkInterfaceSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateInstanceNetworkInterfaceSpecification) GoString() string { - return s.String() -} - -// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetAssociatePublicIpAddress(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.AssociatePublicIpAddress = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetDeleteOnTermination(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.DeleteOnTermination = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetDescription(v string) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.Description = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetDeviceIndex(v int64) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.DeviceIndex = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetGroups(v []*string) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.Groups = v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetIpv6AddressCount(v int64) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetIpv6Addresses(v []*InstanceIpv6Address) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetNetworkInterfaceId(v string) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetPrivateIpAddress(v string) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetPrivateIpAddresses(v []*PrivateIpAddressSpecification) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.PrivateIpAddresses = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetSecondaryPrivateIpAddressCount(v int64) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetSubnetId(v string) *LaunchTemplateInstanceNetworkInterfaceSpecification { - s.SubnetId = &v - return s -} - -// The parameters for a network interface. -type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct { - _ struct{} `type:"structure"` - - // Associates a public IPv4 address with eth0 for a new network interface. - AssociatePublicIpAddress *bool `type:"boolean"` - - // Indicates whether the network interface is deleted when the instance is terminated. - DeleteOnTermination *bool `type:"boolean"` - - // A description for the network interface. - Description *string `type:"string"` - - // The device index for the network interface attachment. - DeviceIndex *int64 `type:"integer"` - - // The IDs of one or more security groups. - Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // The number of IPv6 addresses to assign to a network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. You can't - // use this option if specifying specific IPv6 addresses. - Ipv6AddressCount *int64 `type:"integer"` - - // One or more specific IPv6 addresses from the IPv6 CIDR block range of your - // subnet. You can't use this option if you're specifying a number of IPv6 addresses. - Ipv6Addresses []*InstanceIpv6AddressRequest `locationNameList:"InstanceIpv6Address" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `type:"string"` - - // The primary private IPv4 address of the network interface. - PrivateIpAddress *string `type:"string"` - - // One or more private IPv4 addresses. - PrivateIpAddresses []*PrivateIpAddressSpecification `locationNameList:"item" type:"list"` - - // The number of secondary private IPv4 addresses to assign to a network interface. - SecondaryPrivateIpAddressCount *int64 `type:"integer"` - - // The ID of the subnet for the network interface. - SubnetId *string `type:"string"` -} - -// String returns the string representation -func (s LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LaunchTemplateInstanceNetworkInterfaceSpecificationRequest"} - if s.PrivateIpAddresses != nil { - for i, v := range s.PrivateIpAddresses { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PrivateIpAddresses", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetAssociatePublicIpAddress(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.AssociatePublicIpAddress = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetDeleteOnTermination(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.DeleteOnTermination = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetDescription(v string) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.Description = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetDeviceIndex(v int64) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.DeviceIndex = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetGroups(v []*string) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.Groups = v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetIpv6AddressCount(v int64) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetIpv6Addresses(v []*InstanceIpv6AddressRequest) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetNetworkInterfaceId(v string) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetPrivateIpAddress(v string) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetPrivateIpAddresses(v []*PrivateIpAddressSpecification) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.PrivateIpAddresses = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetSecondaryPrivateIpAddressCount(v int64) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetSubnetId(v string) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { - s.SubnetId = &v - return s -} - -// Describes overrides for a launch template. -type LaunchTemplateOverrides struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which to launch the instances. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The maximum price per unit hour that you are willing to pay for a Spot Instance. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The ID of the subnet in which to launch the instances. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The number of units provided by the specified instance type. - WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"` -} - -// String returns the string representation -func (s LaunchTemplateOverrides) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateOverrides) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *LaunchTemplateOverrides) SetAvailabilityZone(v string) *LaunchTemplateOverrides { - s.AvailabilityZone = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *LaunchTemplateOverrides) SetInstanceType(v string) *LaunchTemplateOverrides { - s.InstanceType = &v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *LaunchTemplateOverrides) SetSpotPrice(v string) *LaunchTemplateOverrides { - s.SpotPrice = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *LaunchTemplateOverrides) SetSubnetId(v string) *LaunchTemplateOverrides { - s.SubnetId = &v - return s -} - -// SetWeightedCapacity sets the WeightedCapacity field's value. -func (s *LaunchTemplateOverrides) SetWeightedCapacity(v float64) *LaunchTemplateOverrides { - s.WeightedCapacity = &v - return s -} - -// Describes the placement of an instance. -type LaunchTemplatePlacement struct { - _ struct{} `type:"structure"` - - // The affinity setting for the instance on the Dedicated Host. - Affinity *string `locationName:"affinity" type:"string"` - - // The Availability Zone of the instance. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The name of the placement group for the instance. - GroupName *string `locationName:"groupName" type:"string"` - - // The ID of the Dedicated Host for the instance. - HostId *string `locationName:"hostId" type:"string"` - - // Reserved for future use. - SpreadDomain *string `locationName:"spreadDomain" type:"string"` - - // The tenancy of the instance (if the instance is running in a VPC). An instance - // with a tenancy of dedicated runs on single-tenant hardware. - Tenancy *string `locationName:"tenancy" type:"string" enum:"Tenancy"` -} - -// String returns the string representation -func (s LaunchTemplatePlacement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplatePlacement) GoString() string { - return s.String() -} - -// SetAffinity sets the Affinity field's value. -func (s *LaunchTemplatePlacement) SetAffinity(v string) *LaunchTemplatePlacement { - s.Affinity = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *LaunchTemplatePlacement) SetAvailabilityZone(v string) *LaunchTemplatePlacement { - s.AvailabilityZone = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *LaunchTemplatePlacement) SetGroupName(v string) *LaunchTemplatePlacement { - s.GroupName = &v - return s -} - -// SetHostId sets the HostId field's value. -func (s *LaunchTemplatePlacement) SetHostId(v string) *LaunchTemplatePlacement { - s.HostId = &v - return s -} - -// SetSpreadDomain sets the SpreadDomain field's value. -func (s *LaunchTemplatePlacement) SetSpreadDomain(v string) *LaunchTemplatePlacement { - s.SpreadDomain = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *LaunchTemplatePlacement) SetTenancy(v string) *LaunchTemplatePlacement { - s.Tenancy = &v - return s -} - -// The placement for the instance. -type LaunchTemplatePlacementRequest struct { - _ struct{} `type:"structure"` - - // The affinity setting for an instance on a Dedicated Host. - Affinity *string `type:"string"` - - // The Availability Zone for the instance. - AvailabilityZone *string `type:"string"` - - // The name of the placement group for the instance. - GroupName *string `type:"string"` - - // The ID of the Dedicated Host for the instance. - HostId *string `type:"string"` - - // Reserved for future use. - SpreadDomain *string `type:"string"` - - // The tenancy of the instance (if the instance is running in a VPC). An instance - // with a tenancy of dedicated runs on single-tenant hardware. - Tenancy *string `type:"string" enum:"Tenancy"` -} - -// String returns the string representation -func (s LaunchTemplatePlacementRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplatePlacementRequest) GoString() string { - return s.String() -} - -// SetAffinity sets the Affinity field's value. -func (s *LaunchTemplatePlacementRequest) SetAffinity(v string) *LaunchTemplatePlacementRequest { - s.Affinity = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *LaunchTemplatePlacementRequest) SetAvailabilityZone(v string) *LaunchTemplatePlacementRequest { - s.AvailabilityZone = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *LaunchTemplatePlacementRequest) SetGroupName(v string) *LaunchTemplatePlacementRequest { - s.GroupName = &v - return s -} - -// SetHostId sets the HostId field's value. -func (s *LaunchTemplatePlacementRequest) SetHostId(v string) *LaunchTemplatePlacementRequest { - s.HostId = &v - return s -} - -// SetSpreadDomain sets the SpreadDomain field's value. -func (s *LaunchTemplatePlacementRequest) SetSpreadDomain(v string) *LaunchTemplatePlacementRequest { - s.SpreadDomain = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *LaunchTemplatePlacementRequest) SetTenancy(v string) *LaunchTemplatePlacementRequest { - s.Tenancy = &v - return s -} - -// The launch template to use. You must specify either the launch template ID -// or launch template name in the request, but not both. -type LaunchTemplateSpecification struct { - _ struct{} `type:"structure"` - - // The ID of the launch template. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. - LaunchTemplateName *string `type:"string"` - - // The version number of the launch template. - // - // Default: The default version for the launch template. - Version *string `type:"string"` -} - -// String returns the string representation -func (s LaunchTemplateSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateSpecification) GoString() string { - return s.String() -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *LaunchTemplateSpecification) SetLaunchTemplateId(v string) *LaunchTemplateSpecification { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *LaunchTemplateSpecification) SetLaunchTemplateName(v string) *LaunchTemplateSpecification { - s.LaunchTemplateName = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *LaunchTemplateSpecification) SetVersion(v string) *LaunchTemplateSpecification { - s.Version = &v - return s -} - -// The options for Spot Instances. -type LaunchTemplateSpotMarketOptions struct { - _ struct{} `type:"structure"` - - // The required duration for the Spot Instances (also known as Spot blocks), - // in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, - // or 360). - BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"` - - // The behavior when a Spot Instance is interrupted. - InstanceInterruptionBehavior *string `locationName:"instanceInterruptionBehavior" type:"string" enum:"InstanceInterruptionBehavior"` - - // The maximum hourly price you're willing to pay for the Spot Instances. - MaxPrice *string `locationName:"maxPrice" type:"string"` - - // The Spot Instance request type. - SpotInstanceType *string `locationName:"spotInstanceType" type:"string" enum:"SpotInstanceType"` - - // The end date of the request. For a one-time request, the request remains - // active until all instances launch, the request is canceled, or this date - // is reached. If the request is persistent, it remains active until it is canceled - // or this date and time is reached. - ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s LaunchTemplateSpotMarketOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateSpotMarketOptions) GoString() string { - return s.String() -} - -// SetBlockDurationMinutes sets the BlockDurationMinutes field's value. -func (s *LaunchTemplateSpotMarketOptions) SetBlockDurationMinutes(v int64) *LaunchTemplateSpotMarketOptions { - s.BlockDurationMinutes = &v - return s -} - -// SetInstanceInterruptionBehavior sets the InstanceInterruptionBehavior field's value. -func (s *LaunchTemplateSpotMarketOptions) SetInstanceInterruptionBehavior(v string) *LaunchTemplateSpotMarketOptions { - s.InstanceInterruptionBehavior = &v - return s -} - -// SetMaxPrice sets the MaxPrice field's value. -func (s *LaunchTemplateSpotMarketOptions) SetMaxPrice(v string) *LaunchTemplateSpotMarketOptions { - s.MaxPrice = &v - return s -} - -// SetSpotInstanceType sets the SpotInstanceType field's value. -func (s *LaunchTemplateSpotMarketOptions) SetSpotInstanceType(v string) *LaunchTemplateSpotMarketOptions { - s.SpotInstanceType = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *LaunchTemplateSpotMarketOptions) SetValidUntil(v time.Time) *LaunchTemplateSpotMarketOptions { - s.ValidUntil = &v - return s -} - -// The options for Spot Instances. -type LaunchTemplateSpotMarketOptionsRequest struct { - _ struct{} `type:"structure"` - - // The required duration for the Spot Instances (also known as Spot blocks), - // in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, - // or 360). - BlockDurationMinutes *int64 `type:"integer"` - - // The behavior when a Spot Instance is interrupted. The default is terminate. - InstanceInterruptionBehavior *string `type:"string" enum:"InstanceInterruptionBehavior"` - - // The maximum hourly price you're willing to pay for the Spot Instances. - MaxPrice *string `type:"string"` - - // The Spot Instance request type. - SpotInstanceType *string `type:"string" enum:"SpotInstanceType"` - - // The end date of the request. For a one-time request, the request remains - // active until all instances launch, the request is canceled, or this date - // is reached. If the request is persistent, it remains active until it is canceled - // or this date and time is reached. The default end date is 7 days from the - // current date. - ValidUntil *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s LaunchTemplateSpotMarketOptionsRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateSpotMarketOptionsRequest) GoString() string { - return s.String() -} - -// SetBlockDurationMinutes sets the BlockDurationMinutes field's value. -func (s *LaunchTemplateSpotMarketOptionsRequest) SetBlockDurationMinutes(v int64) *LaunchTemplateSpotMarketOptionsRequest { - s.BlockDurationMinutes = &v - return s -} - -// SetInstanceInterruptionBehavior sets the InstanceInterruptionBehavior field's value. -func (s *LaunchTemplateSpotMarketOptionsRequest) SetInstanceInterruptionBehavior(v string) *LaunchTemplateSpotMarketOptionsRequest { - s.InstanceInterruptionBehavior = &v - return s -} - -// SetMaxPrice sets the MaxPrice field's value. -func (s *LaunchTemplateSpotMarketOptionsRequest) SetMaxPrice(v string) *LaunchTemplateSpotMarketOptionsRequest { - s.MaxPrice = &v - return s -} - -// SetSpotInstanceType sets the SpotInstanceType field's value. -func (s *LaunchTemplateSpotMarketOptionsRequest) SetSpotInstanceType(v string) *LaunchTemplateSpotMarketOptionsRequest { - s.SpotInstanceType = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *LaunchTemplateSpotMarketOptionsRequest) SetValidUntil(v time.Time) *LaunchTemplateSpotMarketOptionsRequest { - s.ValidUntil = &v - return s -} - -// The tag specification for the launch template. -type LaunchTemplateTagSpecification struct { - _ struct{} `type:"structure"` - - // The type of resource. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The tags for the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s LaunchTemplateTagSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateTagSpecification) GoString() string { - return s.String() -} - -// SetResourceType sets the ResourceType field's value. -func (s *LaunchTemplateTagSpecification) SetResourceType(v string) *LaunchTemplateTagSpecification { - s.ResourceType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *LaunchTemplateTagSpecification) SetTags(v []*Tag) *LaunchTemplateTagSpecification { - s.Tags = v - return s -} - -// The tags specification for the launch template. -type LaunchTemplateTagSpecificationRequest struct { - _ struct{} `type:"structure"` - - // The type of resource to tag. Currently, the resource types that support tagging - // on creation are instance and volume. - ResourceType *string `type:"string" enum:"ResourceType"` - - // The tags to apply to the resource. - Tags []*Tag `locationName:"Tag" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s LaunchTemplateTagSpecificationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateTagSpecificationRequest) GoString() string { - return s.String() -} - -// SetResourceType sets the ResourceType field's value. -func (s *LaunchTemplateTagSpecificationRequest) SetResourceType(v string) *LaunchTemplateTagSpecificationRequest { - s.ResourceType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *LaunchTemplateTagSpecificationRequest) SetTags(v []*Tag) *LaunchTemplateTagSpecificationRequest { - s.Tags = v - return s -} - -// Describes a launch template version. -type LaunchTemplateVersion struct { - _ struct{} `type:"structure"` - - // The time the version was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // The principal that created the version. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // Indicates whether the version is the default version. - DefaultVersion *bool `locationName:"defaultVersion" type:"boolean"` - - // Information about the launch template. - LaunchTemplateData *ResponseLaunchTemplateData `locationName:"launchTemplateData" type:"structure"` - - // The ID of the launch template. - LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` - - // The name of the launch template. - LaunchTemplateName *string `locationName:"launchTemplateName" min:"3" type:"string"` - - // The description for the version. - VersionDescription *string `locationName:"versionDescription" type:"string"` - - // The version number. - VersionNumber *int64 `locationName:"versionNumber" type:"long"` -} - -// String returns the string representation -func (s LaunchTemplateVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplateVersion) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *LaunchTemplateVersion) SetCreateTime(v time.Time) *LaunchTemplateVersion { - s.CreateTime = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *LaunchTemplateVersion) SetCreatedBy(v string) *LaunchTemplateVersion { - s.CreatedBy = &v - return s -} - -// SetDefaultVersion sets the DefaultVersion field's value. -func (s *LaunchTemplateVersion) SetDefaultVersion(v bool) *LaunchTemplateVersion { - s.DefaultVersion = &v - return s -} - -// SetLaunchTemplateData sets the LaunchTemplateData field's value. -func (s *LaunchTemplateVersion) SetLaunchTemplateData(v *ResponseLaunchTemplateData) *LaunchTemplateVersion { - s.LaunchTemplateData = v - return s -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *LaunchTemplateVersion) SetLaunchTemplateId(v string) *LaunchTemplateVersion { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *LaunchTemplateVersion) SetLaunchTemplateName(v string) *LaunchTemplateVersion { - s.LaunchTemplateName = &v - return s -} - -// SetVersionDescription sets the VersionDescription field's value. -func (s *LaunchTemplateVersion) SetVersionDescription(v string) *LaunchTemplateVersion { - s.VersionDescription = &v - return s -} - -// SetVersionNumber sets the VersionNumber field's value. -func (s *LaunchTemplateVersion) SetVersionNumber(v int64) *LaunchTemplateVersion { - s.VersionNumber = &v - return s -} - -// Describes the monitoring for the instance. -type LaunchTemplatesMonitoring struct { - _ struct{} `type:"structure"` - - // Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring - // is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` -} - -// String returns the string representation -func (s LaunchTemplatesMonitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplatesMonitoring) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *LaunchTemplatesMonitoring) SetEnabled(v bool) *LaunchTemplatesMonitoring { - s.Enabled = &v - return s -} - -// Describes the monitoring for the instance. -type LaunchTemplatesMonitoringRequest struct { - _ struct{} `type:"structure"` - - // Specify true to enable detailed monitoring. Otherwise, basic monitoring is - // enabled. - Enabled *bool `type:"boolean"` -} - -// String returns the string representation -func (s LaunchTemplatesMonitoringRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchTemplatesMonitoringRequest) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *LaunchTemplatesMonitoringRequest) SetEnabled(v bool) *LaunchTemplatesMonitoringRequest { - s.Enabled = &v - return s -} - -// Describes the Classic Load Balancers and target groups to attach to a Spot -// Fleet request. -type LoadBalancersConfig struct { - _ struct{} `type:"structure"` - - // The Classic Load Balancers. - ClassicLoadBalancersConfig *ClassicLoadBalancersConfig `locationName:"classicLoadBalancersConfig" type:"structure"` - - // The target groups. - TargetGroupsConfig *TargetGroupsConfig `locationName:"targetGroupsConfig" type:"structure"` -} - -// String returns the string representation -func (s LoadBalancersConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancersConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LoadBalancersConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LoadBalancersConfig"} - if s.ClassicLoadBalancersConfig != nil { - if err := s.ClassicLoadBalancersConfig.Validate(); err != nil { - invalidParams.AddNested("ClassicLoadBalancersConfig", err.(request.ErrInvalidParams)) - } - } - if s.TargetGroupsConfig != nil { - if err := s.TargetGroupsConfig.Validate(); err != nil { - invalidParams.AddNested("TargetGroupsConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClassicLoadBalancersConfig sets the ClassicLoadBalancersConfig field's value. -func (s *LoadBalancersConfig) SetClassicLoadBalancersConfig(v *ClassicLoadBalancersConfig) *LoadBalancersConfig { - s.ClassicLoadBalancersConfig = v - return s -} - -// SetTargetGroupsConfig sets the TargetGroupsConfig field's value. -func (s *LoadBalancersConfig) SetTargetGroupsConfig(v *TargetGroupsConfig) *LoadBalancersConfig { - s.TargetGroupsConfig = v - return s -} - -// Describes a load permission. -type LoadPermission struct { - _ struct{} `type:"structure"` - - // The name of the group. - Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` - - // The AWS account ID. - UserId *string `locationName:"userId" type:"string"` -} - -// String returns the string representation -func (s LoadPermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadPermission) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *LoadPermission) SetGroup(v string) *LoadPermission { - s.Group = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *LoadPermission) SetUserId(v string) *LoadPermission { - s.UserId = &v - return s -} - -// Describes modifications to the load permissions of an Amazon FPGA image (AFI). -type LoadPermissionModifications struct { - _ struct{} `type:"structure"` - - // The load permissions to add. - Add []*LoadPermissionRequest `locationNameList:"item" type:"list"` - - // The load permissions to remove. - Remove []*LoadPermissionRequest `locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s LoadPermissionModifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadPermissionModifications) GoString() string { - return s.String() -} - -// SetAdd sets the Add field's value. -func (s *LoadPermissionModifications) SetAdd(v []*LoadPermissionRequest) *LoadPermissionModifications { - s.Add = v - return s -} - -// SetRemove sets the Remove field's value. -func (s *LoadPermissionModifications) SetRemove(v []*LoadPermissionRequest) *LoadPermissionModifications { - s.Remove = v - return s -} - -// Describes a load permission. -type LoadPermissionRequest struct { - _ struct{} `type:"structure"` - - // The name of the group. - Group *string `type:"string" enum:"PermissionGroup"` - - // The AWS account ID. - UserId *string `type:"string"` -} - -// String returns the string representation -func (s LoadPermissionRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadPermissionRequest) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *LoadPermissionRequest) SetGroup(v string) *LoadPermissionRequest { - s.Group = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *LoadPermissionRequest) SetUserId(v string) *LoadPermissionRequest { - s.UserId = &v - return s -} - -type ModifyFleetInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // Indicates whether running instances should be terminated if the total target - // capacity of the EC2 Fleet is decreased below the current size of the EC2 - // Fleet. - ExcessCapacityTerminationPolicy *string `type:"string" enum:"FleetExcessCapacityTerminationPolicy"` - - // The ID of the EC2 Fleet. - // - // FleetId is a required field - FleetId *string `type:"string" required:"true"` - - // The size of the EC2 Fleet. - // - // TargetCapacitySpecification is a required field - TargetCapacitySpecification *TargetCapacitySpecificationRequest `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ModifyFleetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyFleetInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.TargetCapacitySpecification == nil { - invalidParams.Add(request.NewErrParamRequired("TargetCapacitySpecification")) - } - if s.TargetCapacitySpecification != nil { - if err := s.TargetCapacitySpecification.Validate(); err != nil { - invalidParams.AddNested("TargetCapacitySpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyFleetInput) SetDryRun(v bool) *ModifyFleetInput { - s.DryRun = &v - return s -} - -// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. -func (s *ModifyFleetInput) SetExcessCapacityTerminationPolicy(v string) *ModifyFleetInput { - s.ExcessCapacityTerminationPolicy = &v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *ModifyFleetInput) SetFleetId(v string) *ModifyFleetInput { - s.FleetId = &v - return s -} - -// SetTargetCapacitySpecification sets the TargetCapacitySpecification field's value. -func (s *ModifyFleetInput) SetTargetCapacitySpecification(v *TargetCapacitySpecificationRequest) *ModifyFleetInput { - s.TargetCapacitySpecification = v - return s -} - -type ModifyFleetOutput struct { - _ struct{} `type:"structure"` - - // Is true if the request succeeds, and an error otherwise. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyFleetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyFleetOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ModifyFleetOutput) SetReturn(v bool) *ModifyFleetOutput { - s.Return = &v - return s -} - -type ModifyFpgaImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - Attribute *string `type:"string" enum:"FpgaImageAttributeName"` - - // A description for the AFI. - Description *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the AFI. - // - // FpgaImageId is a required field - FpgaImageId *string `type:"string" required:"true"` - - // The load permission for the AFI. - LoadPermission *LoadPermissionModifications `type:"structure"` - - // A name for the AFI. - Name *string `type:"string"` - - // The operation type. - OperationType *string `type:"string" enum:"OperationType"` - - // One or more product codes. After you add a product code to an AFI, it can't - // be removed. This parameter is valid only when modifying the productCodes - // attribute. - ProductCodes []*string `locationName:"ProductCode" locationNameList:"ProductCode" type:"list"` - - // One or more user groups. This parameter is valid only when modifying the - // loadPermission attribute. - UserGroups []*string `locationName:"UserGroup" locationNameList:"UserGroup" type:"list"` - - // One or more AWS account IDs. This parameter is valid only when modifying - // the loadPermission attribute. - UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` -} - -// String returns the string representation -func (s ModifyFpgaImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyFpgaImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyFpgaImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyFpgaImageAttributeInput"} - if s.FpgaImageId == nil { - invalidParams.Add(request.NewErrParamRequired("FpgaImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ModifyFpgaImageAttributeInput) SetAttribute(v string) *ModifyFpgaImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModifyFpgaImageAttributeInput) SetDescription(v string) *ModifyFpgaImageAttributeInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyFpgaImageAttributeInput) SetDryRun(v bool) *ModifyFpgaImageAttributeInput { - s.DryRun = &v - return s -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *ModifyFpgaImageAttributeInput) SetFpgaImageId(v string) *ModifyFpgaImageAttributeInput { - s.FpgaImageId = &v - return s -} - -// SetLoadPermission sets the LoadPermission field's value. -func (s *ModifyFpgaImageAttributeInput) SetLoadPermission(v *LoadPermissionModifications) *ModifyFpgaImageAttributeInput { - s.LoadPermission = v - return s -} - -// SetName sets the Name field's value. -func (s *ModifyFpgaImageAttributeInput) SetName(v string) *ModifyFpgaImageAttributeInput { - s.Name = &v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *ModifyFpgaImageAttributeInput) SetOperationType(v string) *ModifyFpgaImageAttributeInput { - s.OperationType = &v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *ModifyFpgaImageAttributeInput) SetProductCodes(v []*string) *ModifyFpgaImageAttributeInput { - s.ProductCodes = v - return s -} - -// SetUserGroups sets the UserGroups field's value. -func (s *ModifyFpgaImageAttributeInput) SetUserGroups(v []*string) *ModifyFpgaImageAttributeInput { - s.UserGroups = v - return s -} - -// SetUserIds sets the UserIds field's value. -func (s *ModifyFpgaImageAttributeInput) SetUserIds(v []*string) *ModifyFpgaImageAttributeInput { - s.UserIds = v - return s -} - -type ModifyFpgaImageAttributeOutput struct { - _ struct{} `type:"structure"` - - // Information about the attribute. - FpgaImageAttribute *FpgaImageAttribute `locationName:"fpgaImageAttribute" type:"structure"` -} - -// String returns the string representation -func (s ModifyFpgaImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyFpgaImageAttributeOutput) GoString() string { - return s.String() -} - -// SetFpgaImageAttribute sets the FpgaImageAttribute field's value. -func (s *ModifyFpgaImageAttributeOutput) SetFpgaImageAttribute(v *FpgaImageAttribute) *ModifyFpgaImageAttributeOutput { - s.FpgaImageAttribute = v - return s -} - -// Contains the parameters for ModifyHosts. -type ModifyHostsInput struct { - _ struct{} `type:"structure"` - - // Specify whether to enable or disable auto-placement. - // - // AutoPlacement is a required field - AutoPlacement *string `locationName:"autoPlacement" type:"string" required:"true" enum:"AutoPlacement"` - - // The host IDs of the Dedicated Hosts you want to modify. - // - // HostIds is a required field - HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyHostsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyHostsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyHostsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyHostsInput"} - if s.AutoPlacement == nil { - invalidParams.Add(request.NewErrParamRequired("AutoPlacement")) - } - if s.HostIds == nil { - invalidParams.Add(request.NewErrParamRequired("HostIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoPlacement sets the AutoPlacement field's value. -func (s *ModifyHostsInput) SetAutoPlacement(v string) *ModifyHostsInput { - s.AutoPlacement = &v - return s -} - -// SetHostIds sets the HostIds field's value. -func (s *ModifyHostsInput) SetHostIds(v []*string) *ModifyHostsInput { - s.HostIds = v - return s -} - -// Contains the output of ModifyHosts. -type ModifyHostsOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the Dedicated Hosts that were successfully modified. - Successful []*string `locationName:"successful" locationNameList:"item" type:"list"` - - // The IDs of the Dedicated Hosts that could not be modified. Check whether - // the setting you requested can be used. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ModifyHostsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyHostsOutput) GoString() string { - return s.String() -} - -// SetSuccessful sets the Successful field's value. -func (s *ModifyHostsOutput) SetSuccessful(v []*string) *ModifyHostsOutput { - s.Successful = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *ModifyHostsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *ModifyHostsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters of ModifyIdFormat. -type ModifyIdFormatInput struct { - _ struct{} `type:"structure"` - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log - // | image | import-task | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | route-table - // | route-table-association | security-group | subnet | subnet-cidr-block-association - // | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection - // | vpn-connection | vpn-gateway. - // - // Alternatively, use the all-current option to include all resource types that - // are currently within their opt-in period for longer IDs. - // - // Resource is a required field - Resource *string `type:"string" required:"true"` - - // Indicate whether the resource should use longer IDs (17-character IDs). - // - // UseLongIds is a required field - UseLongIds *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s ModifyIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyIdFormatInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyIdFormatInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyIdFormatInput"} - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - if s.UseLongIds == nil { - invalidParams.Add(request.NewErrParamRequired("UseLongIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResource sets the Resource field's value. -func (s *ModifyIdFormatInput) SetResource(v string) *ModifyIdFormatInput { - s.Resource = &v - return s -} - -// SetUseLongIds sets the UseLongIds field's value. -func (s *ModifyIdFormatInput) SetUseLongIds(v bool) *ModifyIdFormatInput { - s.UseLongIds = &v - return s -} - -type ModifyIdFormatOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyIdFormatOutput) GoString() string { - return s.String() -} - -// Contains the parameters of ModifyIdentityIdFormat. -type ModifyIdentityIdFormatInput struct { - _ struct{} `type:"structure"` - - // The ARN of the principal, which can be an IAM user, IAM role, or the root - // user. Specify all to modify the ID format for all IAM users, IAM roles, and - // the root user of the account. - // - // PrincipalArn is a required field - PrincipalArn *string `locationName:"principalArn" type:"string" required:"true"` - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log - // | image | import-task | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | route-table - // | route-table-association | security-group | subnet | subnet-cidr-block-association - // | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection - // | vpn-connection | vpn-gateway. - // - // Alternatively, use the all-current option to include all resource types that - // are currently within their opt-in period for longer IDs. - // - // Resource is a required field - Resource *string `locationName:"resource" type:"string" required:"true"` - - // Indicates whether the resource should use longer IDs (17-character IDs) - // - // UseLongIds is a required field - UseLongIds *bool `locationName:"useLongIds" type:"boolean" required:"true"` -} - -// String returns the string representation -func (s ModifyIdentityIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyIdentityIdFormatInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyIdentityIdFormatInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyIdentityIdFormatInput"} - if s.PrincipalArn == nil { - invalidParams.Add(request.NewErrParamRequired("PrincipalArn")) - } - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - if s.UseLongIds == nil { - invalidParams.Add(request.NewErrParamRequired("UseLongIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrincipalArn sets the PrincipalArn field's value. -func (s *ModifyIdentityIdFormatInput) SetPrincipalArn(v string) *ModifyIdentityIdFormatInput { - s.PrincipalArn = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *ModifyIdentityIdFormatInput) SetResource(v string) *ModifyIdentityIdFormatInput { - s.Resource = &v - return s -} - -// SetUseLongIds sets the UseLongIds field's value. -func (s *ModifyIdentityIdFormatInput) SetUseLongIds(v bool) *ModifyIdentityIdFormatInput { - s.UseLongIds = &v - return s -} - -type ModifyIdentityIdFormatOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyIdentityIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyIdentityIdFormatOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyImageAttribute. -type ModifyImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute to modify. The valid values are description, launchPermission, - // and productCodes. - Attribute *string `type:"string"` - - // A new description for the AMI. - Description *AttributeValue `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the AMI. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` - - // A new launch permission for the AMI. - LaunchPermission *LaunchPermissionModifications `type:"structure"` - - // The operation type. This parameter can be used only when the Attribute parameter - // is launchPermission. - OperationType *string `type:"string" enum:"OperationType"` - - // One or more DevPay product codes. After you add a product code to an AMI, - // it can't be removed. - ProductCodes []*string `locationName:"ProductCode" locationNameList:"ProductCode" type:"list"` - - // One or more user groups. This parameter can be used only when the Attribute - // parameter is launchPermission. - UserGroups []*string `locationName:"UserGroup" locationNameList:"UserGroup" type:"list"` - - // One or more AWS account IDs. This parameter can be used only when the Attribute - // parameter is launchPermission. - UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` - - // The value of the attribute being modified. This parameter can be used only - // when the Attribute parameter is description or productCodes. - Value *string `type:"string"` -} - -// String returns the string representation -func (s ModifyImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyImageAttributeInput"} - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ModifyImageAttributeInput) SetAttribute(v string) *ModifyImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModifyImageAttributeInput) SetDescription(v *AttributeValue) *ModifyImageAttributeInput { - s.Description = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyImageAttributeInput) SetDryRun(v bool) *ModifyImageAttributeInput { - s.DryRun = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ModifyImageAttributeInput) SetImageId(v string) *ModifyImageAttributeInput { - s.ImageId = &v - return s -} - -// SetLaunchPermission sets the LaunchPermission field's value. -func (s *ModifyImageAttributeInput) SetLaunchPermission(v *LaunchPermissionModifications) *ModifyImageAttributeInput { - s.LaunchPermission = v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *ModifyImageAttributeInput) SetOperationType(v string) *ModifyImageAttributeInput { - s.OperationType = &v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *ModifyImageAttributeInput) SetProductCodes(v []*string) *ModifyImageAttributeInput { - s.ProductCodes = v - return s -} - -// SetUserGroups sets the UserGroups field's value. -func (s *ModifyImageAttributeInput) SetUserGroups(v []*string) *ModifyImageAttributeInput { - s.UserGroups = v - return s -} - -// SetUserIds sets the UserIds field's value. -func (s *ModifyImageAttributeInput) SetUserIds(v []*string) *ModifyImageAttributeInput { - s.UserIds = v - return s -} - -// SetValue sets the Value field's value. -func (s *ModifyImageAttributeInput) SetValue(v string) *ModifyImageAttributeInput { - s.Value = &v - return s -} - -type ModifyImageAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyImageAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyInstanceAttribute. -type ModifyInstanceAttributeInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - Attribute *string `locationName:"attribute" type:"string" enum:"InstanceAttributeName"` - - // Modifies the DeleteOnTermination attribute for volumes that are currently - // attached. The volume must be owned by the caller. If no value is specified - // for DeleteOnTermination, the default is true and the volume is deleted when - // the instance is terminated. - // - // To add instance store volumes to an Amazon EBS-backed instance, you must - // add them when you launch the instance. For more information, see Updating - // the Block Device Mapping when Launching an Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM) - // in the Amazon Elastic Compute Cloud User Guide. - BlockDeviceMappings []*InstanceBlockDeviceMappingSpecification `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // If the value is true, you can't terminate the instance using the Amazon EC2 - // console, CLI, or API; otherwise, you can. You cannot use this parameter for - // Spot Instances. - DisableApiTermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether the instance is optimized for Amazon EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` - - // Set to true to enable enhanced networking with ENA for the instance. - // - // This option is supported only for HVM instances. Specifying this option with - // a PV instance can make it unreachable. - EnaSupport *AttributeBooleanValue `locationName:"enaSupport" type:"structure"` - - // [EC2-VPC] Changes the security groups of the instance. You must specify at - // least one security group, even if it's just the default security group for - // the VPC. You must specify the security group ID, not the security group name. - Groups []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // Specifies whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *AttributeValue `locationName:"instanceInitiatedShutdownBehavior" type:"structure"` - - // Changes the instance type to the specified value. For more information, see - // Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). - // If the instance type is not valid, the error returned is InvalidInstanceAttributeValue. - InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` - - // Changes the instance's kernel to the specified value. We recommend that you - // use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html). - Kernel *AttributeValue `locationName:"kernel" type:"structure"` - - // Changes the instance's RAM disk to the specified value. We recommend that - // you use PV-GRUB instead of kernels and RAM disks. For more information, see - // PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html). - Ramdisk *AttributeValue `locationName:"ramdisk" type:"structure"` - - // Specifies whether source/destination checking is enabled. A value of true - // means that checking is enabled, and false means that checking is disabled. - // This value must be false for a NAT instance to perform NAT. - SourceDestCheck *AttributeBooleanValue `type:"structure"` - - // Set to simple to enable enhanced networking with the Intel 82599 Virtual - // Function interface for the instance. - // - // There is no way to disable enhanced networking with the Intel 82599 Virtual - // Function interface at this time. - // - // This option is supported only for HVM instances. Specifying this option with - // a PV instance can make it unreachable. - SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` - - // Changes the instance's user data to the specified value. If you are using - // an AWS SDK or command line tool, base64-encoding is performed for you, and - // you can load the text from a file. Otherwise, you must provide base64-encoded - // text. - UserData *BlobAttributeValue `locationName:"userData" type:"structure"` - - // A new value for the attribute. Use only with the kernel, ramdisk, userData, - // disableApiTermination, or instanceInitiatedShutdownBehavior attribute. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s ModifyInstanceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyInstanceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceAttributeInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ModifyInstanceAttributeInput) SetAttribute(v string) *ModifyInstanceAttributeInput { - s.Attribute = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *ModifyInstanceAttributeInput) SetBlockDeviceMappings(v []*InstanceBlockDeviceMappingSpecification) *ModifyInstanceAttributeInput { - s.BlockDeviceMappings = v - return s -} - -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *ModifyInstanceAttributeInput) SetDisableApiTermination(v *AttributeBooleanValue) *ModifyInstanceAttributeInput { - s.DisableApiTermination = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyInstanceAttributeInput) SetDryRun(v bool) *ModifyInstanceAttributeInput { - s.DryRun = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *ModifyInstanceAttributeInput) SetEbsOptimized(v *AttributeBooleanValue) *ModifyInstanceAttributeInput { - s.EbsOptimized = v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *ModifyInstanceAttributeInput) SetEnaSupport(v *AttributeBooleanValue) *ModifyInstanceAttributeInput { - s.EnaSupport = v - return s -} - -// SetGroups sets the Groups field's value. -func (s *ModifyInstanceAttributeInput) SetGroups(v []*string) *ModifyInstanceAttributeInput { - s.Groups = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ModifyInstanceAttributeInput) SetInstanceId(v string) *ModifyInstanceAttributeInput { - s.InstanceId = &v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *ModifyInstanceAttributeInput) SetInstanceInitiatedShutdownBehavior(v *AttributeValue) *ModifyInstanceAttributeInput { - s.InstanceInitiatedShutdownBehavior = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ModifyInstanceAttributeInput) SetInstanceType(v *AttributeValue) *ModifyInstanceAttributeInput { - s.InstanceType = v - return s -} - -// SetKernel sets the Kernel field's value. -func (s *ModifyInstanceAttributeInput) SetKernel(v *AttributeValue) *ModifyInstanceAttributeInput { - s.Kernel = v - return s -} - -// SetRamdisk sets the Ramdisk field's value. -func (s *ModifyInstanceAttributeInput) SetRamdisk(v *AttributeValue) *ModifyInstanceAttributeInput { - s.Ramdisk = v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *ModifyInstanceAttributeInput) SetSourceDestCheck(v *AttributeBooleanValue) *ModifyInstanceAttributeInput { - s.SourceDestCheck = v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *ModifyInstanceAttributeInput) SetSriovNetSupport(v *AttributeValue) *ModifyInstanceAttributeInput { - s.SriovNetSupport = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ModifyInstanceAttributeInput) SetUserData(v *BlobAttributeValue) *ModifyInstanceAttributeInput { - s.UserData = v - return s -} - -// SetValue sets the Value field's value. -func (s *ModifyInstanceAttributeInput) SetValue(v string) *ModifyInstanceAttributeInput { - s.Value = &v - return s -} - -type ModifyInstanceAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyInstanceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceAttributeOutput) GoString() string { - return s.String() -} - -type ModifyInstanceCreditSpecificationInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive token that you provide to ensure idempotency of - // your modification request. For more information, see Ensuring Idempotency - // (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // Information about the credit option for CPU usage. - // - // InstanceCreditSpecifications is a required field - InstanceCreditSpecifications []*InstanceCreditSpecificationRequest `locationName:"InstanceCreditSpecification" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyInstanceCreditSpecificationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceCreditSpecificationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyInstanceCreditSpecificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceCreditSpecificationInput"} - if s.InstanceCreditSpecifications == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCreditSpecifications")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *ModifyInstanceCreditSpecificationInput) SetClientToken(v string) *ModifyInstanceCreditSpecificationInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyInstanceCreditSpecificationInput) SetDryRun(v bool) *ModifyInstanceCreditSpecificationInput { - s.DryRun = &v - return s -} - -// SetInstanceCreditSpecifications sets the InstanceCreditSpecifications field's value. -func (s *ModifyInstanceCreditSpecificationInput) SetInstanceCreditSpecifications(v []*InstanceCreditSpecificationRequest) *ModifyInstanceCreditSpecificationInput { - s.InstanceCreditSpecifications = v - return s -} - -type ModifyInstanceCreditSpecificationOutput struct { - _ struct{} `type:"structure"` - - // Information about the instances whose credit option for CPU usage was successfully - // modified. - SuccessfulInstanceCreditSpecifications []*SuccessfulInstanceCreditSpecificationItem `locationName:"successfulInstanceCreditSpecificationSet" locationNameList:"item" type:"list"` - - // Information about the instances whose credit option for CPU usage was not - // modified. - UnsuccessfulInstanceCreditSpecifications []*UnsuccessfulInstanceCreditSpecificationItem `locationName:"unsuccessfulInstanceCreditSpecificationSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ModifyInstanceCreditSpecificationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceCreditSpecificationOutput) GoString() string { - return s.String() -} - -// SetSuccessfulInstanceCreditSpecifications sets the SuccessfulInstanceCreditSpecifications field's value. -func (s *ModifyInstanceCreditSpecificationOutput) SetSuccessfulInstanceCreditSpecifications(v []*SuccessfulInstanceCreditSpecificationItem) *ModifyInstanceCreditSpecificationOutput { - s.SuccessfulInstanceCreditSpecifications = v - return s -} - -// SetUnsuccessfulInstanceCreditSpecifications sets the UnsuccessfulInstanceCreditSpecifications field's value. -func (s *ModifyInstanceCreditSpecificationOutput) SetUnsuccessfulInstanceCreditSpecifications(v []*UnsuccessfulInstanceCreditSpecificationItem) *ModifyInstanceCreditSpecificationOutput { - s.UnsuccessfulInstanceCreditSpecifications = v - return s -} - -// Contains the parameters for ModifyInstancePlacement. -type ModifyInstancePlacementInput struct { - _ struct{} `type:"structure"` - - // The affinity setting for the instance. - Affinity *string `locationName:"affinity" type:"string" enum:"Affinity"` - - // The name of the placement group in which to place the instance. For spread - // placement groups, the instance must have a tenancy of default. For cluster - // placement groups, the instance must have a tenancy of default or dedicated. - // - // To remove an instance from a placement group, specify an empty string (""). - GroupName *string `type:"string"` - - // The ID of the Dedicated Host with which to associate the instance. - HostId *string `locationName:"hostId" type:"string"` - - // The ID of the instance that you are modifying. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The tenancy for the instance. - Tenancy *string `locationName:"tenancy" type:"string" enum:"HostTenancy"` -} - -// String returns the string representation -func (s ModifyInstancePlacementInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstancePlacementInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyInstancePlacementInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyInstancePlacementInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAffinity sets the Affinity field's value. -func (s *ModifyInstancePlacementInput) SetAffinity(v string) *ModifyInstancePlacementInput { - s.Affinity = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *ModifyInstancePlacementInput) SetGroupName(v string) *ModifyInstancePlacementInput { - s.GroupName = &v - return s -} - -// SetHostId sets the HostId field's value. -func (s *ModifyInstancePlacementInput) SetHostId(v string) *ModifyInstancePlacementInput { - s.HostId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ModifyInstancePlacementInput) SetInstanceId(v string) *ModifyInstancePlacementInput { - s.InstanceId = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *ModifyInstancePlacementInput) SetTenancy(v string) *ModifyInstancePlacementInput { - s.Tenancy = &v - return s -} - -// Contains the output of ModifyInstancePlacement. -type ModifyInstancePlacementOutput struct { - _ struct{} `type:"structure"` - - // Is true if the request succeeds, and an error otherwise. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyInstancePlacementOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstancePlacementOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ModifyInstancePlacementOutput) SetReturn(v bool) *ModifyInstancePlacementOutput { - s.Return = &v - return s -} - -type ModifyLaunchTemplateInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // The version number of the launch template to set as the default version. - DefaultVersion *string `locationName:"SetDefaultVersion" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` -} - -// String returns the string representation -func (s ModifyLaunchTemplateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyLaunchTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyLaunchTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyLaunchTemplateInput"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *ModifyLaunchTemplateInput) SetClientToken(v string) *ModifyLaunchTemplateInput { - s.ClientToken = &v - return s -} - -// SetDefaultVersion sets the DefaultVersion field's value. -func (s *ModifyLaunchTemplateInput) SetDefaultVersion(v string) *ModifyLaunchTemplateInput { - s.DefaultVersion = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyLaunchTemplateInput) SetDryRun(v bool) *ModifyLaunchTemplateInput { - s.DryRun = &v - return s -} - -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *ModifyLaunchTemplateInput) SetLaunchTemplateId(v string) *ModifyLaunchTemplateInput { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *ModifyLaunchTemplateInput) SetLaunchTemplateName(v string) *ModifyLaunchTemplateInput { - s.LaunchTemplateName = &v - return s -} - -type ModifyLaunchTemplateOutput struct { - _ struct{} `type:"structure"` - - // Information about the launch template. - LaunchTemplate *LaunchTemplate `locationName:"launchTemplate" type:"structure"` -} - -// String returns the string representation -func (s ModifyLaunchTemplateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyLaunchTemplateOutput) GoString() string { - return s.String() -} - -// SetLaunchTemplate sets the LaunchTemplate field's value. -func (s *ModifyLaunchTemplateOutput) SetLaunchTemplate(v *LaunchTemplate) *ModifyLaunchTemplateOutput { - s.LaunchTemplate = v - return s -} - -// Contains the parameters for ModifyNetworkInterfaceAttribute. -type ModifyNetworkInterfaceAttributeInput struct { - _ struct{} `type:"structure"` - - // Information about the interface attachment. If modifying the 'delete on termination' - // attribute, you must specify the ID of the interface attachment. - Attachment *NetworkInterfaceAttachmentChanges `locationName:"attachment" type:"structure"` - - // A description for the network interface. - Description *AttributeValue `locationName:"description" type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Changes the security groups for the network interface. The new set of groups - // you specify replaces the current set. You must specify at least one group, - // even if it's just the default security group in the VPC. You must specify - // the ID of the security group, not the name. - Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - - // Indicates whether source/destination checking is enabled. A value of true - // means checking is enabled, and false means checking is disabled. This value - // must be false for a NAT instance to perform NAT. For more information, see - // NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) - // in the Amazon Virtual Private Cloud User Guide. - SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` -} - -// String returns the string representation -func (s ModifyNetworkInterfaceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyNetworkInterfaceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyNetworkInterfaceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyNetworkInterfaceAttributeInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttachment sets the Attachment field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetAttachment(v *NetworkInterfaceAttachmentChanges) *ModifyNetworkInterfaceAttributeInput { - s.Attachment = v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetDescription(v *AttributeValue) *ModifyNetworkInterfaceAttributeInput { - s.Description = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetDryRun(v bool) *ModifyNetworkInterfaceAttributeInput { - s.DryRun = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetGroups(v []*string) *ModifyNetworkInterfaceAttributeInput { - s.Groups = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetNetworkInterfaceId(v string) *ModifyNetworkInterfaceAttributeInput { - s.NetworkInterfaceId = &v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetSourceDestCheck(v *AttributeBooleanValue) *ModifyNetworkInterfaceAttributeInput { - s.SourceDestCheck = v - return s -} - -type ModifyNetworkInterfaceAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyNetworkInterfaceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyNetworkInterfaceAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyReservedInstances. -type ModifyReservedInstancesInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive token you provide to ensure idempotency of your - // modification request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // The IDs of the Reserved Instances to modify. - // - // ReservedInstancesIds is a required field - ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list" required:"true"` - - // The configuration settings for the Reserved Instances to modify. - // - // TargetConfigurations is a required field - TargetConfigurations []*ReservedInstancesConfiguration `locationName:"ReservedInstancesConfigurationSetItemType" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyReservedInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReservedInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyReservedInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyReservedInstancesInput"} - if s.ReservedInstancesIds == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesIds")) - } - if s.TargetConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("TargetConfigurations")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *ModifyReservedInstancesInput) SetClientToken(v string) *ModifyReservedInstancesInput { - s.ClientToken = &v - return s -} - -// SetReservedInstancesIds sets the ReservedInstancesIds field's value. -func (s *ModifyReservedInstancesInput) SetReservedInstancesIds(v []*string) *ModifyReservedInstancesInput { - s.ReservedInstancesIds = v - return s -} - -// SetTargetConfigurations sets the TargetConfigurations field's value. -func (s *ModifyReservedInstancesInput) SetTargetConfigurations(v []*ReservedInstancesConfiguration) *ModifyReservedInstancesInput { - s.TargetConfigurations = v - return s -} - -// Contains the output of ModifyReservedInstances. -type ModifyReservedInstancesOutput struct { - _ struct{} `type:"structure"` - - // The ID for the modification. - ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` -} - -// String returns the string representation -func (s ModifyReservedInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReservedInstancesOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesModificationId sets the ReservedInstancesModificationId field's value. -func (s *ModifyReservedInstancesOutput) SetReservedInstancesModificationId(v string) *ModifyReservedInstancesOutput { - s.ReservedInstancesModificationId = &v - return s -} - -// Contains the parameters for ModifySnapshotAttribute. -type ModifySnapshotAttributeInput struct { - _ struct{} `type:"structure"` - - // The snapshot attribute to modify. - // - // Only volume creation permissions may be modified at the customer level. - Attribute *string `type:"string" enum:"SnapshotAttributeName"` - - // A JSON representation of the snapshot attribute modification. - CreateVolumePermission *CreateVolumePermissionModifications `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The group to modify for the snapshot. - GroupNames []*string `locationName:"UserGroup" locationNameList:"GroupName" type:"list"` - - // The type of operation to perform to the attribute. - OperationType *string `type:"string" enum:"OperationType"` - - // The ID of the snapshot. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` - - // The account ID to modify for the snapshot. - UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` -} - -// String returns the string representation -func (s ModifySnapshotAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySnapshotAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifySnapshotAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifySnapshotAttributeInput"} - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ModifySnapshotAttributeInput) SetAttribute(v string) *ModifySnapshotAttributeInput { - s.Attribute = &v - return s -} - -// SetCreateVolumePermission sets the CreateVolumePermission field's value. -func (s *ModifySnapshotAttributeInput) SetCreateVolumePermission(v *CreateVolumePermissionModifications) *ModifySnapshotAttributeInput { - s.CreateVolumePermission = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifySnapshotAttributeInput) SetDryRun(v bool) *ModifySnapshotAttributeInput { - s.DryRun = &v - return s -} - -// SetGroupNames sets the GroupNames field's value. -func (s *ModifySnapshotAttributeInput) SetGroupNames(v []*string) *ModifySnapshotAttributeInput { - s.GroupNames = v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *ModifySnapshotAttributeInput) SetOperationType(v string) *ModifySnapshotAttributeInput { - s.OperationType = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *ModifySnapshotAttributeInput) SetSnapshotId(v string) *ModifySnapshotAttributeInput { - s.SnapshotId = &v - return s -} - -// SetUserIds sets the UserIds field's value. -func (s *ModifySnapshotAttributeInput) SetUserIds(v []*string) *ModifySnapshotAttributeInput { - s.UserIds = v - return s -} - -type ModifySnapshotAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifySnapshotAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySnapshotAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifySpotFleetRequest. -type ModifySpotFleetRequestInput struct { - _ struct{} `type:"structure"` - - // Indicates whether running Spot Instances should be terminated if the target - // capacity of the Spot Fleet request is decreased below the current size of - // the Spot Fleet. - ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` - - // The size of the fleet. - TargetCapacity *int64 `locationName:"targetCapacity" type:"integer"` -} - -// String returns the string representation -func (s ModifySpotFleetRequestInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySpotFleetRequestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifySpotFleetRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifySpotFleetRequestInput"} - if s.SpotFleetRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. -func (s *ModifySpotFleetRequestInput) SetExcessCapacityTerminationPolicy(v string) *ModifySpotFleetRequestInput { - s.ExcessCapacityTerminationPolicy = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *ModifySpotFleetRequestInput) SetSpotFleetRequestId(v string) *ModifySpotFleetRequestInput { - s.SpotFleetRequestId = &v - return s -} - -// SetTargetCapacity sets the TargetCapacity field's value. -func (s *ModifySpotFleetRequestInput) SetTargetCapacity(v int64) *ModifySpotFleetRequestInput { - s.TargetCapacity = &v - return s -} - -// Contains the output of ModifySpotFleetRequest. -type ModifySpotFleetRequestOutput struct { - _ struct{} `type:"structure"` - - // Is true if the request succeeds, and an error otherwise. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifySpotFleetRequestOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySpotFleetRequestOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ModifySpotFleetRequestOutput) SetReturn(v bool) *ModifySpotFleetRequestOutput { - s.Return = &v - return s -} - -// Contains the parameters for ModifySubnetAttribute. -type ModifySubnetAttributeInput struct { - _ struct{} `type:"structure"` - - // Specify true to indicate that network interfaces created in the specified - // subnet should be assigned an IPv6 address. This includes a network interface - // that's created when launching an instance into the subnet (the instance therefore - // receives an IPv6 address). - // - // If you enable the IPv6 addressing feature for your subnet, your network interface - // or instance only receives an IPv6 address if it's created using version 2016-11-15 - // or later of the Amazon EC2 API. - AssignIpv6AddressOnCreation *AttributeBooleanValue `type:"structure"` - - // Specify true to indicate that network interfaces created in the specified - // subnet should be assigned a public IPv4 address. This includes a network - // interface that's created when launching an instance into the subnet (the - // instance therefore receives a public IPv4 address). - MapPublicIpOnLaunch *AttributeBooleanValue `type:"structure"` - - // The ID of the subnet. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifySubnetAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySubnetAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifySubnetAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifySubnetAttributeInput"} - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssignIpv6AddressOnCreation sets the AssignIpv6AddressOnCreation field's value. -func (s *ModifySubnetAttributeInput) SetAssignIpv6AddressOnCreation(v *AttributeBooleanValue) *ModifySubnetAttributeInput { - s.AssignIpv6AddressOnCreation = v - return s -} - -// SetMapPublicIpOnLaunch sets the MapPublicIpOnLaunch field's value. -func (s *ModifySubnetAttributeInput) SetMapPublicIpOnLaunch(v *AttributeBooleanValue) *ModifySubnetAttributeInput { - s.MapPublicIpOnLaunch = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *ModifySubnetAttributeInput) SetSubnetId(v string) *ModifySubnetAttributeInput { - s.SubnetId = &v - return s -} - -type ModifySubnetAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifySubnetAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySubnetAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyVolumeAttribute. -type ModifyVolumeAttributeInput struct { - _ struct{} `type:"structure"` - - // Indicates whether the volume should be auto-enabled for I/O operations. - AutoEnableIO *AttributeBooleanValue `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVolumeAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVolumeAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVolumeAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVolumeAttributeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoEnableIO sets the AutoEnableIO field's value. -func (s *ModifyVolumeAttributeInput) SetAutoEnableIO(v *AttributeBooleanValue) *ModifyVolumeAttributeInput { - s.AutoEnableIO = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVolumeAttributeInput) SetDryRun(v bool) *ModifyVolumeAttributeInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *ModifyVolumeAttributeInput) SetVolumeId(v string) *ModifyVolumeAttributeInput { - s.VolumeId = &v - return s -} - -type ModifyVolumeAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyVolumeAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVolumeAttributeOutput) GoString() string { - return s.String() -} - -type ModifyVolumeInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // Target IOPS rate of the volume to be modified. - // - // Only valid for Provisioned IOPS SSD (io1) volumes. For more information about - // io1 IOPS configuration, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops). - // - // Default: If no IOPS value is specified, the existing value is retained. - Iops *int64 `type:"integer"` - - // Target size in GiB of the volume to be modified. Target volume size must - // be greater than or equal to than the existing size of the volume. For information - // about available EBS volume sizes, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html). - // - // Default: If no size is specified, the existing size is retained. - Size *int64 `type:"integer"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` - - // Target EBS volume type of the volume to be modified - // - // The API does not support modifications for volume type standard. You also - // cannot change the type of a volume to standard. - // - // Default: If no type is specified, the existing type is retained. - VolumeType *string `type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s ModifyVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVolumeInput) SetDryRun(v bool) *ModifyVolumeInput { - s.DryRun = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *ModifyVolumeInput) SetIops(v int64) *ModifyVolumeInput { - s.Iops = &v - return s -} - -// SetSize sets the Size field's value. -func (s *ModifyVolumeInput) SetSize(v int64) *ModifyVolumeInput { - s.Size = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *ModifyVolumeInput) SetVolumeId(v string) *ModifyVolumeInput { - s.VolumeId = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *ModifyVolumeInput) SetVolumeType(v string) *ModifyVolumeInput { - s.VolumeType = &v - return s -} - -type ModifyVolumeOutput struct { - _ struct{} `type:"structure"` - - // A VolumeModification object. - VolumeModification *VolumeModification `locationName:"volumeModification" type:"structure"` -} - -// String returns the string representation -func (s ModifyVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVolumeOutput) GoString() string { - return s.String() -} - -// SetVolumeModification sets the VolumeModification field's value. -func (s *ModifyVolumeOutput) SetVolumeModification(v *VolumeModification) *ModifyVolumeOutput { - s.VolumeModification = v - return s -} - -// Contains the parameters for ModifyVpcAttribute. -type ModifyVpcAttributeInput struct { - _ struct{} `type:"structure"` - - // Indicates whether the instances launched in the VPC get DNS hostnames. If - // enabled, instances in the VPC get DNS hostnames; otherwise, they do not. - // - // You cannot modify the DNS resolution and DNS hostnames attributes in the - // same request. Use separate requests for each attribute. You can only enable - // DNS hostnames if you've enabled DNS support. - EnableDnsHostnames *AttributeBooleanValue `type:"structure"` - - // Indicates whether the DNS resolution is supported for the VPC. If enabled, - // queries to the Amazon provided DNS server at the 169.254.169.253 IP address, - // or the reserved IP address at the base of the VPC network range "plus two" - // will succeed. If disabled, the Amazon provided DNS service in the VPC that - // resolves public DNS hostnames to IP addresses is not enabled. - // - // You cannot modify the DNS resolution and DNS hostnames attributes in the - // same request. Use separate requests for each attribute. - EnableDnsSupport *AttributeBooleanValue `type:"structure"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcAttributeInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnableDnsHostnames sets the EnableDnsHostnames field's value. -func (s *ModifyVpcAttributeInput) SetEnableDnsHostnames(v *AttributeBooleanValue) *ModifyVpcAttributeInput { - s.EnableDnsHostnames = v - return s -} - -// SetEnableDnsSupport sets the EnableDnsSupport field's value. -func (s *ModifyVpcAttributeInput) SetEnableDnsSupport(v *AttributeBooleanValue) *ModifyVpcAttributeInput { - s.EnableDnsSupport = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ModifyVpcAttributeInput) SetVpcId(v string) *ModifyVpcAttributeInput { - s.VpcId = &v - return s -} - -type ModifyVpcAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyVpcAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcAttributeOutput) GoString() string { - return s.String() -} - -type ModifyVpcEndpointConnectionNotificationInput struct { - _ struct{} `type:"structure"` - - // One or more events for the endpoint. Valid values are Accept, Connect, Delete, - // and Reject. - ConnectionEvents []*string `locationNameList:"item" type:"list"` - - // The ARN for the SNS topic for the notification. - ConnectionNotificationArn *string `type:"string"` - - // The ID of the notification. - // - // ConnectionNotificationId is a required field - ConnectionNotificationId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` -} - -// String returns the string representation -func (s ModifyVpcEndpointConnectionNotificationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointConnectionNotificationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcEndpointConnectionNotificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcEndpointConnectionNotificationInput"} - if s.ConnectionNotificationId == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionNotificationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectionEvents sets the ConnectionEvents field's value. -func (s *ModifyVpcEndpointConnectionNotificationInput) SetConnectionEvents(v []*string) *ModifyVpcEndpointConnectionNotificationInput { - s.ConnectionEvents = v - return s -} - -// SetConnectionNotificationArn sets the ConnectionNotificationArn field's value. -func (s *ModifyVpcEndpointConnectionNotificationInput) SetConnectionNotificationArn(v string) *ModifyVpcEndpointConnectionNotificationInput { - s.ConnectionNotificationArn = &v - return s -} - -// SetConnectionNotificationId sets the ConnectionNotificationId field's value. -func (s *ModifyVpcEndpointConnectionNotificationInput) SetConnectionNotificationId(v string) *ModifyVpcEndpointConnectionNotificationInput { - s.ConnectionNotificationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVpcEndpointConnectionNotificationInput) SetDryRun(v bool) *ModifyVpcEndpointConnectionNotificationInput { - s.DryRun = &v - return s -} - -type ModifyVpcEndpointConnectionNotificationOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnValue *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyVpcEndpointConnectionNotificationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointConnectionNotificationOutput) GoString() string { - return s.String() -} - -// SetReturnValue sets the ReturnValue field's value. -func (s *ModifyVpcEndpointConnectionNotificationOutput) SetReturnValue(v bool) *ModifyVpcEndpointConnectionNotificationOutput { - s.ReturnValue = &v - return s -} - -// Contains the parameters for ModifyVpcEndpoint. -type ModifyVpcEndpointInput struct { - _ struct{} `type:"structure"` - - // (Gateway endpoint) One or more route tables IDs to associate with the endpoint. - AddRouteTableIds []*string `locationName:"AddRouteTableId" locationNameList:"item" type:"list"` - - // (Interface endpoint) One or more security group IDs to associate with the - // network interface. - AddSecurityGroupIds []*string `locationName:"AddSecurityGroupId" locationNameList:"item" type:"list"` - - // (Interface endpoint) One or more subnet IDs in which to serve the endpoint. - AddSubnetIds []*string `locationName:"AddSubnetId" locationNameList:"item" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // (Gateway endpoint) A policy document to attach to the endpoint. The policy - // must be in valid JSON format. - PolicyDocument *string `type:"string"` - - // (Interface endpoint) Indicate whether a private hosted zone is associated - // with the VPC. - PrivateDnsEnabled *bool `type:"boolean"` - - // (Gateway endpoint) One or more route table IDs to disassociate from the endpoint. - RemoveRouteTableIds []*string `locationName:"RemoveRouteTableId" locationNameList:"item" type:"list"` - - // (Interface endpoint) One or more security group IDs to disassociate from - // the network interface. - RemoveSecurityGroupIds []*string `locationName:"RemoveSecurityGroupId" locationNameList:"item" type:"list"` - - // (Interface endpoint) One or more subnets IDs in which to remove the endpoint. - RemoveSubnetIds []*string `locationName:"RemoveSubnetId" locationNameList:"item" type:"list"` - - // (Gateway endpoint) Specify true to reset the policy document to the default - // policy. The default policy allows full access to the service. - ResetPolicy *bool `type:"boolean"` - - // The ID of the endpoint. - // - // VpcEndpointId is a required field - VpcEndpointId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcEndpointInput"} - if s.VpcEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcEndpointId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddRouteTableIds sets the AddRouteTableIds field's value. -func (s *ModifyVpcEndpointInput) SetAddRouteTableIds(v []*string) *ModifyVpcEndpointInput { - s.AddRouteTableIds = v - return s -} - -// SetAddSecurityGroupIds sets the AddSecurityGroupIds field's value. -func (s *ModifyVpcEndpointInput) SetAddSecurityGroupIds(v []*string) *ModifyVpcEndpointInput { - s.AddSecurityGroupIds = v - return s -} - -// SetAddSubnetIds sets the AddSubnetIds field's value. -func (s *ModifyVpcEndpointInput) SetAddSubnetIds(v []*string) *ModifyVpcEndpointInput { - s.AddSubnetIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVpcEndpointInput) SetDryRun(v bool) *ModifyVpcEndpointInput { - s.DryRun = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *ModifyVpcEndpointInput) SetPolicyDocument(v string) *ModifyVpcEndpointInput { - s.PolicyDocument = &v - return s -} - -// SetPrivateDnsEnabled sets the PrivateDnsEnabled field's value. -func (s *ModifyVpcEndpointInput) SetPrivateDnsEnabled(v bool) *ModifyVpcEndpointInput { - s.PrivateDnsEnabled = &v - return s -} - -// SetRemoveRouteTableIds sets the RemoveRouteTableIds field's value. -func (s *ModifyVpcEndpointInput) SetRemoveRouteTableIds(v []*string) *ModifyVpcEndpointInput { - s.RemoveRouteTableIds = v - return s -} - -// SetRemoveSecurityGroupIds sets the RemoveSecurityGroupIds field's value. -func (s *ModifyVpcEndpointInput) SetRemoveSecurityGroupIds(v []*string) *ModifyVpcEndpointInput { - s.RemoveSecurityGroupIds = v - return s -} - -// SetRemoveSubnetIds sets the RemoveSubnetIds field's value. -func (s *ModifyVpcEndpointInput) SetRemoveSubnetIds(v []*string) *ModifyVpcEndpointInput { - s.RemoveSubnetIds = v - return s -} - -// SetResetPolicy sets the ResetPolicy field's value. -func (s *ModifyVpcEndpointInput) SetResetPolicy(v bool) *ModifyVpcEndpointInput { - s.ResetPolicy = &v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *ModifyVpcEndpointInput) SetVpcEndpointId(v string) *ModifyVpcEndpointInput { - s.VpcEndpointId = &v - return s -} - -type ModifyVpcEndpointOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyVpcEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ModifyVpcEndpointOutput) SetReturn(v bool) *ModifyVpcEndpointOutput { - s.Return = &v - return s -} - -type ModifyVpcEndpointServiceConfigurationInput struct { - _ struct{} `type:"structure"` - - // Indicate whether requests to create an endpoint to your service must be accepted. - AcceptanceRequired *bool `type:"boolean"` - - // The Amazon Resource Names (ARNs) of Network Load Balancers to add to your - // service configuration. - AddNetworkLoadBalancerArns []*string `locationName:"AddNetworkLoadBalancerArn" locationNameList:"item" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The Amazon Resource Names (ARNs) of Network Load Balancers to remove from - // your service configuration. - RemoveNetworkLoadBalancerArns []*string `locationName:"RemoveNetworkLoadBalancerArn" locationNameList:"item" type:"list"` - - // The ID of the service. - // - // ServiceId is a required field - ServiceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcEndpointServiceConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointServiceConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcEndpointServiceConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcEndpointServiceConfigurationInput"} - if s.ServiceId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAcceptanceRequired sets the AcceptanceRequired field's value. -func (s *ModifyVpcEndpointServiceConfigurationInput) SetAcceptanceRequired(v bool) *ModifyVpcEndpointServiceConfigurationInput { - s.AcceptanceRequired = &v - return s -} - -// SetAddNetworkLoadBalancerArns sets the AddNetworkLoadBalancerArns field's value. -func (s *ModifyVpcEndpointServiceConfigurationInput) SetAddNetworkLoadBalancerArns(v []*string) *ModifyVpcEndpointServiceConfigurationInput { - s.AddNetworkLoadBalancerArns = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVpcEndpointServiceConfigurationInput) SetDryRun(v bool) *ModifyVpcEndpointServiceConfigurationInput { - s.DryRun = &v - return s -} - -// SetRemoveNetworkLoadBalancerArns sets the RemoveNetworkLoadBalancerArns field's value. -func (s *ModifyVpcEndpointServiceConfigurationInput) SetRemoveNetworkLoadBalancerArns(v []*string) *ModifyVpcEndpointServiceConfigurationInput { - s.RemoveNetworkLoadBalancerArns = v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *ModifyVpcEndpointServiceConfigurationInput) SetServiceId(v string) *ModifyVpcEndpointServiceConfigurationInput { - s.ServiceId = &v - return s -} - -type ModifyVpcEndpointServiceConfigurationOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyVpcEndpointServiceConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointServiceConfigurationOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ModifyVpcEndpointServiceConfigurationOutput) SetReturn(v bool) *ModifyVpcEndpointServiceConfigurationOutput { - s.Return = &v - return s -} - -type ModifyVpcEndpointServicePermissionsInput struct { - _ struct{} `type:"structure"` - - // One or more Amazon Resource Names (ARNs) of principals for which to allow - // permission. Specify * to allow all principals. - AddAllowedPrincipals []*string `locationNameList:"item" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more Amazon Resource Names (ARNs) of principals for which to remove - // permission. - RemoveAllowedPrincipals []*string `locationNameList:"item" type:"list"` - - // The ID of the service. - // - // ServiceId is a required field - ServiceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcEndpointServicePermissionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointServicePermissionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcEndpointServicePermissionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcEndpointServicePermissionsInput"} - if s.ServiceId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddAllowedPrincipals sets the AddAllowedPrincipals field's value. -func (s *ModifyVpcEndpointServicePermissionsInput) SetAddAllowedPrincipals(v []*string) *ModifyVpcEndpointServicePermissionsInput { - s.AddAllowedPrincipals = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVpcEndpointServicePermissionsInput) SetDryRun(v bool) *ModifyVpcEndpointServicePermissionsInput { - s.DryRun = &v - return s -} - -// SetRemoveAllowedPrincipals sets the RemoveAllowedPrincipals field's value. -func (s *ModifyVpcEndpointServicePermissionsInput) SetRemoveAllowedPrincipals(v []*string) *ModifyVpcEndpointServicePermissionsInput { - s.RemoveAllowedPrincipals = v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *ModifyVpcEndpointServicePermissionsInput) SetServiceId(v string) *ModifyVpcEndpointServicePermissionsInput { - s.ServiceId = &v - return s -} - -type ModifyVpcEndpointServicePermissionsOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnValue *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyVpcEndpointServicePermissionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointServicePermissionsOutput) GoString() string { - return s.String() -} - -// SetReturnValue sets the ReturnValue field's value. -func (s *ModifyVpcEndpointServicePermissionsOutput) SetReturnValue(v bool) *ModifyVpcEndpointServicePermissionsOutput { - s.ReturnValue = &v - return s -} - -type ModifyVpcPeeringConnectionOptionsInput struct { - _ struct{} `type:"structure"` - - // The VPC peering connection options for the accepter VPC. - AccepterPeeringConnectionOptions *PeeringConnectionOptionsRequest `type:"structure"` - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The VPC peering connection options for the requester VPC. - RequesterPeeringConnectionOptions *PeeringConnectionOptionsRequest `type:"structure"` - - // The ID of the VPC peering connection. - // - // VpcPeeringConnectionId is a required field - VpcPeeringConnectionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcPeeringConnectionOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcPeeringConnectionOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcPeeringConnectionOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcPeeringConnectionOptionsInput"} - if s.VpcPeeringConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcPeeringConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccepterPeeringConnectionOptions sets the AccepterPeeringConnectionOptions field's value. -func (s *ModifyVpcPeeringConnectionOptionsInput) SetAccepterPeeringConnectionOptions(v *PeeringConnectionOptionsRequest) *ModifyVpcPeeringConnectionOptionsInput { - s.AccepterPeeringConnectionOptions = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVpcPeeringConnectionOptionsInput) SetDryRun(v bool) *ModifyVpcPeeringConnectionOptionsInput { - s.DryRun = &v - return s -} - -// SetRequesterPeeringConnectionOptions sets the RequesterPeeringConnectionOptions field's value. -func (s *ModifyVpcPeeringConnectionOptionsInput) SetRequesterPeeringConnectionOptions(v *PeeringConnectionOptionsRequest) *ModifyVpcPeeringConnectionOptionsInput { - s.RequesterPeeringConnectionOptions = v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *ModifyVpcPeeringConnectionOptionsInput) SetVpcPeeringConnectionId(v string) *ModifyVpcPeeringConnectionOptionsInput { - s.VpcPeeringConnectionId = &v - return s -} - -type ModifyVpcPeeringConnectionOptionsOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC peering connection options for the accepter VPC. - AccepterPeeringConnectionOptions *PeeringConnectionOptions `locationName:"accepterPeeringConnectionOptions" type:"structure"` - - // Information about the VPC peering connection options for the requester VPC. - RequesterPeeringConnectionOptions *PeeringConnectionOptions `locationName:"requesterPeeringConnectionOptions" type:"structure"` -} - -// String returns the string representation -func (s ModifyVpcPeeringConnectionOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcPeeringConnectionOptionsOutput) GoString() string { - return s.String() -} - -// SetAccepterPeeringConnectionOptions sets the AccepterPeeringConnectionOptions field's value. -func (s *ModifyVpcPeeringConnectionOptionsOutput) SetAccepterPeeringConnectionOptions(v *PeeringConnectionOptions) *ModifyVpcPeeringConnectionOptionsOutput { - s.AccepterPeeringConnectionOptions = v - return s -} - -// SetRequesterPeeringConnectionOptions sets the RequesterPeeringConnectionOptions field's value. -func (s *ModifyVpcPeeringConnectionOptionsOutput) SetRequesterPeeringConnectionOptions(v *PeeringConnectionOptions) *ModifyVpcPeeringConnectionOptionsOutput { - s.RequesterPeeringConnectionOptions = v - return s -} - -// Contains the parameters for ModifyVpcTenancy. -type ModifyVpcTenancyInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The instance tenancy attribute for the VPC. - // - // InstanceTenancy is a required field - InstanceTenancy *string `type:"string" required:"true" enum:"VpcTenancy"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcTenancyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcTenancyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcTenancyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcTenancyInput"} - if s.InstanceTenancy == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceTenancy")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVpcTenancyInput) SetDryRun(v bool) *ModifyVpcTenancyInput { - s.DryRun = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *ModifyVpcTenancyInput) SetInstanceTenancy(v string) *ModifyVpcTenancyInput { - s.InstanceTenancy = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ModifyVpcTenancyInput) SetVpcId(v string) *ModifyVpcTenancyInput { - s.VpcId = &v - return s -} - -// Contains the output of ModifyVpcTenancy. -type ModifyVpcTenancyOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, returns an error. - ReturnValue *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyVpcTenancyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcTenancyOutput) GoString() string { - return s.String() -} - -// SetReturnValue sets the ReturnValue field's value. -func (s *ModifyVpcTenancyOutput) SetReturnValue(v bool) *ModifyVpcTenancyOutput { - s.ReturnValue = &v - return s -} - -// Contains the parameters for MonitorInstances. -type MonitorInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s MonitorInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MonitorInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MonitorInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MonitorInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *MonitorInstancesInput) SetDryRun(v bool) *MonitorInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *MonitorInstancesInput) SetInstanceIds(v []*string) *MonitorInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of MonitorInstances. -type MonitorInstancesOutput struct { - _ struct{} `type:"structure"` - - // The monitoring information. - InstanceMonitorings []*InstanceMonitoring `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s MonitorInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MonitorInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceMonitorings sets the InstanceMonitorings field's value. -func (s *MonitorInstancesOutput) SetInstanceMonitorings(v []*InstanceMonitoring) *MonitorInstancesOutput { - s.InstanceMonitorings = v - return s -} - -// Describes the monitoring of an instance. -type Monitoring struct { - _ struct{} `type:"structure"` - - // Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring - // is enabled. - State *string `locationName:"state" type:"string" enum:"MonitoringState"` -} - -// String returns the string representation -func (s Monitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Monitoring) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *Monitoring) SetState(v string) *Monitoring { - s.State = &v - return s -} - -// Contains the parameters for MoveAddressToVpc. -type MoveAddressToVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The Elastic IP address. - // - // PublicIp is a required field - PublicIp *string `locationName:"publicIp" type:"string" required:"true"` -} - -// String returns the string representation -func (s MoveAddressToVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MoveAddressToVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MoveAddressToVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MoveAddressToVpcInput"} - if s.PublicIp == nil { - invalidParams.Add(request.NewErrParamRequired("PublicIp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *MoveAddressToVpcInput) SetDryRun(v bool) *MoveAddressToVpcInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *MoveAddressToVpcInput) SetPublicIp(v string) *MoveAddressToVpcInput { - s.PublicIp = &v - return s -} - -// Contains the output of MoveAddressToVpc. -type MoveAddressToVpcOutput struct { - _ struct{} `type:"structure"` - - // The allocation ID for the Elastic IP address. - AllocationId *string `locationName:"allocationId" type:"string"` - - // The status of the move of the IP address. - Status *string `locationName:"status" type:"string" enum:"Status"` -} - -// String returns the string representation -func (s MoveAddressToVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MoveAddressToVpcOutput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *MoveAddressToVpcOutput) SetAllocationId(v string) *MoveAddressToVpcOutput { - s.AllocationId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *MoveAddressToVpcOutput) SetStatus(v string) *MoveAddressToVpcOutput { - s.Status = &v - return s -} - -// Describes the status of a moving Elastic IP address. -type MovingAddressStatus struct { - _ struct{} `type:"structure"` - - // The status of the Elastic IP address that's being moved to the EC2-VPC platform, - // or restored to the EC2-Classic platform. - MoveStatus *string `locationName:"moveStatus" type:"string" enum:"MoveStatus"` - - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s MovingAddressStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MovingAddressStatus) GoString() string { - return s.String() -} - -// SetMoveStatus sets the MoveStatus field's value. -func (s *MovingAddressStatus) SetMoveStatus(v string) *MovingAddressStatus { - s.MoveStatus = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *MovingAddressStatus) SetPublicIp(v string) *MovingAddressStatus { - s.PublicIp = &v - return s -} - -// Describes a NAT gateway. -type NatGateway struct { - _ struct{} `type:"structure"` - - // The date and time the NAT gateway was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // The date and time the NAT gateway was deleted, if applicable. - DeleteTime *time.Time `locationName:"deleteTime" type:"timestamp" timestampFormat:"iso8601"` - - // If the NAT gateway could not be created, specifies the error code for the - // failure. (InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound - // | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound) - FailureCode *string `locationName:"failureCode" type:"string"` - - // If the NAT gateway could not be created, specifies the error message for - // the failure, that corresponds to the error code. - // - // * For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free - // addresses to create this NAT gateway" - // - // * For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway - // attached" - // - // * For InvalidAllocationID.NotFound: "Elastic IP address eipalloc-xxxxxxxx - // could not be associated with this NAT gateway" - // - // * For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx - // is already associated" - // - // * For InternalError: "Network interface eni-xxxxxxxx, created and used - // internally by this NAT gateway is in an invalid state. Please try again." - // - // * For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx - // does not exist or could not be found." - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // Information about the IP addresses and network interface associated with - // the NAT gateway. - NatGatewayAddresses []*NatGatewayAddress `locationName:"natGatewayAddressSet" locationNameList:"item" type:"list"` - - // The ID of the NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - ProvisionedBandwidth *ProvisionedBandwidth `locationName:"provisionedBandwidth" type:"structure"` - - // The state of the NAT gateway. - // - // * pending: The NAT gateway is being created and is not ready to process - // traffic. - // - // * failed: The NAT gateway could not be created. Check the failureCode - // and failureMessage fields for the reason. - // - // * available: The NAT gateway is able to process traffic. This status remains - // until you delete the NAT gateway, and does not indicate the health of - // the NAT gateway. - // - // * deleting: The NAT gateway is in the process of being terminated and - // may still be processing traffic. - // - // * deleted: The NAT gateway has been terminated and is no longer processing - // traffic. - State *string `locationName:"state" type:"string" enum:"NatGatewayState"` - - // The ID of the subnet in which the NAT gateway is located. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The tags for the NAT gateway. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC in which the NAT gateway is located. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s NatGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NatGateway) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *NatGateway) SetCreateTime(v time.Time) *NatGateway { - s.CreateTime = &v - return s -} - -// SetDeleteTime sets the DeleteTime field's value. -func (s *NatGateway) SetDeleteTime(v time.Time) *NatGateway { - s.DeleteTime = &v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *NatGateway) SetFailureCode(v string) *NatGateway { - s.FailureCode = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *NatGateway) SetFailureMessage(v string) *NatGateway { - s.FailureMessage = &v - return s -} - -// SetNatGatewayAddresses sets the NatGatewayAddresses field's value. -func (s *NatGateway) SetNatGatewayAddresses(v []*NatGatewayAddress) *NatGateway { - s.NatGatewayAddresses = v - return s -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *NatGateway) SetNatGatewayId(v string) *NatGateway { - s.NatGatewayId = &v - return s -} - -// SetProvisionedBandwidth sets the ProvisionedBandwidth field's value. -func (s *NatGateway) SetProvisionedBandwidth(v *ProvisionedBandwidth) *NatGateway { - s.ProvisionedBandwidth = v - return s -} - -// SetState sets the State field's value. -func (s *NatGateway) SetState(v string) *NatGateway { - s.State = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NatGateway) SetSubnetId(v string) *NatGateway { - s.SubnetId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *NatGateway) SetTags(v []*Tag) *NatGateway { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *NatGateway) SetVpcId(v string) *NatGateway { - s.VpcId = &v - return s -} - -// Describes the IP addresses and network interface associated with a NAT gateway. -type NatGatewayAddress struct { - _ struct{} `type:"structure"` - - // The allocation ID of the Elastic IP address that's associated with the NAT - // gateway. - AllocationId *string `locationName:"allocationId" type:"string"` - - // The ID of the network interface associated with the NAT gateway. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The private IP address associated with the Elastic IP address. - PrivateIp *string `locationName:"privateIp" type:"string"` - - // The Elastic IP address associated with the NAT gateway. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s NatGatewayAddress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NatGatewayAddress) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *NatGatewayAddress) SetAllocationId(v string) *NatGatewayAddress { - s.AllocationId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *NatGatewayAddress) SetNetworkInterfaceId(v string) *NatGatewayAddress { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIp sets the PrivateIp field's value. -func (s *NatGatewayAddress) SetPrivateIp(v string) *NatGatewayAddress { - s.PrivateIp = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *NatGatewayAddress) SetPublicIp(v string) *NatGatewayAddress { - s.PublicIp = &v - return s -} - -// Describes a network ACL. -type NetworkAcl struct { - _ struct{} `type:"structure"` - - // Any associations between the network ACL and one or more subnets - Associations []*NetworkAclAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` - - // One or more entries (rules) in the network ACL. - Entries []*NetworkAclEntry `locationName:"entrySet" locationNameList:"item" type:"list"` - - // Indicates whether this is the default network ACL for the VPC. - IsDefault *bool `locationName:"default" type:"boolean"` - - // The ID of the network ACL. - NetworkAclId *string `locationName:"networkAclId" type:"string"` - - // Any tags assigned to the network ACL. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC for the network ACL. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s NetworkAcl) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkAcl) GoString() string { - return s.String() -} - -// SetAssociations sets the Associations field's value. -func (s *NetworkAcl) SetAssociations(v []*NetworkAclAssociation) *NetworkAcl { - s.Associations = v - return s -} - -// SetEntries sets the Entries field's value. -func (s *NetworkAcl) SetEntries(v []*NetworkAclEntry) *NetworkAcl { - s.Entries = v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *NetworkAcl) SetIsDefault(v bool) *NetworkAcl { - s.IsDefault = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *NetworkAcl) SetNetworkAclId(v string) *NetworkAcl { - s.NetworkAclId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *NetworkAcl) SetTags(v []*Tag) *NetworkAcl { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *NetworkAcl) SetVpcId(v string) *NetworkAcl { - s.VpcId = &v - return s -} - -// Describes an association between a network ACL and a subnet. -type NetworkAclAssociation struct { - _ struct{} `type:"structure"` - - // The ID of the association between a network ACL and a subnet. - NetworkAclAssociationId *string `locationName:"networkAclAssociationId" type:"string"` - - // The ID of the network ACL. - NetworkAclId *string `locationName:"networkAclId" type:"string"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s NetworkAclAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkAclAssociation) GoString() string { - return s.String() -} - -// SetNetworkAclAssociationId sets the NetworkAclAssociationId field's value. -func (s *NetworkAclAssociation) SetNetworkAclAssociationId(v string) *NetworkAclAssociation { - s.NetworkAclAssociationId = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *NetworkAclAssociation) SetNetworkAclId(v string) *NetworkAclAssociation { - s.NetworkAclId = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NetworkAclAssociation) SetSubnetId(v string) *NetworkAclAssociation { - s.SubnetId = &v - return s -} - -// Describes an entry in a network ACL. -type NetworkAclEntry struct { - _ struct{} `type:"structure"` - - // The IPv4 network range to allow or deny, in CIDR notation. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Indicates whether the rule is an egress rule (applied to traffic leaving - // the subnet). - Egress *bool `locationName:"egress" type:"boolean"` - - // ICMP protocol: The ICMP type and code. - IcmpTypeCode *IcmpTypeCode `locationName:"icmpTypeCode" type:"structure"` - - // The IPv6 network range to allow or deny, in CIDR notation. - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // TCP or UDP protocols: The range of ports the rule applies to. - PortRange *PortRange `locationName:"portRange" type:"structure"` - - // The protocol. A value of -1 means all protocols. - Protocol *string `locationName:"protocol" type:"string"` - - // Indicates whether to allow or deny the traffic that matches the rule. - RuleAction *string `locationName:"ruleAction" type:"string" enum:"RuleAction"` - - // The rule number for the entry. ACL entries are processed in ascending order - // by rule number. - RuleNumber *int64 `locationName:"ruleNumber" type:"integer"` -} - -// String returns the string representation -func (s NetworkAclEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkAclEntry) GoString() string { - return s.String() -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *NetworkAclEntry) SetCidrBlock(v string) *NetworkAclEntry { - s.CidrBlock = &v - return s -} - -// SetEgress sets the Egress field's value. -func (s *NetworkAclEntry) SetEgress(v bool) *NetworkAclEntry { - s.Egress = &v - return s -} - -// SetIcmpTypeCode sets the IcmpTypeCode field's value. -func (s *NetworkAclEntry) SetIcmpTypeCode(v *IcmpTypeCode) *NetworkAclEntry { - s.IcmpTypeCode = v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *NetworkAclEntry) SetIpv6CidrBlock(v string) *NetworkAclEntry { - s.Ipv6CidrBlock = &v - return s -} - -// SetPortRange sets the PortRange field's value. -func (s *NetworkAclEntry) SetPortRange(v *PortRange) *NetworkAclEntry { - s.PortRange = v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *NetworkAclEntry) SetProtocol(v string) *NetworkAclEntry { - s.Protocol = &v - return s -} - -// SetRuleAction sets the RuleAction field's value. -func (s *NetworkAclEntry) SetRuleAction(v string) *NetworkAclEntry { - s.RuleAction = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *NetworkAclEntry) SetRuleNumber(v int64) *NetworkAclEntry { - s.RuleNumber = &v - return s -} - -// Describes a network interface. -type NetworkInterface struct { - _ struct{} `type:"structure"` - - // The association information for an Elastic IP address (IPv4) associated with - // the network interface. - Association *NetworkInterfaceAssociation `locationName:"association" type:"structure"` - - // The network interface attachment. - Attachment *NetworkInterfaceAttachment `locationName:"attachment" type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // A description. - Description *string `locationName:"description" type:"string"` - - // Any security groups for the network interface. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The type of interface. - InterfaceType *string `locationName:"interfaceType" type:"string" enum:"NetworkInterfaceType"` - - // The IPv6 addresses associated with the network interface. - Ipv6Addresses []*NetworkInterfaceIpv6Address `locationName:"ipv6AddressesSet" locationNameList:"item" type:"list"` - - // The MAC address. - MacAddress *string `locationName:"macAddress" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The AWS account ID of the owner of the network interface. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The private DNS name. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The private IPv4 addresses associated with the network interface. - PrivateIpAddresses []*NetworkInterfacePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` - - // The ID of the entity that launched the instance on your behalf (for example, - // AWS Management Console or Auto Scaling). - RequesterId *string `locationName:"requesterId" type:"string"` - - // Indicates whether the network interface is being managed by AWS. - RequesterManaged *bool `locationName:"requesterManaged" type:"boolean"` - - // Indicates whether traffic to or from the instance is validated. - SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` - - // The status of the network interface. - Status *string `locationName:"status" type:"string" enum:"NetworkInterfaceStatus"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` - - // Any tags assigned to the network interface. - TagSet []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s NetworkInterface) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterface) GoString() string { - return s.String() -} - -// SetAssociation sets the Association field's value. -func (s *NetworkInterface) SetAssociation(v *NetworkInterfaceAssociation) *NetworkInterface { - s.Association = v - return s -} - -// SetAttachment sets the Attachment field's value. -func (s *NetworkInterface) SetAttachment(v *NetworkInterfaceAttachment) *NetworkInterface { - s.Attachment = v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *NetworkInterface) SetAvailabilityZone(v string) *NetworkInterface { - s.AvailabilityZone = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *NetworkInterface) SetDescription(v string) *NetworkInterface { - s.Description = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *NetworkInterface) SetGroups(v []*GroupIdentifier) *NetworkInterface { - s.Groups = v - return s -} - -// SetInterfaceType sets the InterfaceType field's value. -func (s *NetworkInterface) SetInterfaceType(v string) *NetworkInterface { - s.InterfaceType = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *NetworkInterface) SetIpv6Addresses(v []*NetworkInterfaceIpv6Address) *NetworkInterface { - s.Ipv6Addresses = v - return s -} - -// SetMacAddress sets the MacAddress field's value. -func (s *NetworkInterface) SetMacAddress(v string) *NetworkInterface { - s.MacAddress = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *NetworkInterface) SetNetworkInterfaceId(v string) *NetworkInterface { - s.NetworkInterfaceId = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *NetworkInterface) SetOwnerId(v string) *NetworkInterface { - s.OwnerId = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *NetworkInterface) SetPrivateDnsName(v string) *NetworkInterface { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *NetworkInterface) SetPrivateIpAddress(v string) *NetworkInterface { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *NetworkInterface) SetPrivateIpAddresses(v []*NetworkInterfacePrivateIpAddress) *NetworkInterface { - s.PrivateIpAddresses = v - return s -} - -// SetRequesterId sets the RequesterId field's value. -func (s *NetworkInterface) SetRequesterId(v string) *NetworkInterface { - s.RequesterId = &v - return s -} - -// SetRequesterManaged sets the RequesterManaged field's value. -func (s *NetworkInterface) SetRequesterManaged(v bool) *NetworkInterface { - s.RequesterManaged = &v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *NetworkInterface) SetSourceDestCheck(v bool) *NetworkInterface { - s.SourceDestCheck = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *NetworkInterface) SetStatus(v string) *NetworkInterface { - s.Status = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NetworkInterface) SetSubnetId(v string) *NetworkInterface { - s.SubnetId = &v - return s -} - -// SetTagSet sets the TagSet field's value. -func (s *NetworkInterface) SetTagSet(v []*Tag) *NetworkInterface { - s.TagSet = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *NetworkInterface) SetVpcId(v string) *NetworkInterface { - s.VpcId = &v - return s -} - -// Describes association information for an Elastic IP address (IPv4 only). -type NetworkInterfaceAssociation struct { - _ struct{} `type:"structure"` - - // The allocation ID. - AllocationId *string `locationName:"allocationId" type:"string"` - - // The association ID. - AssociationId *string `locationName:"associationId" type:"string"` - - // The ID of the Elastic IP address owner. - IpOwnerId *string `locationName:"ipOwnerId" type:"string"` - - // The public DNS name. - PublicDnsName *string `locationName:"publicDnsName" type:"string"` - - // The address of the Elastic IP address bound to the network interface. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s NetworkInterfaceAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceAssociation) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *NetworkInterfaceAssociation) SetAllocationId(v string) *NetworkInterfaceAssociation { - s.AllocationId = &v - return s -} - -// SetAssociationId sets the AssociationId field's value. -func (s *NetworkInterfaceAssociation) SetAssociationId(v string) *NetworkInterfaceAssociation { - s.AssociationId = &v - return s -} - -// SetIpOwnerId sets the IpOwnerId field's value. -func (s *NetworkInterfaceAssociation) SetIpOwnerId(v string) *NetworkInterfaceAssociation { - s.IpOwnerId = &v - return s -} - -// SetPublicDnsName sets the PublicDnsName field's value. -func (s *NetworkInterfaceAssociation) SetPublicDnsName(v string) *NetworkInterfaceAssociation { - s.PublicDnsName = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *NetworkInterfaceAssociation) SetPublicIp(v string) *NetworkInterfaceAssociation { - s.PublicIp = &v - return s -} - -// Describes a network interface attachment. -type NetworkInterfaceAttachment struct { - _ struct{} `type:"structure"` - - // The timestamp indicating when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` - - // Indicates whether the network interface is deleted when the instance is terminated. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The device index of the network interface attachment on the instance. - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The AWS account ID of the owner of the instance. - InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` - - // The attachment state. - Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` -} - -// String returns the string representation -func (s NetworkInterfaceAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceAttachment) GoString() string { - return s.String() -} - -// SetAttachTime sets the AttachTime field's value. -func (s *NetworkInterfaceAttachment) SetAttachTime(v time.Time) *NetworkInterfaceAttachment { - s.AttachTime = &v - return s -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *NetworkInterfaceAttachment) SetAttachmentId(v string) *NetworkInterfaceAttachment { - s.AttachmentId = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *NetworkInterfaceAttachment) SetDeleteOnTermination(v bool) *NetworkInterfaceAttachment { - s.DeleteOnTermination = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *NetworkInterfaceAttachment) SetDeviceIndex(v int64) *NetworkInterfaceAttachment { - s.DeviceIndex = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *NetworkInterfaceAttachment) SetInstanceId(v string) *NetworkInterfaceAttachment { - s.InstanceId = &v - return s -} - -// SetInstanceOwnerId sets the InstanceOwnerId field's value. -func (s *NetworkInterfaceAttachment) SetInstanceOwnerId(v string) *NetworkInterfaceAttachment { - s.InstanceOwnerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *NetworkInterfaceAttachment) SetStatus(v string) *NetworkInterfaceAttachment { - s.Status = &v - return s -} - -// Describes an attachment change. -type NetworkInterfaceAttachmentChanges struct { - _ struct{} `type:"structure"` - - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` - - // Indicates whether the network interface is deleted when the instance is terminated. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` -} - -// String returns the string representation -func (s NetworkInterfaceAttachmentChanges) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceAttachmentChanges) GoString() string { - return s.String() -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *NetworkInterfaceAttachmentChanges) SetAttachmentId(v string) *NetworkInterfaceAttachmentChanges { - s.AttachmentId = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *NetworkInterfaceAttachmentChanges) SetDeleteOnTermination(v bool) *NetworkInterfaceAttachmentChanges { - s.DeleteOnTermination = &v - return s -} - -// Describes an IPv6 address associated with a network interface. -type NetworkInterfaceIpv6Address struct { - _ struct{} `type:"structure"` - - // The IPv6 address. - Ipv6Address *string `locationName:"ipv6Address" type:"string"` -} - -// String returns the string representation -func (s NetworkInterfaceIpv6Address) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceIpv6Address) GoString() string { - return s.String() -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *NetworkInterfaceIpv6Address) SetIpv6Address(v string) *NetworkInterfaceIpv6Address { - s.Ipv6Address = &v - return s -} - -// Describes a permission for a network interface. -type NetworkInterfacePermission struct { - _ struct{} `type:"structure"` - - // The AWS account ID. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The AWS service. - AwsService *string `locationName:"awsService" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the network interface permission. - NetworkInterfacePermissionId *string `locationName:"networkInterfacePermissionId" type:"string"` - - // The type of permission. - Permission *string `locationName:"permission" type:"string" enum:"InterfacePermissionType"` - - // Information about the state of the permission. - PermissionState *NetworkInterfacePermissionState `locationName:"permissionState" type:"structure"` -} - -// String returns the string representation -func (s NetworkInterfacePermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfacePermission) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *NetworkInterfacePermission) SetAwsAccountId(v string) *NetworkInterfacePermission { - s.AwsAccountId = &v - return s -} - -// SetAwsService sets the AwsService field's value. -func (s *NetworkInterfacePermission) SetAwsService(v string) *NetworkInterfacePermission { - s.AwsService = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *NetworkInterfacePermission) SetNetworkInterfaceId(v string) *NetworkInterfacePermission { - s.NetworkInterfaceId = &v - return s -} - -// SetNetworkInterfacePermissionId sets the NetworkInterfacePermissionId field's value. -func (s *NetworkInterfacePermission) SetNetworkInterfacePermissionId(v string) *NetworkInterfacePermission { - s.NetworkInterfacePermissionId = &v - return s -} - -// SetPermission sets the Permission field's value. -func (s *NetworkInterfacePermission) SetPermission(v string) *NetworkInterfacePermission { - s.Permission = &v - return s -} - -// SetPermissionState sets the PermissionState field's value. -func (s *NetworkInterfacePermission) SetPermissionState(v *NetworkInterfacePermissionState) *NetworkInterfacePermission { - s.PermissionState = v - return s -} - -// Describes the state of a network interface permission. -type NetworkInterfacePermissionState struct { - _ struct{} `type:"structure"` - - // The state of the permission. - State *string `locationName:"state" type:"string" enum:"NetworkInterfacePermissionStateCode"` - - // A status message, if applicable. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s NetworkInterfacePermissionState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfacePermissionState) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *NetworkInterfacePermissionState) SetState(v string) *NetworkInterfacePermissionState { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *NetworkInterfacePermissionState) SetStatusMessage(v string) *NetworkInterfacePermissionState { - s.StatusMessage = &v - return s -} - -// Describes the private IPv4 address of a network interface. -type NetworkInterfacePrivateIpAddress struct { - _ struct{} `type:"structure"` - - // The association information for an Elastic IP address (IPv4) associated with - // the network interface. - Association *NetworkInterfaceAssociation `locationName:"association" type:"structure"` - - // Indicates whether this IPv4 address is the primary private IPv4 address of - // the network interface. - Primary *bool `locationName:"primary" type:"boolean"` - - // The private DNS name. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The private IPv4 address. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` -} - -// String returns the string representation -func (s NetworkInterfacePrivateIpAddress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfacePrivateIpAddress) GoString() string { - return s.String() -} - -// SetAssociation sets the Association field's value. -func (s *NetworkInterfacePrivateIpAddress) SetAssociation(v *NetworkInterfaceAssociation) *NetworkInterfacePrivateIpAddress { - s.Association = v - return s -} - -// SetPrimary sets the Primary field's value. -func (s *NetworkInterfacePrivateIpAddress) SetPrimary(v bool) *NetworkInterfacePrivateIpAddress { - s.Primary = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *NetworkInterfacePrivateIpAddress) SetPrivateDnsName(v string) *NetworkInterfacePrivateIpAddress { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *NetworkInterfacePrivateIpAddress) SetPrivateIpAddress(v string) *NetworkInterfacePrivateIpAddress { - s.PrivateIpAddress = &v - return s -} - -type NewDhcpConfiguration struct { - _ struct{} `type:"structure"` - - Key *string `locationName:"key" type:"string"` - - Values []*string `locationName:"Value" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s NewDhcpConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NewDhcpConfiguration) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *NewDhcpConfiguration) SetKey(v string) *NewDhcpConfiguration { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *NewDhcpConfiguration) SetValues(v []*string) *NewDhcpConfiguration { - s.Values = v - return s -} - -// Describes the data that identifies an Amazon FPGA image (AFI) on the PCI -// bus. -type PciId struct { - _ struct{} `type:"structure"` - - // The ID of the device. - DeviceId *string `type:"string"` - - // The ID of the subsystem. - SubsystemId *string `type:"string"` - - // The ID of the vendor for the subsystem. - SubsystemVendorId *string `type:"string"` - - // The ID of the vendor. - VendorId *string `type:"string"` -} - -// String returns the string representation -func (s PciId) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PciId) GoString() string { - return s.String() -} - -// SetDeviceId sets the DeviceId field's value. -func (s *PciId) SetDeviceId(v string) *PciId { - s.DeviceId = &v - return s -} - -// SetSubsystemId sets the SubsystemId field's value. -func (s *PciId) SetSubsystemId(v string) *PciId { - s.SubsystemId = &v - return s -} - -// SetSubsystemVendorId sets the SubsystemVendorId field's value. -func (s *PciId) SetSubsystemVendorId(v string) *PciId { - s.SubsystemVendorId = &v - return s -} - -// SetVendorId sets the VendorId field's value. -func (s *PciId) SetVendorId(v string) *PciId { - s.VendorId = &v - return s -} - -// Describes the VPC peering connection options. -type PeeringConnectionOptions struct { - _ struct{} `type:"structure"` - - // If true, the public DNS hostnames of instances in the specified VPC resolve - // to private IP addresses when queried from instances in the peer VPC. - AllowDnsResolutionFromRemoteVpc *bool `locationName:"allowDnsResolutionFromRemoteVpc" type:"boolean"` - - // If true, enables outbound communication from an EC2-Classic instance that's - // linked to a local VPC via ClassicLink to instances in a peer VPC. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool `locationName:"allowEgressFromLocalClassicLinkToRemoteVpc" type:"boolean"` - - // If true, enables outbound communication from instances in a local VPC to - // an EC2-Classic instance that's linked to a peer VPC via ClassicLink. - AllowEgressFromLocalVpcToRemoteClassicLink *bool `locationName:"allowEgressFromLocalVpcToRemoteClassicLink" type:"boolean"` -} - -// String returns the string representation -func (s PeeringConnectionOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PeeringConnectionOptions) GoString() string { - return s.String() -} - -// SetAllowDnsResolutionFromRemoteVpc sets the AllowDnsResolutionFromRemoteVpc field's value. -func (s *PeeringConnectionOptions) SetAllowDnsResolutionFromRemoteVpc(v bool) *PeeringConnectionOptions { - s.AllowDnsResolutionFromRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalClassicLinkToRemoteVpc sets the AllowEgressFromLocalClassicLinkToRemoteVpc field's value. -func (s *PeeringConnectionOptions) SetAllowEgressFromLocalClassicLinkToRemoteVpc(v bool) *PeeringConnectionOptions { - s.AllowEgressFromLocalClassicLinkToRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalVpcToRemoteClassicLink sets the AllowEgressFromLocalVpcToRemoteClassicLink field's value. -func (s *PeeringConnectionOptions) SetAllowEgressFromLocalVpcToRemoteClassicLink(v bool) *PeeringConnectionOptions { - s.AllowEgressFromLocalVpcToRemoteClassicLink = &v - return s -} - -// The VPC peering connection options. -type PeeringConnectionOptionsRequest struct { - _ struct{} `type:"structure"` - - // If true, enables a local VPC to resolve public DNS hostnames to private IP - // addresses when queried from instances in the peer VPC. - AllowDnsResolutionFromRemoteVpc *bool `type:"boolean"` - - // If true, enables outbound communication from an EC2-Classic instance that's - // linked to a local VPC via ClassicLink to instances in a peer VPC. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool `type:"boolean"` - - // If true, enables outbound communication from instances in a local VPC to - // an EC2-Classic instance that's linked to a peer VPC via ClassicLink. - AllowEgressFromLocalVpcToRemoteClassicLink *bool `type:"boolean"` -} - -// String returns the string representation -func (s PeeringConnectionOptionsRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PeeringConnectionOptionsRequest) GoString() string { - return s.String() -} - -// SetAllowDnsResolutionFromRemoteVpc sets the AllowDnsResolutionFromRemoteVpc field's value. -func (s *PeeringConnectionOptionsRequest) SetAllowDnsResolutionFromRemoteVpc(v bool) *PeeringConnectionOptionsRequest { - s.AllowDnsResolutionFromRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalClassicLinkToRemoteVpc sets the AllowEgressFromLocalClassicLinkToRemoteVpc field's value. -func (s *PeeringConnectionOptionsRequest) SetAllowEgressFromLocalClassicLinkToRemoteVpc(v bool) *PeeringConnectionOptionsRequest { - s.AllowEgressFromLocalClassicLinkToRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalVpcToRemoteClassicLink sets the AllowEgressFromLocalVpcToRemoteClassicLink field's value. -func (s *PeeringConnectionOptionsRequest) SetAllowEgressFromLocalVpcToRemoteClassicLink(v bool) *PeeringConnectionOptionsRequest { - s.AllowEgressFromLocalVpcToRemoteClassicLink = &v - return s -} - -// Describes the placement of an instance. -type Placement struct { - _ struct{} `type:"structure"` - - // The affinity setting for the instance on the Dedicated Host. This parameter - // is not supported for the ImportInstance command. - Affinity *string `locationName:"affinity" type:"string"` - - // The Availability Zone of the instance. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The name of the placement group the instance is in (for cluster compute instances). - GroupName *string `locationName:"groupName" type:"string"` - - // The ID of the Dedicated Host on which the instance resides. This parameter - // is not supported for the ImportInstance command. - HostId *string `locationName:"hostId" type:"string"` - - // Reserved for future use. - SpreadDomain *string `locationName:"spreadDomain" type:"string"` - - // The tenancy of the instance (if the instance is running in a VPC). An instance - // with a tenancy of dedicated runs on single-tenant hardware. The host tenancy - // is not supported for the ImportInstance command. - Tenancy *string `locationName:"tenancy" type:"string" enum:"Tenancy"` -} - -// String returns the string representation -func (s Placement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Placement) GoString() string { - return s.String() -} - -// SetAffinity sets the Affinity field's value. -func (s *Placement) SetAffinity(v string) *Placement { - s.Affinity = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Placement) SetAvailabilityZone(v string) *Placement { - s.AvailabilityZone = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *Placement) SetGroupName(v string) *Placement { - s.GroupName = &v - return s -} - -// SetHostId sets the HostId field's value. -func (s *Placement) SetHostId(v string) *Placement { - s.HostId = &v - return s -} - -// SetSpreadDomain sets the SpreadDomain field's value. -func (s *Placement) SetSpreadDomain(v string) *Placement { - s.SpreadDomain = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *Placement) SetTenancy(v string) *Placement { - s.Tenancy = &v - return s -} - -// Describes a placement group. -type PlacementGroup struct { - _ struct{} `type:"structure"` - - // The name of the placement group. - GroupName *string `locationName:"groupName" type:"string"` - - // The state of the placement group. - State *string `locationName:"state" type:"string" enum:"PlacementGroupState"` - - // The placement strategy. - Strategy *string `locationName:"strategy" type:"string" enum:"PlacementStrategy"` -} - -// String returns the string representation -func (s PlacementGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlacementGroup) GoString() string { - return s.String() -} - -// SetGroupName sets the GroupName field's value. -func (s *PlacementGroup) SetGroupName(v string) *PlacementGroup { - s.GroupName = &v - return s -} - -// SetState sets the State field's value. -func (s *PlacementGroup) SetState(v string) *PlacementGroup { - s.State = &v - return s -} - -// SetStrategy sets the Strategy field's value. -func (s *PlacementGroup) SetStrategy(v string) *PlacementGroup { - s.Strategy = &v - return s -} - -// Describes a range of ports. -type PortRange struct { - _ struct{} `type:"structure"` - - // The first port in the range. - From *int64 `locationName:"from" type:"integer"` - - // The last port in the range. - To *int64 `locationName:"to" type:"integer"` -} - -// String returns the string representation -func (s PortRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PortRange) GoString() string { - return s.String() -} - -// SetFrom sets the From field's value. -func (s *PortRange) SetFrom(v int64) *PortRange { - s.From = &v - return s -} - -// SetTo sets the To field's value. -func (s *PortRange) SetTo(v int64) *PortRange { - s.To = &v - return s -} - -// Describes prefixes for AWS services. -type PrefixList struct { - _ struct{} `type:"structure"` - - // The IP address range of the AWS service. - Cidrs []*string `locationName:"cidrSet" locationNameList:"item" type:"list"` - - // The ID of the prefix. - PrefixListId *string `locationName:"prefixListId" type:"string"` - - // The name of the prefix. - PrefixListName *string `locationName:"prefixListName" type:"string"` -} - -// String returns the string representation -func (s PrefixList) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PrefixList) GoString() string { - return s.String() -} - -// SetCidrs sets the Cidrs field's value. -func (s *PrefixList) SetCidrs(v []*string) *PrefixList { - s.Cidrs = v - return s -} - -// SetPrefixListId sets the PrefixListId field's value. -func (s *PrefixList) SetPrefixListId(v string) *PrefixList { - s.PrefixListId = &v - return s -} - -// SetPrefixListName sets the PrefixListName field's value. -func (s *PrefixList) SetPrefixListName(v string) *PrefixList { - s.PrefixListName = &v - return s -} - -// [EC2-VPC only] The ID of the prefix. -type PrefixListId struct { - _ struct{} `type:"structure"` - - // A description for the security group rule that references this prefix list - // ID. - // - // Constraints: Up to 255 characters in length. Allowed characters are a-z, - // A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$* - Description *string `locationName:"description" type:"string"` - - // The ID of the prefix. - PrefixListId *string `locationName:"prefixListId" type:"string"` -} - -// String returns the string representation -func (s PrefixListId) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PrefixListId) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *PrefixListId) SetDescription(v string) *PrefixListId { - s.Description = &v - return s -} - -// SetPrefixListId sets the PrefixListId field's value. -func (s *PrefixListId) SetPrefixListId(v string) *PrefixListId { - s.PrefixListId = &v - return s -} - -// Describes the price for a Reserved Instance. -type PriceSchedule struct { - _ struct{} `type:"structure"` - - // The current price schedule, as determined by the term remaining for the Reserved - // Instance in the listing. - // - // A specific price schedule is always in effect, but only one price schedule - // can be active at any time. Take, for example, a Reserved Instance listing - // that has five months remaining in its term. When you specify price schedules - // for five months and two months, this means that schedule 1, covering the - // first three months of the remaining term, will be active during months 5, - // 4, and 3. Then schedule 2, covering the last two months of the term, will - // be active for months 2 and 1. - Active *bool `locationName:"active" type:"boolean"` - - // The currency for transacting the Reserved Instance resale. At this time, - // the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The fixed price for the term. - Price *float64 `locationName:"price" type:"double"` - - // The number of months remaining in the reservation. For example, 2 is the - // second to the last month before the capacity reservation expires. - Term *int64 `locationName:"term" type:"long"` -} - -// String returns the string representation -func (s PriceSchedule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PriceSchedule) GoString() string { - return s.String() -} - -// SetActive sets the Active field's value. -func (s *PriceSchedule) SetActive(v bool) *PriceSchedule { - s.Active = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *PriceSchedule) SetCurrencyCode(v string) *PriceSchedule { - s.CurrencyCode = &v - return s -} - -// SetPrice sets the Price field's value. -func (s *PriceSchedule) SetPrice(v float64) *PriceSchedule { - s.Price = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *PriceSchedule) SetTerm(v int64) *PriceSchedule { - s.Term = &v - return s -} - -// Describes the price for a Reserved Instance. -type PriceScheduleSpecification struct { - _ struct{} `type:"structure"` - - // The currency for transacting the Reserved Instance resale. At this time, - // the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The fixed price for the term. - Price *float64 `locationName:"price" type:"double"` - - // The number of months remaining in the reservation. For example, 2 is the - // second to the last month before the capacity reservation expires. - Term *int64 `locationName:"term" type:"long"` -} - -// String returns the string representation -func (s PriceScheduleSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PriceScheduleSpecification) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *PriceScheduleSpecification) SetCurrencyCode(v string) *PriceScheduleSpecification { - s.CurrencyCode = &v - return s -} - -// SetPrice sets the Price field's value. -func (s *PriceScheduleSpecification) SetPrice(v float64) *PriceScheduleSpecification { - s.Price = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *PriceScheduleSpecification) SetTerm(v int64) *PriceScheduleSpecification { - s.Term = &v - return s -} - -// Describes a Reserved Instance offering. -type PricingDetail struct { - _ struct{} `type:"structure"` - - // The number of reservations available for the price. - Count *int64 `locationName:"count" type:"integer"` - - // The price per instance. - Price *float64 `locationName:"price" type:"double"` -} - -// String returns the string representation -func (s PricingDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PricingDetail) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *PricingDetail) SetCount(v int64) *PricingDetail { - s.Count = &v - return s -} - -// SetPrice sets the Price field's value. -func (s *PricingDetail) SetPrice(v float64) *PricingDetail { - s.Price = &v - return s -} - -// PrincipalIdFormat description -type PrincipalIdFormat struct { - _ struct{} `type:"structure"` - - // PrincipalIdFormatARN description - Arn *string `locationName:"arn" type:"string"` - - // PrincipalIdFormatStatuses description - Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s PrincipalIdFormat) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PrincipalIdFormat) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *PrincipalIdFormat) SetArn(v string) *PrincipalIdFormat { - s.Arn = &v - return s -} - -// SetStatuses sets the Statuses field's value. -func (s *PrincipalIdFormat) SetStatuses(v []*IdFormat) *PrincipalIdFormat { - s.Statuses = v - return s -} - -// Describes a secondary private IPv4 address for a network interface. -type PrivateIpAddressSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether the private IPv4 address is the primary private IPv4 address. - // Only one IPv4 address can be designated as primary. - Primary *bool `locationName:"primary" type:"boolean"` - - // The private IPv4 addresses. - // - // PrivateIpAddress is a required field - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string" required:"true"` -} - -// String returns the string representation -func (s PrivateIpAddressSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PrivateIpAddressSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrivateIpAddressSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrivateIpAddressSpecification"} - if s.PrivateIpAddress == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateIpAddress")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrimary sets the Primary field's value. -func (s *PrivateIpAddressSpecification) SetPrimary(v bool) *PrivateIpAddressSpecification { - s.Primary = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *PrivateIpAddressSpecification) SetPrivateIpAddress(v string) *PrivateIpAddressSpecification { - s.PrivateIpAddress = &v - return s -} - -// Describes a product code. -type ProductCode struct { - _ struct{} `type:"structure"` - - // The product code. - ProductCodeId *string `locationName:"productCode" type:"string"` - - // The type of product code. - ProductCodeType *string `locationName:"type" type:"string" enum:"ProductCodeValues"` -} - -// String returns the string representation -func (s ProductCode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProductCode) GoString() string { - return s.String() -} - -// SetProductCodeId sets the ProductCodeId field's value. -func (s *ProductCode) SetProductCodeId(v string) *ProductCode { - s.ProductCodeId = &v - return s -} - -// SetProductCodeType sets the ProductCodeType field's value. -func (s *ProductCode) SetProductCodeType(v string) *ProductCode { - s.ProductCodeType = &v - return s -} - -// Describes a virtual private gateway propagating route. -type PropagatingVgw struct { - _ struct{} `type:"structure"` - - // The ID of the virtual private gateway (VGW). - GatewayId *string `locationName:"gatewayId" type:"string"` -} - -// String returns the string representation -func (s PropagatingVgw) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PropagatingVgw) GoString() string { - return s.String() -} - -// SetGatewayId sets the GatewayId field's value. -func (s *PropagatingVgw) SetGatewayId(v string) *PropagatingVgw { - s.GatewayId = &v - return s -} - -// Reserved. If you need to sustain traffic greater than the documented limits -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), -// contact us through the Support Center (https://console.aws.amazon.com/support/home?). -type ProvisionedBandwidth struct { - _ struct{} `type:"structure"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - ProvisionTime *time.Time `locationName:"provisionTime" type:"timestamp" timestampFormat:"iso8601"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - Provisioned *string `locationName:"provisioned" type:"string"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - RequestTime *time.Time `locationName:"requestTime" type:"timestamp" timestampFormat:"iso8601"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - Requested *string `locationName:"requested" type:"string"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - Status *string `locationName:"status" type:"string"` -} - -// String returns the string representation -func (s ProvisionedBandwidth) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProvisionedBandwidth) GoString() string { - return s.String() -} - -// SetProvisionTime sets the ProvisionTime field's value. -func (s *ProvisionedBandwidth) SetProvisionTime(v time.Time) *ProvisionedBandwidth { - s.ProvisionTime = &v - return s -} - -// SetProvisioned sets the Provisioned field's value. -func (s *ProvisionedBandwidth) SetProvisioned(v string) *ProvisionedBandwidth { - s.Provisioned = &v - return s -} - -// SetRequestTime sets the RequestTime field's value. -func (s *ProvisionedBandwidth) SetRequestTime(v time.Time) *ProvisionedBandwidth { - s.RequestTime = &v - return s -} - -// SetRequested sets the Requested field's value. -func (s *ProvisionedBandwidth) SetRequested(v string) *ProvisionedBandwidth { - s.Requested = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ProvisionedBandwidth) SetStatus(v string) *ProvisionedBandwidth { - s.Status = &v - return s -} - -// Describes the result of the purchase. -type Purchase struct { - _ struct{} `type:"structure"` - - // The currency in which the UpfrontPrice and HourlyPrice amounts are specified. - // At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The duration of the reservation's term in seconds. - Duration *int64 `locationName:"duration" type:"integer"` - - // The IDs of the Dedicated Hosts associated with the reservation. - HostIdSet []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"` - - // The ID of the reservation. - HostReservationId *string `locationName:"hostReservationId" type:"string"` - - // The hourly price of the reservation per hour. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The instance family on the Dedicated Host that the reservation can be associated - // with. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The payment option for the reservation. - PaymentOption *string `locationName:"paymentOption" type:"string" enum:"PaymentOption"` - - // The upfront price of the reservation. - UpfrontPrice *string `locationName:"upfrontPrice" type:"string"` -} - -// String returns the string representation -func (s Purchase) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Purchase) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *Purchase) SetCurrencyCode(v string) *Purchase { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *Purchase) SetDuration(v int64) *Purchase { - s.Duration = &v - return s -} - -// SetHostIdSet sets the HostIdSet field's value. -func (s *Purchase) SetHostIdSet(v []*string) *Purchase { - s.HostIdSet = v - return s -} - -// SetHostReservationId sets the HostReservationId field's value. -func (s *Purchase) SetHostReservationId(v string) *Purchase { - s.HostReservationId = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *Purchase) SetHourlyPrice(v string) *Purchase { - s.HourlyPrice = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *Purchase) SetInstanceFamily(v string) *Purchase { - s.InstanceFamily = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *Purchase) SetPaymentOption(v string) *Purchase { - s.PaymentOption = &v - return s -} - -// SetUpfrontPrice sets the UpfrontPrice field's value. -func (s *Purchase) SetUpfrontPrice(v string) *Purchase { - s.UpfrontPrice = &v - return s -} - -type PurchaseHostReservationInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `type:"string"` - - // The currency in which the totalUpfrontPrice, LimitPrice, and totalHourlyPrice - // amounts are specified. At this time, the only supported currency is USD. - CurrencyCode *string `type:"string" enum:"CurrencyCodeValues"` - - // The ID/s of the Dedicated Host/s that the reservation will be associated - // with. - // - // HostIdSet is a required field - HostIdSet []*string `locationNameList:"item" type:"list" required:"true"` - - // The specified limit is checked against the total upfront cost of the reservation - // (calculated as the offering's upfront cost multiplied by the host count). - // If the total upfront cost is greater than the specified price limit, the - // request will fail. This is used to ensure that the purchase does not exceed - // the expected upfront cost of the purchase. At this time, the only supported - // currency is USD. For example, to indicate a limit price of USD 100, specify - // 100.00. - LimitPrice *string `type:"string"` - - // The ID of the offering. - // - // OfferingId is a required field - OfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseHostReservationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseHostReservationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseHostReservationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseHostReservationInput"} - if s.HostIdSet == nil { - invalidParams.Add(request.NewErrParamRequired("HostIdSet")) - } - if s.OfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("OfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *PurchaseHostReservationInput) SetClientToken(v string) *PurchaseHostReservationInput { - s.ClientToken = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *PurchaseHostReservationInput) SetCurrencyCode(v string) *PurchaseHostReservationInput { - s.CurrencyCode = &v - return s -} - -// SetHostIdSet sets the HostIdSet field's value. -func (s *PurchaseHostReservationInput) SetHostIdSet(v []*string) *PurchaseHostReservationInput { - s.HostIdSet = v - return s -} - -// SetLimitPrice sets the LimitPrice field's value. -func (s *PurchaseHostReservationInput) SetLimitPrice(v string) *PurchaseHostReservationInput { - s.LimitPrice = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *PurchaseHostReservationInput) SetOfferingId(v string) *PurchaseHostReservationInput { - s.OfferingId = &v - return s -} - -type PurchaseHostReservationOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide - ClientToken *string `locationName:"clientToken" type:"string"` - - // The currency in which the totalUpfrontPrice and totalHourlyPrice amounts - // are specified. At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // Describes the details of the purchase. - Purchase []*Purchase `locationName:"purchase" locationNameList:"item" type:"list"` - - // The total hourly price of the reservation calculated per hour. - TotalHourlyPrice *string `locationName:"totalHourlyPrice" type:"string"` - - // The total amount that will be charged to your account when you purchase the - // reservation. - TotalUpfrontPrice *string `locationName:"totalUpfrontPrice" type:"string"` -} - -// String returns the string representation -func (s PurchaseHostReservationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseHostReservationOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *PurchaseHostReservationOutput) SetClientToken(v string) *PurchaseHostReservationOutput { - s.ClientToken = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *PurchaseHostReservationOutput) SetCurrencyCode(v string) *PurchaseHostReservationOutput { - s.CurrencyCode = &v - return s -} - -// SetPurchase sets the Purchase field's value. -func (s *PurchaseHostReservationOutput) SetPurchase(v []*Purchase) *PurchaseHostReservationOutput { - s.Purchase = v - return s -} - -// SetTotalHourlyPrice sets the TotalHourlyPrice field's value. -func (s *PurchaseHostReservationOutput) SetTotalHourlyPrice(v string) *PurchaseHostReservationOutput { - s.TotalHourlyPrice = &v - return s -} - -// SetTotalUpfrontPrice sets the TotalUpfrontPrice field's value. -func (s *PurchaseHostReservationOutput) SetTotalUpfrontPrice(v string) *PurchaseHostReservationOutput { - s.TotalUpfrontPrice = &v - return s -} - -// Describes a request to purchase Scheduled Instances. -type PurchaseRequest struct { - _ struct{} `type:"structure"` - - // The number of instances. - // - // InstanceCount is a required field - InstanceCount *int64 `type:"integer" required:"true"` - - // The purchase token. - // - // PurchaseToken is a required field - PurchaseToken *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseRequest"} - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.PurchaseToken == nil { - invalidParams.Add(request.NewErrParamRequired("PurchaseToken")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *PurchaseRequest) SetInstanceCount(v int64) *PurchaseRequest { - s.InstanceCount = &v - return s -} - -// SetPurchaseToken sets the PurchaseToken field's value. -func (s *PurchaseRequest) SetPurchaseToken(v string) *PurchaseRequest { - s.PurchaseToken = &v - return s -} - -// Contains the parameters for PurchaseReservedInstancesOffering. -type PurchaseReservedInstancesOfferingInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The number of Reserved Instances to purchase. - // - // InstanceCount is a required field - InstanceCount *int64 `type:"integer" required:"true"` - - // Specified for Reserved Instance Marketplace offerings to limit the total - // order and ensure that the Reserved Instances are not purchased at unexpected - // prices. - LimitPrice *ReservedInstanceLimitPrice `locationName:"limitPrice" type:"structure"` - - // The ID of the Reserved Instance offering to purchase. - // - // ReservedInstancesOfferingId is a required field - ReservedInstancesOfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseReservedInstancesOfferingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedInstancesOfferingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseReservedInstancesOfferingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseReservedInstancesOfferingInput"} - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.ReservedInstancesOfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesOfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *PurchaseReservedInstancesOfferingInput) SetDryRun(v bool) *PurchaseReservedInstancesOfferingInput { - s.DryRun = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *PurchaseReservedInstancesOfferingInput) SetInstanceCount(v int64) *PurchaseReservedInstancesOfferingInput { - s.InstanceCount = &v - return s -} - -// SetLimitPrice sets the LimitPrice field's value. -func (s *PurchaseReservedInstancesOfferingInput) SetLimitPrice(v *ReservedInstanceLimitPrice) *PurchaseReservedInstancesOfferingInput { - s.LimitPrice = v - return s -} - -// SetReservedInstancesOfferingId sets the ReservedInstancesOfferingId field's value. -func (s *PurchaseReservedInstancesOfferingInput) SetReservedInstancesOfferingId(v string) *PurchaseReservedInstancesOfferingInput { - s.ReservedInstancesOfferingId = &v - return s -} - -// Contains the output of PurchaseReservedInstancesOffering. -type PurchaseReservedInstancesOfferingOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the purchased Reserved Instances. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` -} - -// String returns the string representation -func (s PurchaseReservedInstancesOfferingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedInstancesOfferingOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *PurchaseReservedInstancesOfferingOutput) SetReservedInstancesId(v string) *PurchaseReservedInstancesOfferingOutput { - s.ReservedInstancesId = &v - return s -} - -// Contains the parameters for PurchaseScheduledInstances. -type PurchaseScheduledInstancesInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that ensures the idempotency of the request. - // For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more purchase requests. - // - // PurchaseRequests is a required field - PurchaseRequests []*PurchaseRequest `locationName:"PurchaseRequest" locationNameList:"PurchaseRequest" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PurchaseScheduledInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseScheduledInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseScheduledInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseScheduledInstancesInput"} - if s.PurchaseRequests == nil { - invalidParams.Add(request.NewErrParamRequired("PurchaseRequests")) - } - if s.PurchaseRequests != nil && len(s.PurchaseRequests) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PurchaseRequests", 1)) - } - if s.PurchaseRequests != nil { - for i, v := range s.PurchaseRequests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PurchaseRequests", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *PurchaseScheduledInstancesInput) SetClientToken(v string) *PurchaseScheduledInstancesInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *PurchaseScheduledInstancesInput) SetDryRun(v bool) *PurchaseScheduledInstancesInput { - s.DryRun = &v - return s -} - -// SetPurchaseRequests sets the PurchaseRequests field's value. -func (s *PurchaseScheduledInstancesInput) SetPurchaseRequests(v []*PurchaseRequest) *PurchaseScheduledInstancesInput { - s.PurchaseRequests = v - return s -} - -// Contains the output of PurchaseScheduledInstances. -type PurchaseScheduledInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about the Scheduled Instances. - ScheduledInstanceSet []*ScheduledInstance `locationName:"scheduledInstanceSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s PurchaseScheduledInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseScheduledInstancesOutput) GoString() string { - return s.String() -} - -// SetScheduledInstanceSet sets the ScheduledInstanceSet field's value. -func (s *PurchaseScheduledInstancesOutput) SetScheduledInstanceSet(v []*ScheduledInstance) *PurchaseScheduledInstancesOutput { - s.ScheduledInstanceSet = v - return s -} - -// Contains the parameters for RebootInstances. -type RebootInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s RebootInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RebootInstancesInput) SetDryRun(v bool) *RebootInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *RebootInstancesInput) SetInstanceIds(v []*string) *RebootInstancesInput { - s.InstanceIds = v - return s -} - -type RebootInstancesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RebootInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstancesOutput) GoString() string { - return s.String() -} - -// Describes a recurring charge. -type RecurringCharge struct { - _ struct{} `type:"structure"` - - // The amount of the recurring charge. - Amount *float64 `locationName:"amount" type:"double"` - - // The frequency of the recurring charge. - Frequency *string `locationName:"frequency" type:"string" enum:"RecurringChargeFrequency"` -} - -// String returns the string representation -func (s RecurringCharge) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RecurringCharge) GoString() string { - return s.String() -} - -// SetAmount sets the Amount field's value. -func (s *RecurringCharge) SetAmount(v float64) *RecurringCharge { - s.Amount = &v - return s -} - -// SetFrequency sets the Frequency field's value. -func (s *RecurringCharge) SetFrequency(v string) *RecurringCharge { - s.Frequency = &v - return s -} - -// Describes a region. -type Region struct { - _ struct{} `type:"structure"` - - // The region service endpoint. - Endpoint *string `locationName:"regionEndpoint" type:"string"` - - // The name of the region. - RegionName *string `locationName:"regionName" type:"string"` -} - -// String returns the string representation -func (s Region) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Region) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *Region) SetEndpoint(v string) *Region { - s.Endpoint = &v - return s -} - -// SetRegionName sets the RegionName field's value. -func (s *Region) SetRegionName(v string) *Region { - s.RegionName = &v - return s -} - -// Contains the parameters for RegisterImage. -type RegisterImageInput struct { - _ struct{} `type:"structure"` - - // The architecture of the AMI. - // - // Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, - // the architecture specified in the manifest file. - Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - - // The billing product codes. Your account must be authorized to specify billing - // product codes. Otherwise, you can use the AWS Marketplace to bill for the - // use of an AMI. - BillingProducts []*string `locationName:"BillingProduct" locationNameList:"item" type:"list"` - - // One or more block device mapping entries. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // A description for your AMI. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Set to true to enable enhanced networking with ENA for the AMI and any instances - // that you launch from the AMI. - // - // This option is supported only for HVM AMIs. Specifying this option with a - // PV AMI can make instances launched from the AMI unreachable. - EnaSupport *bool `locationName:"enaSupport" type:"boolean"` - - // The full path to your AMI manifest in Amazon S3 storage. - ImageLocation *string `type:"string"` - - // The ID of the kernel. - KernelId *string `locationName:"kernelId" type:"string"` - - // A name for your AMI. - // - // Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets - // ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), - // at-signs (@), or underscores(_) - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The ID of the RAM disk. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // The device name of the root device volume (for example, /dev/sda1). - RootDeviceName *string `locationName:"rootDeviceName" type:"string"` - - // Set to simple to enable enhanced networking with the Intel 82599 Virtual - // Function interface for the AMI and any instances that you launch from the - // AMI. - // - // There is no way to disable sriovNetSupport at this time. - // - // This option is supported only for HVM AMIs. Specifying this option with a - // PV AMI can make instances launched from the AMI unreachable. - SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` - - // The type of virtualization (hvm | paravirtual). - // - // Default: paravirtual - VirtualizationType *string `locationName:"virtualizationType" type:"string"` -} - -// String returns the string representation -func (s RegisterImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterImageInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArchitecture sets the Architecture field's value. -func (s *RegisterImageInput) SetArchitecture(v string) *RegisterImageInput { - s.Architecture = &v - return s -} - -// SetBillingProducts sets the BillingProducts field's value. -func (s *RegisterImageInput) SetBillingProducts(v []*string) *RegisterImageInput { - s.BillingProducts = v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *RegisterImageInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *RegisterImageInput { - s.BlockDeviceMappings = v - return s -} - -// SetDescription sets the Description field's value. -func (s *RegisterImageInput) SetDescription(v string) *RegisterImageInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RegisterImageInput) SetDryRun(v bool) *RegisterImageInput { - s.DryRun = &v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *RegisterImageInput) SetEnaSupport(v bool) *RegisterImageInput { - s.EnaSupport = &v - return s -} - -// SetImageLocation sets the ImageLocation field's value. -func (s *RegisterImageInput) SetImageLocation(v string) *RegisterImageInput { - s.ImageLocation = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *RegisterImageInput) SetKernelId(v string) *RegisterImageInput { - s.KernelId = &v - return s -} - -// SetName sets the Name field's value. -func (s *RegisterImageInput) SetName(v string) *RegisterImageInput { - s.Name = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *RegisterImageInput) SetRamdiskId(v string) *RegisterImageInput { - s.RamdiskId = &v - return s -} - -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *RegisterImageInput) SetRootDeviceName(v string) *RegisterImageInput { - s.RootDeviceName = &v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *RegisterImageInput) SetSriovNetSupport(v string) *RegisterImageInput { - s.SriovNetSupport = &v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *RegisterImageInput) SetVirtualizationType(v string) *RegisterImageInput { - s.VirtualizationType = &v - return s -} - -// Contains the output of RegisterImage. -type RegisterImageOutput struct { - _ struct{} `type:"structure"` - - // The ID of the newly registered AMI. - ImageId *string `locationName:"imageId" type:"string"` -} - -// String returns the string representation -func (s RegisterImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterImageOutput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *RegisterImageOutput) SetImageId(v string) *RegisterImageOutput { - s.ImageId = &v - return s -} - -type RejectVpcEndpointConnectionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the service. - // - // ServiceId is a required field - ServiceId *string `type:"string" required:"true"` - - // The IDs of one or more VPC endpoints. - // - // VpcEndpointIds is a required field - VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s RejectVpcEndpointConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RejectVpcEndpointConnectionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RejectVpcEndpointConnectionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RejectVpcEndpointConnectionsInput"} - if s.ServiceId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceId")) - } - if s.VpcEndpointIds == nil { - invalidParams.Add(request.NewErrParamRequired("VpcEndpointIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RejectVpcEndpointConnectionsInput) SetDryRun(v bool) *RejectVpcEndpointConnectionsInput { - s.DryRun = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *RejectVpcEndpointConnectionsInput) SetServiceId(v string) *RejectVpcEndpointConnectionsInput { - s.ServiceId = &v - return s -} - -// SetVpcEndpointIds sets the VpcEndpointIds field's value. -func (s *RejectVpcEndpointConnectionsInput) SetVpcEndpointIds(v []*string) *RejectVpcEndpointConnectionsInput { - s.VpcEndpointIds = v - return s -} - -type RejectVpcEndpointConnectionsOutput struct { - _ struct{} `type:"structure"` - - // Information about the endpoints that were not rejected, if applicable. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s RejectVpcEndpointConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RejectVpcEndpointConnectionsOutput) GoString() string { - return s.String() -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *RejectVpcEndpointConnectionsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *RejectVpcEndpointConnectionsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters for RejectVpcPeeringConnection. -type RejectVpcPeeringConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC peering connection. - // - // VpcPeeringConnectionId is a required field - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` -} - -// String returns the string representation -func (s RejectVpcPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RejectVpcPeeringConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RejectVpcPeeringConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RejectVpcPeeringConnectionInput"} - if s.VpcPeeringConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcPeeringConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RejectVpcPeeringConnectionInput) SetDryRun(v bool) *RejectVpcPeeringConnectionInput { - s.DryRun = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *RejectVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *RejectVpcPeeringConnectionInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Contains the output of RejectVpcPeeringConnection. -type RejectVpcPeeringConnectionOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s RejectVpcPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RejectVpcPeeringConnectionOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *RejectVpcPeeringConnectionOutput) SetReturn(v bool) *RejectVpcPeeringConnectionOutput { - s.Return = &v - return s -} - -// Contains the parameters for ReleaseAddress. -type ReleaseAddressInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The allocation ID. Required for EC2-VPC. - AllocationId *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. - PublicIp *string `type:"string"` -} - -// String returns the string representation -func (s ReleaseAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseAddressInput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *ReleaseAddressInput) SetAllocationId(v string) *ReleaseAddressInput { - s.AllocationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReleaseAddressInput) SetDryRun(v bool) *ReleaseAddressInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *ReleaseAddressInput) SetPublicIp(v string) *ReleaseAddressInput { - s.PublicIp = &v - return s -} - -type ReleaseAddressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReleaseAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseAddressOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ReleaseHosts. -type ReleaseHostsInput struct { - _ struct{} `type:"structure"` - - // The IDs of the Dedicated Hosts you want to release. - // - // HostIds is a required field - HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s ReleaseHostsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseHostsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReleaseHostsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReleaseHostsInput"} - if s.HostIds == nil { - invalidParams.Add(request.NewErrParamRequired("HostIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostIds sets the HostIds field's value. -func (s *ReleaseHostsInput) SetHostIds(v []*string) *ReleaseHostsInput { - s.HostIds = v - return s -} - -// Contains the output of ReleaseHosts. -type ReleaseHostsOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the Dedicated Hosts that were successfully released. - Successful []*string `locationName:"successful" locationNameList:"item" type:"list"` - - // The IDs of the Dedicated Hosts that could not be released, including an error - // message. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ReleaseHostsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseHostsOutput) GoString() string { - return s.String() -} - -// SetSuccessful sets the Successful field's value. -func (s *ReleaseHostsOutput) SetSuccessful(v []*string) *ReleaseHostsOutput { - s.Successful = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *ReleaseHostsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *ReleaseHostsOutput { - s.Unsuccessful = v - return s -} - -type ReplaceIamInstanceProfileAssociationInput struct { - _ struct{} `type:"structure"` - - // The ID of the existing IAM instance profile association. - // - // AssociationId is a required field - AssociationId *string `type:"string" required:"true"` - - // The IAM instance profile. - // - // IamInstanceProfile is a required field - IamInstanceProfile *IamInstanceProfileSpecification `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ReplaceIamInstanceProfileAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceIamInstanceProfileAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceIamInstanceProfileAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceIamInstanceProfileAssociationInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - if s.IamInstanceProfile == nil { - invalidParams.Add(request.NewErrParamRequired("IamInstanceProfile")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *ReplaceIamInstanceProfileAssociationInput) SetAssociationId(v string) *ReplaceIamInstanceProfileAssociationInput { - s.AssociationId = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *ReplaceIamInstanceProfileAssociationInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *ReplaceIamInstanceProfileAssociationInput { - s.IamInstanceProfile = v - return s -} - -type ReplaceIamInstanceProfileAssociationOutput struct { - _ struct{} `type:"structure"` - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` -} - -// String returns the string representation -func (s ReplaceIamInstanceProfileAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceIamInstanceProfileAssociationOutput) GoString() string { - return s.String() -} - -// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. -func (s *ReplaceIamInstanceProfileAssociationOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *ReplaceIamInstanceProfileAssociationOutput { - s.IamInstanceProfileAssociation = v - return s -} - -// Contains the parameters for ReplaceNetworkAclAssociation. -type ReplaceNetworkAclAssociationInput struct { - _ struct{} `type:"structure"` - - // The ID of the current association between the original network ACL and the - // subnet. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the new network ACL to associate with the subnet. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReplaceNetworkAclAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceNetworkAclAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceNetworkAclAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceNetworkAclAssociationInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *ReplaceNetworkAclAssociationInput) SetAssociationId(v string) *ReplaceNetworkAclAssociationInput { - s.AssociationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReplaceNetworkAclAssociationInput) SetDryRun(v bool) *ReplaceNetworkAclAssociationInput { - s.DryRun = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *ReplaceNetworkAclAssociationInput) SetNetworkAclId(v string) *ReplaceNetworkAclAssociationInput { - s.NetworkAclId = &v - return s -} - -// Contains the output of ReplaceNetworkAclAssociation. -type ReplaceNetworkAclAssociationOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new association. - NewAssociationId *string `locationName:"newAssociationId" type:"string"` -} - -// String returns the string representation -func (s ReplaceNetworkAclAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceNetworkAclAssociationOutput) GoString() string { - return s.String() -} - -// SetNewAssociationId sets the NewAssociationId field's value. -func (s *ReplaceNetworkAclAssociationOutput) SetNewAssociationId(v string) *ReplaceNetworkAclAssociationOutput { - s.NewAssociationId = &v - return s -} - -// Contains the parameters for ReplaceNetworkAclEntry. -type ReplaceNetworkAclEntryInput struct { - _ struct{} `type:"structure"` - - // The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether to replace the egress rule. - // - // Default: If no value is specified, we replace the ingress rule. - // - // Egress is a required field - Egress *bool `locationName:"egress" type:"boolean" required:"true"` - - // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying the - // ICMP (1) protocol, or protocol 58 (ICMPv6) with an IPv6 CIDR block. - IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` - - // The IPv6 network range to allow or deny, in CIDR notation (for example 2001:bd8:1234:1a00::/64). - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // The ID of the ACL. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - - // TCP or UDP protocols: The range of ports the rule applies to. Required if - // specifying TCP (6) or UDP (17) for the protocol. - PortRange *PortRange `locationName:"portRange" type:"structure"` - - // The IP protocol. You can specify all or -1 to mean all protocols. If you - // specify all, -1, or a protocol number other than tcp, udp, or icmp, traffic - // on all ports is allowed, regardless of any ports or ICMP types or codes you - // specify. If you specify protocol 58 (ICMPv6) and specify an IPv4 CIDR block, - // traffic for all ICMP types and codes allowed, regardless of any that you - // specify. If you specify protocol 58 (ICMPv6) and specify an IPv6 CIDR block, - // you must specify an ICMP type and code. - // - // Protocol is a required field - Protocol *string `locationName:"protocol" type:"string" required:"true"` - - // Indicates whether to allow or deny the traffic that matches the rule. - // - // RuleAction is a required field - RuleAction *string `locationName:"ruleAction" type:"string" required:"true" enum:"RuleAction"` - - // The rule number of the entry to replace. - // - // RuleNumber is a required field - RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` -} - -// String returns the string representation -func (s ReplaceNetworkAclEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceNetworkAclEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceNetworkAclEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceNetworkAclEntryInput"} - if s.Egress == nil { - invalidParams.Add(request.NewErrParamRequired("Egress")) - } - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - if s.RuleAction == nil { - invalidParams.Add(request.NewErrParamRequired("RuleAction")) - } - if s.RuleNumber == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *ReplaceNetworkAclEntryInput) SetCidrBlock(v string) *ReplaceNetworkAclEntryInput { - s.CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReplaceNetworkAclEntryInput) SetDryRun(v bool) *ReplaceNetworkAclEntryInput { - s.DryRun = &v - return s -} - -// SetEgress sets the Egress field's value. -func (s *ReplaceNetworkAclEntryInput) SetEgress(v bool) *ReplaceNetworkAclEntryInput { - s.Egress = &v - return s -} - -// SetIcmpTypeCode sets the IcmpTypeCode field's value. -func (s *ReplaceNetworkAclEntryInput) SetIcmpTypeCode(v *IcmpTypeCode) *ReplaceNetworkAclEntryInput { - s.IcmpTypeCode = v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *ReplaceNetworkAclEntryInput) SetIpv6CidrBlock(v string) *ReplaceNetworkAclEntryInput { - s.Ipv6CidrBlock = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *ReplaceNetworkAclEntryInput) SetNetworkAclId(v string) *ReplaceNetworkAclEntryInput { - s.NetworkAclId = &v - return s -} - -// SetPortRange sets the PortRange field's value. -func (s *ReplaceNetworkAclEntryInput) SetPortRange(v *PortRange) *ReplaceNetworkAclEntryInput { - s.PortRange = v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *ReplaceNetworkAclEntryInput) SetProtocol(v string) *ReplaceNetworkAclEntryInput { - s.Protocol = &v - return s -} - -// SetRuleAction sets the RuleAction field's value. -func (s *ReplaceNetworkAclEntryInput) SetRuleAction(v string) *ReplaceNetworkAclEntryInput { - s.RuleAction = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *ReplaceNetworkAclEntryInput) SetRuleNumber(v int64) *ReplaceNetworkAclEntryInput { - s.RuleNumber = &v - return s -} - -type ReplaceNetworkAclEntryOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReplaceNetworkAclEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceNetworkAclEntryOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ReplaceRoute. -type ReplaceRouteInput struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR address block used for the destination match. The value you - // provide must match the CIDR of an existing route in the table. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // The IPv6 CIDR address block used for the destination match. The value you - // provide must match the CIDR of an existing route in the table. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // [IPv6 traffic only] The ID of an egress-only Internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` - - // The ID of an Internet gateway or virtual private gateway. - GatewayId *string `locationName:"gatewayId" type:"string"` - - // The ID of a NAT instance in your VPC. - InstanceId *string `locationName:"instanceId" type:"string"` - - // [IPv4 traffic only] The ID of a NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` - - // The ID of a network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` - - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s ReplaceRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceRouteInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *ReplaceRouteInput) SetDestinationCidrBlock(v string) *ReplaceRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *ReplaceRouteInput) SetDestinationIpv6CidrBlock(v string) *ReplaceRouteInput { - s.DestinationIpv6CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReplaceRouteInput) SetDryRun(v bool) *ReplaceRouteInput { - s.DryRun = &v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *ReplaceRouteInput) SetEgressOnlyInternetGatewayId(v string) *ReplaceRouteInput { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// SetGatewayId sets the GatewayId field's value. -func (s *ReplaceRouteInput) SetGatewayId(v string) *ReplaceRouteInput { - s.GatewayId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ReplaceRouteInput) SetInstanceId(v string) *ReplaceRouteInput { - s.InstanceId = &v - return s -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *ReplaceRouteInput) SetNatGatewayId(v string) *ReplaceRouteInput { - s.NatGatewayId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *ReplaceRouteInput) SetNetworkInterfaceId(v string) *ReplaceRouteInput { - s.NetworkInterfaceId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *ReplaceRouteInput) SetRouteTableId(v string) *ReplaceRouteInput { - s.RouteTableId = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *ReplaceRouteInput) SetVpcPeeringConnectionId(v string) *ReplaceRouteInput { - s.VpcPeeringConnectionId = &v - return s -} - -type ReplaceRouteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReplaceRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceRouteOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ReplaceRouteTableAssociation. -type ReplaceRouteTableAssociationInput struct { - _ struct{} `type:"structure"` - - // The association ID. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the new route table to associate with the subnet. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReplaceRouteTableAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceRouteTableAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceRouteTableAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceRouteTableAssociationInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *ReplaceRouteTableAssociationInput) SetAssociationId(v string) *ReplaceRouteTableAssociationInput { - s.AssociationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReplaceRouteTableAssociationInput) SetDryRun(v bool) *ReplaceRouteTableAssociationInput { - s.DryRun = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *ReplaceRouteTableAssociationInput) SetRouteTableId(v string) *ReplaceRouteTableAssociationInput { - s.RouteTableId = &v - return s -} - -// Contains the output of ReplaceRouteTableAssociation. -type ReplaceRouteTableAssociationOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new association. - NewAssociationId *string `locationName:"newAssociationId" type:"string"` -} - -// String returns the string representation -func (s ReplaceRouteTableAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceRouteTableAssociationOutput) GoString() string { - return s.String() -} - -// SetNewAssociationId sets the NewAssociationId field's value. -func (s *ReplaceRouteTableAssociationOutput) SetNewAssociationId(v string) *ReplaceRouteTableAssociationOutput { - s.NewAssociationId = &v - return s -} - -// Contains the parameters for ReportInstanceStatus. -type ReportInstanceStatusInput struct { - _ struct{} `type:"structure"` - - // Descriptive text about the health state of your instance. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The time at which the reported instance health state ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // One or more instances. - // - // Instances is a required field - Instances []*string `locationName:"instanceId" locationNameList:"InstanceId" type:"list" required:"true"` - - // One or more reason codes that describe the health state of your instance. - // - // * instance-stuck-in-state: My instance is stuck in a state. - // - // * unresponsive: My instance is unresponsive. - // - // * not-accepting-credentials: My instance is not accepting my credentials. - // - // * password-not-available: A password is not available for my instance. - // - // * performance-network: My instance is experiencing performance problems - // that I believe are network related. - // - // * performance-instance-store: My instance is experiencing performance - // problems that I believe are related to the instance stores. - // - // * performance-ebs-volume: My instance is experiencing performance problems - // that I believe are related to an EBS volume. - // - // * performance-other: My instance is experiencing performance problems. - // - // * other: [explain using the description parameter] - // - // ReasonCodes is a required field - ReasonCodes []*string `locationName:"reasonCode" locationNameList:"item" type:"list" required:"true"` - - // The time at which the reported instance health state began. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The status of all instances listed. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReportStatusType"` -} - -// String returns the string representation -func (s ReportInstanceStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReportInstanceStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReportInstanceStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReportInstanceStatusInput"} - if s.Instances == nil { - invalidParams.Add(request.NewErrParamRequired("Instances")) - } - if s.ReasonCodes == nil { - invalidParams.Add(request.NewErrParamRequired("ReasonCodes")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *ReportInstanceStatusInput) SetDescription(v string) *ReportInstanceStatusInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReportInstanceStatusInput) SetDryRun(v bool) *ReportInstanceStatusInput { - s.DryRun = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *ReportInstanceStatusInput) SetEndTime(v time.Time) *ReportInstanceStatusInput { - s.EndTime = &v - return s -} - -// SetInstances sets the Instances field's value. -func (s *ReportInstanceStatusInput) SetInstances(v []*string) *ReportInstanceStatusInput { - s.Instances = v - return s -} - -// SetReasonCodes sets the ReasonCodes field's value. -func (s *ReportInstanceStatusInput) SetReasonCodes(v []*string) *ReportInstanceStatusInput { - s.ReasonCodes = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ReportInstanceStatusInput) SetStartTime(v time.Time) *ReportInstanceStatusInput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReportInstanceStatusInput) SetStatus(v string) *ReportInstanceStatusInput { - s.Status = &v - return s -} - -type ReportInstanceStatusOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReportInstanceStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReportInstanceStatusOutput) GoString() string { - return s.String() -} - -// The information to include in the launch template. -type RequestLaunchTemplateData struct { - _ struct{} `type:"structure"` - - // The block device mapping. - // - // Supplying both a snapshot ID and an encryption value as arguments for block-device - // mapping results in an error. This is because only blank volumes can be encrypted - // on start, and these are not created from a snapshot. If a snapshot is the - // basis for the volume, it contains data by definition and its encryption status - // cannot be changed using this action. - BlockDeviceMappings []*LaunchTemplateBlockDeviceMappingRequest `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // The credit option for CPU usage of the instance. Valid for T2 instances only. - CreditSpecification *CreditSpecificationRequest `type:"structure"` - - // If set to true, you can't terminate the instance using the Amazon EC2 console, - // CLI, or API. To change this attribute to false after launch, use ModifyInstanceAttribute. - DisableApiTermination *bool `type:"boolean"` - - // Indicates whether the instance is optimized for Amazon EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal Amazon EBS I/O performance. This optimization isn't - // available with all instance types. Additional usage charges apply when using - // an EBS-optimized instance. - EbsOptimized *bool `type:"boolean"` - - // An elastic GPU to associate with the instance. - ElasticGpuSpecifications []*ElasticGpuSpecification `locationName:"ElasticGpuSpecification" locationNameList:"ElasticGpuSpecification" type:"list"` - - // The IAM instance profile. - IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecificationRequest `type:"structure"` - - // The ID of the AMI, which you can get by using DescribeImages. - ImageId *string `type:"string"` - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - // - // Default: stop - InstanceInitiatedShutdownBehavior *string `type:"string" enum:"ShutdownBehavior"` - - // The market (purchasing) option for the instances. - InstanceMarketOptions *LaunchTemplateInstanceMarketOptionsRequest `type:"structure"` - - // The instance type. For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. - InstanceType *string `type:"string" enum:"InstanceType"` - - // The ID of the kernel. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see User Provided Kernels (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) - // in the Amazon Elastic Compute Cloud User Guide. - KernelId *string `type:"string"` - - // The name of the key pair. You can create a key pair using CreateKeyPair or - // ImportKeyPair. - // - // If you do not specify a key pair, you can't connect to the instance unless - // you choose an AMI that is configured to allow users another way to log in. - KeyName *string `type:"string"` - - // The monitoring for the instance. - Monitoring *LaunchTemplatesMonitoringRequest `type:"structure"` - - // One or more network interfaces. - NetworkInterfaces []*LaunchTemplateInstanceNetworkInterfaceSpecificationRequest `locationName:"NetworkInterface" locationNameList:"InstanceNetworkInterfaceSpecification" type:"list"` - - // The placement for the instance. - Placement *LaunchTemplatePlacementRequest `type:"structure"` - - // The ID of the RAM disk. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see User Provided Kernels (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) - // in the Amazon Elastic Compute Cloud User Guide. - RamDiskId *string `type:"string"` - - // One or more security group IDs. You can create a security group using CreateSecurityGroup. - // You cannot specify both a security group ID and security name in the same - // request. - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // [EC2-Classic, default VPC] One or more security group names. For a nondefault - // VPC, you must use security group IDs instead. You cannot specify both a security - // group ID and security name in the same request. - SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"` - - // The tags to apply to the resources during launch. You can tag instances and - // volumes. The specified tags are applied to all instances or volumes that - // are created during launch. - TagSpecifications []*LaunchTemplateTagSpecificationRequest `locationName:"TagSpecification" locationNameList:"LaunchTemplateTagSpecificationRequest" type:"list"` - - // The Base64-encoded user data to make available to the instance. For more - // information, see Running Commands on Your Linux Instance at Launch (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) - // (Linux) and Adding User Data (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data) - // (Windows). - UserData *string `type:"string"` -} - -// String returns the string representation -func (s RequestLaunchTemplateData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestLaunchTemplateData) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestLaunchTemplateData) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestLaunchTemplateData"} - if s.CreditSpecification != nil { - if err := s.CreditSpecification.Validate(); err != nil { - invalidParams.AddNested("CreditSpecification", err.(request.ErrInvalidParams)) - } - } - if s.ElasticGpuSpecifications != nil { - for i, v := range s.ElasticGpuSpecifications { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ElasticGpuSpecifications", i), err.(request.ErrInvalidParams)) - } - } - } - if s.NetworkInterfaces != nil { - for i, v := range s.NetworkInterfaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *RequestLaunchTemplateData) SetBlockDeviceMappings(v []*LaunchTemplateBlockDeviceMappingRequest) *RequestLaunchTemplateData { - s.BlockDeviceMappings = v - return s -} - -// SetCreditSpecification sets the CreditSpecification field's value. -func (s *RequestLaunchTemplateData) SetCreditSpecification(v *CreditSpecificationRequest) *RequestLaunchTemplateData { - s.CreditSpecification = v - return s -} - -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *RequestLaunchTemplateData) SetDisableApiTermination(v bool) *RequestLaunchTemplateData { - s.DisableApiTermination = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *RequestLaunchTemplateData) SetEbsOptimized(v bool) *RequestLaunchTemplateData { - s.EbsOptimized = &v - return s -} - -// SetElasticGpuSpecifications sets the ElasticGpuSpecifications field's value. -func (s *RequestLaunchTemplateData) SetElasticGpuSpecifications(v []*ElasticGpuSpecification) *RequestLaunchTemplateData { - s.ElasticGpuSpecifications = v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *RequestLaunchTemplateData) SetIamInstanceProfile(v *LaunchTemplateIamInstanceProfileSpecificationRequest) *RequestLaunchTemplateData { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *RequestLaunchTemplateData) SetImageId(v string) *RequestLaunchTemplateData { - s.ImageId = &v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *RequestLaunchTemplateData) SetInstanceInitiatedShutdownBehavior(v string) *RequestLaunchTemplateData { - s.InstanceInitiatedShutdownBehavior = &v - return s -} - -// SetInstanceMarketOptions sets the InstanceMarketOptions field's value. -func (s *RequestLaunchTemplateData) SetInstanceMarketOptions(v *LaunchTemplateInstanceMarketOptionsRequest) *RequestLaunchTemplateData { - s.InstanceMarketOptions = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *RequestLaunchTemplateData) SetInstanceType(v string) *RequestLaunchTemplateData { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *RequestLaunchTemplateData) SetKernelId(v string) *RequestLaunchTemplateData { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *RequestLaunchTemplateData) SetKeyName(v string) *RequestLaunchTemplateData { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *RequestLaunchTemplateData) SetMonitoring(v *LaunchTemplatesMonitoringRequest) *RequestLaunchTemplateData { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *RequestLaunchTemplateData) SetNetworkInterfaces(v []*LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) *RequestLaunchTemplateData { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *RequestLaunchTemplateData) SetPlacement(v *LaunchTemplatePlacementRequest) *RequestLaunchTemplateData { - s.Placement = v - return s -} - -// SetRamDiskId sets the RamDiskId field's value. -func (s *RequestLaunchTemplateData) SetRamDiskId(v string) *RequestLaunchTemplateData { - s.RamDiskId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *RequestLaunchTemplateData) SetSecurityGroupIds(v []*string) *RequestLaunchTemplateData { - s.SecurityGroupIds = v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *RequestLaunchTemplateData) SetSecurityGroups(v []*string) *RequestLaunchTemplateData { - s.SecurityGroups = v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *RequestLaunchTemplateData) SetTagSpecifications(v []*LaunchTemplateTagSpecificationRequest) *RequestLaunchTemplateData { - s.TagSpecifications = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *RequestLaunchTemplateData) SetUserData(v string) *RequestLaunchTemplateData { - s.UserData = &v - return s -} - -// Contains the parameters for RequestSpotFleet. -type RequestSpotFleetInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The configuration for the Spot Fleet request. - // - // SpotFleetRequestConfig is a required field - SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure" required:"true"` -} - -// String returns the string representation -func (s RequestSpotFleetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestSpotFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestSpotFleetInput"} - if s.SpotFleetRequestConfig == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestConfig")) - } - if s.SpotFleetRequestConfig != nil { - if err := s.SpotFleetRequestConfig.Validate(); err != nil { - invalidParams.AddNested("SpotFleetRequestConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RequestSpotFleetInput) SetDryRun(v bool) *RequestSpotFleetInput { - s.DryRun = &v - return s -} - -// SetSpotFleetRequestConfig sets the SpotFleetRequestConfig field's value. -func (s *RequestSpotFleetInput) SetSpotFleetRequestConfig(v *SpotFleetRequestConfigData) *RequestSpotFleetInput { - s.SpotFleetRequestConfig = v - return s -} - -// Contains the output of RequestSpotFleet. -type RequestSpotFleetOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s RequestSpotFleetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotFleetOutput) GoString() string { - return s.String() -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *RequestSpotFleetOutput) SetSpotFleetRequestId(v string) *RequestSpotFleetOutput { - s.SpotFleetRequestId = &v - return s -} - -// Contains the parameters for RequestSpotInstances. -type RequestSpotInstancesInput struct { - _ struct{} `type:"structure"` - - // The user-specified name for a logical grouping of requests. - // - // When you specify an Availability Zone group in a Spot Instance request, all - // Spot Instances in the request are launched in the same Availability Zone. - // Instance proximity is maintained with this parameter, but the choice of Availability - // Zone is not. The group applies only to requests for Spot Instances of the - // same instance type. Any additional Spot Instance requests that are specified - // with the same Availability Zone group name are launched in that same Availability - // Zone, as long as at least one instance from the group is still active. - // - // If there is no active instance running in the Availability Zone group that - // you specify for a new Spot Instance request (all instances are terminated, - // the request is expired, or the maximum price you specified falls below current - // Spot price), then Amazon EC2 launches the instance in any Availability Zone - // where the constraint can be met. Consequently, the subsequent set of Spot - // Instances could be placed in a different zone from the original request, - // even if you specified the same Availability Zone group. - // - // Default: Instances are launched in any available Availability Zone. - AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` - - // The required duration for the Spot Instances (also known as Spot blocks), - // in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, - // or 360). - // - // The duration period starts as soon as your Spot Instance receives its instance - // ID. At the end of the duration period, Amazon EC2 marks the Spot Instance - // for termination and provides a Spot Instance termination notice, which gives - // the instance a two-minute warning before it terminates. - // - // You can't specify an Availability Zone group or a launch group if you specify - // a duration. - BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon EC2 User Guide for Linux Instances. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The maximum number of Spot Instances to launch. - // - // Default: 1 - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The behavior when a Spot Instance is interrupted. The default is terminate. - InstanceInterruptionBehavior *string `type:"string" enum:"InstanceInterruptionBehavior"` - - // The instance launch group. Launch groups are Spot Instances that launch together - // and terminate together. - // - // Default: Instances are launched and terminated individually - LaunchGroup *string `locationName:"launchGroup" type:"string"` - - // The launch specification. - LaunchSpecification *RequestSpotLaunchSpecification `type:"structure"` - - // The maximum price per hour that you are willing to pay for a Spot Instance. - // The default is the On-Demand price. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The Spot Instance request type. - // - // Default: one-time - Type *string `locationName:"type" type:"string" enum:"SpotInstanceType"` - - // The start date of the request. If this is a one-time request, the request - // becomes active at this date and time and remains active until all instances - // launch, the request expires, or the request is canceled. If the request is - // persistent, the request becomes active at this date and time and remains - // active until it expires or is canceled. - ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` - - // The end date of the request. If this is a one-time request, the request remains - // active until all instances launch, the request is canceled, or this date - // is reached. If the request is persistent, it remains active until it is canceled - // or this date is reached. The default end date is 7 days from the current - // date. - ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s RequestSpotInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestSpotInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestSpotInstancesInput"} - if s.LaunchSpecification != nil { - if err := s.LaunchSpecification.Validate(); err != nil { - invalidParams.AddNested("LaunchSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZoneGroup sets the AvailabilityZoneGroup field's value. -func (s *RequestSpotInstancesInput) SetAvailabilityZoneGroup(v string) *RequestSpotInstancesInput { - s.AvailabilityZoneGroup = &v - return s -} - -// SetBlockDurationMinutes sets the BlockDurationMinutes field's value. -func (s *RequestSpotInstancesInput) SetBlockDurationMinutes(v int64) *RequestSpotInstancesInput { - s.BlockDurationMinutes = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *RequestSpotInstancesInput) SetClientToken(v string) *RequestSpotInstancesInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RequestSpotInstancesInput) SetDryRun(v bool) *RequestSpotInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *RequestSpotInstancesInput) SetInstanceCount(v int64) *RequestSpotInstancesInput { - s.InstanceCount = &v - return s -} - -// SetInstanceInterruptionBehavior sets the InstanceInterruptionBehavior field's value. -func (s *RequestSpotInstancesInput) SetInstanceInterruptionBehavior(v string) *RequestSpotInstancesInput { - s.InstanceInterruptionBehavior = &v - return s -} - -// SetLaunchGroup sets the LaunchGroup field's value. -func (s *RequestSpotInstancesInput) SetLaunchGroup(v string) *RequestSpotInstancesInput { - s.LaunchGroup = &v - return s -} - -// SetLaunchSpecification sets the LaunchSpecification field's value. -func (s *RequestSpotInstancesInput) SetLaunchSpecification(v *RequestSpotLaunchSpecification) *RequestSpotInstancesInput { - s.LaunchSpecification = v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *RequestSpotInstancesInput) SetSpotPrice(v string) *RequestSpotInstancesInput { - s.SpotPrice = &v - return s -} - -// SetType sets the Type field's value. -func (s *RequestSpotInstancesInput) SetType(v string) *RequestSpotInstancesInput { - s.Type = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *RequestSpotInstancesInput) SetValidFrom(v time.Time) *RequestSpotInstancesInput { - s.ValidFrom = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *RequestSpotInstancesInput) SetValidUntil(v time.Time) *RequestSpotInstancesInput { - s.ValidUntil = &v - return s -} - -// Contains the output of RequestSpotInstances. -type RequestSpotInstancesOutput struct { - _ struct{} `type:"structure"` - - // One or more Spot Instance requests. - SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s RequestSpotInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotInstancesOutput) GoString() string { - return s.String() -} - -// SetSpotInstanceRequests sets the SpotInstanceRequests field's value. -func (s *RequestSpotInstancesOutput) SetSpotInstanceRequests(v []*SpotInstanceRequest) *RequestSpotInstancesOutput { - s.SpotInstanceRequests = v - return s -} - -// Describes the launch specification for an instance. -type RequestSpotLaunchSpecification struct { - _ struct{} `type:"structure"` - - // Deprecated. - AddressingType *string `locationName:"addressingType" type:"string"` - - // One or more block device mapping entries. You can't specify both a snapshot - // ID and an encryption value. This is because only blank volumes can be encrypted - // on creation. If a snapshot is the basis for a volume, it is not blank and - // its encryption status is used for the volume encryption status. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // Indicates whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - // - // Default: false - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The ID of the kernel. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // Indicates whether basic or detailed monitoring is enabled for the instance. - // - // Default: Disabled - Monitoring *RunInstancesMonitoringEnabled `locationName:"monitoring" type:"structure"` - - // One or more network interfaces. If you specify a network interface, you must - // specify subnet IDs and security group IDs using the network interface. - NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"NetworkInterface" locationNameList:"item" type:"list"` - - // The placement information for the instance. - Placement *SpotPlacement `locationName:"placement" type:"structure"` - - // The ID of the RAM disk. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // One or more security group IDs. - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` - - // One or more security groups. When requesting instances in a VPC, you must - // specify the IDs of the security groups. When requesting instances in EC2-Classic, - // you can specify the names or the IDs of the security groups. - SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"item" type:"list"` - - // The ID of the subnet in which to launch the instance. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The Base64-encoded user data for the instance. - UserData *string `locationName:"userData" type:"string"` -} - -// String returns the string representation -func (s RequestSpotLaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotLaunchSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestSpotLaunchSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestSpotLaunchSpecification"} - if s.Monitoring != nil { - if err := s.Monitoring.Validate(); err != nil { - invalidParams.AddNested("Monitoring", err.(request.ErrInvalidParams)) - } - } - if s.NetworkInterfaces != nil { - for i, v := range s.NetworkInterfaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddressingType sets the AddressingType field's value. -func (s *RequestSpotLaunchSpecification) SetAddressingType(v string) *RequestSpotLaunchSpecification { - s.AddressingType = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *RequestSpotLaunchSpecification) SetBlockDeviceMappings(v []*BlockDeviceMapping) *RequestSpotLaunchSpecification { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *RequestSpotLaunchSpecification) SetEbsOptimized(v bool) *RequestSpotLaunchSpecification { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *RequestSpotLaunchSpecification) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *RequestSpotLaunchSpecification { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *RequestSpotLaunchSpecification) SetImageId(v string) *RequestSpotLaunchSpecification { - s.ImageId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *RequestSpotLaunchSpecification) SetInstanceType(v string) *RequestSpotLaunchSpecification { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *RequestSpotLaunchSpecification) SetKernelId(v string) *RequestSpotLaunchSpecification { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *RequestSpotLaunchSpecification) SetKeyName(v string) *RequestSpotLaunchSpecification { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *RequestSpotLaunchSpecification) SetMonitoring(v *RunInstancesMonitoringEnabled) *RequestSpotLaunchSpecification { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *RequestSpotLaunchSpecification) SetNetworkInterfaces(v []*InstanceNetworkInterfaceSpecification) *RequestSpotLaunchSpecification { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *RequestSpotLaunchSpecification) SetPlacement(v *SpotPlacement) *RequestSpotLaunchSpecification { - s.Placement = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *RequestSpotLaunchSpecification) SetRamdiskId(v string) *RequestSpotLaunchSpecification { - s.RamdiskId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *RequestSpotLaunchSpecification) SetSecurityGroupIds(v []*string) *RequestSpotLaunchSpecification { - s.SecurityGroupIds = v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *RequestSpotLaunchSpecification) SetSecurityGroups(v []*string) *RequestSpotLaunchSpecification { - s.SecurityGroups = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *RequestSpotLaunchSpecification) SetSubnetId(v string) *RequestSpotLaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *RequestSpotLaunchSpecification) SetUserData(v string) *RequestSpotLaunchSpecification { - s.UserData = &v - return s -} - -// Describes a reservation. -type Reservation struct { - _ struct{} `type:"structure"` - - // [EC2-Classic only] One or more security groups. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // One or more instances. - Instances []*Instance `locationName:"instancesSet" locationNameList:"item" type:"list"` - - // The ID of the AWS account that owns the reservation. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The ID of the requester that launched the instances on your behalf (for example, - // AWS Management Console or Auto Scaling). - RequesterId *string `locationName:"requesterId" type:"string"` - - // The ID of the reservation. - ReservationId *string `locationName:"reservationId" type:"string"` -} - -// String returns the string representation -func (s Reservation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Reservation) GoString() string { - return s.String() -} - -// SetGroups sets the Groups field's value. -func (s *Reservation) SetGroups(v []*GroupIdentifier) *Reservation { - s.Groups = v - return s -} - -// SetInstances sets the Instances field's value. -func (s *Reservation) SetInstances(v []*Instance) *Reservation { - s.Instances = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *Reservation) SetOwnerId(v string) *Reservation { - s.OwnerId = &v - return s -} - -// SetRequesterId sets the RequesterId field's value. -func (s *Reservation) SetRequesterId(v string) *Reservation { - s.RequesterId = &v - return s -} - -// SetReservationId sets the ReservationId field's value. -func (s *Reservation) SetReservationId(v string) *Reservation { - s.ReservationId = &v - return s -} - -// The cost associated with the Reserved Instance. -type ReservationValue struct { - _ struct{} `type:"structure"` - - // The hourly rate of the reservation. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The balance of the total value (the sum of remainingUpfrontValue + hourlyPrice - // * number of hours remaining). - RemainingTotalValue *string `locationName:"remainingTotalValue" type:"string"` - - // The remaining upfront cost of the reservation. - RemainingUpfrontValue *string `locationName:"remainingUpfrontValue" type:"string"` -} - -// String returns the string representation -func (s ReservationValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservationValue) GoString() string { - return s.String() -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *ReservationValue) SetHourlyPrice(v string) *ReservationValue { - s.HourlyPrice = &v - return s -} - -// SetRemainingTotalValue sets the RemainingTotalValue field's value. -func (s *ReservationValue) SetRemainingTotalValue(v string) *ReservationValue { - s.RemainingTotalValue = &v - return s -} - -// SetRemainingUpfrontValue sets the RemainingUpfrontValue field's value. -func (s *ReservationValue) SetRemainingUpfrontValue(v string) *ReservationValue { - s.RemainingUpfrontValue = &v - return s -} - -// Describes the limit price of a Reserved Instance offering. -type ReservedInstanceLimitPrice struct { - _ struct{} `type:"structure"` - - // Used for Reserved Instance Marketplace offerings. Specifies the limit price - // on the total order (instanceCount * price). - Amount *float64 `locationName:"amount" type:"double"` - - // The currency in which the limitPrice amount is specified. At this time, the - // only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` -} - -// String returns the string representation -func (s ReservedInstanceLimitPrice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstanceLimitPrice) GoString() string { - return s.String() -} - -// SetAmount sets the Amount field's value. -func (s *ReservedInstanceLimitPrice) SetAmount(v float64) *ReservedInstanceLimitPrice { - s.Amount = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedInstanceLimitPrice) SetCurrencyCode(v string) *ReservedInstanceLimitPrice { - s.CurrencyCode = &v - return s -} - -// The total value of the Convertible Reserved Instance. -type ReservedInstanceReservationValue struct { - _ struct{} `type:"structure"` - - // The total value of the Convertible Reserved Instance that you are exchanging. - ReservationValue *ReservationValue `locationName:"reservationValue" type:"structure"` - - // The ID of the Convertible Reserved Instance that you are exchanging. - ReservedInstanceId *string `locationName:"reservedInstanceId" type:"string"` -} - -// String returns the string representation -func (s ReservedInstanceReservationValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstanceReservationValue) GoString() string { - return s.String() -} - -// SetReservationValue sets the ReservationValue field's value. -func (s *ReservedInstanceReservationValue) SetReservationValue(v *ReservationValue) *ReservedInstanceReservationValue { - s.ReservationValue = v - return s -} - -// SetReservedInstanceId sets the ReservedInstanceId field's value. -func (s *ReservedInstanceReservationValue) SetReservedInstanceId(v string) *ReservedInstanceReservationValue { - s.ReservedInstanceId = &v - return s -} - -// Describes a Reserved Instance. -type ReservedInstances struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which the Reserved Instance can be used. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The currency of the Reserved Instance. It's specified using ISO 4217 standard - // currency codes. At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The duration of the Reserved Instance, in seconds. - Duration *int64 `locationName:"duration" type:"long"` - - // The time when the Reserved Instance expires. - End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"iso8601"` - - // The purchase price of the Reserved Instance. - FixedPrice *float64 `locationName:"fixedPrice" type:"float"` - - // The number of reservations purchased. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The tenancy of the instance. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // The instance type on which the Reserved Instance can be used. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The offering class of the Reserved Instance. - OfferingClass *string `locationName:"offeringClass" type:"string" enum:"OfferingClassType"` - - // The Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - - // The Reserved Instance product platform description. - ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - - // The recurring charge tag assigned to the resource. - RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` - - // The ID of the Reserved Instance. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - - // The scope of the Reserved Instance. - Scope *string `locationName:"scope" type:"string" enum:"scope"` - - // The date and time the Reserved Instance started. - Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"` - - // The state of the Reserved Instance purchase. - State *string `locationName:"state" type:"string" enum:"ReservedInstanceState"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The usage price of the Reserved Instance, per hour. - UsagePrice *float64 `locationName:"usagePrice" type:"float"` -} - -// String returns the string representation -func (s ReservedInstances) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstances) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ReservedInstances) SetAvailabilityZone(v string) *ReservedInstances { - s.AvailabilityZone = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedInstances) SetCurrencyCode(v string) *ReservedInstances { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedInstances) SetDuration(v int64) *ReservedInstances { - s.Duration = &v - return s -} - -// SetEnd sets the End field's value. -func (s *ReservedInstances) SetEnd(v time.Time) *ReservedInstances { - s.End = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedInstances) SetFixedPrice(v float64) *ReservedInstances { - s.FixedPrice = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *ReservedInstances) SetInstanceCount(v int64) *ReservedInstances { - s.InstanceCount = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *ReservedInstances) SetInstanceTenancy(v string) *ReservedInstances { - s.InstanceTenancy = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ReservedInstances) SetInstanceType(v string) *ReservedInstances { - s.InstanceType = &v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *ReservedInstances) SetOfferingClass(v string) *ReservedInstances { - s.OfferingClass = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedInstances) SetOfferingType(v string) *ReservedInstances { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *ReservedInstances) SetProductDescription(v string) *ReservedInstances { - s.ProductDescription = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedInstances) SetRecurringCharges(v []*RecurringCharge) *ReservedInstances { - s.RecurringCharges = v - return s -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *ReservedInstances) SetReservedInstancesId(v string) *ReservedInstances { - s.ReservedInstancesId = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ReservedInstances) SetScope(v string) *ReservedInstances { - s.Scope = &v - return s -} - -// SetStart sets the Start field's value. -func (s *ReservedInstances) SetStart(v time.Time) *ReservedInstances { - s.Start = &v - return s -} - -// SetState sets the State field's value. -func (s *ReservedInstances) SetState(v string) *ReservedInstances { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ReservedInstances) SetTags(v []*Tag) *ReservedInstances { - s.Tags = v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedInstances) SetUsagePrice(v float64) *ReservedInstances { - s.UsagePrice = &v - return s -} - -// Describes the configuration settings for the modified Reserved Instances. -type ReservedInstancesConfiguration struct { - _ struct{} `type:"structure"` - - // The Availability Zone for the modified Reserved Instances. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of modified Reserved Instances. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The instance type for the modified Reserved Instances. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The network platform of the modified Reserved Instances, which is either - // EC2-Classic or EC2-VPC. - Platform *string `locationName:"platform" type:"string"` - - // Whether the Reserved Instance is applied to instances in a region or instances - // in a specific Availability Zone. - Scope *string `locationName:"scope" type:"string" enum:"scope"` -} - -// String returns the string representation -func (s ReservedInstancesConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesConfiguration) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ReservedInstancesConfiguration) SetAvailabilityZone(v string) *ReservedInstancesConfiguration { - s.AvailabilityZone = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *ReservedInstancesConfiguration) SetInstanceCount(v int64) *ReservedInstancesConfiguration { - s.InstanceCount = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ReservedInstancesConfiguration) SetInstanceType(v string) *ReservedInstancesConfiguration { - s.InstanceType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ReservedInstancesConfiguration) SetPlatform(v string) *ReservedInstancesConfiguration { - s.Platform = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ReservedInstancesConfiguration) SetScope(v string) *ReservedInstancesConfiguration { - s.Scope = &v - return s -} - -// Describes the ID of a Reserved Instance. -type ReservedInstancesId struct { - _ struct{} `type:"structure"` - - // The ID of the Reserved Instance. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` -} - -// String returns the string representation -func (s ReservedInstancesId) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesId) GoString() string { - return s.String() -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *ReservedInstancesId) SetReservedInstancesId(v string) *ReservedInstancesId { - s.ReservedInstancesId = &v - return s -} - -// Describes a Reserved Instance listing. -type ReservedInstancesListing struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive key supplied by the client to ensure that the request - // is idempotent. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // The time the listing was created. - CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"` - - // The number of instances in this state. - InstanceCounts []*InstanceCount `locationName:"instanceCounts" locationNameList:"item" type:"list"` - - // The price of the Reserved Instance listing. - PriceSchedules []*PriceSchedule `locationName:"priceSchedules" locationNameList:"item" type:"list"` - - // The ID of the Reserved Instance. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - - // The ID of the Reserved Instance listing. - ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` - - // The status of the Reserved Instance listing. - Status *string `locationName:"status" type:"string" enum:"ListingStatus"` - - // The reason for the current status of the Reserved Instance listing. The response - // can be blank. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The last modified timestamp of the listing. - UpdateDate *time.Time `locationName:"updateDate" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ReservedInstancesListing) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesListing) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *ReservedInstancesListing) SetClientToken(v string) *ReservedInstancesListing { - s.ClientToken = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ReservedInstancesListing) SetCreateDate(v time.Time) *ReservedInstancesListing { - s.CreateDate = &v - return s -} - -// SetInstanceCounts sets the InstanceCounts field's value. -func (s *ReservedInstancesListing) SetInstanceCounts(v []*InstanceCount) *ReservedInstancesListing { - s.InstanceCounts = v - return s -} - -// SetPriceSchedules sets the PriceSchedules field's value. -func (s *ReservedInstancesListing) SetPriceSchedules(v []*PriceSchedule) *ReservedInstancesListing { - s.PriceSchedules = v - return s -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *ReservedInstancesListing) SetReservedInstancesId(v string) *ReservedInstancesListing { - s.ReservedInstancesId = &v - return s -} - -// SetReservedInstancesListingId sets the ReservedInstancesListingId field's value. -func (s *ReservedInstancesListing) SetReservedInstancesListingId(v string) *ReservedInstancesListing { - s.ReservedInstancesListingId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReservedInstancesListing) SetStatus(v string) *ReservedInstancesListing { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ReservedInstancesListing) SetStatusMessage(v string) *ReservedInstancesListing { - s.StatusMessage = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ReservedInstancesListing) SetTags(v []*Tag) *ReservedInstancesListing { - s.Tags = v - return s -} - -// SetUpdateDate sets the UpdateDate field's value. -func (s *ReservedInstancesListing) SetUpdateDate(v time.Time) *ReservedInstancesListing { - s.UpdateDate = &v - return s -} - -// Describes a Reserved Instance modification. -type ReservedInstancesModification struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive key supplied by the client to ensure that the request - // is idempotent. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // The time when the modification request was created. - CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"` - - // The time for the modification to become effective. - EffectiveDate *time.Time `locationName:"effectiveDate" type:"timestamp" timestampFormat:"iso8601"` - - // Contains target configurations along with their corresponding new Reserved - // Instance IDs. - ModificationResults []*ReservedInstancesModificationResult `locationName:"modificationResultSet" locationNameList:"item" type:"list"` - - // The IDs of one or more Reserved Instances. - ReservedInstancesIds []*ReservedInstancesId `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` - - // A unique ID for the Reserved Instance modification. - ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` - - // The status of the Reserved Instances modification request. - Status *string `locationName:"status" type:"string"` - - // The reason for the status. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The time when the modification request was last updated. - UpdateDate *time.Time `locationName:"updateDate" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ReservedInstancesModification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesModification) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *ReservedInstancesModification) SetClientToken(v string) *ReservedInstancesModification { - s.ClientToken = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ReservedInstancesModification) SetCreateDate(v time.Time) *ReservedInstancesModification { - s.CreateDate = &v - return s -} - -// SetEffectiveDate sets the EffectiveDate field's value. -func (s *ReservedInstancesModification) SetEffectiveDate(v time.Time) *ReservedInstancesModification { - s.EffectiveDate = &v - return s -} - -// SetModificationResults sets the ModificationResults field's value. -func (s *ReservedInstancesModification) SetModificationResults(v []*ReservedInstancesModificationResult) *ReservedInstancesModification { - s.ModificationResults = v - return s -} - -// SetReservedInstancesIds sets the ReservedInstancesIds field's value. -func (s *ReservedInstancesModification) SetReservedInstancesIds(v []*ReservedInstancesId) *ReservedInstancesModification { - s.ReservedInstancesIds = v - return s -} - -// SetReservedInstancesModificationId sets the ReservedInstancesModificationId field's value. -func (s *ReservedInstancesModification) SetReservedInstancesModificationId(v string) *ReservedInstancesModification { - s.ReservedInstancesModificationId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReservedInstancesModification) SetStatus(v string) *ReservedInstancesModification { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ReservedInstancesModification) SetStatusMessage(v string) *ReservedInstancesModification { - s.StatusMessage = &v - return s -} - -// SetUpdateDate sets the UpdateDate field's value. -func (s *ReservedInstancesModification) SetUpdateDate(v time.Time) *ReservedInstancesModification { - s.UpdateDate = &v - return s -} - -// Describes the modification request/s. -type ReservedInstancesModificationResult struct { - _ struct{} `type:"structure"` - - // The ID for the Reserved Instances that were created as part of the modification - // request. This field is only available when the modification is fulfilled. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - - // The target Reserved Instances configurations supplied as part of the modification - // request. - TargetConfiguration *ReservedInstancesConfiguration `locationName:"targetConfiguration" type:"structure"` -} - -// String returns the string representation -func (s ReservedInstancesModificationResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesModificationResult) GoString() string { - return s.String() -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *ReservedInstancesModificationResult) SetReservedInstancesId(v string) *ReservedInstancesModificationResult { - s.ReservedInstancesId = &v - return s -} - -// SetTargetConfiguration sets the TargetConfiguration field's value. -func (s *ReservedInstancesModificationResult) SetTargetConfiguration(v *ReservedInstancesConfiguration) *ReservedInstancesModificationResult { - s.TargetConfiguration = v - return s -} - -// Describes a Reserved Instance offering. -type ReservedInstancesOffering struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which the Reserved Instance can be used. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The currency of the Reserved Instance offering you are purchasing. It's specified - // using ISO 4217 standard currency codes. At this time, the only supported - // currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The duration of the Reserved Instance, in seconds. - Duration *int64 `locationName:"duration" type:"long"` - - // The purchase price of the Reserved Instance. - FixedPrice *float64 `locationName:"fixedPrice" type:"float"` - - // The tenancy of the instance. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // The instance type on which the Reserved Instance can be used. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // Indicates whether the offering is available through the Reserved Instance - // Marketplace (resale) or AWS. If it's a Reserved Instance Marketplace offering, - // this is true. - Marketplace *bool `locationName:"marketplace" type:"boolean"` - - // If convertible it can be exchanged for Reserved Instances of the same or - // higher monetary value, with different configurations. If standard, it is - // not possible to perform an exchange. - OfferingClass *string `locationName:"offeringClass" type:"string" enum:"OfferingClassType"` - - // The Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - - // The pricing details of the Reserved Instance offering. - PricingDetails []*PricingDetail `locationName:"pricingDetailsSet" locationNameList:"item" type:"list"` - - // The Reserved Instance product platform description. - ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - - // The recurring charge tag assigned to the resource. - RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` - - // The ID of the Reserved Instance offering. This is the offering ID used in - // GetReservedInstancesExchangeQuote to confirm that an exchange can be made. - ReservedInstancesOfferingId *string `locationName:"reservedInstancesOfferingId" type:"string"` - - // Whether the Reserved Instance is applied to instances in a region or an Availability - // Zone. - Scope *string `locationName:"scope" type:"string" enum:"scope"` - - // The usage price of the Reserved Instance, per hour. - UsagePrice *float64 `locationName:"usagePrice" type:"float"` -} - -// String returns the string representation -func (s ReservedInstancesOffering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesOffering) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ReservedInstancesOffering) SetAvailabilityZone(v string) *ReservedInstancesOffering { - s.AvailabilityZone = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedInstancesOffering) SetCurrencyCode(v string) *ReservedInstancesOffering { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedInstancesOffering) SetDuration(v int64) *ReservedInstancesOffering { - s.Duration = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedInstancesOffering) SetFixedPrice(v float64) *ReservedInstancesOffering { - s.FixedPrice = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *ReservedInstancesOffering) SetInstanceTenancy(v string) *ReservedInstancesOffering { - s.InstanceTenancy = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ReservedInstancesOffering) SetInstanceType(v string) *ReservedInstancesOffering { - s.InstanceType = &v - return s -} - -// SetMarketplace sets the Marketplace field's value. -func (s *ReservedInstancesOffering) SetMarketplace(v bool) *ReservedInstancesOffering { - s.Marketplace = &v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *ReservedInstancesOffering) SetOfferingClass(v string) *ReservedInstancesOffering { - s.OfferingClass = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedInstancesOffering) SetOfferingType(v string) *ReservedInstancesOffering { - s.OfferingType = &v - return s -} - -// SetPricingDetails sets the PricingDetails field's value. -func (s *ReservedInstancesOffering) SetPricingDetails(v []*PricingDetail) *ReservedInstancesOffering { - s.PricingDetails = v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *ReservedInstancesOffering) SetProductDescription(v string) *ReservedInstancesOffering { - s.ProductDescription = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedInstancesOffering) SetRecurringCharges(v []*RecurringCharge) *ReservedInstancesOffering { - s.RecurringCharges = v - return s -} - -// SetReservedInstancesOfferingId sets the ReservedInstancesOfferingId field's value. -func (s *ReservedInstancesOffering) SetReservedInstancesOfferingId(v string) *ReservedInstancesOffering { - s.ReservedInstancesOfferingId = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ReservedInstancesOffering) SetScope(v string) *ReservedInstancesOffering { - s.Scope = &v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedInstancesOffering) SetUsagePrice(v float64) *ReservedInstancesOffering { - s.UsagePrice = &v - return s -} - -type ResetFpgaImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute. - Attribute *string `type:"string" enum:"ResetFpgaImageAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the AFI. - // - // FpgaImageId is a required field - FpgaImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ResetFpgaImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetFpgaImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetFpgaImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetFpgaImageAttributeInput"} - if s.FpgaImageId == nil { - invalidParams.Add(request.NewErrParamRequired("FpgaImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ResetFpgaImageAttributeInput) SetAttribute(v string) *ResetFpgaImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetFpgaImageAttributeInput) SetDryRun(v bool) *ResetFpgaImageAttributeInput { - s.DryRun = &v - return s -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *ResetFpgaImageAttributeInput) SetFpgaImageId(v string) *ResetFpgaImageAttributeInput { - s.FpgaImageId = &v - return s -} - -type ResetFpgaImageAttributeOutput struct { - _ struct{} `type:"structure"` - - // Is true if the request succeeds, and an error otherwise. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ResetFpgaImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetFpgaImageAttributeOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ResetFpgaImageAttributeOutput) SetReturn(v bool) *ResetFpgaImageAttributeOutput { - s.Return = &v - return s -} - -// Contains the parameters for ResetImageAttribute. -type ResetImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute to reset (currently you can only reset the launch permission - // attribute). - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"ResetImageAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the AMI. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ResetImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetImageAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ResetImageAttributeInput) SetAttribute(v string) *ResetImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetImageAttributeInput) SetDryRun(v bool) *ResetImageAttributeInput { - s.DryRun = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ResetImageAttributeInput) SetImageId(v string) *ResetImageAttributeInput { - s.ImageId = &v - return s -} - -type ResetImageAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResetImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetImageAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ResetInstanceAttribute. -type ResetInstanceAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute to reset. - // - // You can only reset the following attributes: kernel | ramdisk | sourceDestCheck. - // To change an instance attribute, use ModifyInstanceAttribute. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"InstanceAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ResetInstanceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetInstanceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetInstanceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetInstanceAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ResetInstanceAttributeInput) SetAttribute(v string) *ResetInstanceAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetInstanceAttributeInput) SetDryRun(v bool) *ResetInstanceAttributeInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ResetInstanceAttributeInput) SetInstanceId(v string) *ResetInstanceAttributeInput { - s.InstanceId = &v - return s -} - -type ResetInstanceAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResetInstanceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetInstanceAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ResetNetworkInterfaceAttribute. -type ResetNetworkInterfaceAttributeInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - - // The source/destination checking attribute. Resets the value to true. - SourceDestCheck *string `locationName:"sourceDestCheck" type:"string"` -} - -// String returns the string representation -func (s ResetNetworkInterfaceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetNetworkInterfaceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetNetworkInterfaceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetNetworkInterfaceAttributeInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetNetworkInterfaceAttributeInput) SetDryRun(v bool) *ResetNetworkInterfaceAttributeInput { - s.DryRun = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *ResetNetworkInterfaceAttributeInput) SetNetworkInterfaceId(v string) *ResetNetworkInterfaceAttributeInput { - s.NetworkInterfaceId = &v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *ResetNetworkInterfaceAttributeInput) SetSourceDestCheck(v string) *ResetNetworkInterfaceAttributeInput { - s.SourceDestCheck = &v - return s -} - -type ResetNetworkInterfaceAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResetNetworkInterfaceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetNetworkInterfaceAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ResetSnapshotAttribute. -type ResetSnapshotAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute to reset. Currently, only the attribute for permission to create - // volumes can be reset. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"SnapshotAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the snapshot. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ResetSnapshotAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetSnapshotAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetSnapshotAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetSnapshotAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ResetSnapshotAttributeInput) SetAttribute(v string) *ResetSnapshotAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetSnapshotAttributeInput) SetDryRun(v bool) *ResetSnapshotAttributeInput { - s.DryRun = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *ResetSnapshotAttributeInput) SetSnapshotId(v string) *ResetSnapshotAttributeInput { - s.SnapshotId = &v - return s -} - -type ResetSnapshotAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResetSnapshotAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetSnapshotAttributeOutput) GoString() string { - return s.String() -} - -// Describes the error that's returned when you cannot delete a launch template -// version. -type ResponseError struct { - _ struct{} `type:"structure"` - - // The error code. - Code *string `locationName:"code" type:"string" enum:"LaunchTemplateErrorCode"` - - // The error message, if applicable. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s ResponseError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResponseError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ResponseError) SetCode(v string) *ResponseError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ResponseError) SetMessage(v string) *ResponseError { - s.Message = &v - return s -} - -// The information for a launch template. -type ResponseLaunchTemplateData struct { - _ struct{} `type:"structure"` - - // The block device mappings. - BlockDeviceMappings []*LaunchTemplateBlockDeviceMapping `locationName:"blockDeviceMappingSet" locationNameList:"item" type:"list"` - - // The credit option for CPU usage of the instance. - CreditSpecification *CreditSpecification `locationName:"creditSpecification" type:"structure"` - - // If set to true, indicates that the instance cannot be terminated using the - // Amazon EC2 console, command line tool, or API. - DisableApiTermination *bool `locationName:"disableApiTermination" type:"boolean"` - - // Indicates whether the instance is optimized for Amazon EBS I/O. - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The elastic GPU specification. - ElasticGpuSpecifications []*ElasticGpuSpecificationResponse `locationName:"elasticGpuSpecificationSet" locationNameList:"item" type:"list"` - - // The IAM instance profile. - IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI that was used to launch the instance. - ImageId *string `locationName:"imageId" type:"string"` - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"` - - // The market (purchasing) option for the instances. - InstanceMarketOptions *LaunchTemplateInstanceMarketOptions `locationName:"instanceMarketOptions" type:"structure"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The ID of the kernel, if applicable. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // The monitoring for the instance. - Monitoring *LaunchTemplatesMonitoring `locationName:"monitoring" type:"structure"` - - // The network interfaces. - NetworkInterfaces []*LaunchTemplateInstanceNetworkInterfaceSpecification `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - - // The placement of the instance. - Placement *LaunchTemplatePlacement `locationName:"placement" type:"structure"` - - // The ID of the RAM disk, if applicable. - RamDiskId *string `locationName:"ramDiskId" type:"string"` - - // The security group IDs. - SecurityGroupIds []*string `locationName:"securityGroupIdSet" locationNameList:"item" type:"list"` - - // The security group names. - SecurityGroups []*string `locationName:"securityGroupSet" locationNameList:"item" type:"list"` - - // The tags. - TagSpecifications []*LaunchTemplateTagSpecification `locationName:"tagSpecificationSet" locationNameList:"item" type:"list"` - - // The user data for the instance. - UserData *string `locationName:"userData" type:"string"` -} - -// String returns the string representation -func (s ResponseLaunchTemplateData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResponseLaunchTemplateData) GoString() string { - return s.String() -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *ResponseLaunchTemplateData) SetBlockDeviceMappings(v []*LaunchTemplateBlockDeviceMapping) *ResponseLaunchTemplateData { - s.BlockDeviceMappings = v - return s -} - -// SetCreditSpecification sets the CreditSpecification field's value. -func (s *ResponseLaunchTemplateData) SetCreditSpecification(v *CreditSpecification) *ResponseLaunchTemplateData { - s.CreditSpecification = v - return s -} - -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *ResponseLaunchTemplateData) SetDisableApiTermination(v bool) *ResponseLaunchTemplateData { - s.DisableApiTermination = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *ResponseLaunchTemplateData) SetEbsOptimized(v bool) *ResponseLaunchTemplateData { - s.EbsOptimized = &v - return s -} - -// SetElasticGpuSpecifications sets the ElasticGpuSpecifications field's value. -func (s *ResponseLaunchTemplateData) SetElasticGpuSpecifications(v []*ElasticGpuSpecificationResponse) *ResponseLaunchTemplateData { - s.ElasticGpuSpecifications = v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *ResponseLaunchTemplateData) SetIamInstanceProfile(v *LaunchTemplateIamInstanceProfileSpecification) *ResponseLaunchTemplateData { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ResponseLaunchTemplateData) SetImageId(v string) *ResponseLaunchTemplateData { - s.ImageId = &v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *ResponseLaunchTemplateData) SetInstanceInitiatedShutdownBehavior(v string) *ResponseLaunchTemplateData { - s.InstanceInitiatedShutdownBehavior = &v - return s -} - -// SetInstanceMarketOptions sets the InstanceMarketOptions field's value. -func (s *ResponseLaunchTemplateData) SetInstanceMarketOptions(v *LaunchTemplateInstanceMarketOptions) *ResponseLaunchTemplateData { - s.InstanceMarketOptions = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ResponseLaunchTemplateData) SetInstanceType(v string) *ResponseLaunchTemplateData { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *ResponseLaunchTemplateData) SetKernelId(v string) *ResponseLaunchTemplateData { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *ResponseLaunchTemplateData) SetKeyName(v string) *ResponseLaunchTemplateData { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *ResponseLaunchTemplateData) SetMonitoring(v *LaunchTemplatesMonitoring) *ResponseLaunchTemplateData { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *ResponseLaunchTemplateData) SetNetworkInterfaces(v []*LaunchTemplateInstanceNetworkInterfaceSpecification) *ResponseLaunchTemplateData { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *ResponseLaunchTemplateData) SetPlacement(v *LaunchTemplatePlacement) *ResponseLaunchTemplateData { - s.Placement = v - return s -} - -// SetRamDiskId sets the RamDiskId field's value. -func (s *ResponseLaunchTemplateData) SetRamDiskId(v string) *ResponseLaunchTemplateData { - s.RamDiskId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ResponseLaunchTemplateData) SetSecurityGroupIds(v []*string) *ResponseLaunchTemplateData { - s.SecurityGroupIds = v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *ResponseLaunchTemplateData) SetSecurityGroups(v []*string) *ResponseLaunchTemplateData { - s.SecurityGroups = v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *ResponseLaunchTemplateData) SetTagSpecifications(v []*LaunchTemplateTagSpecification) *ResponseLaunchTemplateData { - s.TagSpecifications = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ResponseLaunchTemplateData) SetUserData(v string) *ResponseLaunchTemplateData { - s.UserData = &v - return s -} - -// Contains the parameters for RestoreAddressToClassic. -type RestoreAddressToClassicInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The Elastic IP address. - // - // PublicIp is a required field - PublicIp *string `locationName:"publicIp" type:"string" required:"true"` -} - -// String returns the string representation -func (s RestoreAddressToClassicInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreAddressToClassicInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreAddressToClassicInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreAddressToClassicInput"} - if s.PublicIp == nil { - invalidParams.Add(request.NewErrParamRequired("PublicIp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RestoreAddressToClassicInput) SetDryRun(v bool) *RestoreAddressToClassicInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *RestoreAddressToClassicInput) SetPublicIp(v string) *RestoreAddressToClassicInput { - s.PublicIp = &v - return s -} - -// Contains the output of RestoreAddressToClassic. -type RestoreAddressToClassicOutput struct { - _ struct{} `type:"structure"` - - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` - - // The move status for the IP address. - Status *string `locationName:"status" type:"string" enum:"Status"` -} - -// String returns the string representation -func (s RestoreAddressToClassicOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreAddressToClassicOutput) GoString() string { - return s.String() -} - -// SetPublicIp sets the PublicIp field's value. -func (s *RestoreAddressToClassicOutput) SetPublicIp(v string) *RestoreAddressToClassicOutput { - s.PublicIp = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RestoreAddressToClassicOutput) SetStatus(v string) *RestoreAddressToClassicOutput { - s.Status = &v - return s -} - -// Contains the parameters for RevokeSecurityGroupEgress. -type RevokeSecurityGroupEgressInput struct { - _ struct{} `type:"structure"` - - // Not supported. Use a set of IP permissions to specify the CIDR. - CidrIp *string `locationName:"cidrIp" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Not supported. Use a set of IP permissions to specify the port. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The ID of the security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` - - // One or more sets of IP permissions. You can't specify a destination security - // group and a CIDR IP address range in the same set of permissions. - IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` - - // Not supported. Use a set of IP permissions to specify the protocol name or - // number. - IpProtocol *string `locationName:"ipProtocol" type:"string"` - - // Not supported. Use a set of IP permissions to specify a destination security - // group. - SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"` - - // Not supported. Use a set of IP permissions to specify a destination security - // group. - SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` - - // Not supported. Use a set of IP permissions to specify the port. - ToPort *int64 `locationName:"toPort" type:"integer"` -} - -// String returns the string representation -func (s RevokeSecurityGroupEgressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSecurityGroupEgressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RevokeSecurityGroupEgressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RevokeSecurityGroupEgressInput"} - if s.GroupId == nil { - invalidParams.Add(request.NewErrParamRequired("GroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrIp sets the CidrIp field's value. -func (s *RevokeSecurityGroupEgressInput) SetCidrIp(v string) *RevokeSecurityGroupEgressInput { - s.CidrIp = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RevokeSecurityGroupEgressInput) SetDryRun(v bool) *RevokeSecurityGroupEgressInput { - s.DryRun = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *RevokeSecurityGroupEgressInput) SetFromPort(v int64) *RevokeSecurityGroupEgressInput { - s.FromPort = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *RevokeSecurityGroupEgressInput) SetGroupId(v string) *RevokeSecurityGroupEgressInput { - s.GroupId = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *RevokeSecurityGroupEgressInput) SetIpPermissions(v []*IpPermission) *RevokeSecurityGroupEgressInput { - s.IpPermissions = v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *RevokeSecurityGroupEgressInput) SetIpProtocol(v string) *RevokeSecurityGroupEgressInput { - s.IpProtocol = &v - return s -} - -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *RevokeSecurityGroupEgressInput) SetSourceSecurityGroupName(v string) *RevokeSecurityGroupEgressInput { - s.SourceSecurityGroupName = &v - return s -} - -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *RevokeSecurityGroupEgressInput) SetSourceSecurityGroupOwnerId(v string) *RevokeSecurityGroupEgressInput { - s.SourceSecurityGroupOwnerId = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *RevokeSecurityGroupEgressInput) SetToPort(v int64) *RevokeSecurityGroupEgressInput { - s.ToPort = &v - return s -} - -type RevokeSecurityGroupEgressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RevokeSecurityGroupEgressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSecurityGroupEgressOutput) GoString() string { - return s.String() -} - -// Contains the parameters for RevokeSecurityGroupIngress. -type RevokeSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The CIDR IP address range. You can't specify this parameter when specifying - // a source security group. - CidrIp *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The start of port range for the TCP and UDP protocols, or an ICMP type number. - // For the ICMP type number, use -1 to specify all ICMP types. - FromPort *int64 `type:"integer"` - - // The ID of the security group. You must specify either the security group - // ID or the security group name in the request. For security groups in a nondefault - // VPC, you must specify the security group ID. - GroupId *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the security group. You must specify - // either the security group ID or the security group name in the request. - GroupName *string `type:"string"` - - // One or more sets of IP permissions. You can't specify a source security group - // and a CIDR IP address range in the same set of permissions. - IpPermissions []*IpPermission `locationNameList:"item" type:"list"` - - // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). - // Use -1 to specify all. - IpProtocol *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the source security group. You can't - // specify this parameter in combination with the following parameters: the - // CIDR IP address range, the start of the port range, the IP protocol, and - // the end of the port range. For EC2-VPC, the source security group must be - // in the same VPC. To revoke a specific rule for an IP protocol and port range, - // use a set of IP permissions instead. - SourceSecurityGroupName *string `type:"string"` - - // [EC2-Classic] The AWS account ID of the source security group, if the source - // security group is in a different account. You can't specify this parameter - // in combination with the following parameters: the CIDR IP address range, - // the IP protocol, the start of the port range, and the end of the port range. - // To revoke a specific rule for an IP protocol and port range, use a set of - // IP permissions instead. - SourceSecurityGroupOwnerId *string `type:"string"` - - // The end of port range for the TCP and UDP protocols, or an ICMP code number. - // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. - ToPort *int64 `type:"integer"` -} - -// String returns the string representation -func (s RevokeSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// SetCidrIp sets the CidrIp field's value. -func (s *RevokeSecurityGroupIngressInput) SetCidrIp(v string) *RevokeSecurityGroupIngressInput { - s.CidrIp = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RevokeSecurityGroupIngressInput) SetDryRun(v bool) *RevokeSecurityGroupIngressInput { - s.DryRun = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *RevokeSecurityGroupIngressInput) SetFromPort(v int64) *RevokeSecurityGroupIngressInput { - s.FromPort = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *RevokeSecurityGroupIngressInput) SetGroupId(v string) *RevokeSecurityGroupIngressInput { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *RevokeSecurityGroupIngressInput) SetGroupName(v string) *RevokeSecurityGroupIngressInput { - s.GroupName = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *RevokeSecurityGroupIngressInput) SetIpPermissions(v []*IpPermission) *RevokeSecurityGroupIngressInput { - s.IpPermissions = v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *RevokeSecurityGroupIngressInput) SetIpProtocol(v string) *RevokeSecurityGroupIngressInput { - s.IpProtocol = &v - return s -} - -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *RevokeSecurityGroupIngressInput) SetSourceSecurityGroupName(v string) *RevokeSecurityGroupIngressInput { - s.SourceSecurityGroupName = &v - return s -} - -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *RevokeSecurityGroupIngressInput) SetSourceSecurityGroupOwnerId(v string) *RevokeSecurityGroupIngressInput { - s.SourceSecurityGroupOwnerId = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *RevokeSecurityGroupIngressInput) SetToPort(v int64) *RevokeSecurityGroupIngressInput { - s.ToPort = &v - return s -} - -type RevokeSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RevokeSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// Describes a route in a route table. -type Route struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR block used for the destination match. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // The IPv6 CIDR block used for the destination match. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` - - // The prefix of the AWS service. - DestinationPrefixListId *string `locationName:"destinationPrefixListId" type:"string"` - - // The ID of the egress-only Internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` - - // The ID of a gateway attached to your VPC. - GatewayId *string `locationName:"gatewayId" type:"string"` - - // The ID of a NAT instance in your VPC. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The AWS account ID of the owner of the instance. - InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` - - // The ID of a NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // Describes how the route was created. - // - // * CreateRouteTable - The route was automatically created when the route - // table was created. - // - // * CreateRoute - The route was manually added to the route table. - // - // * EnableVgwRoutePropagation - The route was propagated by route propagation. - Origin *string `locationName:"origin" type:"string" enum:"RouteOrigin"` - - // The state of the route. The blackhole state indicates that the route's target - // isn't available (for example, the specified gateway isn't attached to the - // VPC, or the specified NAT instance has been terminated). - State *string `locationName:"state" type:"string" enum:"RouteState"` - - // The ID of the VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s Route) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Route) GoString() string { - return s.String() -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *Route) SetDestinationCidrBlock(v string) *Route { - s.DestinationCidrBlock = &v - return s -} - -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *Route) SetDestinationIpv6CidrBlock(v string) *Route { - s.DestinationIpv6CidrBlock = &v - return s -} - -// SetDestinationPrefixListId sets the DestinationPrefixListId field's value. -func (s *Route) SetDestinationPrefixListId(v string) *Route { - s.DestinationPrefixListId = &v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *Route) SetEgressOnlyInternetGatewayId(v string) *Route { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// SetGatewayId sets the GatewayId field's value. -func (s *Route) SetGatewayId(v string) *Route { - s.GatewayId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Route) SetInstanceId(v string) *Route { - s.InstanceId = &v - return s -} - -// SetInstanceOwnerId sets the InstanceOwnerId field's value. -func (s *Route) SetInstanceOwnerId(v string) *Route { - s.InstanceOwnerId = &v - return s -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *Route) SetNatGatewayId(v string) *Route { - s.NatGatewayId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *Route) SetNetworkInterfaceId(v string) *Route { - s.NetworkInterfaceId = &v - return s -} - -// SetOrigin sets the Origin field's value. -func (s *Route) SetOrigin(v string) *Route { - s.Origin = &v - return s -} - -// SetState sets the State field's value. -func (s *Route) SetState(v string) *Route { - s.State = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *Route) SetVpcPeeringConnectionId(v string) *Route { - s.VpcPeeringConnectionId = &v - return s -} - -// Describes a route table. -type RouteTable struct { - _ struct{} `type:"structure"` - - // The associations between the route table and one or more subnets. - Associations []*RouteTableAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` - - // Any virtual private gateway (VGW) propagating routes. - PropagatingVgws []*PropagatingVgw `locationName:"propagatingVgwSet" locationNameList:"item" type:"list"` - - // The ID of the route table. - RouteTableId *string `locationName:"routeTableId" type:"string"` - - // The routes in the route table. - Routes []*Route `locationName:"routeSet" locationNameList:"item" type:"list"` - - // Any tags assigned to the route table. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s RouteTable) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RouteTable) GoString() string { - return s.String() -} - -// SetAssociations sets the Associations field's value. -func (s *RouteTable) SetAssociations(v []*RouteTableAssociation) *RouteTable { - s.Associations = v - return s -} - -// SetPropagatingVgws sets the PropagatingVgws field's value. -func (s *RouteTable) SetPropagatingVgws(v []*PropagatingVgw) *RouteTable { - s.PropagatingVgws = v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *RouteTable) SetRouteTableId(v string) *RouteTable { - s.RouteTableId = &v - return s -} - -// SetRoutes sets the Routes field's value. -func (s *RouteTable) SetRoutes(v []*Route) *RouteTable { - s.Routes = v - return s -} - -// SetTags sets the Tags field's value. -func (s *RouteTable) SetTags(v []*Tag) *RouteTable { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *RouteTable) SetVpcId(v string) *RouteTable { - s.VpcId = &v - return s -} - -// Describes an association between a route table and a subnet. -type RouteTableAssociation struct { - _ struct{} `type:"structure"` - - // Indicates whether this is the main route table. - Main *bool `locationName:"main" type:"boolean"` - - // The ID of the association between a route table and a subnet. - RouteTableAssociationId *string `locationName:"routeTableAssociationId" type:"string"` - - // The ID of the route table. - RouteTableId *string `locationName:"routeTableId" type:"string"` - - // The ID of the subnet. A subnet ID is not returned for an implicit association. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s RouteTableAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RouteTableAssociation) GoString() string { - return s.String() -} - -// SetMain sets the Main field's value. -func (s *RouteTableAssociation) SetMain(v bool) *RouteTableAssociation { - s.Main = &v - return s -} - -// SetRouteTableAssociationId sets the RouteTableAssociationId field's value. -func (s *RouteTableAssociation) SetRouteTableAssociationId(v string) *RouteTableAssociation { - s.RouteTableAssociationId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *RouteTableAssociation) SetRouteTableId(v string) *RouteTableAssociation { - s.RouteTableId = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *RouteTableAssociation) SetSubnetId(v string) *RouteTableAssociation { - s.SubnetId = &v - return s -} - -// Contains the parameters for RunInstances. -type RunInstancesInput struct { - _ struct{} `type:"structure"` - - // Reserved. - AdditionalInfo *string `locationName:"additionalInfo" type:"string"` - - // One or more block device mapping entries. You can't specify both a snapshot - // ID and an encryption value. This is because only blank volumes can be encrypted - // on creation. If a snapshot is the basis for a volume, it is not blank and - // its encryption status is used for the volume encryption status. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraints: Maximum 64 ASCII characters - ClientToken *string `locationName:"clientToken" type:"string"` - - // The CPU options for the instance. For more information, see Optimizing CPU - // Options (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) - // in the Amazon Elastic Compute Cloud User Guide. - CpuOptions *CpuOptionsRequest `type:"structure"` - - // The credit option for CPU usage of the instance. Valid values are standard - // and unlimited. To change this attribute after launch, use ModifyInstanceCreditSpecification. - // For more information, see T2 Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Default: standard - CreditSpecification *CreditSpecificationRequest `type:"structure"` - - // If you set this parameter to true, you can't terminate the instance using - // the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute - // to false after launch, use ModifyInstanceAttribute. Alternatively, if you - // set InstanceInitiatedShutdownBehavior to terminate, you can terminate the - // instance by running the shutdown command from the instance. - // - // Default: false - DisableApiTermination *bool `locationName:"disableApiTermination" type:"boolean"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether the instance is optimized for Amazon EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal Amazon EBS I/O performance. This optimization isn't - // available with all instance types. Additional usage charges apply when using - // an EBS-optimized instance. - // - // Default: false - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // An elastic GPU to associate with the instance. - ElasticGpuSpecification []*ElasticGpuSpecification `locationNameList:"item" type:"list"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI, which you can get by calling DescribeImages. An AMI is - // required to launch an instance and must be specified here or in a launch - // template. - ImageId *string `type:"string"` - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - // - // Default: stop - InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"` - - // The market (purchasing) option for the instances. - InstanceMarketOptions *InstanceMarketOptionsRequest `type:"structure"` - - // The instance type. For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Default: m1.small - InstanceType *string `type:"string" enum:"InstanceType"` - - // [EC2-VPC] A number of IPv6 addresses to associate with the primary network - // interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. - // You cannot specify this option and the option to assign specific IPv6 addresses - // in the same request. You can specify this option if you've specified a minimum - // number of instances to launch. - Ipv6AddressCount *int64 `type:"integer"` - - // [EC2-VPC] Specify one or more IPv6 addresses from the range of the subnet - // to associate with the primary network interface. You cannot specify this - // option and the option to assign a number of IPv6 addresses in the same request. - // You cannot specify this option if you've specified a minimum number of instances - // to launch. - Ipv6Addresses []*InstanceIpv6Address `locationName:"Ipv6Address" locationNameList:"item" type:"list"` - - // The ID of the kernel. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) - // in the Amazon Elastic Compute Cloud User Guide. - KernelId *string `type:"string"` - - // The name of the key pair. You can create a key pair using CreateKeyPair or - // ImportKeyPair. - // - // If you do not specify a key pair, you can't connect to the instance unless - // you choose an AMI that is configured to allow users another way to log in. - KeyName *string `type:"string"` - - // The launch template to use to launch the instances. Any parameters that you - // specify in RunInstances override the same parameters in the launch template. - // You can specify either the name or ID of a launch template, but not both. - LaunchTemplate *LaunchTemplateSpecification `type:"structure"` - - // The maximum number of instances to launch. If you specify more instances - // than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches - // the largest possible number of instances above MinCount. - // - // Constraints: Between 1 and the maximum number you're allowed for the specified - // instance type. For more information about the default limits, and how to - // request an increase, see How many instances can I run in Amazon EC2 (http://aws.amazon.com/ec2/faqs/#How_many_instances_can_I_run_in_Amazon_EC2) - // in the Amazon EC2 FAQ. - // - // MaxCount is a required field - MaxCount *int64 `type:"integer" required:"true"` - - // The minimum number of instances to launch. If you specify a minimum that - // is more instances than Amazon EC2 can launch in the target Availability Zone, - // Amazon EC2 launches no instances. - // - // Constraints: Between 1 and the maximum number you're allowed for the specified - // instance type. For more information about the default limits, and how to - // request an increase, see How many instances can I run in Amazon EC2 (http://aws.amazon.com/ec2/faqs/#How_many_instances_can_I_run_in_Amazon_EC2) - // in the Amazon EC2 General FAQ. - // - // MinCount is a required field - MinCount *int64 `type:"integer" required:"true"` - - // The monitoring for the instance. - Monitoring *RunInstancesMonitoringEnabled `type:"structure"` - - // One or more network interfaces. - NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterface" locationNameList:"item" type:"list"` - - // The placement for the instance. - Placement *Placement `type:"structure"` - - // [EC2-VPC] The primary IPv4 address. You must specify a value from the IPv4 - // address range of the subnet. - // - // Only one private IP address can be designated as primary. You can't specify - // this option if you've specified the option to designate a private IP address - // as the primary IP address in a network interface specification. You cannot - // specify this option if you're launching more than one instance in the request. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The ID of the RAM disk. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) - // in the Amazon Elastic Compute Cloud User Guide. - RamdiskId *string `type:"string"` - - // One or more security group IDs. You can create a security group using CreateSecurityGroup. - // - // Default: Amazon EC2 uses the default security group. - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // [EC2-Classic, default VPC] One or more security group names. For a nondefault - // VPC, you must use security group IDs instead. - // - // Default: Amazon EC2 uses the default security group. - SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"` - - // [EC2-VPC] The ID of the subnet to launch the instance into. - SubnetId *string `type:"string"` - - // The tags to apply to the resources during launch. You can tag instances and - // volumes. The specified tags are applied to all instances or volumes that - // are created during launch. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // The user data to make available to the instance. For more information, see - // Running Commands on Your Linux Instance at Launch (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) - // (Linux) and Adding User Data (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data) - // (Windows). If you are using a command line tool, base64-encoding is performed - // for you, and you can load the text from a file. Otherwise, you must provide - // base64-encoded text. - UserData *string `type:"string"` -} - -// String returns the string representation -func (s RunInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunInstancesInput"} - if s.MaxCount == nil { - invalidParams.Add(request.NewErrParamRequired("MaxCount")) - } - if s.MinCount == nil { - invalidParams.Add(request.NewErrParamRequired("MinCount")) - } - if s.CreditSpecification != nil { - if err := s.CreditSpecification.Validate(); err != nil { - invalidParams.AddNested("CreditSpecification", err.(request.ErrInvalidParams)) - } - } - if s.ElasticGpuSpecification != nil { - for i, v := range s.ElasticGpuSpecification { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ElasticGpuSpecification", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Monitoring != nil { - if err := s.Monitoring.Validate(); err != nil { - invalidParams.AddNested("Monitoring", err.(request.ErrInvalidParams)) - } - } - if s.NetworkInterfaces != nil { - for i, v := range s.NetworkInterfaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *RunInstancesInput) SetAdditionalInfo(v string) *RunInstancesInput { - s.AdditionalInfo = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *RunInstancesInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *RunInstancesInput { - s.BlockDeviceMappings = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *RunInstancesInput) SetClientToken(v string) *RunInstancesInput { - s.ClientToken = &v - return s -} - -// SetCpuOptions sets the CpuOptions field's value. -func (s *RunInstancesInput) SetCpuOptions(v *CpuOptionsRequest) *RunInstancesInput { - s.CpuOptions = v - return s -} - -// SetCreditSpecification sets the CreditSpecification field's value. -func (s *RunInstancesInput) SetCreditSpecification(v *CreditSpecificationRequest) *RunInstancesInput { - s.CreditSpecification = v - return s -} - -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *RunInstancesInput) SetDisableApiTermination(v bool) *RunInstancesInput { - s.DisableApiTermination = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RunInstancesInput) SetDryRun(v bool) *RunInstancesInput { - s.DryRun = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *RunInstancesInput) SetEbsOptimized(v bool) *RunInstancesInput { - s.EbsOptimized = &v - return s -} - -// SetElasticGpuSpecification sets the ElasticGpuSpecification field's value. -func (s *RunInstancesInput) SetElasticGpuSpecification(v []*ElasticGpuSpecification) *RunInstancesInput { - s.ElasticGpuSpecification = v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *RunInstancesInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *RunInstancesInput { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *RunInstancesInput) SetImageId(v string) *RunInstancesInput { - s.ImageId = &v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *RunInstancesInput) SetInstanceInitiatedShutdownBehavior(v string) *RunInstancesInput { - s.InstanceInitiatedShutdownBehavior = &v - return s -} - -// SetInstanceMarketOptions sets the InstanceMarketOptions field's value. -func (s *RunInstancesInput) SetInstanceMarketOptions(v *InstanceMarketOptionsRequest) *RunInstancesInput { - s.InstanceMarketOptions = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *RunInstancesInput) SetInstanceType(v string) *RunInstancesInput { - s.InstanceType = &v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *RunInstancesInput) SetIpv6AddressCount(v int64) *RunInstancesInput { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *RunInstancesInput) SetIpv6Addresses(v []*InstanceIpv6Address) *RunInstancesInput { - s.Ipv6Addresses = v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *RunInstancesInput) SetKernelId(v string) *RunInstancesInput { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *RunInstancesInput) SetKeyName(v string) *RunInstancesInput { - s.KeyName = &v - return s -} - -// SetLaunchTemplate sets the LaunchTemplate field's value. -func (s *RunInstancesInput) SetLaunchTemplate(v *LaunchTemplateSpecification) *RunInstancesInput { - s.LaunchTemplate = v - return s -} - -// SetMaxCount sets the MaxCount field's value. -func (s *RunInstancesInput) SetMaxCount(v int64) *RunInstancesInput { - s.MaxCount = &v - return s -} - -// SetMinCount sets the MinCount field's value. -func (s *RunInstancesInput) SetMinCount(v int64) *RunInstancesInput { - s.MinCount = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *RunInstancesInput) SetMonitoring(v *RunInstancesMonitoringEnabled) *RunInstancesInput { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *RunInstancesInput) SetNetworkInterfaces(v []*InstanceNetworkInterfaceSpecification) *RunInstancesInput { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *RunInstancesInput) SetPlacement(v *Placement) *RunInstancesInput { - s.Placement = v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *RunInstancesInput) SetPrivateIpAddress(v string) *RunInstancesInput { - s.PrivateIpAddress = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *RunInstancesInput) SetRamdiskId(v string) *RunInstancesInput { - s.RamdiskId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *RunInstancesInput) SetSecurityGroupIds(v []*string) *RunInstancesInput { - s.SecurityGroupIds = v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *RunInstancesInput) SetSecurityGroups(v []*string) *RunInstancesInput { - s.SecurityGroups = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *RunInstancesInput) SetSubnetId(v string) *RunInstancesInput { - s.SubnetId = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *RunInstancesInput) SetTagSpecifications(v []*TagSpecification) *RunInstancesInput { - s.TagSpecifications = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *RunInstancesInput) SetUserData(v string) *RunInstancesInput { - s.UserData = &v - return s -} - -// Describes the monitoring of an instance. -type RunInstancesMonitoringEnabled struct { - _ struct{} `type:"structure"` - - // Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring - // is enabled. - // - // Enabled is a required field - Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` -} - -// String returns the string representation -func (s RunInstancesMonitoringEnabled) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunInstancesMonitoringEnabled) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunInstancesMonitoringEnabled) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunInstancesMonitoringEnabled"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *RunInstancesMonitoringEnabled) SetEnabled(v bool) *RunInstancesMonitoringEnabled { - s.Enabled = &v - return s -} - -// Contains the parameters for RunScheduledInstances. -type RunScheduledInstancesInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that ensures the idempotency of the request. - // For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The number of instances. - // - // Default: 1 - InstanceCount *int64 `type:"integer"` - - // The launch specification. You must match the instance type, Availability - // Zone, network, and platform of the schedule that you purchased. - // - // LaunchSpecification is a required field - LaunchSpecification *ScheduledInstancesLaunchSpecification `type:"structure" required:"true"` - - // The Scheduled Instance ID. - // - // ScheduledInstanceId is a required field - ScheduledInstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RunScheduledInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunScheduledInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunScheduledInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunScheduledInstancesInput"} - if s.LaunchSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchSpecification")) - } - if s.ScheduledInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("ScheduledInstanceId")) - } - if s.LaunchSpecification != nil { - if err := s.LaunchSpecification.Validate(); err != nil { - invalidParams.AddNested("LaunchSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *RunScheduledInstancesInput) SetClientToken(v string) *RunScheduledInstancesInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RunScheduledInstancesInput) SetDryRun(v bool) *RunScheduledInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *RunScheduledInstancesInput) SetInstanceCount(v int64) *RunScheduledInstancesInput { - s.InstanceCount = &v - return s -} - -// SetLaunchSpecification sets the LaunchSpecification field's value. -func (s *RunScheduledInstancesInput) SetLaunchSpecification(v *ScheduledInstancesLaunchSpecification) *RunScheduledInstancesInput { - s.LaunchSpecification = v - return s -} - -// SetScheduledInstanceId sets the ScheduledInstanceId field's value. -func (s *RunScheduledInstancesInput) SetScheduledInstanceId(v string) *RunScheduledInstancesInput { - s.ScheduledInstanceId = &v - return s -} - -// Contains the output of RunScheduledInstances. -type RunScheduledInstancesOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the newly launched instances. - InstanceIdSet []*string `locationName:"instanceIdSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s RunScheduledInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunScheduledInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceIdSet sets the InstanceIdSet field's value. -func (s *RunScheduledInstancesOutput) SetInstanceIdSet(v []*string) *RunScheduledInstancesOutput { - s.InstanceIdSet = v - return s -} - -// Describes the storage parameters for S3 and S3 buckets for an instance store-backed -// AMI. -type S3Storage struct { - _ struct{} `type:"structure"` - - // The access key ID of the owner of the bucket. Before you specify a value - // for your access key ID, review and follow the guidance in Best Practices - // for Managing AWS Access Keys (http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html). - AWSAccessKeyId *string `type:"string"` - - // The bucket in which to store the AMI. You can specify a bucket that you already - // own or a new bucket that Amazon EC2 creates on your behalf. If you specify - // a bucket that belongs to someone else, Amazon EC2 returns an error. - Bucket *string `locationName:"bucket" type:"string"` - - // The beginning of the file name of the AMI. - Prefix *string `locationName:"prefix" type:"string"` - - // An Amazon S3 upload policy that gives Amazon EC2 permission to upload items - // into Amazon S3 on your behalf. - // - // UploadPolicy is automatically base64 encoded/decoded by the SDK. - UploadPolicy []byte `locationName:"uploadPolicy" type:"blob"` - - // The signature of the JSON document. - UploadPolicySignature *string `locationName:"uploadPolicySignature" type:"string"` -} - -// String returns the string representation -func (s S3Storage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3Storage) GoString() string { - return s.String() -} - -// SetAWSAccessKeyId sets the AWSAccessKeyId field's value. -func (s *S3Storage) SetAWSAccessKeyId(v string) *S3Storage { - s.AWSAccessKeyId = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *S3Storage) SetBucket(v string) *S3Storage { - s.Bucket = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3Storage) SetPrefix(v string) *S3Storage { - s.Prefix = &v - return s -} - -// SetUploadPolicy sets the UploadPolicy field's value. -func (s *S3Storage) SetUploadPolicy(v []byte) *S3Storage { - s.UploadPolicy = v - return s -} - -// SetUploadPolicySignature sets the UploadPolicySignature field's value. -func (s *S3Storage) SetUploadPolicySignature(v string) *S3Storage { - s.UploadPolicySignature = &v - return s -} - -// Describes a Scheduled Instance. -type ScheduledInstance struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The date when the Scheduled Instance was purchased. - CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"` - - // The hourly price for a single instance. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The number of instances. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The network platform (EC2-Classic or EC2-VPC). - NetworkPlatform *string `locationName:"networkPlatform" type:"string"` - - // The time for the next schedule to start. - NextSlotStartTime *time.Time `locationName:"nextSlotStartTime" type:"timestamp" timestampFormat:"iso8601"` - - // The platform (Linux/UNIX or Windows). - Platform *string `locationName:"platform" type:"string"` - - // The time that the previous schedule ended or will end. - PreviousSlotEndTime *time.Time `locationName:"previousSlotEndTime" type:"timestamp" timestampFormat:"iso8601"` - - // The schedule recurrence. - Recurrence *ScheduledInstanceRecurrence `locationName:"recurrence" type:"structure"` - - // The Scheduled Instance ID. - ScheduledInstanceId *string `locationName:"scheduledInstanceId" type:"string"` - - // The number of hours in the schedule. - SlotDurationInHours *int64 `locationName:"slotDurationInHours" type:"integer"` - - // The end date for the Scheduled Instance. - TermEndDate *time.Time `locationName:"termEndDate" type:"timestamp" timestampFormat:"iso8601"` - - // The start date for the Scheduled Instance. - TermStartDate *time.Time `locationName:"termStartDate" type:"timestamp" timestampFormat:"iso8601"` - - // The total number of hours for a single instance for the entire term. - TotalScheduledInstanceHours *int64 `locationName:"totalScheduledInstanceHours" type:"integer"` -} - -// String returns the string representation -func (s ScheduledInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstance) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ScheduledInstance) SetAvailabilityZone(v string) *ScheduledInstance { - s.AvailabilityZone = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ScheduledInstance) SetCreateDate(v time.Time) *ScheduledInstance { - s.CreateDate = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *ScheduledInstance) SetHourlyPrice(v string) *ScheduledInstance { - s.HourlyPrice = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *ScheduledInstance) SetInstanceCount(v int64) *ScheduledInstance { - s.InstanceCount = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ScheduledInstance) SetInstanceType(v string) *ScheduledInstance { - s.InstanceType = &v - return s -} - -// SetNetworkPlatform sets the NetworkPlatform field's value. -func (s *ScheduledInstance) SetNetworkPlatform(v string) *ScheduledInstance { - s.NetworkPlatform = &v - return s -} - -// SetNextSlotStartTime sets the NextSlotStartTime field's value. -func (s *ScheduledInstance) SetNextSlotStartTime(v time.Time) *ScheduledInstance { - s.NextSlotStartTime = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ScheduledInstance) SetPlatform(v string) *ScheduledInstance { - s.Platform = &v - return s -} - -// SetPreviousSlotEndTime sets the PreviousSlotEndTime field's value. -func (s *ScheduledInstance) SetPreviousSlotEndTime(v time.Time) *ScheduledInstance { - s.PreviousSlotEndTime = &v - return s -} - -// SetRecurrence sets the Recurrence field's value. -func (s *ScheduledInstance) SetRecurrence(v *ScheduledInstanceRecurrence) *ScheduledInstance { - s.Recurrence = v - return s -} - -// SetScheduledInstanceId sets the ScheduledInstanceId field's value. -func (s *ScheduledInstance) SetScheduledInstanceId(v string) *ScheduledInstance { - s.ScheduledInstanceId = &v - return s -} - -// SetSlotDurationInHours sets the SlotDurationInHours field's value. -func (s *ScheduledInstance) SetSlotDurationInHours(v int64) *ScheduledInstance { - s.SlotDurationInHours = &v - return s -} - -// SetTermEndDate sets the TermEndDate field's value. -func (s *ScheduledInstance) SetTermEndDate(v time.Time) *ScheduledInstance { - s.TermEndDate = &v - return s -} - -// SetTermStartDate sets the TermStartDate field's value. -func (s *ScheduledInstance) SetTermStartDate(v time.Time) *ScheduledInstance { - s.TermStartDate = &v - return s -} - -// SetTotalScheduledInstanceHours sets the TotalScheduledInstanceHours field's value. -func (s *ScheduledInstance) SetTotalScheduledInstanceHours(v int64) *ScheduledInstance { - s.TotalScheduledInstanceHours = &v - return s -} - -// Describes a schedule that is available for your Scheduled Instances. -type ScheduledInstanceAvailability struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of available instances. - AvailableInstanceCount *int64 `locationName:"availableInstanceCount" type:"integer"` - - // The time period for the first schedule to start. - FirstSlotStartTime *time.Time `locationName:"firstSlotStartTime" type:"timestamp" timestampFormat:"iso8601"` - - // The hourly price for a single instance. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The instance type. You can specify one of the C3, C4, M4, or R3 instance - // types. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The maximum term. The only possible value is 365 days. - MaxTermDurationInDays *int64 `locationName:"maxTermDurationInDays" type:"integer"` - - // The minimum term. The only possible value is 365 days. - MinTermDurationInDays *int64 `locationName:"minTermDurationInDays" type:"integer"` - - // The network platform (EC2-Classic or EC2-VPC). - NetworkPlatform *string `locationName:"networkPlatform" type:"string"` - - // The platform (Linux/UNIX or Windows). - Platform *string `locationName:"platform" type:"string"` - - // The purchase token. This token expires in two hours. - PurchaseToken *string `locationName:"purchaseToken" type:"string"` - - // The schedule recurrence. - Recurrence *ScheduledInstanceRecurrence `locationName:"recurrence" type:"structure"` - - // The number of hours in the schedule. - SlotDurationInHours *int64 `locationName:"slotDurationInHours" type:"integer"` - - // The total number of hours for a single instance for the entire term. - TotalScheduledInstanceHours *int64 `locationName:"totalScheduledInstanceHours" type:"integer"` -} - -// String returns the string representation -func (s ScheduledInstanceAvailability) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstanceAvailability) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ScheduledInstanceAvailability) SetAvailabilityZone(v string) *ScheduledInstanceAvailability { - s.AvailabilityZone = &v - return s -} - -// SetAvailableInstanceCount sets the AvailableInstanceCount field's value. -func (s *ScheduledInstanceAvailability) SetAvailableInstanceCount(v int64) *ScheduledInstanceAvailability { - s.AvailableInstanceCount = &v - return s -} - -// SetFirstSlotStartTime sets the FirstSlotStartTime field's value. -func (s *ScheduledInstanceAvailability) SetFirstSlotStartTime(v time.Time) *ScheduledInstanceAvailability { - s.FirstSlotStartTime = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *ScheduledInstanceAvailability) SetHourlyPrice(v string) *ScheduledInstanceAvailability { - s.HourlyPrice = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ScheduledInstanceAvailability) SetInstanceType(v string) *ScheduledInstanceAvailability { - s.InstanceType = &v - return s -} - -// SetMaxTermDurationInDays sets the MaxTermDurationInDays field's value. -func (s *ScheduledInstanceAvailability) SetMaxTermDurationInDays(v int64) *ScheduledInstanceAvailability { - s.MaxTermDurationInDays = &v - return s -} - -// SetMinTermDurationInDays sets the MinTermDurationInDays field's value. -func (s *ScheduledInstanceAvailability) SetMinTermDurationInDays(v int64) *ScheduledInstanceAvailability { - s.MinTermDurationInDays = &v - return s -} - -// SetNetworkPlatform sets the NetworkPlatform field's value. -func (s *ScheduledInstanceAvailability) SetNetworkPlatform(v string) *ScheduledInstanceAvailability { - s.NetworkPlatform = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ScheduledInstanceAvailability) SetPlatform(v string) *ScheduledInstanceAvailability { - s.Platform = &v - return s -} - -// SetPurchaseToken sets the PurchaseToken field's value. -func (s *ScheduledInstanceAvailability) SetPurchaseToken(v string) *ScheduledInstanceAvailability { - s.PurchaseToken = &v - return s -} - -// SetRecurrence sets the Recurrence field's value. -func (s *ScheduledInstanceAvailability) SetRecurrence(v *ScheduledInstanceRecurrence) *ScheduledInstanceAvailability { - s.Recurrence = v - return s -} - -// SetSlotDurationInHours sets the SlotDurationInHours field's value. -func (s *ScheduledInstanceAvailability) SetSlotDurationInHours(v int64) *ScheduledInstanceAvailability { - s.SlotDurationInHours = &v - return s -} - -// SetTotalScheduledInstanceHours sets the TotalScheduledInstanceHours field's value. -func (s *ScheduledInstanceAvailability) SetTotalScheduledInstanceHours(v int64) *ScheduledInstanceAvailability { - s.TotalScheduledInstanceHours = &v - return s -} - -// Describes the recurring schedule for a Scheduled Instance. -type ScheduledInstanceRecurrence struct { - _ struct{} `type:"structure"` - - // The frequency (Daily, Weekly, or Monthly). - Frequency *string `locationName:"frequency" type:"string"` - - // The interval quantity. The interval unit depends on the value of frequency. - // For example, every 2 weeks or every 2 months. - Interval *int64 `locationName:"interval" type:"integer"` - - // The days. For a monthly schedule, this is one or more days of the month (1-31). - // For a weekly schedule, this is one or more days of the week (1-7, where 1 - // is Sunday). - OccurrenceDaySet []*int64 `locationName:"occurrenceDaySet" locationNameList:"item" type:"list"` - - // Indicates whether the occurrence is relative to the end of the specified - // week or month. - OccurrenceRelativeToEnd *bool `locationName:"occurrenceRelativeToEnd" type:"boolean"` - - // The unit for occurrenceDaySet (DayOfWeek or DayOfMonth). - OccurrenceUnit *string `locationName:"occurrenceUnit" type:"string"` -} - -// String returns the string representation -func (s ScheduledInstanceRecurrence) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstanceRecurrence) GoString() string { - return s.String() -} - -// SetFrequency sets the Frequency field's value. -func (s *ScheduledInstanceRecurrence) SetFrequency(v string) *ScheduledInstanceRecurrence { - s.Frequency = &v - return s -} - -// SetInterval sets the Interval field's value. -func (s *ScheduledInstanceRecurrence) SetInterval(v int64) *ScheduledInstanceRecurrence { - s.Interval = &v - return s -} - -// SetOccurrenceDaySet sets the OccurrenceDaySet field's value. -func (s *ScheduledInstanceRecurrence) SetOccurrenceDaySet(v []*int64) *ScheduledInstanceRecurrence { - s.OccurrenceDaySet = v - return s -} - -// SetOccurrenceRelativeToEnd sets the OccurrenceRelativeToEnd field's value. -func (s *ScheduledInstanceRecurrence) SetOccurrenceRelativeToEnd(v bool) *ScheduledInstanceRecurrence { - s.OccurrenceRelativeToEnd = &v - return s -} - -// SetOccurrenceUnit sets the OccurrenceUnit field's value. -func (s *ScheduledInstanceRecurrence) SetOccurrenceUnit(v string) *ScheduledInstanceRecurrence { - s.OccurrenceUnit = &v - return s -} - -// Describes the recurring schedule for a Scheduled Instance. -type ScheduledInstanceRecurrenceRequest struct { - _ struct{} `type:"structure"` - - // The frequency (Daily, Weekly, or Monthly). - Frequency *string `type:"string"` - - // The interval quantity. The interval unit depends on the value of Frequency. - // For example, every 2 weeks or every 2 months. - Interval *int64 `type:"integer"` - - // The days. For a monthly schedule, this is one or more days of the month (1-31). - // For a weekly schedule, this is one or more days of the week (1-7, where 1 - // is Sunday). You can't specify this value with a daily schedule. If the occurrence - // is relative to the end of the month, you can specify only a single day. - OccurrenceDays []*int64 `locationName:"OccurrenceDay" locationNameList:"OccurenceDay" type:"list"` - - // Indicates whether the occurrence is relative to the end of the specified - // week or month. You can't specify this value with a daily schedule. - OccurrenceRelativeToEnd *bool `type:"boolean"` - - // The unit for OccurrenceDays (DayOfWeek or DayOfMonth). This value is required - // for a monthly schedule. You can't specify DayOfWeek with a weekly schedule. - // You can't specify this value with a daily schedule. - OccurrenceUnit *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstanceRecurrenceRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstanceRecurrenceRequest) GoString() string { - return s.String() -} - -// SetFrequency sets the Frequency field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetFrequency(v string) *ScheduledInstanceRecurrenceRequest { - s.Frequency = &v - return s -} - -// SetInterval sets the Interval field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetInterval(v int64) *ScheduledInstanceRecurrenceRequest { - s.Interval = &v - return s -} - -// SetOccurrenceDays sets the OccurrenceDays field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetOccurrenceDays(v []*int64) *ScheduledInstanceRecurrenceRequest { - s.OccurrenceDays = v - return s -} - -// SetOccurrenceRelativeToEnd sets the OccurrenceRelativeToEnd field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetOccurrenceRelativeToEnd(v bool) *ScheduledInstanceRecurrenceRequest { - s.OccurrenceRelativeToEnd = &v - return s -} - -// SetOccurrenceUnit sets the OccurrenceUnit field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetOccurrenceUnit(v string) *ScheduledInstanceRecurrenceRequest { - s.OccurrenceUnit = &v - return s -} - -// Describes a block device mapping for a Scheduled Instance. -type ScheduledInstancesBlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name (for example, /dev/sdh or xvdh). - DeviceName *string `type:"string"` - - // Parameters used to set up EBS volumes automatically when the instance is - // launched. - Ebs *ScheduledInstancesEbs `type:"structure"` - - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice *string `type:"string"` - - // The virtual device name (ephemeralN). Instance store volumes are numbered - // starting from 0. An instance type with two available instance store volumes - // can specify mappings for ephemeral0 and ephemeral1. The number of available - // instance store volumes depends on the instance type. After you connect to - // the instance, you must mount the volume. - // - // Constraints: For M3 instances, you must specify instance store volumes in - // the block device mapping for the instance. When you launch an M3 instance, - // we ignore any instance store volumes specified in the block device mapping - // for the AMI. - VirtualName *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesBlockDeviceMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesBlockDeviceMapping) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *ScheduledInstancesBlockDeviceMapping) SetDeviceName(v string) *ScheduledInstancesBlockDeviceMapping { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *ScheduledInstancesBlockDeviceMapping) SetEbs(v *ScheduledInstancesEbs) *ScheduledInstancesBlockDeviceMapping { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *ScheduledInstancesBlockDeviceMapping) SetNoDevice(v string) *ScheduledInstancesBlockDeviceMapping { - s.NoDevice = &v - return s -} - -// SetVirtualName sets the VirtualName field's value. -func (s *ScheduledInstancesBlockDeviceMapping) SetVirtualName(v string) *ScheduledInstancesBlockDeviceMapping { - s.VirtualName = &v - return s -} - -// Describes an EBS volume for a Scheduled Instance. -type ScheduledInstancesEbs struct { - _ struct{} `type:"structure"` - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool `type:"boolean"` - - // Indicates whether the volume is encrypted. You can attached encrypted volumes - // only to instances that support them. - Encrypted *bool `type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1 volumes, this represents the number of IOPS that are provisioned - // for the volume. For gp2 volumes, this represents the baseline performance - // of the volume and the rate at which the volume accumulates I/O credits for - // bursting. For more information about gp2 baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops *int64 `type:"integer"` - - // The ID of the snapshot. - SnapshotId *string `type:"string"` - - // The size of the volume, in GiB. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - VolumeSize *int64 `type:"integer"` - - // The volume type. gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, - // Throughput Optimized HDD for st1, Cold HDD for sc1, or standard for Magnetic. - // - // Default: standard - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesEbs) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesEbs) GoString() string { - return s.String() -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *ScheduledInstancesEbs) SetDeleteOnTermination(v bool) *ScheduledInstancesEbs { - s.DeleteOnTermination = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *ScheduledInstancesEbs) SetEncrypted(v bool) *ScheduledInstancesEbs { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *ScheduledInstancesEbs) SetIops(v int64) *ScheduledInstancesEbs { - s.Iops = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *ScheduledInstancesEbs) SetSnapshotId(v string) *ScheduledInstancesEbs { - s.SnapshotId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *ScheduledInstancesEbs) SetVolumeSize(v int64) *ScheduledInstancesEbs { - s.VolumeSize = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *ScheduledInstancesEbs) SetVolumeType(v string) *ScheduledInstancesEbs { - s.VolumeType = &v - return s -} - -// Describes an IAM instance profile for a Scheduled Instance. -type ScheduledInstancesIamInstanceProfile struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). - Arn *string `type:"string"` - - // The name. - Name *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesIamInstanceProfile) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesIamInstanceProfile) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ScheduledInstancesIamInstanceProfile) SetArn(v string) *ScheduledInstancesIamInstanceProfile { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *ScheduledInstancesIamInstanceProfile) SetName(v string) *ScheduledInstancesIamInstanceProfile { - s.Name = &v - return s -} - -// Describes an IPv6 address. -type ScheduledInstancesIpv6Address struct { - _ struct{} `type:"structure"` - - // The IPv6 address. - Ipv6Address *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesIpv6Address) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesIpv6Address) GoString() string { - return s.String() -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *ScheduledInstancesIpv6Address) SetIpv6Address(v string) *ScheduledInstancesIpv6Address { - s.Ipv6Address = &v - return s -} - -// Describes the launch specification for a Scheduled Instance. -// -// If you are launching the Scheduled Instance in EC2-VPC, you must specify -// the ID of the subnet. You can specify the subnet using either SubnetId or -// NetworkInterface. -type ScheduledInstancesLaunchSpecification struct { - _ struct{} `type:"structure"` - - // One or more block device mapping entries. - BlockDeviceMappings []*ScheduledInstancesBlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // Indicates whether the instances are optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS-optimized - // instance. - // - // Default: false - EbsOptimized *bool `type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *ScheduledInstancesIamInstanceProfile `type:"structure"` - - // The ID of the Amazon Machine Image (AMI). - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` - - // The instance type. - InstanceType *string `type:"string"` - - // The ID of the kernel. - KernelId *string `type:"string"` - - // The name of the key pair. - KeyName *string `type:"string"` - - // Enable or disable monitoring for the instances. - Monitoring *ScheduledInstancesMonitoring `type:"structure"` - - // One or more network interfaces. - NetworkInterfaces []*ScheduledInstancesNetworkInterface `locationName:"NetworkInterface" locationNameList:"NetworkInterface" type:"list"` - - // The placement information. - Placement *ScheduledInstancesPlacement `type:"structure"` - - // The ID of the RAM disk. - RamdiskId *string `type:"string"` - - // The IDs of one or more security groups. - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // The ID of the subnet in which to launch the instances. - SubnetId *string `type:"string"` - - // The base64-encoded MIME user data. - UserData *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesLaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesLaunchSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScheduledInstancesLaunchSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScheduledInstancesLaunchSpecification"} - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *ScheduledInstancesLaunchSpecification) SetBlockDeviceMappings(v []*ScheduledInstancesBlockDeviceMapping) *ScheduledInstancesLaunchSpecification { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *ScheduledInstancesLaunchSpecification) SetEbsOptimized(v bool) *ScheduledInstancesLaunchSpecification { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *ScheduledInstancesLaunchSpecification) SetIamInstanceProfile(v *ScheduledInstancesIamInstanceProfile) *ScheduledInstancesLaunchSpecification { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ScheduledInstancesLaunchSpecification) SetImageId(v string) *ScheduledInstancesLaunchSpecification { - s.ImageId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ScheduledInstancesLaunchSpecification) SetInstanceType(v string) *ScheduledInstancesLaunchSpecification { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *ScheduledInstancesLaunchSpecification) SetKernelId(v string) *ScheduledInstancesLaunchSpecification { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *ScheduledInstancesLaunchSpecification) SetKeyName(v string) *ScheduledInstancesLaunchSpecification { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *ScheduledInstancesLaunchSpecification) SetMonitoring(v *ScheduledInstancesMonitoring) *ScheduledInstancesLaunchSpecification { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *ScheduledInstancesLaunchSpecification) SetNetworkInterfaces(v []*ScheduledInstancesNetworkInterface) *ScheduledInstancesLaunchSpecification { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *ScheduledInstancesLaunchSpecification) SetPlacement(v *ScheduledInstancesPlacement) *ScheduledInstancesLaunchSpecification { - s.Placement = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *ScheduledInstancesLaunchSpecification) SetRamdiskId(v string) *ScheduledInstancesLaunchSpecification { - s.RamdiskId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ScheduledInstancesLaunchSpecification) SetSecurityGroupIds(v []*string) *ScheduledInstancesLaunchSpecification { - s.SecurityGroupIds = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *ScheduledInstancesLaunchSpecification) SetSubnetId(v string) *ScheduledInstancesLaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ScheduledInstancesLaunchSpecification) SetUserData(v string) *ScheduledInstancesLaunchSpecification { - s.UserData = &v - return s -} - -// Describes whether monitoring is enabled for a Scheduled Instance. -type ScheduledInstancesMonitoring struct { - _ struct{} `type:"structure"` - - // Indicates whether monitoring is enabled. - Enabled *bool `type:"boolean"` -} - -// String returns the string representation -func (s ScheduledInstancesMonitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesMonitoring) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *ScheduledInstancesMonitoring) SetEnabled(v bool) *ScheduledInstancesMonitoring { - s.Enabled = &v - return s -} - -// Describes a network interface for a Scheduled Instance. -type ScheduledInstancesNetworkInterface struct { - _ struct{} `type:"structure"` - - // Indicates whether to assign a public IPv4 address to instances launched in - // a VPC. The public IPv4 address can only be assigned to a network interface - // for eth0, and can only be assigned to a new network interface, not an existing - // one. You cannot specify more than one network interface in the request. If - // launching into a default subnet, the default value is true. - AssociatePublicIpAddress *bool `type:"boolean"` - - // Indicates whether to delete the interface when the instance is terminated. - DeleteOnTermination *bool `type:"boolean"` - - // The description. - Description *string `type:"string"` - - // The index of the device for the network interface attachment. - DeviceIndex *int64 `type:"integer"` - - // The IDs of one or more security groups. - Groups []*string `locationName:"Group" locationNameList:"SecurityGroupId" type:"list"` - - // The number of IPv6 addresses to assign to the network interface. The IPv6 - // addresses are automatically selected from the subnet range. - Ipv6AddressCount *int64 `type:"integer"` - - // One or more specific IPv6 addresses from the subnet range. - Ipv6Addresses []*ScheduledInstancesIpv6Address `locationName:"Ipv6Address" locationNameList:"Ipv6Address" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `type:"string"` - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string `type:"string"` - - // The private IPv4 addresses. - PrivateIpAddressConfigs []*ScheduledInstancesPrivateIpAddressConfig `locationName:"PrivateIpAddressConfig" locationNameList:"PrivateIpAddressConfigSet" type:"list"` - - // The number of secondary private IPv4 addresses. - SecondaryPrivateIpAddressCount *int64 `type:"integer"` - - // The ID of the subnet. - SubnetId *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesNetworkInterface) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesNetworkInterface) GoString() string { - return s.String() -} - -// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. -func (s *ScheduledInstancesNetworkInterface) SetAssociatePublicIpAddress(v bool) *ScheduledInstancesNetworkInterface { - s.AssociatePublicIpAddress = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *ScheduledInstancesNetworkInterface) SetDeleteOnTermination(v bool) *ScheduledInstancesNetworkInterface { - s.DeleteOnTermination = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ScheduledInstancesNetworkInterface) SetDescription(v string) *ScheduledInstancesNetworkInterface { - s.Description = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *ScheduledInstancesNetworkInterface) SetDeviceIndex(v int64) *ScheduledInstancesNetworkInterface { - s.DeviceIndex = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *ScheduledInstancesNetworkInterface) SetGroups(v []*string) *ScheduledInstancesNetworkInterface { - s.Groups = v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *ScheduledInstancesNetworkInterface) SetIpv6AddressCount(v int64) *ScheduledInstancesNetworkInterface { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *ScheduledInstancesNetworkInterface) SetIpv6Addresses(v []*ScheduledInstancesIpv6Address) *ScheduledInstancesNetworkInterface { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *ScheduledInstancesNetworkInterface) SetNetworkInterfaceId(v string) *ScheduledInstancesNetworkInterface { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *ScheduledInstancesNetworkInterface) SetPrivateIpAddress(v string) *ScheduledInstancesNetworkInterface { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddressConfigs sets the PrivateIpAddressConfigs field's value. -func (s *ScheduledInstancesNetworkInterface) SetPrivateIpAddressConfigs(v []*ScheduledInstancesPrivateIpAddressConfig) *ScheduledInstancesNetworkInterface { - s.PrivateIpAddressConfigs = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *ScheduledInstancesNetworkInterface) SetSecondaryPrivateIpAddressCount(v int64) *ScheduledInstancesNetworkInterface { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *ScheduledInstancesNetworkInterface) SetSubnetId(v string) *ScheduledInstancesNetworkInterface { - s.SubnetId = &v - return s -} - -// Describes the placement for a Scheduled Instance. -type ScheduledInstancesPlacement struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `type:"string"` - - // The name of the placement group. - GroupName *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesPlacement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesPlacement) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ScheduledInstancesPlacement) SetAvailabilityZone(v string) *ScheduledInstancesPlacement { - s.AvailabilityZone = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *ScheduledInstancesPlacement) SetGroupName(v string) *ScheduledInstancesPlacement { - s.GroupName = &v - return s -} - -// Describes a private IPv4 address for a Scheduled Instance. -type ScheduledInstancesPrivateIpAddressConfig struct { - _ struct{} `type:"structure"` - - // Indicates whether this is a primary IPv4 address. Otherwise, this is a secondary - // IPv4 address. - Primary *bool `type:"boolean"` - - // The IPv4 address. - PrivateIpAddress *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesPrivateIpAddressConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesPrivateIpAddressConfig) GoString() string { - return s.String() -} - -// SetPrimary sets the Primary field's value. -func (s *ScheduledInstancesPrivateIpAddressConfig) SetPrimary(v bool) *ScheduledInstancesPrivateIpAddressConfig { - s.Primary = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *ScheduledInstancesPrivateIpAddressConfig) SetPrivateIpAddress(v string) *ScheduledInstancesPrivateIpAddressConfig { - s.PrivateIpAddress = &v - return s -} - -// Describes a security group -type SecurityGroup struct { - _ struct{} `type:"structure"` - - // A description of the security group. - Description *string `locationName:"groupDescription" type:"string"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` - - // The name of the security group. - GroupName *string `locationName:"groupName" type:"string"` - - // One or more inbound rules associated with the security group. - IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` - - // [EC2-VPC] One or more outbound rules associated with the security group. - IpPermissionsEgress []*IpPermission `locationName:"ipPermissionsEgress" locationNameList:"item" type:"list"` - - // The AWS account ID of the owner of the security group. - OwnerId *string `locationName:"ownerId" type:"string"` - - // Any tags assigned to the security group. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // [EC2-VPC] The ID of the VPC for the security group. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s SecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SecurityGroup) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SecurityGroup) SetDescription(v string) *SecurityGroup { - s.Description = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *SecurityGroup) SetGroupId(v string) *SecurityGroup { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *SecurityGroup) SetGroupName(v string) *SecurityGroup { - s.GroupName = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *SecurityGroup) SetIpPermissions(v []*IpPermission) *SecurityGroup { - s.IpPermissions = v - return s -} - -// SetIpPermissionsEgress sets the IpPermissionsEgress field's value. -func (s *SecurityGroup) SetIpPermissionsEgress(v []*IpPermission) *SecurityGroup { - s.IpPermissionsEgress = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *SecurityGroup) SetOwnerId(v string) *SecurityGroup { - s.OwnerId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SecurityGroup) SetTags(v []*Tag) *SecurityGroup { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *SecurityGroup) SetVpcId(v string) *SecurityGroup { - s.VpcId = &v - return s -} - -// Describes a security group. -type SecurityGroupIdentifier struct { - _ struct{} `type:"structure"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` - - // The name of the security group. - GroupName *string `locationName:"groupName" type:"string"` -} - -// String returns the string representation -func (s SecurityGroupIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SecurityGroupIdentifier) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *SecurityGroupIdentifier) SetGroupId(v string) *SecurityGroupIdentifier { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *SecurityGroupIdentifier) SetGroupName(v string) *SecurityGroupIdentifier { - s.GroupName = &v - return s -} - -// Describes a VPC with a security group that references your security group. -type SecurityGroupReference struct { - _ struct{} `type:"structure"` - - // The ID of your security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` - - // The ID of the VPC with the referencing security group. - // - // ReferencingVpcId is a required field - ReferencingVpcId *string `locationName:"referencingVpcId" type:"string" required:"true"` - - // The ID of the VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s SecurityGroupReference) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SecurityGroupReference) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *SecurityGroupReference) SetGroupId(v string) *SecurityGroupReference { - s.GroupId = &v - return s -} - -// SetReferencingVpcId sets the ReferencingVpcId field's value. -func (s *SecurityGroupReference) SetReferencingVpcId(v string) *SecurityGroupReference { - s.ReferencingVpcId = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *SecurityGroupReference) SetVpcPeeringConnectionId(v string) *SecurityGroupReference { - s.VpcPeeringConnectionId = &v - return s -} - -// Describes a service configuration for a VPC endpoint service. -type ServiceConfiguration struct { - _ struct{} `type:"structure"` - - // Indicates whether requests from other AWS accounts to create an endpoint - // to the service must first be accepted. - AcceptanceRequired *bool `locationName:"acceptanceRequired" type:"boolean"` - - // In the Availability Zones in which the service is available. - AvailabilityZones []*string `locationName:"availabilityZoneSet" locationNameList:"item" type:"list"` - - // The DNS names for the service. - BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"` - - // The Amazon Resource Names (ARNs) of the Network Load Balancers for the service. - NetworkLoadBalancerArns []*string `locationName:"networkLoadBalancerArnSet" locationNameList:"item" type:"list"` - - // The private DNS name for the service. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The ID of the service. - ServiceId *string `locationName:"serviceId" type:"string"` - - // The name of the service. - ServiceName *string `locationName:"serviceName" type:"string"` - - // The service state. - ServiceState *string `locationName:"serviceState" type:"string" enum:"ServiceState"` - - // The type of service. - ServiceType []*ServiceTypeDetail `locationName:"serviceType" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ServiceConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceConfiguration) GoString() string { - return s.String() -} - -// SetAcceptanceRequired sets the AcceptanceRequired field's value. -func (s *ServiceConfiguration) SetAcceptanceRequired(v bool) *ServiceConfiguration { - s.AcceptanceRequired = &v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *ServiceConfiguration) SetAvailabilityZones(v []*string) *ServiceConfiguration { - s.AvailabilityZones = v - return s -} - -// SetBaseEndpointDnsNames sets the BaseEndpointDnsNames field's value. -func (s *ServiceConfiguration) SetBaseEndpointDnsNames(v []*string) *ServiceConfiguration { - s.BaseEndpointDnsNames = v - return s -} - -// SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value. -func (s *ServiceConfiguration) SetNetworkLoadBalancerArns(v []*string) *ServiceConfiguration { - s.NetworkLoadBalancerArns = v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *ServiceConfiguration) SetPrivateDnsName(v string) *ServiceConfiguration { - s.PrivateDnsName = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *ServiceConfiguration) SetServiceId(v string) *ServiceConfiguration { - s.ServiceId = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *ServiceConfiguration) SetServiceName(v string) *ServiceConfiguration { - s.ServiceName = &v - return s -} - -// SetServiceState sets the ServiceState field's value. -func (s *ServiceConfiguration) SetServiceState(v string) *ServiceConfiguration { - s.ServiceState = &v - return s -} - -// SetServiceType sets the ServiceType field's value. -func (s *ServiceConfiguration) SetServiceType(v []*ServiceTypeDetail) *ServiceConfiguration { - s.ServiceType = v - return s -} - -// Describes a VPC endpoint service. -type ServiceDetail struct { - _ struct{} `type:"structure"` - - // Indicates whether VPC endpoint connection requests to the service must be - // accepted by the service owner. - AcceptanceRequired *bool `locationName:"acceptanceRequired" type:"boolean"` - - // The Availability Zones in which the service is available. - AvailabilityZones []*string `locationName:"availabilityZoneSet" locationNameList:"item" type:"list"` - - // The DNS names for the service. - BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"` - - // The AWS account ID of the service owner. - Owner *string `locationName:"owner" type:"string"` - - // The private DNS name for the service. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The Amazon Resource Name (ARN) of the service. - ServiceName *string `locationName:"serviceName" type:"string"` - - // The type of service. - ServiceType []*ServiceTypeDetail `locationName:"serviceType" locationNameList:"item" type:"list"` - - // Indicates whether the service supports endpoint policies. - VpcEndpointPolicySupported *bool `locationName:"vpcEndpointPolicySupported" type:"boolean"` -} - -// String returns the string representation -func (s ServiceDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceDetail) GoString() string { - return s.String() -} - -// SetAcceptanceRequired sets the AcceptanceRequired field's value. -func (s *ServiceDetail) SetAcceptanceRequired(v bool) *ServiceDetail { - s.AcceptanceRequired = &v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *ServiceDetail) SetAvailabilityZones(v []*string) *ServiceDetail { - s.AvailabilityZones = v - return s -} - -// SetBaseEndpointDnsNames sets the BaseEndpointDnsNames field's value. -func (s *ServiceDetail) SetBaseEndpointDnsNames(v []*string) *ServiceDetail { - s.BaseEndpointDnsNames = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *ServiceDetail) SetOwner(v string) *ServiceDetail { - s.Owner = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *ServiceDetail) SetPrivateDnsName(v string) *ServiceDetail { - s.PrivateDnsName = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *ServiceDetail) SetServiceName(v string) *ServiceDetail { - s.ServiceName = &v - return s -} - -// SetServiceType sets the ServiceType field's value. -func (s *ServiceDetail) SetServiceType(v []*ServiceTypeDetail) *ServiceDetail { - s.ServiceType = v - return s -} - -// SetVpcEndpointPolicySupported sets the VpcEndpointPolicySupported field's value. -func (s *ServiceDetail) SetVpcEndpointPolicySupported(v bool) *ServiceDetail { - s.VpcEndpointPolicySupported = &v - return s -} - -// Describes the type of service for a VPC endpoint. -type ServiceTypeDetail struct { - _ struct{} `type:"structure"` - - // The type of service. - ServiceType *string `locationName:"serviceType" type:"string" enum:"ServiceType"` -} - -// String returns the string representation -func (s ServiceTypeDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceTypeDetail) GoString() string { - return s.String() -} - -// SetServiceType sets the ServiceType field's value. -func (s *ServiceTypeDetail) SetServiceType(v string) *ServiceTypeDetail { - s.ServiceType = &v - return s -} - -// Describes the time period for a Scheduled Instance to start its first schedule. -// The time period must span less than one day. -type SlotDateTimeRangeRequest struct { - _ struct{} `type:"structure"` - - // The earliest date and time, in UTC, for the Scheduled Instance to start. - // - // EarliestTime is a required field - EarliestTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The latest date and time, in UTC, for the Scheduled Instance to start. This - // value must be later than or equal to the earliest date and at most three - // months in the future. - // - // LatestTime is a required field - LatestTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s SlotDateTimeRangeRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SlotDateTimeRangeRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SlotDateTimeRangeRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SlotDateTimeRangeRequest"} - if s.EarliestTime == nil { - invalidParams.Add(request.NewErrParamRequired("EarliestTime")) - } - if s.LatestTime == nil { - invalidParams.Add(request.NewErrParamRequired("LatestTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEarliestTime sets the EarliestTime field's value. -func (s *SlotDateTimeRangeRequest) SetEarliestTime(v time.Time) *SlotDateTimeRangeRequest { - s.EarliestTime = &v - return s -} - -// SetLatestTime sets the LatestTime field's value. -func (s *SlotDateTimeRangeRequest) SetLatestTime(v time.Time) *SlotDateTimeRangeRequest { - s.LatestTime = &v - return s -} - -// Describes the time period for a Scheduled Instance to start its first schedule. -type SlotStartTimeRangeRequest struct { - _ struct{} `type:"structure"` - - // The earliest date and time, in UTC, for the Scheduled Instance to start. - EarliestTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The latest date and time, in UTC, for the Scheduled Instance to start. - LatestTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SlotStartTimeRangeRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SlotStartTimeRangeRequest) GoString() string { - return s.String() -} - -// SetEarliestTime sets the EarliestTime field's value. -func (s *SlotStartTimeRangeRequest) SetEarliestTime(v time.Time) *SlotStartTimeRangeRequest { - s.EarliestTime = &v - return s -} - -// SetLatestTime sets the LatestTime field's value. -func (s *SlotStartTimeRangeRequest) SetLatestTime(v time.Time) *SlotStartTimeRangeRequest { - s.LatestTime = &v - return s -} - -// Describes a snapshot. -type Snapshot struct { - _ struct{} `type:"structure"` - - // The data encryption key identifier for the snapshot. This value is a unique - // identifier that corresponds to the data encryption key that was used to encrypt - // the original volume or snapshot copy. Because data encryption keys are inherited - // by volumes created from snapshots, and vice versa, if snapshots share the - // same data encryption key identifier, then they belong to the same volume/snapshot - // lineage. This parameter is only returned by the DescribeSnapshots API operation. - DataEncryptionKeyId *string `locationName:"dataEncryptionKeyId" type:"string"` - - // The description for the snapshot. - Description *string `locationName:"description" type:"string"` - - // Indicates whether the snapshot is encrypted. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The full ARN of the AWS Key Management Service (AWS KMS) customer master - // key (CMK) that was used to protect the volume encryption key for the parent - // volume. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // Value from an Amazon-maintained list (amazon | aws-marketplace | microsoft) - // of snapshot owners. Not to be confused with the user-configured AWS account - // alias, which is set from the IAM console. - OwnerAlias *string `locationName:"ownerAlias" type:"string"` - - // The AWS account ID of the EBS snapshot owner. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The progress of the snapshot, as a percentage. - Progress *string `locationName:"progress" type:"string"` - - // The ID of the snapshot. Each snapshot receives a unique identifier when it - // is created. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // The time stamp when the snapshot was initiated. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The snapshot state. - State *string `locationName:"status" type:"string" enum:"SnapshotState"` - - // Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy - // operation fails (for example, if the proper AWS Key Management Service (AWS - // KMS) permissions are not obtained) this field displays error state details - // to help you diagnose why the error occurred. This parameter is only returned - // by the DescribeSnapshots API operation. - StateMessage *string `locationName:"statusMessage" type:"string"` - - // Any tags assigned to the snapshot. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the volume that was used to create the snapshot. Snapshots created - // by the CopySnapshot action have an arbitrary volume ID that should not be - // used for any purpose. - VolumeId *string `locationName:"volumeId" type:"string"` - - // The size of the volume, in GiB. - VolumeSize *int64 `locationName:"volumeSize" type:"integer"` -} - -// String returns the string representation -func (s Snapshot) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Snapshot) GoString() string { - return s.String() -} - -// SetDataEncryptionKeyId sets the DataEncryptionKeyId field's value. -func (s *Snapshot) SetDataEncryptionKeyId(v string) *Snapshot { - s.DataEncryptionKeyId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Snapshot) SetDescription(v string) *Snapshot { - s.Description = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *Snapshot) SetEncrypted(v bool) *Snapshot { - s.Encrypted = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Snapshot) SetKmsKeyId(v string) *Snapshot { - s.KmsKeyId = &v - return s -} - -// SetOwnerAlias sets the OwnerAlias field's value. -func (s *Snapshot) SetOwnerAlias(v string) *Snapshot { - s.OwnerAlias = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *Snapshot) SetOwnerId(v string) *Snapshot { - s.OwnerId = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *Snapshot) SetProgress(v string) *Snapshot { - s.Progress = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *Snapshot) SetSnapshotId(v string) *Snapshot { - s.SnapshotId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Snapshot) SetStartTime(v time.Time) *Snapshot { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *Snapshot) SetState(v string) *Snapshot { - s.State = &v - return s -} - -// SetStateMessage sets the StateMessage field's value. -func (s *Snapshot) SetStateMessage(v string) *Snapshot { - s.StateMessage = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Snapshot) SetTags(v []*Tag) *Snapshot { - s.Tags = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *Snapshot) SetVolumeId(v string) *Snapshot { - s.VolumeId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *Snapshot) SetVolumeSize(v int64) *Snapshot { - s.VolumeSize = &v - return s -} - -// Describes the snapshot created from the imported disk. -type SnapshotDetail struct { - _ struct{} `type:"structure"` - - // A description for the snapshot. - Description *string `locationName:"description" type:"string"` - - // The block device mapping for the snapshot. - DeviceName *string `locationName:"deviceName" type:"string"` - - // The size of the disk in the snapshot, in GiB. - DiskImageSize *float64 `locationName:"diskImageSize" type:"double"` - - // The format of the disk image from which the snapshot is created. - Format *string `locationName:"format" type:"string"` - - // The percentage of progress for the task. - Progress *string `locationName:"progress" type:"string"` - - // The snapshot ID of the disk being imported. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // A brief status of the snapshot creation. - Status *string `locationName:"status" type:"string"` - - // A detailed status message for the snapshot creation. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The URL used to access the disk image. - Url *string `locationName:"url" type:"string"` - - // The S3 bucket for the disk image. - UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` -} - -// String returns the string representation -func (s SnapshotDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotDetail) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SnapshotDetail) SetDescription(v string) *SnapshotDetail { - s.Description = &v - return s -} - -// SetDeviceName sets the DeviceName field's value. -func (s *SnapshotDetail) SetDeviceName(v string) *SnapshotDetail { - s.DeviceName = &v - return s -} - -// SetDiskImageSize sets the DiskImageSize field's value. -func (s *SnapshotDetail) SetDiskImageSize(v float64) *SnapshotDetail { - s.DiskImageSize = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *SnapshotDetail) SetFormat(v string) *SnapshotDetail { - s.Format = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *SnapshotDetail) SetProgress(v string) *SnapshotDetail { - s.Progress = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *SnapshotDetail) SetSnapshotId(v string) *SnapshotDetail { - s.SnapshotId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SnapshotDetail) SetStatus(v string) *SnapshotDetail { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *SnapshotDetail) SetStatusMessage(v string) *SnapshotDetail { - s.StatusMessage = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *SnapshotDetail) SetUrl(v string) *SnapshotDetail { - s.Url = &v - return s -} - -// SetUserBucket sets the UserBucket field's value. -func (s *SnapshotDetail) SetUserBucket(v *UserBucketDetails) *SnapshotDetail { - s.UserBucket = v - return s -} - -// The disk container object for the import snapshot request. -type SnapshotDiskContainer struct { - _ struct{} `type:"structure"` - - // The description of the disk image being imported. - Description *string `type:"string"` - - // The format of the disk image being imported. - // - // Valid values: VHD | VMDK | OVA - Format *string `type:"string"` - - // The URL to the Amazon S3-based disk image being imported. It can either be - // a https URL (https://..) or an Amazon S3 URL (s3://..). - Url *string `type:"string"` - - // The S3 bucket for the disk image. - UserBucket *UserBucket `type:"structure"` -} - -// String returns the string representation -func (s SnapshotDiskContainer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotDiskContainer) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SnapshotDiskContainer) SetDescription(v string) *SnapshotDiskContainer { - s.Description = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *SnapshotDiskContainer) SetFormat(v string) *SnapshotDiskContainer { - s.Format = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *SnapshotDiskContainer) SetUrl(v string) *SnapshotDiskContainer { - s.Url = &v - return s -} - -// SetUserBucket sets the UserBucket field's value. -func (s *SnapshotDiskContainer) SetUserBucket(v *UserBucket) *SnapshotDiskContainer { - s.UserBucket = v - return s -} - -// Details about the import snapshot task. -type SnapshotTaskDetail struct { - _ struct{} `type:"structure"` - - // The description of the snapshot. - Description *string `locationName:"description" type:"string"` - - // The size of the disk in the snapshot, in GiB. - DiskImageSize *float64 `locationName:"diskImageSize" type:"double"` - - // The format of the disk image from which the snapshot is created. - Format *string `locationName:"format" type:"string"` - - // The percentage of completion for the import snapshot task. - Progress *string `locationName:"progress" type:"string"` - - // The snapshot ID of the disk being imported. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // A brief status for the import snapshot task. - Status *string `locationName:"status" type:"string"` - - // A detailed status message for the import snapshot task. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The URL of the disk image from which the snapshot is created. - Url *string `locationName:"url" type:"string"` - - // The S3 bucket for the disk image. - UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` -} - -// String returns the string representation -func (s SnapshotTaskDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotTaskDetail) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SnapshotTaskDetail) SetDescription(v string) *SnapshotTaskDetail { - s.Description = &v - return s -} - -// SetDiskImageSize sets the DiskImageSize field's value. -func (s *SnapshotTaskDetail) SetDiskImageSize(v float64) *SnapshotTaskDetail { - s.DiskImageSize = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *SnapshotTaskDetail) SetFormat(v string) *SnapshotTaskDetail { - s.Format = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *SnapshotTaskDetail) SetProgress(v string) *SnapshotTaskDetail { - s.Progress = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *SnapshotTaskDetail) SetSnapshotId(v string) *SnapshotTaskDetail { - s.SnapshotId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SnapshotTaskDetail) SetStatus(v string) *SnapshotTaskDetail { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *SnapshotTaskDetail) SetStatusMessage(v string) *SnapshotTaskDetail { - s.StatusMessage = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *SnapshotTaskDetail) SetUrl(v string) *SnapshotTaskDetail { - s.Url = &v - return s -} - -// SetUserBucket sets the UserBucket field's value. -func (s *SnapshotTaskDetail) SetUserBucket(v *UserBucketDetails) *SnapshotTaskDetail { - s.UserBucket = v - return s -} - -// Describes the data feed for a Spot Instance. -type SpotDatafeedSubscription struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket where the Spot Instance data feed is located. - Bucket *string `locationName:"bucket" type:"string"` - - // The fault codes for the Spot Instance request, if any. - Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"` - - // The AWS account ID of the account. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The prefix that is prepended to data feed files. - Prefix *string `locationName:"prefix" type:"string"` - - // The state of the Spot Instance data feed subscription. - State *string `locationName:"state" type:"string" enum:"DatafeedSubscriptionState"` -} - -// String returns the string representation -func (s SpotDatafeedSubscription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotDatafeedSubscription) GoString() string { - return s.String() -} - -// SetBucket sets the Bucket field's value. -func (s *SpotDatafeedSubscription) SetBucket(v string) *SpotDatafeedSubscription { - s.Bucket = &v - return s -} - -// SetFault sets the Fault field's value. -func (s *SpotDatafeedSubscription) SetFault(v *SpotInstanceStateFault) *SpotDatafeedSubscription { - s.Fault = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *SpotDatafeedSubscription) SetOwnerId(v string) *SpotDatafeedSubscription { - s.OwnerId = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *SpotDatafeedSubscription) SetPrefix(v string) *SpotDatafeedSubscription { - s.Prefix = &v - return s -} - -// SetState sets the State field's value. -func (s *SpotDatafeedSubscription) SetState(v string) *SpotDatafeedSubscription { - s.State = &v - return s -} - -// Describes the launch specification for one or more Spot Instances. -type SpotFleetLaunchSpecification struct { - _ struct{} `type:"structure"` - - // Deprecated. - AddressingType *string `locationName:"addressingType" type:"string"` - - // One or more block device mapping entries. You can't specify both a snapshot - // ID and an encryption value. This is because only blank volumes can be encrypted - // on creation. If a snapshot is the basis for a volume, it is not blank and - // its encryption status is used for the volume encryption status. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // Indicates whether the instances are optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - // - // Default: false - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The ID of the kernel. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // Enable or disable monitoring for the instances. - Monitoring *SpotFleetMonitoring `locationName:"monitoring" type:"structure"` - - // One or more network interfaces. If you specify a network interface, you must - // specify subnet IDs and security group IDs using the network interface. - NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - - // The placement information. - Placement *SpotPlacement `locationName:"placement" type:"structure"` - - // The ID of the RAM disk. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // One or more security groups. When requesting instances in a VPC, you must - // specify the IDs of the security groups. When requesting instances in EC2-Classic, - // you can specify the names or the IDs of the security groups. - SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The maximum price per unit hour that you are willing to pay for a Spot Instance. - // If this value is not specified, the default is the Spot price specified for - // the fleet. To determine the Spot price per unit hour, divide the Spot price - // by the value of WeightedCapacity. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The ID of the subnet in which to launch the instances. To specify multiple - // subnets, separate them using commas; for example, "subnet-a61dafcf, subnet-65ea5f08". - SubnetId *string `locationName:"subnetId" type:"string"` - - // The tags to apply during creation. - TagSpecifications []*SpotFleetTagSpecification `locationName:"tagSpecificationSet" locationNameList:"item" type:"list"` - - // The Base64-encoded user data to make available to the instances. - UserData *string `locationName:"userData" type:"string"` - - // The number of units provided by the specified instance type. These are the - // same units that you chose to set the target capacity in terms (instances - // or a performance characteristic such as vCPUs, memory, or I/O). - // - // If the target capacity divided by this value is not a whole number, we round - // the number of instances to the next whole number. If this value is not specified, - // the default is 1. - WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"` -} - -// String returns the string representation -func (s SpotFleetLaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetLaunchSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SpotFleetLaunchSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SpotFleetLaunchSpecification"} - if s.NetworkInterfaces != nil { - for i, v := range s.NetworkInterfaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddressingType sets the AddressingType field's value. -func (s *SpotFleetLaunchSpecification) SetAddressingType(v string) *SpotFleetLaunchSpecification { - s.AddressingType = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *SpotFleetLaunchSpecification) SetBlockDeviceMappings(v []*BlockDeviceMapping) *SpotFleetLaunchSpecification { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *SpotFleetLaunchSpecification) SetEbsOptimized(v bool) *SpotFleetLaunchSpecification { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *SpotFleetLaunchSpecification) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *SpotFleetLaunchSpecification { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *SpotFleetLaunchSpecification) SetImageId(v string) *SpotFleetLaunchSpecification { - s.ImageId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *SpotFleetLaunchSpecification) SetInstanceType(v string) *SpotFleetLaunchSpecification { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *SpotFleetLaunchSpecification) SetKernelId(v string) *SpotFleetLaunchSpecification { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *SpotFleetLaunchSpecification) SetKeyName(v string) *SpotFleetLaunchSpecification { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *SpotFleetLaunchSpecification) SetMonitoring(v *SpotFleetMonitoring) *SpotFleetLaunchSpecification { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *SpotFleetLaunchSpecification) SetNetworkInterfaces(v []*InstanceNetworkInterfaceSpecification) *SpotFleetLaunchSpecification { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *SpotFleetLaunchSpecification) SetPlacement(v *SpotPlacement) *SpotFleetLaunchSpecification { - s.Placement = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *SpotFleetLaunchSpecification) SetRamdiskId(v string) *SpotFleetLaunchSpecification { - s.RamdiskId = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *SpotFleetLaunchSpecification) SetSecurityGroups(v []*GroupIdentifier) *SpotFleetLaunchSpecification { - s.SecurityGroups = v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *SpotFleetLaunchSpecification) SetSpotPrice(v string) *SpotFleetLaunchSpecification { - s.SpotPrice = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *SpotFleetLaunchSpecification) SetSubnetId(v string) *SpotFleetLaunchSpecification { - s.SubnetId = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *SpotFleetLaunchSpecification) SetTagSpecifications(v []*SpotFleetTagSpecification) *SpotFleetLaunchSpecification { - s.TagSpecifications = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *SpotFleetLaunchSpecification) SetUserData(v string) *SpotFleetLaunchSpecification { - s.UserData = &v - return s -} - -// SetWeightedCapacity sets the WeightedCapacity field's value. -func (s *SpotFleetLaunchSpecification) SetWeightedCapacity(v float64) *SpotFleetLaunchSpecification { - s.WeightedCapacity = &v - return s -} - -// Describes whether monitoring is enabled. -type SpotFleetMonitoring struct { - _ struct{} `type:"structure"` - - // Enables monitoring for the instance. - // - // Default: false - Enabled *bool `locationName:"enabled" type:"boolean"` -} - -// String returns the string representation -func (s SpotFleetMonitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetMonitoring) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *SpotFleetMonitoring) SetEnabled(v bool) *SpotFleetMonitoring { - s.Enabled = &v - return s -} - -// Describes a Spot Fleet request. -type SpotFleetRequestConfig struct { - _ struct{} `type:"structure"` - - // The progress of the Spot Fleet request. If there is an error, the status - // is error. After all requests are placed, the status is pending_fulfillment. - // If the size of the fleet is equal to or greater than its target capacity, - // the status is fulfilled. If the size of the fleet is decreased, the status - // is pending_termination while Spot Instances are terminating. - ActivityStatus *string `locationName:"activityStatus" type:"string" enum:"ActivityStatus"` - - // The creation date and time of the request. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The configuration of the Spot Fleet request. - // - // SpotFleetRequestConfig is a required field - SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure" required:"true"` - - // The ID of the Spot Fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` - - // The state of the Spot Fleet request. - // - // SpotFleetRequestState is a required field - SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" required:"true" enum:"BatchState"` -} - -// String returns the string representation -func (s SpotFleetRequestConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetRequestConfig) GoString() string { - return s.String() -} - -// SetActivityStatus sets the ActivityStatus field's value. -func (s *SpotFleetRequestConfig) SetActivityStatus(v string) *SpotFleetRequestConfig { - s.ActivityStatus = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *SpotFleetRequestConfig) SetCreateTime(v time.Time) *SpotFleetRequestConfig { - s.CreateTime = &v - return s -} - -// SetSpotFleetRequestConfig sets the SpotFleetRequestConfig field's value. -func (s *SpotFleetRequestConfig) SetSpotFleetRequestConfig(v *SpotFleetRequestConfigData) *SpotFleetRequestConfig { - s.SpotFleetRequestConfig = v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *SpotFleetRequestConfig) SetSpotFleetRequestId(v string) *SpotFleetRequestConfig { - s.SpotFleetRequestId = &v - return s -} - -// SetSpotFleetRequestState sets the SpotFleetRequestState field's value. -func (s *SpotFleetRequestConfig) SetSpotFleetRequestState(v string) *SpotFleetRequestConfig { - s.SpotFleetRequestState = &v - return s -} - -// Describes the configuration of a Spot Fleet request. -type SpotFleetRequestConfigData struct { - _ struct{} `type:"structure"` - - // Indicates how to allocate the target capacity across the Spot pools specified - // by the Spot Fleet request. The default is lowestPrice. - AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"AllocationStrategy"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of your listings. This helps to avoid duplicate listings. For more information, - // see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // Indicates whether running Spot Instances should be terminated if the target - // capacity of the Spot Fleet request is decreased below the current size of - // the Spot Fleet. - ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"` - - // The number of units fulfilled by this request compared to the set target - // capacity. - FulfilledCapacity *float64 `locationName:"fulfilledCapacity" type:"double"` - - // Grants the Spot Fleet permission to terminate Spot Instances on your behalf - // when you cancel its Spot Fleet request using CancelSpotFleetRequests or when - // the Spot Fleet request expires, if you set terminateInstancesWithExpiration. - // - // IamFleetRole is a required field - IamFleetRole *string `locationName:"iamFleetRole" type:"string" required:"true"` - - // The behavior when a Spot Instance is interrupted. The default is terminate. - InstanceInterruptionBehavior *string `locationName:"instanceInterruptionBehavior" type:"string" enum:"InstanceInterruptionBehavior"` - - // The launch specifications for the Spot Fleet request. - LaunchSpecifications []*SpotFleetLaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" type:"list"` - - // The launch template and overrides. - LaunchTemplateConfigs []*LaunchTemplateConfig `locationName:"launchTemplateConfigs" locationNameList:"item" type:"list"` - - // One or more Classic Load Balancers and target groups to attach to the Spot - // Fleet request. Spot Fleet registers the running Spot Instances with the specified - // Classic Load Balancers and target groups. - // - // With Network Load Balancers, Spot Fleet cannot register instances that have - // the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, - // HS1, M1, M2, M3, and T1. - LoadBalancersConfig *LoadBalancersConfig `locationName:"loadBalancersConfig" type:"structure"` - - // The number of On-Demand units fulfilled by this request compared to the set - // target On-Demand capacity. - OnDemandFulfilledCapacity *float64 `locationName:"onDemandFulfilledCapacity" type:"double"` - - // The number of On-Demand units to request. You can choose to set the target - // capacity in terms of instances or a performance characteristic that is important - // to your application workload, such as vCPUs, memory, or I/O. If the request - // type is maintain, you can specify a target capacity of 0 and add capacity - // later. - OnDemandTargetCapacity *int64 `locationName:"onDemandTargetCapacity" type:"integer"` - - // Indicates whether Spot Fleet should replace unhealthy instances. - ReplaceUnhealthyInstances *bool `locationName:"replaceUnhealthyInstances" type:"boolean"` - - // The maximum price per unit hour that you are willing to pay for a Spot Instance. - // The default is the On-Demand price. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The number of units to request. You can choose to set the target capacity - // in terms of instances or a performance characteristic that is important to - // your application workload, such as vCPUs, memory, or I/O. If the request - // type is maintain, you can specify a target capacity of 0 and add capacity - // later. - // - // TargetCapacity is a required field - TargetCapacity *int64 `locationName:"targetCapacity" type:"integer" required:"true"` - - // Indicates whether running Spot Instances should be terminated when the Spot - // Fleet request expires. - TerminateInstancesWithExpiration *bool `locationName:"terminateInstancesWithExpiration" type:"boolean"` - - // The type of request. Indicates whether the Spot Fleet only requests the target - // capacity or also attempts to maintain it. When this value is request, the - // Spot Fleet only places the required requests. It does not attempt to replenish - // Spot Instances if capacity is diminished, nor does it submit requests in - // alternative Spot pools if capacity is not available. To maintain a certain - // target capacity, the Spot Fleet places the required requests to meet capacity - // and automatically replenishes any interrupted instances. Default: maintain. - Type *string `locationName:"type" type:"string" enum:"FleetType"` - - // The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // The default is to start fulfilling the request immediately. - ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` - - // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // At this point, no new Spot Instance requests are placed or able to fulfill - // the request. The default end date is 7 days from the current date. - ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotFleetRequestConfigData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetRequestConfigData) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SpotFleetRequestConfigData) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SpotFleetRequestConfigData"} - if s.IamFleetRole == nil { - invalidParams.Add(request.NewErrParamRequired("IamFleetRole")) - } - if s.TargetCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("TargetCapacity")) - } - if s.LaunchSpecifications != nil { - for i, v := range s.LaunchSpecifications { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchSpecifications", i), err.(request.ErrInvalidParams)) - } - } - } - if s.LaunchTemplateConfigs != nil { - for i, v := range s.LaunchTemplateConfigs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchTemplateConfigs", i), err.(request.ErrInvalidParams)) - } - } - } - if s.LoadBalancersConfig != nil { - if err := s.LoadBalancersConfig.Validate(); err != nil { - invalidParams.AddNested("LoadBalancersConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllocationStrategy sets the AllocationStrategy field's value. -func (s *SpotFleetRequestConfigData) SetAllocationStrategy(v string) *SpotFleetRequestConfigData { - s.AllocationStrategy = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *SpotFleetRequestConfigData) SetClientToken(v string) *SpotFleetRequestConfigData { - s.ClientToken = &v - return s -} - -// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. -func (s *SpotFleetRequestConfigData) SetExcessCapacityTerminationPolicy(v string) *SpotFleetRequestConfigData { - s.ExcessCapacityTerminationPolicy = &v - return s -} - -// SetFulfilledCapacity sets the FulfilledCapacity field's value. -func (s *SpotFleetRequestConfigData) SetFulfilledCapacity(v float64) *SpotFleetRequestConfigData { - s.FulfilledCapacity = &v - return s -} - -// SetIamFleetRole sets the IamFleetRole field's value. -func (s *SpotFleetRequestConfigData) SetIamFleetRole(v string) *SpotFleetRequestConfigData { - s.IamFleetRole = &v - return s -} - -// SetInstanceInterruptionBehavior sets the InstanceInterruptionBehavior field's value. -func (s *SpotFleetRequestConfigData) SetInstanceInterruptionBehavior(v string) *SpotFleetRequestConfigData { - s.InstanceInterruptionBehavior = &v - return s -} - -// SetLaunchSpecifications sets the LaunchSpecifications field's value. -func (s *SpotFleetRequestConfigData) SetLaunchSpecifications(v []*SpotFleetLaunchSpecification) *SpotFleetRequestConfigData { - s.LaunchSpecifications = v - return s -} - -// SetLaunchTemplateConfigs sets the LaunchTemplateConfigs field's value. -func (s *SpotFleetRequestConfigData) SetLaunchTemplateConfigs(v []*LaunchTemplateConfig) *SpotFleetRequestConfigData { - s.LaunchTemplateConfigs = v - return s -} - -// SetLoadBalancersConfig sets the LoadBalancersConfig field's value. -func (s *SpotFleetRequestConfigData) SetLoadBalancersConfig(v *LoadBalancersConfig) *SpotFleetRequestConfigData { - s.LoadBalancersConfig = v - return s -} - -// SetOnDemandFulfilledCapacity sets the OnDemandFulfilledCapacity field's value. -func (s *SpotFleetRequestConfigData) SetOnDemandFulfilledCapacity(v float64) *SpotFleetRequestConfigData { - s.OnDemandFulfilledCapacity = &v - return s -} - -// SetOnDemandTargetCapacity sets the OnDemandTargetCapacity field's value. -func (s *SpotFleetRequestConfigData) SetOnDemandTargetCapacity(v int64) *SpotFleetRequestConfigData { - s.OnDemandTargetCapacity = &v - return s -} - -// SetReplaceUnhealthyInstances sets the ReplaceUnhealthyInstances field's value. -func (s *SpotFleetRequestConfigData) SetReplaceUnhealthyInstances(v bool) *SpotFleetRequestConfigData { - s.ReplaceUnhealthyInstances = &v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *SpotFleetRequestConfigData) SetSpotPrice(v string) *SpotFleetRequestConfigData { - s.SpotPrice = &v - return s -} - -// SetTargetCapacity sets the TargetCapacity field's value. -func (s *SpotFleetRequestConfigData) SetTargetCapacity(v int64) *SpotFleetRequestConfigData { - s.TargetCapacity = &v - return s -} - -// SetTerminateInstancesWithExpiration sets the TerminateInstancesWithExpiration field's value. -func (s *SpotFleetRequestConfigData) SetTerminateInstancesWithExpiration(v bool) *SpotFleetRequestConfigData { - s.TerminateInstancesWithExpiration = &v - return s -} - -// SetType sets the Type field's value. -func (s *SpotFleetRequestConfigData) SetType(v string) *SpotFleetRequestConfigData { - s.Type = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *SpotFleetRequestConfigData) SetValidFrom(v time.Time) *SpotFleetRequestConfigData { - s.ValidFrom = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *SpotFleetRequestConfigData) SetValidUntil(v time.Time) *SpotFleetRequestConfigData { - s.ValidUntil = &v - return s -} - -// The tags for a Spot Fleet resource. -type SpotFleetTagSpecification struct { - _ struct{} `type:"structure"` - - // The type of resource. Currently, the only resource type that is supported - // is instance. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The tags. - Tags []*Tag `locationName:"tag" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s SpotFleetTagSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetTagSpecification) GoString() string { - return s.String() -} - -// SetResourceType sets the ResourceType field's value. -func (s *SpotFleetTagSpecification) SetResourceType(v string) *SpotFleetTagSpecification { - s.ResourceType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SpotFleetTagSpecification) SetTags(v []*Tag) *SpotFleetTagSpecification { - s.Tags = v - return s -} - -// Describes a Spot Instance request. -type SpotInstanceRequest struct { - _ struct{} `type:"structure"` - - // If you specified a duration and your Spot Instance request was fulfilled, - // this is the fixed hourly price in effect for the Spot Instance while it runs. - ActualBlockHourlyPrice *string `locationName:"actualBlockHourlyPrice" type:"string"` - - // The Availability Zone group. If you specify the same Availability Zone group - // for all Spot Instance requests, all Spot Instances are launched in the same - // Availability Zone. - AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` - - // The duration for the Spot Instance, in minutes. - BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"` - - // The date and time when the Spot Instance request was created, in UTC format - // (for example, YYYY-MM-DDTHH:MM:SSZ). - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // The fault codes for the Spot Instance request, if any. - Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"` - - // The instance ID, if an instance has been launched to fulfill the Spot Instance - // request. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The behavior when a Spot Instance is interrupted. - InstanceInterruptionBehavior *string `locationName:"instanceInterruptionBehavior" type:"string" enum:"InstanceInterruptionBehavior"` - - // The instance launch group. Launch groups are Spot Instances that launch together - // and terminate together. - LaunchGroup *string `locationName:"launchGroup" type:"string"` - - // Additional information for launching instances. - LaunchSpecification *LaunchSpecification `locationName:"launchSpecification" type:"structure"` - - // The Availability Zone in which the request is launched. - LaunchedAvailabilityZone *string `locationName:"launchedAvailabilityZone" type:"string"` - - // The product description associated with the Spot Instance. - ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - - // The ID of the Spot Instance request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - - // The maximum price per hour that you are willing to pay for a Spot Instance. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The state of the Spot Instance request. Spot status information helps track - // your Spot Instance requests. For more information, see Spot Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) - // in the Amazon EC2 User Guide for Linux Instances. - State *string `locationName:"state" type:"string" enum:"SpotInstanceState"` - - // The status code and status message describing the Spot Instance request. - Status *SpotInstanceStatus `locationName:"status" type:"structure"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The Spot Instance request type. - Type *string `locationName:"type" type:"string" enum:"SpotInstanceType"` - - // The start date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // The request becomes active at this date and time. - ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` - - // The end date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // If this is a one-time request, it remains active until all instances launch, - // the request is canceled, or this date is reached. If the request is persistent, - // it remains active until it is canceled or this date is reached. The default - // end date is 7 days from the current date. - ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotInstanceRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotInstanceRequest) GoString() string { - return s.String() -} - -// SetActualBlockHourlyPrice sets the ActualBlockHourlyPrice field's value. -func (s *SpotInstanceRequest) SetActualBlockHourlyPrice(v string) *SpotInstanceRequest { - s.ActualBlockHourlyPrice = &v - return s -} - -// SetAvailabilityZoneGroup sets the AvailabilityZoneGroup field's value. -func (s *SpotInstanceRequest) SetAvailabilityZoneGroup(v string) *SpotInstanceRequest { - s.AvailabilityZoneGroup = &v - return s -} - -// SetBlockDurationMinutes sets the BlockDurationMinutes field's value. -func (s *SpotInstanceRequest) SetBlockDurationMinutes(v int64) *SpotInstanceRequest { - s.BlockDurationMinutes = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *SpotInstanceRequest) SetCreateTime(v time.Time) *SpotInstanceRequest { - s.CreateTime = &v - return s -} - -// SetFault sets the Fault field's value. -func (s *SpotInstanceRequest) SetFault(v *SpotInstanceStateFault) *SpotInstanceRequest { - s.Fault = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *SpotInstanceRequest) SetInstanceId(v string) *SpotInstanceRequest { - s.InstanceId = &v - return s -} - -// SetInstanceInterruptionBehavior sets the InstanceInterruptionBehavior field's value. -func (s *SpotInstanceRequest) SetInstanceInterruptionBehavior(v string) *SpotInstanceRequest { - s.InstanceInterruptionBehavior = &v - return s -} - -// SetLaunchGroup sets the LaunchGroup field's value. -func (s *SpotInstanceRequest) SetLaunchGroup(v string) *SpotInstanceRequest { - s.LaunchGroup = &v - return s -} - -// SetLaunchSpecification sets the LaunchSpecification field's value. -func (s *SpotInstanceRequest) SetLaunchSpecification(v *LaunchSpecification) *SpotInstanceRequest { - s.LaunchSpecification = v - return s -} - -// SetLaunchedAvailabilityZone sets the LaunchedAvailabilityZone field's value. -func (s *SpotInstanceRequest) SetLaunchedAvailabilityZone(v string) *SpotInstanceRequest { - s.LaunchedAvailabilityZone = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *SpotInstanceRequest) SetProductDescription(v string) *SpotInstanceRequest { - s.ProductDescription = &v - return s -} - -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *SpotInstanceRequest) SetSpotInstanceRequestId(v string) *SpotInstanceRequest { - s.SpotInstanceRequestId = &v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *SpotInstanceRequest) SetSpotPrice(v string) *SpotInstanceRequest { - s.SpotPrice = &v - return s -} - -// SetState sets the State field's value. -func (s *SpotInstanceRequest) SetState(v string) *SpotInstanceRequest { - s.State = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SpotInstanceRequest) SetStatus(v *SpotInstanceStatus) *SpotInstanceRequest { - s.Status = v - return s -} - -// SetTags sets the Tags field's value. -func (s *SpotInstanceRequest) SetTags(v []*Tag) *SpotInstanceRequest { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *SpotInstanceRequest) SetType(v string) *SpotInstanceRequest { - s.Type = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *SpotInstanceRequest) SetValidFrom(v time.Time) *SpotInstanceRequest { - s.ValidFrom = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *SpotInstanceRequest) SetValidUntil(v time.Time) *SpotInstanceRequest { - s.ValidUntil = &v - return s -} - -// Describes a Spot Instance state change. -type SpotInstanceStateFault struct { - _ struct{} `type:"structure"` - - // The reason code for the Spot Instance state change. - Code *string `locationName:"code" type:"string"` - - // The message for the Spot Instance state change. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s SpotInstanceStateFault) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotInstanceStateFault) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *SpotInstanceStateFault) SetCode(v string) *SpotInstanceStateFault { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *SpotInstanceStateFault) SetMessage(v string) *SpotInstanceStateFault { - s.Message = &v - return s -} - -// Describes the status of a Spot Instance request. -type SpotInstanceStatus struct { - _ struct{} `type:"structure"` - - // The status code. For a list of status codes, see Spot Status Codes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html#spot-instance-bid-status-understand) - // in the Amazon EC2 User Guide for Linux Instances. - Code *string `locationName:"code" type:"string"` - - // The description for the status code. - Message *string `locationName:"message" type:"string"` - - // The date and time of the most recent status update, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotInstanceStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotInstanceStatus) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *SpotInstanceStatus) SetCode(v string) *SpotInstanceStatus { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *SpotInstanceStatus) SetMessage(v string) *SpotInstanceStatus { - s.Message = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *SpotInstanceStatus) SetUpdateTime(v time.Time) *SpotInstanceStatus { - s.UpdateTime = &v - return s -} - -// The options for Spot Instances. -type SpotMarketOptions struct { - _ struct{} `type:"structure"` - - // The required duration for the Spot Instances (also known as Spot blocks), - // in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, - // or 360). - BlockDurationMinutes *int64 `type:"integer"` - - // The behavior when a Spot Instance is interrupted. The default is terminate. - InstanceInterruptionBehavior *string `type:"string" enum:"InstanceInterruptionBehavior"` - - // The maximum hourly price you're willing to pay for the Spot Instances. The - // default is the On-Demand price. - MaxPrice *string `type:"string"` - - // The Spot Instance request type. - SpotInstanceType *string `type:"string" enum:"SpotInstanceType"` - - // The end date of the request. For a one-time request, the request remains - // active until all instances launch, the request is canceled, or this date - // is reached. If the request is persistent, it remains active until it is canceled - // or this date and time is reached. The default end date is 7 days from the - // current date. - ValidUntil *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotMarketOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotMarketOptions) GoString() string { - return s.String() -} - -// SetBlockDurationMinutes sets the BlockDurationMinutes field's value. -func (s *SpotMarketOptions) SetBlockDurationMinutes(v int64) *SpotMarketOptions { - s.BlockDurationMinutes = &v - return s -} - -// SetInstanceInterruptionBehavior sets the InstanceInterruptionBehavior field's value. -func (s *SpotMarketOptions) SetInstanceInterruptionBehavior(v string) *SpotMarketOptions { - s.InstanceInterruptionBehavior = &v - return s -} - -// SetMaxPrice sets the MaxPrice field's value. -func (s *SpotMarketOptions) SetMaxPrice(v string) *SpotMarketOptions { - s.MaxPrice = &v - return s -} - -// SetSpotInstanceType sets the SpotInstanceType field's value. -func (s *SpotMarketOptions) SetSpotInstanceType(v string) *SpotMarketOptions { - s.SpotInstanceType = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *SpotMarketOptions) SetValidUntil(v time.Time) *SpotMarketOptions { - s.ValidUntil = &v - return s -} - -// Describes the configuration of Spot Instances in an EC2 Fleet. -type SpotOptions struct { - _ struct{} `type:"structure"` - - // Indicates how to allocate the target capacity across the Spot pools specified - // by the Spot Fleet request. The default is lowestPrice. - AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"SpotAllocationStrategy"` - - // The behavior when a Spot Instance is interrupted. The default is terminate. - InstanceInterruptionBehavior *string `locationName:"instanceInterruptionBehavior" type:"string" enum:"SpotInstanceInterruptionBehavior"` -} - -// String returns the string representation -func (s SpotOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotOptions) GoString() string { - return s.String() -} - -// SetAllocationStrategy sets the AllocationStrategy field's value. -func (s *SpotOptions) SetAllocationStrategy(v string) *SpotOptions { - s.AllocationStrategy = &v - return s -} - -// SetInstanceInterruptionBehavior sets the InstanceInterruptionBehavior field's value. -func (s *SpotOptions) SetInstanceInterruptionBehavior(v string) *SpotOptions { - s.InstanceInterruptionBehavior = &v - return s -} - -// Describes the configuration of Spot Instances in an EC2 Fleet request. -type SpotOptionsRequest struct { - _ struct{} `type:"structure"` - - // Indicates how to allocate the target capacity across the Spot pools specified - // by the Spot Fleet request. The default is lowestPrice. - AllocationStrategy *string `type:"string" enum:"SpotAllocationStrategy"` - - // The behavior when a Spot Instance is interrupted. The default is terminate. - InstanceInterruptionBehavior *string `type:"string" enum:"SpotInstanceInterruptionBehavior"` -} - -// String returns the string representation -func (s SpotOptionsRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotOptionsRequest) GoString() string { - return s.String() -} - -// SetAllocationStrategy sets the AllocationStrategy field's value. -func (s *SpotOptionsRequest) SetAllocationStrategy(v string) *SpotOptionsRequest { - s.AllocationStrategy = &v - return s -} - -// SetInstanceInterruptionBehavior sets the InstanceInterruptionBehavior field's value. -func (s *SpotOptionsRequest) SetInstanceInterruptionBehavior(v string) *SpotOptionsRequest { - s.InstanceInterruptionBehavior = &v - return s -} - -// Describes Spot Instance placement. -type SpotPlacement struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - // - // [Spot Fleet only] To specify multiple Availability Zones, separate them using - // commas; for example, "us-west-2a, us-west-2b". - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The name of the placement group. - GroupName *string `locationName:"groupName" type:"string"` - - // The tenancy of the instance (if the instance is running in a VPC). An instance - // with a tenancy of dedicated runs on single-tenant hardware. The host tenancy - // is not supported for Spot Instances. - Tenancy *string `locationName:"tenancy" type:"string" enum:"Tenancy"` -} - -// String returns the string representation -func (s SpotPlacement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotPlacement) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *SpotPlacement) SetAvailabilityZone(v string) *SpotPlacement { - s.AvailabilityZone = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *SpotPlacement) SetGroupName(v string) *SpotPlacement { - s.GroupName = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *SpotPlacement) SetTenancy(v string) *SpotPlacement { - s.Tenancy = &v - return s -} - -// Describes the maximum price per hour that you are willing to pay for a Spot -// Instance. -type SpotPrice struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // A general description of the AMI. - ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - - // The maximum price per hour that you are willing to pay for a Spot Instance. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotPrice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotPrice) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *SpotPrice) SetAvailabilityZone(v string) *SpotPrice { - s.AvailabilityZone = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *SpotPrice) SetInstanceType(v string) *SpotPrice { - s.InstanceType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *SpotPrice) SetProductDescription(v string) *SpotPrice { - s.ProductDescription = &v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *SpotPrice) SetSpotPrice(v string) *SpotPrice { - s.SpotPrice = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *SpotPrice) SetTimestamp(v time.Time) *SpotPrice { - s.Timestamp = &v - return s -} - -// Describes a stale rule in a security group. -type StaleIpPermission struct { - _ struct{} `type:"structure"` - - // The start of the port range for the TCP and UDP protocols, or an ICMP type - // number. A value of -1 indicates all ICMP types. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers) - // (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). - IpProtocol *string `locationName:"ipProtocol" type:"string"` - - // One or more IP ranges. Not applicable for stale security group rules. - IpRanges []*string `locationName:"ipRanges" locationNameList:"item" type:"list"` - - // One or more prefix list IDs for an AWS service. Not applicable for stale - // security group rules. - PrefixListIds []*string `locationName:"prefixListIds" locationNameList:"item" type:"list"` - - // The end of the port range for the TCP and UDP protocols, or an ICMP type - // number. A value of -1 indicates all ICMP types. - ToPort *int64 `locationName:"toPort" type:"integer"` - - // One or more security group pairs. Returns the ID of the referenced security - // group and VPC, and the ID and status of the VPC peering connection. - UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s StaleIpPermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StaleIpPermission) GoString() string { - return s.String() -} - -// SetFromPort sets the FromPort field's value. -func (s *StaleIpPermission) SetFromPort(v int64) *StaleIpPermission { - s.FromPort = &v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *StaleIpPermission) SetIpProtocol(v string) *StaleIpPermission { - s.IpProtocol = &v - return s -} - -// SetIpRanges sets the IpRanges field's value. -func (s *StaleIpPermission) SetIpRanges(v []*string) *StaleIpPermission { - s.IpRanges = v - return s -} - -// SetPrefixListIds sets the PrefixListIds field's value. -func (s *StaleIpPermission) SetPrefixListIds(v []*string) *StaleIpPermission { - s.PrefixListIds = v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *StaleIpPermission) SetToPort(v int64) *StaleIpPermission { - s.ToPort = &v - return s -} - -// SetUserIdGroupPairs sets the UserIdGroupPairs field's value. -func (s *StaleIpPermission) SetUserIdGroupPairs(v []*UserIdGroupPair) *StaleIpPermission { - s.UserIdGroupPairs = v - return s -} - -// Describes a stale security group (a security group that contains stale rules). -type StaleSecurityGroup struct { - _ struct{} `type:"structure"` - - // The description of the security group. - Description *string `locationName:"description" type:"string"` - - // The ID of the security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` - - // The name of the security group. - GroupName *string `locationName:"groupName" type:"string"` - - // Information about the stale inbound rules in the security group. - StaleIpPermissions []*StaleIpPermission `locationName:"staleIpPermissions" locationNameList:"item" type:"list"` - - // Information about the stale outbound rules in the security group. - StaleIpPermissionsEgress []*StaleIpPermission `locationName:"staleIpPermissionsEgress" locationNameList:"item" type:"list"` - - // The ID of the VPC for the security group. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s StaleSecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StaleSecurityGroup) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *StaleSecurityGroup) SetDescription(v string) *StaleSecurityGroup { - s.Description = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *StaleSecurityGroup) SetGroupId(v string) *StaleSecurityGroup { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *StaleSecurityGroup) SetGroupName(v string) *StaleSecurityGroup { - s.GroupName = &v - return s -} - -// SetStaleIpPermissions sets the StaleIpPermissions field's value. -func (s *StaleSecurityGroup) SetStaleIpPermissions(v []*StaleIpPermission) *StaleSecurityGroup { - s.StaleIpPermissions = v - return s -} - -// SetStaleIpPermissionsEgress sets the StaleIpPermissionsEgress field's value. -func (s *StaleSecurityGroup) SetStaleIpPermissionsEgress(v []*StaleIpPermission) *StaleSecurityGroup { - s.StaleIpPermissionsEgress = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *StaleSecurityGroup) SetVpcId(v string) *StaleSecurityGroup { - s.VpcId = &v - return s -} - -// Contains the parameters for StartInstances. -type StartInstancesInput struct { - _ struct{} `type:"structure"` - - // Reserved. - AdditionalInfo *string `locationName:"additionalInfo" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s StartInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *StartInstancesInput) SetAdditionalInfo(v string) *StartInstancesInput { - s.AdditionalInfo = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *StartInstancesInput) SetDryRun(v bool) *StartInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *StartInstancesInput) SetInstanceIds(v []*string) *StartInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of StartInstances. -type StartInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more started instances. - StartingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s StartInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstancesOutput) GoString() string { - return s.String() -} - -// SetStartingInstances sets the StartingInstances field's value. -func (s *StartInstancesOutput) SetStartingInstances(v []*InstanceStateChange) *StartInstancesOutput { - s.StartingInstances = v - return s -} - -// Describes a state change. -type StateReason struct { - _ struct{} `type:"structure"` - - // The reason code for the state change. - Code *string `locationName:"code" type:"string"` - - // The message for the state change. - // - // * Server.InsufficientInstanceCapacity: There was insufficient instance - // capacity to satisfy the launch request. - // - // * Server.InternalError: An internal error occurred during instance launch, - // resulting in termination. - // - // * Server.ScheduledStop: The instance was stopped due to a scheduled retirement. - // - // * Server.SpotInstanceTermination: A Spot Instance was terminated due to - // an increase in the Spot price. - // - // * Client.InternalError: A client error caused the instance to terminate - // on launch. - // - // * Client.InstanceInitiatedShutdown: The instance was shut down using the - // shutdown -h command from the instance. - // - // * Client.InstanceTerminated: The instance was terminated or rebooted during - // AMI creation. - // - // * Client.UserInitiatedShutdown: The instance was shut down using the Amazon - // EC2 API. - // - // * Client.VolumeLimitExceeded: The limit on the number of EBS volumes or - // total storage was exceeded. Decrease usage or request an increase in your - // limits. - // - // * Client.InvalidSnapshot.NotFound: The specified snapshot was not found. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s StateReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StateReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *StateReason) SetCode(v string) *StateReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *StateReason) SetMessage(v string) *StateReason { - s.Message = &v - return s -} - -// Contains the parameters for StopInstances. -type StopInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Forces the instances to stop. The instances do not have an opportunity to - // flush file system caches or file system metadata. If you use this option, - // you must perform file system check and repair procedures. This option is - // not recommended for Windows instances. - // - // Default: false - Force *bool `locationName:"force" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s StopInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *StopInstancesInput) SetDryRun(v bool) *StopInstancesInput { - s.DryRun = &v - return s -} - -// SetForce sets the Force field's value. -func (s *StopInstancesInput) SetForce(v bool) *StopInstancesInput { - s.Force = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *StopInstancesInput) SetInstanceIds(v []*string) *StopInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of StopInstances. -type StopInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more stopped instances. - StoppingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s StopInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstancesOutput) GoString() string { - return s.String() -} - -// SetStoppingInstances sets the StoppingInstances field's value. -func (s *StopInstancesOutput) SetStoppingInstances(v []*InstanceStateChange) *StopInstancesOutput { - s.StoppingInstances = v - return s -} - -// Describes the storage location for an instance store-backed AMI. -type Storage struct { - _ struct{} `type:"structure"` - - // An Amazon S3 storage location. - S3 *S3Storage `type:"structure"` -} - -// String returns the string representation -func (s Storage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Storage) GoString() string { - return s.String() -} - -// SetS3 sets the S3 field's value. -func (s *Storage) SetS3(v *S3Storage) *Storage { - s.S3 = v - return s -} - -// Describes a storage location in Amazon S3. -type StorageLocation struct { - _ struct{} `type:"structure"` - - // The name of the S3 bucket. - Bucket *string `type:"string"` - - // The key. - Key *string `type:"string"` -} - -// String returns the string representation -func (s StorageLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StorageLocation) GoString() string { - return s.String() -} - -// SetBucket sets the Bucket field's value. -func (s *StorageLocation) SetBucket(v string) *StorageLocation { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *StorageLocation) SetKey(v string) *StorageLocation { - s.Key = &v - return s -} - -// Describes a subnet. -type Subnet struct { - _ struct{} `type:"structure"` - - // Indicates whether a network interface created in this subnet (including a - // network interface created by RunInstances) receives an IPv6 address. - AssignIpv6AddressOnCreation *bool `locationName:"assignIpv6AddressOnCreation" type:"boolean"` - - // The Availability Zone of the subnet. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of unused private IPv4 addresses in the subnet. Note that the - // IPv4 addresses for any stopped instances are considered unavailable. - AvailableIpAddressCount *int64 `locationName:"availableIpAddressCount" type:"integer"` - - // The IPv4 CIDR block assigned to the subnet. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Indicates whether this is the default subnet for the Availability Zone. - DefaultForAz *bool `locationName:"defaultForAz" type:"boolean"` - - // Information about the IPv6 CIDR blocks associated with the subnet. - Ipv6CidrBlockAssociationSet []*SubnetIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociationSet" locationNameList:"item" type:"list"` - - // Indicates whether instances launched in this subnet receive a public IPv4 - // address. - MapPublicIpOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"` - - // The current state of the subnet. - State *string `locationName:"state" type:"string" enum:"SubnetState"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` - - // Any tags assigned to the subnet. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC the subnet is in. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s Subnet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Subnet) GoString() string { - return s.String() -} - -// SetAssignIpv6AddressOnCreation sets the AssignIpv6AddressOnCreation field's value. -func (s *Subnet) SetAssignIpv6AddressOnCreation(v bool) *Subnet { - s.AssignIpv6AddressOnCreation = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Subnet) SetAvailabilityZone(v string) *Subnet { - s.AvailabilityZone = &v - return s -} - -// SetAvailableIpAddressCount sets the AvailableIpAddressCount field's value. -func (s *Subnet) SetAvailableIpAddressCount(v int64) *Subnet { - s.AvailableIpAddressCount = &v - return s -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *Subnet) SetCidrBlock(v string) *Subnet { - s.CidrBlock = &v - return s -} - -// SetDefaultForAz sets the DefaultForAz field's value. -func (s *Subnet) SetDefaultForAz(v bool) *Subnet { - s.DefaultForAz = &v - return s -} - -// SetIpv6CidrBlockAssociationSet sets the Ipv6CidrBlockAssociationSet field's value. -func (s *Subnet) SetIpv6CidrBlockAssociationSet(v []*SubnetIpv6CidrBlockAssociation) *Subnet { - s.Ipv6CidrBlockAssociationSet = v - return s -} - -// SetMapPublicIpOnLaunch sets the MapPublicIpOnLaunch field's value. -func (s *Subnet) SetMapPublicIpOnLaunch(v bool) *Subnet { - s.MapPublicIpOnLaunch = &v - return s -} - -// SetState sets the State field's value. -func (s *Subnet) SetState(v string) *Subnet { - s.State = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *Subnet) SetSubnetId(v string) *Subnet { - s.SubnetId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Subnet) SetTags(v []*Tag) *Subnet { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Subnet) SetVpcId(v string) *Subnet { - s.VpcId = &v - return s -} - -// Describes the state of a CIDR block. -type SubnetCidrBlockState struct { - _ struct{} `type:"structure"` - - // The state of a CIDR block. - State *string `locationName:"state" type:"string" enum:"SubnetCidrBlockStateCode"` - - // A message about the status of the CIDR block, if applicable. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s SubnetCidrBlockState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubnetCidrBlockState) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *SubnetCidrBlockState) SetState(v string) *SubnetCidrBlockState { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *SubnetCidrBlockState) SetStatusMessage(v string) *SubnetCidrBlockState { - s.StatusMessage = &v - return s -} - -// Describes an IPv6 CIDR block associated with a subnet. -type SubnetIpv6CidrBlockAssociation struct { - _ struct{} `type:"structure"` - - // The association ID for the CIDR block. - AssociationId *string `locationName:"associationId" type:"string"` - - // The IPv6 CIDR block. - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // Information about the state of the CIDR block. - Ipv6CidrBlockState *SubnetCidrBlockState `locationName:"ipv6CidrBlockState" type:"structure"` -} - -// String returns the string representation -func (s SubnetIpv6CidrBlockAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubnetIpv6CidrBlockAssociation) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *SubnetIpv6CidrBlockAssociation) SetAssociationId(v string) *SubnetIpv6CidrBlockAssociation { - s.AssociationId = &v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *SubnetIpv6CidrBlockAssociation) SetIpv6CidrBlock(v string) *SubnetIpv6CidrBlockAssociation { - s.Ipv6CidrBlock = &v - return s -} - -// SetIpv6CidrBlockState sets the Ipv6CidrBlockState field's value. -func (s *SubnetIpv6CidrBlockAssociation) SetIpv6CidrBlockState(v *SubnetCidrBlockState) *SubnetIpv6CidrBlockAssociation { - s.Ipv6CidrBlockState = v - return s -} - -// Describes the T2 instance whose credit option for CPU usage was successfully -// modified. -type SuccessfulInstanceCreditSpecificationItem struct { - _ struct{} `type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` -} - -// String returns the string representation -func (s SuccessfulInstanceCreditSpecificationItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SuccessfulInstanceCreditSpecificationItem) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *SuccessfulInstanceCreditSpecificationItem) SetInstanceId(v string) *SuccessfulInstanceCreditSpecificationItem { - s.InstanceId = &v - return s -} - -// Describes a tag. -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag. - // - // Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode - // characters. May not begin with aws: - Key *string `locationName:"key" type:"string"` - - // The value of the tag. - // - // Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode - // characters. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tag) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// Describes a tag. -type TagDescription struct { - _ struct{} `type:"structure"` - - // The tag key. - Key *string `locationName:"key" type:"string"` - - // The ID of the resource. For example, ami-1a2b3c4d. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The resource type. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The tag value. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s TagDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagDescription) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TagDescription) SetKey(v string) *TagDescription { - s.Key = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *TagDescription) SetResourceId(v string) *TagDescription { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *TagDescription) SetResourceType(v string) *TagDescription { - s.ResourceType = &v - return s -} - -// SetValue sets the Value field's value. -func (s *TagDescription) SetValue(v string) *TagDescription { - s.Value = &v - return s -} - -// The tags to apply to a resource when the resource is being created. -type TagSpecification struct { - _ struct{} `type:"structure"` - - // The type of resource to tag. Currently, the resource types that support tagging - // on creation are instance, snapshot, and volume. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The tags to apply to the resource. - Tags []*Tag `locationName:"Tag" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s TagSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagSpecification) GoString() string { - return s.String() -} - -// SetResourceType sets the ResourceType field's value. -func (s *TagSpecification) SetResourceType(v string) *TagSpecification { - s.ResourceType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagSpecification) SetTags(v []*Tag) *TagSpecification { - s.Tags = v - return s -} - -// The number of units to request. You can choose to set the target capacity -// in terms of instances or a performance characteristic that is important to -// your application workload, such as vCPUs, memory, or I/O. If the request -// type is maintain, you can specify a target capacity of 0 and add capacity -// later. -type TargetCapacitySpecification struct { - _ struct{} `type:"structure"` - - // The default TotalTargetCapacity, which is either Spot or On-Demand. - DefaultTargetCapacityType *string `locationName:"defaultTargetCapacityType" type:"string" enum:"DefaultTargetCapacityType"` - - // The number of On-Demand units to request. - OnDemandTargetCapacity *int64 `locationName:"onDemandTargetCapacity" type:"integer"` - - // The maximum number of Spot units to launch. - SpotTargetCapacity *int64 `locationName:"spotTargetCapacity" type:"integer"` - - // The number of units to request, filled using DefaultTargetCapacityType. - TotalTargetCapacity *int64 `locationName:"totalTargetCapacity" type:"integer"` -} - -// String returns the string representation -func (s TargetCapacitySpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetCapacitySpecification) GoString() string { - return s.String() -} - -// SetDefaultTargetCapacityType sets the DefaultTargetCapacityType field's value. -func (s *TargetCapacitySpecification) SetDefaultTargetCapacityType(v string) *TargetCapacitySpecification { - s.DefaultTargetCapacityType = &v - return s -} - -// SetOnDemandTargetCapacity sets the OnDemandTargetCapacity field's value. -func (s *TargetCapacitySpecification) SetOnDemandTargetCapacity(v int64) *TargetCapacitySpecification { - s.OnDemandTargetCapacity = &v - return s -} - -// SetSpotTargetCapacity sets the SpotTargetCapacity field's value. -func (s *TargetCapacitySpecification) SetSpotTargetCapacity(v int64) *TargetCapacitySpecification { - s.SpotTargetCapacity = &v - return s -} - -// SetTotalTargetCapacity sets the TotalTargetCapacity field's value. -func (s *TargetCapacitySpecification) SetTotalTargetCapacity(v int64) *TargetCapacitySpecification { - s.TotalTargetCapacity = &v - return s -} - -// The number of units to request. You can choose to set the target capacity -// in terms of instances or a performance characteristic that is important to -// your application workload, such as vCPUs, memory, or I/O. If the request -// type is maintain, you can specify a target capacity of 0 and add capacity -// later. -type TargetCapacitySpecificationRequest struct { - _ struct{} `type:"structure"` - - // The default TotalTargetCapacity, which is either Spot or On-Demand. - DefaultTargetCapacityType *string `type:"string" enum:"DefaultTargetCapacityType"` - - // The number of On-Demand units to request. - OnDemandTargetCapacity *int64 `type:"integer"` - - // The number of Spot units to request. - SpotTargetCapacity *int64 `type:"integer"` - - // The number of units to request, filled using DefaultTargetCapacityType. - // - // TotalTargetCapacity is a required field - TotalTargetCapacity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s TargetCapacitySpecificationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetCapacitySpecificationRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetCapacitySpecificationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetCapacitySpecificationRequest"} - if s.TotalTargetCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("TotalTargetCapacity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultTargetCapacityType sets the DefaultTargetCapacityType field's value. -func (s *TargetCapacitySpecificationRequest) SetDefaultTargetCapacityType(v string) *TargetCapacitySpecificationRequest { - s.DefaultTargetCapacityType = &v - return s -} - -// SetOnDemandTargetCapacity sets the OnDemandTargetCapacity field's value. -func (s *TargetCapacitySpecificationRequest) SetOnDemandTargetCapacity(v int64) *TargetCapacitySpecificationRequest { - s.OnDemandTargetCapacity = &v - return s -} - -// SetSpotTargetCapacity sets the SpotTargetCapacity field's value. -func (s *TargetCapacitySpecificationRequest) SetSpotTargetCapacity(v int64) *TargetCapacitySpecificationRequest { - s.SpotTargetCapacity = &v - return s -} - -// SetTotalTargetCapacity sets the TotalTargetCapacity field's value. -func (s *TargetCapacitySpecificationRequest) SetTotalTargetCapacity(v int64) *TargetCapacitySpecificationRequest { - s.TotalTargetCapacity = &v - return s -} - -// Information about the Convertible Reserved Instance offering. -type TargetConfiguration struct { - _ struct{} `type:"structure"` - - // The number of instances the Convertible Reserved Instance offering can be - // applied to. This parameter is reserved and cannot be specified in a request - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The ID of the Convertible Reserved Instance offering. - OfferingId *string `locationName:"offeringId" type:"string"` -} - -// String returns the string representation -func (s TargetConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetConfiguration) GoString() string { - return s.String() -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *TargetConfiguration) SetInstanceCount(v int64) *TargetConfiguration { - s.InstanceCount = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *TargetConfiguration) SetOfferingId(v string) *TargetConfiguration { - s.OfferingId = &v - return s -} - -// Details about the target configuration. -type TargetConfigurationRequest struct { - _ struct{} `type:"structure"` - - // The number of instances the Covertible Reserved Instance offering can be - // applied to. This parameter is reserved and cannot be specified in a request - InstanceCount *int64 `type:"integer"` - - // The Convertible Reserved Instance offering ID. - // - // OfferingId is a required field - OfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s TargetConfigurationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetConfigurationRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetConfigurationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetConfigurationRequest"} - if s.OfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("OfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *TargetConfigurationRequest) SetInstanceCount(v int64) *TargetConfigurationRequest { - s.InstanceCount = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *TargetConfigurationRequest) SetOfferingId(v string) *TargetConfigurationRequest { - s.OfferingId = &v - return s -} - -// Describes a load balancer target group. -type TargetGroup struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` -} - -// String returns the string representation -func (s TargetGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetGroup) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetGroup) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetGroup"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *TargetGroup) SetArn(v string) *TargetGroup { - s.Arn = &v - return s -} - -// Describes the target groups to attach to a Spot Fleet. Spot Fleet registers -// the running Spot Instances with these target groups. -type TargetGroupsConfig struct { - _ struct{} `type:"structure"` - - // One or more target groups. - // - // TargetGroups is a required field - TargetGroups []*TargetGroup `locationName:"targetGroups" locationNameList:"item" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s TargetGroupsConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetGroupsConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetGroupsConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetGroupsConfig"} - if s.TargetGroups == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroups")) - } - if s.TargetGroups != nil && len(s.TargetGroups) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroups", 1)) - } - if s.TargetGroups != nil { - for i, v := range s.TargetGroups { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetGroups", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroups sets the TargetGroups field's value. -func (s *TargetGroupsConfig) SetTargetGroups(v []*TargetGroup) *TargetGroupsConfig { - s.TargetGroups = v - return s -} - -// The total value of the new Convertible Reserved Instances. -type TargetReservationValue struct { - _ struct{} `type:"structure"` - - // The total value of the Convertible Reserved Instances that make up the exchange. - // This is the sum of the list value, remaining upfront price, and additional - // upfront cost of the exchange. - ReservationValue *ReservationValue `locationName:"reservationValue" type:"structure"` - - // The configuration of the Convertible Reserved Instances that make up the - // exchange. - TargetConfiguration *TargetConfiguration `locationName:"targetConfiguration" type:"structure"` -} - -// String returns the string representation -func (s TargetReservationValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetReservationValue) GoString() string { - return s.String() -} - -// SetReservationValue sets the ReservationValue field's value. -func (s *TargetReservationValue) SetReservationValue(v *ReservationValue) *TargetReservationValue { - s.ReservationValue = v - return s -} - -// SetTargetConfiguration sets the TargetConfiguration field's value. -func (s *TargetReservationValue) SetTargetConfiguration(v *TargetConfiguration) *TargetReservationValue { - s.TargetConfiguration = v - return s -} - -// Contains the parameters for TerminateInstances. -type TerminateInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // Constraints: Up to 1000 instance IDs. We recommend breaking up this request - // into smaller batches. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s TerminateInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TerminateInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TerminateInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *TerminateInstancesInput) SetDryRun(v bool) *TerminateInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *TerminateInstancesInput) SetInstanceIds(v []*string) *TerminateInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of TerminateInstances. -type TerminateInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more terminated instances. - TerminatingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s TerminateInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateInstancesOutput) GoString() string { - return s.String() -} - -// SetTerminatingInstances sets the TerminatingInstances field's value. -func (s *TerminateInstancesOutput) SetTerminatingInstances(v []*InstanceStateChange) *TerminateInstancesOutput { - s.TerminatingInstances = v - return s -} - -type UnassignIpv6AddressesInput struct { - _ struct{} `type:"structure"` - - // The IPv6 addresses to unassign from the network interface. - // - // Ipv6Addresses is a required field - Ipv6Addresses []*string `locationName:"ipv6Addresses" locationNameList:"item" type:"list" required:"true"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s UnassignIpv6AddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignIpv6AddressesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnassignIpv6AddressesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnassignIpv6AddressesInput"} - if s.Ipv6Addresses == nil { - invalidParams.Add(request.NewErrParamRequired("Ipv6Addresses")) - } - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *UnassignIpv6AddressesInput) SetIpv6Addresses(v []*string) *UnassignIpv6AddressesInput { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *UnassignIpv6AddressesInput) SetNetworkInterfaceId(v string) *UnassignIpv6AddressesInput { - s.NetworkInterfaceId = &v - return s -} - -type UnassignIpv6AddressesOutput struct { - _ struct{} `type:"structure"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The IPv6 addresses that have been unassigned from the network interface. - UnassignedIpv6Addresses []*string `locationName:"unassignedIpv6Addresses" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s UnassignIpv6AddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignIpv6AddressesOutput) GoString() string { - return s.String() -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *UnassignIpv6AddressesOutput) SetNetworkInterfaceId(v string) *UnassignIpv6AddressesOutput { - s.NetworkInterfaceId = &v - return s -} - -// SetUnassignedIpv6Addresses sets the UnassignedIpv6Addresses field's value. -func (s *UnassignIpv6AddressesOutput) SetUnassignedIpv6Addresses(v []*string) *UnassignIpv6AddressesOutput { - s.UnassignedIpv6Addresses = v - return s -} - -// Contains the parameters for UnassignPrivateIpAddresses. -type UnassignPrivateIpAddressesInput struct { - _ struct{} `type:"structure"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - - // The secondary private IP addresses to unassign from the network interface. - // You can specify this option multiple times to unassign more than one IP address. - // - // PrivateIpAddresses is a required field - PrivateIpAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list" required:"true"` -} - -// String returns the string representation -func (s UnassignPrivateIpAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignPrivateIpAddressesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnassignPrivateIpAddressesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnassignPrivateIpAddressesInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - if s.PrivateIpAddresses == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateIpAddresses")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *UnassignPrivateIpAddressesInput) SetNetworkInterfaceId(v string) *UnassignPrivateIpAddressesInput { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *UnassignPrivateIpAddressesInput) SetPrivateIpAddresses(v []*string) *UnassignPrivateIpAddressesInput { - s.PrivateIpAddresses = v - return s -} - -type UnassignPrivateIpAddressesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UnassignPrivateIpAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignPrivateIpAddressesOutput) GoString() string { - return s.String() -} - -// Contains the parameters for UnmonitorInstances. -type UnmonitorInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s UnmonitorInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnmonitorInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnmonitorInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnmonitorInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *UnmonitorInstancesInput) SetDryRun(v bool) *UnmonitorInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *UnmonitorInstancesInput) SetInstanceIds(v []*string) *UnmonitorInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of UnmonitorInstances. -type UnmonitorInstancesOutput struct { - _ struct{} `type:"structure"` - - // The monitoring information. - InstanceMonitorings []*InstanceMonitoring `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s UnmonitorInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnmonitorInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceMonitorings sets the InstanceMonitorings field's value. -func (s *UnmonitorInstancesOutput) SetInstanceMonitorings(v []*InstanceMonitoring) *UnmonitorInstancesOutput { - s.InstanceMonitorings = v - return s -} - -// Describes the T2 instance whose credit option for CPU usage was not modified. -type UnsuccessfulInstanceCreditSpecificationItem struct { - _ struct{} `type:"structure"` - - // The applicable error for the T2 instance whose credit option for CPU usage - // was not modified. - Error *UnsuccessfulInstanceCreditSpecificationItemError `locationName:"error" type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` -} - -// String returns the string representation -func (s UnsuccessfulInstanceCreditSpecificationItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsuccessfulInstanceCreditSpecificationItem) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *UnsuccessfulInstanceCreditSpecificationItem) SetError(v *UnsuccessfulInstanceCreditSpecificationItemError) *UnsuccessfulInstanceCreditSpecificationItem { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *UnsuccessfulInstanceCreditSpecificationItem) SetInstanceId(v string) *UnsuccessfulInstanceCreditSpecificationItem { - s.InstanceId = &v - return s -} - -// Information about the error for the T2 instance whose credit option for CPU -// usage was not modified. -type UnsuccessfulInstanceCreditSpecificationItemError struct { - _ struct{} `type:"structure"` - - // The error code. - Code *string `locationName:"code" type:"string" enum:"UnsuccessfulInstanceCreditSpecificationErrorCode"` - - // The applicable error message. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s UnsuccessfulInstanceCreditSpecificationItemError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsuccessfulInstanceCreditSpecificationItemError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *UnsuccessfulInstanceCreditSpecificationItemError) SetCode(v string) *UnsuccessfulInstanceCreditSpecificationItemError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *UnsuccessfulInstanceCreditSpecificationItemError) SetMessage(v string) *UnsuccessfulInstanceCreditSpecificationItemError { - s.Message = &v - return s -} - -// Information about items that were not successfully processed in a batch call. -type UnsuccessfulItem struct { - _ struct{} `type:"structure"` - - // Information about the error. - // - // Error is a required field - Error *UnsuccessfulItemError `locationName:"error" type:"structure" required:"true"` - - // The ID of the resource. - ResourceId *string `locationName:"resourceId" type:"string"` -} - -// String returns the string representation -func (s UnsuccessfulItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsuccessfulItem) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *UnsuccessfulItem) SetError(v *UnsuccessfulItemError) *UnsuccessfulItem { - s.Error = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *UnsuccessfulItem) SetResourceId(v string) *UnsuccessfulItem { - s.ResourceId = &v - return s -} - -// Information about the error that occurred. For more information about errors, -// see Error Codes (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html). -type UnsuccessfulItemError struct { - _ struct{} `type:"structure"` - - // The error code. - // - // Code is a required field - Code *string `locationName:"code" type:"string" required:"true"` - - // The error message accompanying the error code. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` -} - -// String returns the string representation -func (s UnsuccessfulItemError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsuccessfulItemError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *UnsuccessfulItemError) SetCode(v string) *UnsuccessfulItemError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *UnsuccessfulItemError) SetMessage(v string) *UnsuccessfulItemError { - s.Message = &v - return s -} - -// Contains the parameters for UpdateSecurityGroupRuleDescriptionsEgress. -type UpdateSecurityGroupRuleDescriptionsEgressInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the security group. You must specify either the security group - // ID or the security group name in the request. For security groups in a nondefault - // VPC, you must specify the security group ID. - GroupId *string `type:"string"` - - // [Default VPC] The name of the security group. You must specify either the - // security group ID or the security group name in the request. - GroupName *string `type:"string"` - - // The IP permissions for the security group rule. - // - // IpPermissions is a required field - IpPermissions []*IpPermission `locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateSecurityGroupRuleDescriptionsEgressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSecurityGroupRuleDescriptionsEgressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSecurityGroupRuleDescriptionsEgressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSecurityGroupRuleDescriptionsEgressInput"} - if s.IpPermissions == nil { - invalidParams.Add(request.NewErrParamRequired("IpPermissions")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *UpdateSecurityGroupRuleDescriptionsEgressInput) SetDryRun(v bool) *UpdateSecurityGroupRuleDescriptionsEgressInput { - s.DryRun = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *UpdateSecurityGroupRuleDescriptionsEgressInput) SetGroupId(v string) *UpdateSecurityGroupRuleDescriptionsEgressInput { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *UpdateSecurityGroupRuleDescriptionsEgressInput) SetGroupName(v string) *UpdateSecurityGroupRuleDescriptionsEgressInput { - s.GroupName = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *UpdateSecurityGroupRuleDescriptionsEgressInput) SetIpPermissions(v []*IpPermission) *UpdateSecurityGroupRuleDescriptionsEgressInput { - s.IpPermissions = v - return s -} - -// Contains the output of UpdateSecurityGroupRuleDescriptionsEgress. -type UpdateSecurityGroupRuleDescriptionsEgressOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s UpdateSecurityGroupRuleDescriptionsEgressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSecurityGroupRuleDescriptionsEgressOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *UpdateSecurityGroupRuleDescriptionsEgressOutput) SetReturn(v bool) *UpdateSecurityGroupRuleDescriptionsEgressOutput { - s.Return = &v - return s -} - -// Contains the parameters for UpdateSecurityGroupRuleDescriptionsIngress. -type UpdateSecurityGroupRuleDescriptionsIngressInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the security group. You must specify either the security group - // ID or the security group name in the request. For security groups in a nondefault - // VPC, you must specify the security group ID. - GroupId *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the security group. You must specify - // either the security group ID or the security group name in the request. - GroupName *string `type:"string"` - - // The IP permissions for the security group rule. - // - // IpPermissions is a required field - IpPermissions []*IpPermission `locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s UpdateSecurityGroupRuleDescriptionsIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSecurityGroupRuleDescriptionsIngressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSecurityGroupRuleDescriptionsIngressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSecurityGroupRuleDescriptionsIngressInput"} - if s.IpPermissions == nil { - invalidParams.Add(request.NewErrParamRequired("IpPermissions")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *UpdateSecurityGroupRuleDescriptionsIngressInput) SetDryRun(v bool) *UpdateSecurityGroupRuleDescriptionsIngressInput { - s.DryRun = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *UpdateSecurityGroupRuleDescriptionsIngressInput) SetGroupId(v string) *UpdateSecurityGroupRuleDescriptionsIngressInput { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *UpdateSecurityGroupRuleDescriptionsIngressInput) SetGroupName(v string) *UpdateSecurityGroupRuleDescriptionsIngressInput { - s.GroupName = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *UpdateSecurityGroupRuleDescriptionsIngressInput) SetIpPermissions(v []*IpPermission) *UpdateSecurityGroupRuleDescriptionsIngressInput { - s.IpPermissions = v - return s -} - -// Contains the output of UpdateSecurityGroupRuleDescriptionsIngress. -type UpdateSecurityGroupRuleDescriptionsIngressOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s UpdateSecurityGroupRuleDescriptionsIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSecurityGroupRuleDescriptionsIngressOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *UpdateSecurityGroupRuleDescriptionsIngressOutput) SetReturn(v bool) *UpdateSecurityGroupRuleDescriptionsIngressOutput { - s.Return = &v - return s -} - -// Describes the S3 bucket for the disk image. -type UserBucket struct { - _ struct{} `type:"structure"` - - // The name of the S3 bucket where the disk image is located. - S3Bucket *string `type:"string"` - - // The file name of the disk image. - S3Key *string `type:"string"` -} - -// String returns the string representation -func (s UserBucket) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserBucket) GoString() string { - return s.String() -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *UserBucket) SetS3Bucket(v string) *UserBucket { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *UserBucket) SetS3Key(v string) *UserBucket { - s.S3Key = &v - return s -} - -// Describes the S3 bucket for the disk image. -type UserBucketDetails struct { - _ struct{} `type:"structure"` - - // The S3 bucket from which the disk image was created. - S3Bucket *string `locationName:"s3Bucket" type:"string"` - - // The file name of the disk image. - S3Key *string `locationName:"s3Key" type:"string"` -} - -// String returns the string representation -func (s UserBucketDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserBucketDetails) GoString() string { - return s.String() -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *UserBucketDetails) SetS3Bucket(v string) *UserBucketDetails { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *UserBucketDetails) SetS3Key(v string) *UserBucketDetails { - s.S3Key = &v - return s -} - -// Describes the user data for an instance. -type UserData struct { - _ struct{} `type:"structure"` - - // The user data. If you are using an AWS SDK or command line tool, Base64-encoding - // is performed for you, and you can load the text from a file. Otherwise, you - // must provide Base64-encoded text. - Data *string `locationName:"data" type:"string"` -} - -// String returns the string representation -func (s UserData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserData) GoString() string { - return s.String() -} - -// SetData sets the Data field's value. -func (s *UserData) SetData(v string) *UserData { - s.Data = &v - return s -} - -// Describes a security group and AWS account ID pair. -type UserIdGroupPair struct { - _ struct{} `type:"structure"` - - // A description for the security group rule that references this user ID group - // pair. - // - // Constraints: Up to 255 characters in length. Allowed characters are a-z, - // A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$* - Description *string `locationName:"description" type:"string"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` - - // The name of the security group. In a request, use this parameter for a security - // group in EC2-Classic or a default VPC only. For a security group in a nondefault - // VPC, use the security group ID. - // - // For a referenced security group in another VPC, this value is not returned - // if the referenced security group is deleted. - GroupName *string `locationName:"groupName" type:"string"` - - // The status of a VPC peering connection, if applicable. - PeeringStatus *string `locationName:"peeringStatus" type:"string"` - - // The ID of an AWS account. - // - // For a referenced security group in another VPC, the account ID of the referenced - // security group is returned in the response. If the referenced security group - // is deleted, this value is not returned. - // - // [EC2-Classic] Required when adding or removing rules that reference a security - // group in another AWS account. - UserId *string `locationName:"userId" type:"string"` - - // The ID of the VPC for the referenced security group, if applicable. - VpcId *string `locationName:"vpcId" type:"string"` - - // The ID of the VPC peering connection, if applicable. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s UserIdGroupPair) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserIdGroupPair) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *UserIdGroupPair) SetDescription(v string) *UserIdGroupPair { - s.Description = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *UserIdGroupPair) SetGroupId(v string) *UserIdGroupPair { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *UserIdGroupPair) SetGroupName(v string) *UserIdGroupPair { - s.GroupName = &v - return s -} - -// SetPeeringStatus sets the PeeringStatus field's value. -func (s *UserIdGroupPair) SetPeeringStatus(v string) *UserIdGroupPair { - s.PeeringStatus = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *UserIdGroupPair) SetUserId(v string) *UserIdGroupPair { - s.UserId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *UserIdGroupPair) SetVpcId(v string) *UserIdGroupPair { - s.VpcId = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *UserIdGroupPair) SetVpcPeeringConnectionId(v string) *UserIdGroupPair { - s.VpcPeeringConnectionId = &v - return s -} - -// Describes telemetry for a VPN tunnel. -type VgwTelemetry struct { - _ struct{} `type:"structure"` - - // The number of accepted routes. - AcceptedRouteCount *int64 `locationName:"acceptedRouteCount" type:"integer"` - - // The date and time of the last change in status. - LastStatusChange *time.Time `locationName:"lastStatusChange" type:"timestamp" timestampFormat:"iso8601"` - - // The Internet-routable IP address of the virtual private gateway's outside - // interface. - OutsideIpAddress *string `locationName:"outsideIpAddress" type:"string"` - - // The status of the VPN tunnel. - Status *string `locationName:"status" type:"string" enum:"TelemetryStatus"` - - // If an error occurs, a description of the error. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s VgwTelemetry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VgwTelemetry) GoString() string { - return s.String() -} - -// SetAcceptedRouteCount sets the AcceptedRouteCount field's value. -func (s *VgwTelemetry) SetAcceptedRouteCount(v int64) *VgwTelemetry { - s.AcceptedRouteCount = &v - return s -} - -// SetLastStatusChange sets the LastStatusChange field's value. -func (s *VgwTelemetry) SetLastStatusChange(v time.Time) *VgwTelemetry { - s.LastStatusChange = &v - return s -} - -// SetOutsideIpAddress sets the OutsideIpAddress field's value. -func (s *VgwTelemetry) SetOutsideIpAddress(v string) *VgwTelemetry { - s.OutsideIpAddress = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VgwTelemetry) SetStatus(v string) *VgwTelemetry { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VgwTelemetry) SetStatusMessage(v string) *VgwTelemetry { - s.StatusMessage = &v - return s -} - -// Describes a volume. -type Volume struct { - _ struct{} `type:"structure"` - - // Information about the volume attachments. - Attachments []*VolumeAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` - - // The Availability Zone for the volume. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The time stamp when volume creation was initiated. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether the volume will be encrypted. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For Provisioned IOPS SSD volumes, this represents the number of IOPS that - // are provisioned for the volume. For General Purpose SSD volumes, this represents - // the baseline performance of the volume and the rate at which the volume accumulates - // I/O credits for bursting. For more information on General Purpose SSD baseline - // performance, I/O credits, and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100-32000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops *int64 `locationName:"iops" type:"integer"` - - // The full ARN of the AWS Key Management Service (AWS KMS) customer master - // key (CMK) that was used to protect the volume encryption key for the volume. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The size of the volume, in GiBs. - Size *int64 `locationName:"size" type:"integer"` - - // The snapshot from which the volume was created, if applicable. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // The volume state. - State *string `locationName:"status" type:"string" enum:"VolumeState"` - - // Any tags assigned to the volume. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the volume. - VolumeId *string `locationName:"volumeId" type:"string"` - - // The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned - // IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard - // for Magnetic volumes. - VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s Volume) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Volume) GoString() string { - return s.String() -} - -// SetAttachments sets the Attachments field's value. -func (s *Volume) SetAttachments(v []*VolumeAttachment) *Volume { - s.Attachments = v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Volume) SetAvailabilityZone(v string) *Volume { - s.AvailabilityZone = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *Volume) SetCreateTime(v time.Time) *Volume { - s.CreateTime = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *Volume) SetEncrypted(v bool) *Volume { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *Volume) SetIops(v int64) *Volume { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Volume) SetKmsKeyId(v string) *Volume { - s.KmsKeyId = &v - return s -} - -// SetSize sets the Size field's value. -func (s *Volume) SetSize(v int64) *Volume { - s.Size = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *Volume) SetSnapshotId(v string) *Volume { - s.SnapshotId = &v - return s -} - -// SetState sets the State field's value. -func (s *Volume) SetState(v string) *Volume { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Volume) SetTags(v []*Tag) *Volume { - s.Tags = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *Volume) SetVolumeId(v string) *Volume { - s.VolumeId = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *Volume) SetVolumeType(v string) *Volume { - s.VolumeType = &v - return s -} - -// Describes volume attachment details. -type VolumeAttachment struct { - _ struct{} `type:"structure"` - - // The time stamp when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The device name. - Device *string `locationName:"device" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The attachment state of the volume. - State *string `locationName:"status" type:"string" enum:"VolumeAttachmentState"` - - // The ID of the volume. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s VolumeAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeAttachment) GoString() string { - return s.String() -} - -// SetAttachTime sets the AttachTime field's value. -func (s *VolumeAttachment) SetAttachTime(v time.Time) *VolumeAttachment { - s.AttachTime = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *VolumeAttachment) SetDeleteOnTermination(v bool) *VolumeAttachment { - s.DeleteOnTermination = &v - return s -} - -// SetDevice sets the Device field's value. -func (s *VolumeAttachment) SetDevice(v string) *VolumeAttachment { - s.Device = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *VolumeAttachment) SetInstanceId(v string) *VolumeAttachment { - s.InstanceId = &v - return s -} - -// SetState sets the State field's value. -func (s *VolumeAttachment) SetState(v string) *VolumeAttachment { - s.State = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *VolumeAttachment) SetVolumeId(v string) *VolumeAttachment { - s.VolumeId = &v - return s -} - -// Describes an EBS volume. -type VolumeDetail struct { - _ struct{} `type:"structure"` - - // The size of the volume, in GiB. - // - // Size is a required field - Size *int64 `locationName:"size" type:"long" required:"true"` -} - -// String returns the string representation -func (s VolumeDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeDetail) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VolumeDetail) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VolumeDetail"} - if s.Size == nil { - invalidParams.Add(request.NewErrParamRequired("Size")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSize sets the Size field's value. -func (s *VolumeDetail) SetSize(v int64) *VolumeDetail { - s.Size = &v - return s -} - -// Describes the modification status of an EBS volume. -// -// If the volume has never been modified, some element values will be null. -type VolumeModification struct { - _ struct{} `type:"structure"` - - // Modification completion or failure time. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // Current state of modification. Modification state is null for unmodified - // volumes. - ModificationState *string `locationName:"modificationState" type:"string" enum:"VolumeModificationState"` - - // Original IOPS rate of the volume being modified. - OriginalIops *int64 `locationName:"originalIops" type:"integer"` - - // Original size of the volume being modified. - OriginalSize *int64 `locationName:"originalSize" type:"integer"` - - // Original EBS volume type of the volume being modified. - OriginalVolumeType *string `locationName:"originalVolumeType" type:"string" enum:"VolumeType"` - - // Modification progress from 0 to 100%. - Progress *int64 `locationName:"progress" type:"long"` - - // Modification start time - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // Generic status message on modification progress or failure. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // Target IOPS rate of the volume being modified. - TargetIops *int64 `locationName:"targetIops" type:"integer"` - - // Target size of the volume being modified. - TargetSize *int64 `locationName:"targetSize" type:"integer"` - - // Target EBS volume type of the volume being modified. - TargetVolumeType *string `locationName:"targetVolumeType" type:"string" enum:"VolumeType"` - - // ID of the volume being modified. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s VolumeModification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeModification) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *VolumeModification) SetEndTime(v time.Time) *VolumeModification { - s.EndTime = &v - return s -} - -// SetModificationState sets the ModificationState field's value. -func (s *VolumeModification) SetModificationState(v string) *VolumeModification { - s.ModificationState = &v - return s -} - -// SetOriginalIops sets the OriginalIops field's value. -func (s *VolumeModification) SetOriginalIops(v int64) *VolumeModification { - s.OriginalIops = &v - return s -} - -// SetOriginalSize sets the OriginalSize field's value. -func (s *VolumeModification) SetOriginalSize(v int64) *VolumeModification { - s.OriginalSize = &v - return s -} - -// SetOriginalVolumeType sets the OriginalVolumeType field's value. -func (s *VolumeModification) SetOriginalVolumeType(v string) *VolumeModification { - s.OriginalVolumeType = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *VolumeModification) SetProgress(v int64) *VolumeModification { - s.Progress = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *VolumeModification) SetStartTime(v time.Time) *VolumeModification { - s.StartTime = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VolumeModification) SetStatusMessage(v string) *VolumeModification { - s.StatusMessage = &v - return s -} - -// SetTargetIops sets the TargetIops field's value. -func (s *VolumeModification) SetTargetIops(v int64) *VolumeModification { - s.TargetIops = &v - return s -} - -// SetTargetSize sets the TargetSize field's value. -func (s *VolumeModification) SetTargetSize(v int64) *VolumeModification { - s.TargetSize = &v - return s -} - -// SetTargetVolumeType sets the TargetVolumeType field's value. -func (s *VolumeModification) SetTargetVolumeType(v string) *VolumeModification { - s.TargetVolumeType = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *VolumeModification) SetVolumeId(v string) *VolumeModification { - s.VolumeId = &v - return s -} - -// Describes a volume status operation code. -type VolumeStatusAction struct { - _ struct{} `type:"structure"` - - // The code identifying the operation, for example, enable-volume-io. - Code *string `locationName:"code" type:"string"` - - // A description of the operation. - Description *string `locationName:"description" type:"string"` - - // The ID of the event associated with this operation. - EventId *string `locationName:"eventId" type:"string"` - - // The event type associated with this operation. - EventType *string `locationName:"eventType" type:"string"` -} - -// String returns the string representation -func (s VolumeStatusAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusAction) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *VolumeStatusAction) SetCode(v string) *VolumeStatusAction { - s.Code = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *VolumeStatusAction) SetDescription(v string) *VolumeStatusAction { - s.Description = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *VolumeStatusAction) SetEventId(v string) *VolumeStatusAction { - s.EventId = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *VolumeStatusAction) SetEventType(v string) *VolumeStatusAction { - s.EventType = &v - return s -} - -// Describes a volume status. -type VolumeStatusDetails struct { - _ struct{} `type:"structure"` - - // The name of the volume status. - Name *string `locationName:"name" type:"string" enum:"VolumeStatusName"` - - // The intended status of the volume status. - Status *string `locationName:"status" type:"string"` -} - -// String returns the string representation -func (s VolumeStatusDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusDetails) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *VolumeStatusDetails) SetName(v string) *VolumeStatusDetails { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VolumeStatusDetails) SetStatus(v string) *VolumeStatusDetails { - s.Status = &v - return s -} - -// Describes a volume status event. -type VolumeStatusEvent struct { - _ struct{} `type:"structure"` - - // A description of the event. - Description *string `locationName:"description" type:"string"` - - // The ID of this event. - EventId *string `locationName:"eventId" type:"string"` - - // The type of this event. - EventType *string `locationName:"eventType" type:"string"` - - // The latest end time of the event. - NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The earliest start time of the event. - NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s VolumeStatusEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusEvent) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *VolumeStatusEvent) SetDescription(v string) *VolumeStatusEvent { - s.Description = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *VolumeStatusEvent) SetEventId(v string) *VolumeStatusEvent { - s.EventId = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *VolumeStatusEvent) SetEventType(v string) *VolumeStatusEvent { - s.EventType = &v - return s -} - -// SetNotAfter sets the NotAfter field's value. -func (s *VolumeStatusEvent) SetNotAfter(v time.Time) *VolumeStatusEvent { - s.NotAfter = &v - return s -} - -// SetNotBefore sets the NotBefore field's value. -func (s *VolumeStatusEvent) SetNotBefore(v time.Time) *VolumeStatusEvent { - s.NotBefore = &v - return s -} - -// Describes the status of a volume. -type VolumeStatusInfo struct { - _ struct{} `type:"structure"` - - // The details of the volume status. - Details []*VolumeStatusDetails `locationName:"details" locationNameList:"item" type:"list"` - - // The status of the volume. - Status *string `locationName:"status" type:"string" enum:"VolumeStatusInfoStatus"` -} - -// String returns the string representation -func (s VolumeStatusInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusInfo) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *VolumeStatusInfo) SetDetails(v []*VolumeStatusDetails) *VolumeStatusInfo { - s.Details = v - return s -} - -// SetStatus sets the Status field's value. -func (s *VolumeStatusInfo) SetStatus(v string) *VolumeStatusInfo { - s.Status = &v - return s -} - -// Describes the volume status. -type VolumeStatusItem struct { - _ struct{} `type:"structure"` - - // The details of the operation. - Actions []*VolumeStatusAction `locationName:"actionsSet" locationNameList:"item" type:"list"` - - // The Availability Zone of the volume. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // A list of events associated with the volume. - Events []*VolumeStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` - - // The volume ID. - VolumeId *string `locationName:"volumeId" type:"string"` - - // The volume status. - VolumeStatus *VolumeStatusInfo `locationName:"volumeStatus" type:"structure"` -} - -// String returns the string representation -func (s VolumeStatusItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusItem) GoString() string { - return s.String() -} - -// SetActions sets the Actions field's value. -func (s *VolumeStatusItem) SetActions(v []*VolumeStatusAction) *VolumeStatusItem { - s.Actions = v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *VolumeStatusItem) SetAvailabilityZone(v string) *VolumeStatusItem { - s.AvailabilityZone = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *VolumeStatusItem) SetEvents(v []*VolumeStatusEvent) *VolumeStatusItem { - s.Events = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *VolumeStatusItem) SetVolumeId(v string) *VolumeStatusItem { - s.VolumeId = &v - return s -} - -// SetVolumeStatus sets the VolumeStatus field's value. -func (s *VolumeStatusItem) SetVolumeStatus(v *VolumeStatusInfo) *VolumeStatusItem { - s.VolumeStatus = v - return s -} - -// Describes a VPC. -type Vpc struct { - _ struct{} `type:"structure"` - - // The primary IPv4 CIDR block for the VPC. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Information about the IPv4 CIDR blocks associated with the VPC. - CidrBlockAssociationSet []*VpcCidrBlockAssociation `locationName:"cidrBlockAssociationSet" locationNameList:"item" type:"list"` - - // The ID of the set of DHCP options you've associated with the VPC (or default - // if the default options are associated with the VPC). - DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` - - // The allowed tenancy of instances launched into the VPC. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // Information about the IPv6 CIDR blocks associated with the VPC. - Ipv6CidrBlockAssociationSet []*VpcIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociationSet" locationNameList:"item" type:"list"` - - // Indicates whether the VPC is the default VPC. - IsDefault *bool `locationName:"isDefault" type:"boolean"` - - // The current state of the VPC. - State *string `locationName:"state" type:"string" enum:"VpcState"` - - // Any tags assigned to the VPC. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s Vpc) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Vpc) GoString() string { - return s.String() -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *Vpc) SetCidrBlock(v string) *Vpc { - s.CidrBlock = &v - return s -} - -// SetCidrBlockAssociationSet sets the CidrBlockAssociationSet field's value. -func (s *Vpc) SetCidrBlockAssociationSet(v []*VpcCidrBlockAssociation) *Vpc { - s.CidrBlockAssociationSet = v - return s -} - -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *Vpc) SetDhcpOptionsId(v string) *Vpc { - s.DhcpOptionsId = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *Vpc) SetInstanceTenancy(v string) *Vpc { - s.InstanceTenancy = &v - return s -} - -// SetIpv6CidrBlockAssociationSet sets the Ipv6CidrBlockAssociationSet field's value. -func (s *Vpc) SetIpv6CidrBlockAssociationSet(v []*VpcIpv6CidrBlockAssociation) *Vpc { - s.Ipv6CidrBlockAssociationSet = v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *Vpc) SetIsDefault(v bool) *Vpc { - s.IsDefault = &v - return s -} - -// SetState sets the State field's value. -func (s *Vpc) SetState(v string) *Vpc { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Vpc) SetTags(v []*Tag) *Vpc { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Vpc) SetVpcId(v string) *Vpc { - s.VpcId = &v - return s -} - -// Describes an attachment between a virtual private gateway and a VPC. -type VpcAttachment struct { - _ struct{} `type:"structure"` - - // The current state of the attachment. - State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s VpcAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcAttachment) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *VpcAttachment) SetState(v string) *VpcAttachment { - s.State = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcAttachment) SetVpcId(v string) *VpcAttachment { - s.VpcId = &v - return s -} - -// Describes an IPv4 CIDR block associated with a VPC. -type VpcCidrBlockAssociation struct { - _ struct{} `type:"structure"` - - // The association ID for the IPv4 CIDR block. - AssociationId *string `locationName:"associationId" type:"string"` - - // The IPv4 CIDR block. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Information about the state of the CIDR block. - CidrBlockState *VpcCidrBlockState `locationName:"cidrBlockState" type:"structure"` -} - -// String returns the string representation -func (s VpcCidrBlockAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcCidrBlockAssociation) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *VpcCidrBlockAssociation) SetAssociationId(v string) *VpcCidrBlockAssociation { - s.AssociationId = &v - return s -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *VpcCidrBlockAssociation) SetCidrBlock(v string) *VpcCidrBlockAssociation { - s.CidrBlock = &v - return s -} - -// SetCidrBlockState sets the CidrBlockState field's value. -func (s *VpcCidrBlockAssociation) SetCidrBlockState(v *VpcCidrBlockState) *VpcCidrBlockAssociation { - s.CidrBlockState = v - return s -} - -// Describes the state of a CIDR block. -type VpcCidrBlockState struct { - _ struct{} `type:"structure"` - - // The state of the CIDR block. - State *string `locationName:"state" type:"string" enum:"VpcCidrBlockStateCode"` - - // A message about the status of the CIDR block, if applicable. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s VpcCidrBlockState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcCidrBlockState) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *VpcCidrBlockState) SetState(v string) *VpcCidrBlockState { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VpcCidrBlockState) SetStatusMessage(v string) *VpcCidrBlockState { - s.StatusMessage = &v - return s -} - -// Describes whether a VPC is enabled for ClassicLink. -type VpcClassicLink struct { - _ struct{} `type:"structure"` - - // Indicates whether the VPC is enabled for ClassicLink. - ClassicLinkEnabled *bool `locationName:"classicLinkEnabled" type:"boolean"` - - // Any tags assigned to the VPC. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s VpcClassicLink) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcClassicLink) GoString() string { - return s.String() -} - -// SetClassicLinkEnabled sets the ClassicLinkEnabled field's value. -func (s *VpcClassicLink) SetClassicLinkEnabled(v bool) *VpcClassicLink { - s.ClassicLinkEnabled = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *VpcClassicLink) SetTags(v []*Tag) *VpcClassicLink { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcClassicLink) SetVpcId(v string) *VpcClassicLink { - s.VpcId = &v - return s -} - -// Describes a VPC endpoint. -type VpcEndpoint struct { - _ struct{} `type:"structure"` - - // The date and time the VPC endpoint was created. - CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" timestampFormat:"iso8601"` - - // (Interface endpoint) The DNS entries for the endpoint. - DnsEntries []*DnsEntry `locationName:"dnsEntrySet" locationNameList:"item" type:"list"` - - // (Interface endpoint) Information about the security groups associated with - // the network interface. - Groups []*SecurityGroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // (Interface endpoint) One or more network interfaces for the endpoint. - NetworkInterfaceIds []*string `locationName:"networkInterfaceIdSet" locationNameList:"item" type:"list"` - - // The policy document associated with the endpoint, if applicable. - PolicyDocument *string `locationName:"policyDocument" type:"string"` - - // (Interface endpoint) Indicates whether the VPC is associated with a private - // hosted zone. - PrivateDnsEnabled *bool `locationName:"privateDnsEnabled" type:"boolean"` - - // (Gateway endpoint) One or more route tables associated with the endpoint. - RouteTableIds []*string `locationName:"routeTableIdSet" locationNameList:"item" type:"list"` - - // The name of the service to which the endpoint is associated. - ServiceName *string `locationName:"serviceName" type:"string"` - - // The state of the VPC endpoint. - State *string `locationName:"state" type:"string" enum:"State"` - - // (Interface endpoint) One or more subnets in which the endpoint is located. - SubnetIds []*string `locationName:"subnetIdSet" locationNameList:"item" type:"list"` - - // The ID of the VPC endpoint. - VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"` - - // The type of endpoint. - VpcEndpointType *string `locationName:"vpcEndpointType" type:"string" enum:"VpcEndpointType"` - - // The ID of the VPC to which the endpoint is associated. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s VpcEndpoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcEndpoint) GoString() string { - return s.String() -} - -// SetCreationTimestamp sets the CreationTimestamp field's value. -func (s *VpcEndpoint) SetCreationTimestamp(v time.Time) *VpcEndpoint { - s.CreationTimestamp = &v - return s -} - -// SetDnsEntries sets the DnsEntries field's value. -func (s *VpcEndpoint) SetDnsEntries(v []*DnsEntry) *VpcEndpoint { - s.DnsEntries = v - return s -} - -// SetGroups sets the Groups field's value. -func (s *VpcEndpoint) SetGroups(v []*SecurityGroupIdentifier) *VpcEndpoint { - s.Groups = v - return s -} - -// SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value. -func (s *VpcEndpoint) SetNetworkInterfaceIds(v []*string) *VpcEndpoint { - s.NetworkInterfaceIds = v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *VpcEndpoint) SetPolicyDocument(v string) *VpcEndpoint { - s.PolicyDocument = &v - return s -} - -// SetPrivateDnsEnabled sets the PrivateDnsEnabled field's value. -func (s *VpcEndpoint) SetPrivateDnsEnabled(v bool) *VpcEndpoint { - s.PrivateDnsEnabled = &v - return s -} - -// SetRouteTableIds sets the RouteTableIds field's value. -func (s *VpcEndpoint) SetRouteTableIds(v []*string) *VpcEndpoint { - s.RouteTableIds = v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *VpcEndpoint) SetServiceName(v string) *VpcEndpoint { - s.ServiceName = &v - return s -} - -// SetState sets the State field's value. -func (s *VpcEndpoint) SetState(v string) *VpcEndpoint { - s.State = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *VpcEndpoint) SetSubnetIds(v []*string) *VpcEndpoint { - s.SubnetIds = v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *VpcEndpoint) SetVpcEndpointId(v string) *VpcEndpoint { - s.VpcEndpointId = &v - return s -} - -// SetVpcEndpointType sets the VpcEndpointType field's value. -func (s *VpcEndpoint) SetVpcEndpointType(v string) *VpcEndpoint { - s.VpcEndpointType = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcEndpoint) SetVpcId(v string) *VpcEndpoint { - s.VpcId = &v - return s -} - -// Describes a VPC endpoint connection to a service. -type VpcEndpointConnection struct { - _ struct{} `type:"structure"` - - // The date and time the VPC endpoint was created. - CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the service to which the endpoint is connected. - ServiceId *string `locationName:"serviceId" type:"string"` - - // The ID of the VPC endpoint. - VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"` - - // The AWS account ID of the owner of the VPC endpoint. - VpcEndpointOwner *string `locationName:"vpcEndpointOwner" type:"string"` - - // The state of the VPC endpoint. - VpcEndpointState *string `locationName:"vpcEndpointState" type:"string" enum:"State"` -} - -// String returns the string representation -func (s VpcEndpointConnection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcEndpointConnection) GoString() string { - return s.String() -} - -// SetCreationTimestamp sets the CreationTimestamp field's value. -func (s *VpcEndpointConnection) SetCreationTimestamp(v time.Time) *VpcEndpointConnection { - s.CreationTimestamp = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *VpcEndpointConnection) SetServiceId(v string) *VpcEndpointConnection { - s.ServiceId = &v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *VpcEndpointConnection) SetVpcEndpointId(v string) *VpcEndpointConnection { - s.VpcEndpointId = &v - return s -} - -// SetVpcEndpointOwner sets the VpcEndpointOwner field's value. -func (s *VpcEndpointConnection) SetVpcEndpointOwner(v string) *VpcEndpointConnection { - s.VpcEndpointOwner = &v - return s -} - -// SetVpcEndpointState sets the VpcEndpointState field's value. -func (s *VpcEndpointConnection) SetVpcEndpointState(v string) *VpcEndpointConnection { - s.VpcEndpointState = &v - return s -} - -// Describes an IPv6 CIDR block associated with a VPC. -type VpcIpv6CidrBlockAssociation struct { - _ struct{} `type:"structure"` - - // The association ID for the IPv6 CIDR block. - AssociationId *string `locationName:"associationId" type:"string"` - - // The IPv6 CIDR block. - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // Information about the state of the CIDR block. - Ipv6CidrBlockState *VpcCidrBlockState `locationName:"ipv6CidrBlockState" type:"structure"` -} - -// String returns the string representation -func (s VpcIpv6CidrBlockAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcIpv6CidrBlockAssociation) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *VpcIpv6CidrBlockAssociation) SetAssociationId(v string) *VpcIpv6CidrBlockAssociation { - s.AssociationId = &v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *VpcIpv6CidrBlockAssociation) SetIpv6CidrBlock(v string) *VpcIpv6CidrBlockAssociation { - s.Ipv6CidrBlock = &v - return s -} - -// SetIpv6CidrBlockState sets the Ipv6CidrBlockState field's value. -func (s *VpcIpv6CidrBlockAssociation) SetIpv6CidrBlockState(v *VpcCidrBlockState) *VpcIpv6CidrBlockAssociation { - s.Ipv6CidrBlockState = v - return s -} - -// Describes a VPC peering connection. -type VpcPeeringConnection struct { - _ struct{} `type:"structure"` - - // Information about the accepter VPC. CIDR block information is only returned - // when describing an active VPC peering connection. - AccepterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"accepterVpcInfo" type:"structure"` - - // The time that an unaccepted VPC peering connection will expire. - ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601"` - - // Information about the requester VPC. CIDR block information is only returned - // when describing an active VPC peering connection. - RequesterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"requesterVpcInfo" type:"structure"` - - // The status of the VPC peering connection. - Status *VpcPeeringConnectionStateReason `locationName:"status" type:"structure"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s VpcPeeringConnection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcPeeringConnection) GoString() string { - return s.String() -} - -// SetAccepterVpcInfo sets the AccepterVpcInfo field's value. -func (s *VpcPeeringConnection) SetAccepterVpcInfo(v *VpcPeeringConnectionVpcInfo) *VpcPeeringConnection { - s.AccepterVpcInfo = v - return s -} - -// SetExpirationTime sets the ExpirationTime field's value. -func (s *VpcPeeringConnection) SetExpirationTime(v time.Time) *VpcPeeringConnection { - s.ExpirationTime = &v - return s -} - -// SetRequesterVpcInfo sets the RequesterVpcInfo field's value. -func (s *VpcPeeringConnection) SetRequesterVpcInfo(v *VpcPeeringConnectionVpcInfo) *VpcPeeringConnection { - s.RequesterVpcInfo = v - return s -} - -// SetStatus sets the Status field's value. -func (s *VpcPeeringConnection) SetStatus(v *VpcPeeringConnectionStateReason) *VpcPeeringConnection { - s.Status = v - return s -} - -// SetTags sets the Tags field's value. -func (s *VpcPeeringConnection) SetTags(v []*Tag) *VpcPeeringConnection { - s.Tags = v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *VpcPeeringConnection) SetVpcPeeringConnectionId(v string) *VpcPeeringConnection { - s.VpcPeeringConnectionId = &v - return s -} - -// Describes the VPC peering connection options. -type VpcPeeringConnectionOptionsDescription struct { - _ struct{} `type:"structure"` - - // Indicates whether a local VPC can resolve public DNS hostnames to private - // IP addresses when queried from instances in a peer VPC. - AllowDnsResolutionFromRemoteVpc *bool `locationName:"allowDnsResolutionFromRemoteVpc" type:"boolean"` - - // Indicates whether a local ClassicLink connection can communicate with the - // peer VPC over the VPC peering connection. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool `locationName:"allowEgressFromLocalClassicLinkToRemoteVpc" type:"boolean"` - - // Indicates whether a local VPC can communicate with a ClassicLink connection - // in the peer VPC over the VPC peering connection. - AllowEgressFromLocalVpcToRemoteClassicLink *bool `locationName:"allowEgressFromLocalVpcToRemoteClassicLink" type:"boolean"` -} - -// String returns the string representation -func (s VpcPeeringConnectionOptionsDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcPeeringConnectionOptionsDescription) GoString() string { - return s.String() -} - -// SetAllowDnsResolutionFromRemoteVpc sets the AllowDnsResolutionFromRemoteVpc field's value. -func (s *VpcPeeringConnectionOptionsDescription) SetAllowDnsResolutionFromRemoteVpc(v bool) *VpcPeeringConnectionOptionsDescription { - s.AllowDnsResolutionFromRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalClassicLinkToRemoteVpc sets the AllowEgressFromLocalClassicLinkToRemoteVpc field's value. -func (s *VpcPeeringConnectionOptionsDescription) SetAllowEgressFromLocalClassicLinkToRemoteVpc(v bool) *VpcPeeringConnectionOptionsDescription { - s.AllowEgressFromLocalClassicLinkToRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalVpcToRemoteClassicLink sets the AllowEgressFromLocalVpcToRemoteClassicLink field's value. -func (s *VpcPeeringConnectionOptionsDescription) SetAllowEgressFromLocalVpcToRemoteClassicLink(v bool) *VpcPeeringConnectionOptionsDescription { - s.AllowEgressFromLocalVpcToRemoteClassicLink = &v - return s -} - -// Describes the status of a VPC peering connection. -type VpcPeeringConnectionStateReason struct { - _ struct{} `type:"structure"` - - // The status of the VPC peering connection. - Code *string `locationName:"code" type:"string" enum:"VpcPeeringConnectionStateReasonCode"` - - // A message that provides more information about the status, if applicable. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s VpcPeeringConnectionStateReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcPeeringConnectionStateReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *VpcPeeringConnectionStateReason) SetCode(v string) *VpcPeeringConnectionStateReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *VpcPeeringConnectionStateReason) SetMessage(v string) *VpcPeeringConnectionStateReason { - s.Message = &v - return s -} - -// Describes a VPC in a VPC peering connection. -type VpcPeeringConnectionVpcInfo struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR block for the VPC. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Information about the IPv4 CIDR blocks for the VPC. - CidrBlockSet []*CidrBlock `locationName:"cidrBlockSet" locationNameList:"item" type:"list"` - - // The IPv6 CIDR block for the VPC. - Ipv6CidrBlockSet []*Ipv6CidrBlock `locationName:"ipv6CidrBlockSet" locationNameList:"item" type:"list"` - - // The AWS account ID of the VPC owner. - OwnerId *string `locationName:"ownerId" type:"string"` - - // Information about the VPC peering connection options for the accepter or - // requester VPC. - PeeringOptions *VpcPeeringConnectionOptionsDescription `locationName:"peeringOptions" type:"structure"` - - // The region in which the VPC is located. - Region *string `locationName:"region" type:"string"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s VpcPeeringConnectionVpcInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcPeeringConnectionVpcInfo) GoString() string { - return s.String() -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *VpcPeeringConnectionVpcInfo) SetCidrBlock(v string) *VpcPeeringConnectionVpcInfo { - s.CidrBlock = &v - return s -} - -// SetCidrBlockSet sets the CidrBlockSet field's value. -func (s *VpcPeeringConnectionVpcInfo) SetCidrBlockSet(v []*CidrBlock) *VpcPeeringConnectionVpcInfo { - s.CidrBlockSet = v - return s -} - -// SetIpv6CidrBlockSet sets the Ipv6CidrBlockSet field's value. -func (s *VpcPeeringConnectionVpcInfo) SetIpv6CidrBlockSet(v []*Ipv6CidrBlock) *VpcPeeringConnectionVpcInfo { - s.Ipv6CidrBlockSet = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *VpcPeeringConnectionVpcInfo) SetOwnerId(v string) *VpcPeeringConnectionVpcInfo { - s.OwnerId = &v - return s -} - -// SetPeeringOptions sets the PeeringOptions field's value. -func (s *VpcPeeringConnectionVpcInfo) SetPeeringOptions(v *VpcPeeringConnectionOptionsDescription) *VpcPeeringConnectionVpcInfo { - s.PeeringOptions = v - return s -} - -// SetRegion sets the Region field's value. -func (s *VpcPeeringConnectionVpcInfo) SetRegion(v string) *VpcPeeringConnectionVpcInfo { - s.Region = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcPeeringConnectionVpcInfo) SetVpcId(v string) *VpcPeeringConnectionVpcInfo { - s.VpcId = &v - return s -} - -// Describes a VPN connection. -type VpnConnection struct { - _ struct{} `type:"structure"` - - // The category of the VPN connection. A value of VPN indicates an AWS VPN connection. - // A value of VPN-Classic indicates an AWS Classic VPN connection. For more - // information, see AWS Managed VPN Categories (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html#vpn-categories) - // in the Amazon Virtual Private Cloud User Guide. - Category *string `locationName:"category" type:"string"` - - // The configuration information for the VPN connection's customer gateway (in - // the native XML format). This element is always present in the CreateVpnConnection - // response; however, it's present in the DescribeVpnConnections response only - // if the VPN connection is in the pending or available state. - CustomerGatewayConfiguration *string `locationName:"customerGatewayConfiguration" type:"string"` - - // The ID of the customer gateway at your end of the VPN connection. - CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` - - // The VPN connection options. - Options *VpnConnectionOptions `locationName:"options" type:"structure"` - - // The static routes associated with the VPN connection. - Routes []*VpnStaticRoute `locationName:"routes" locationNameList:"item" type:"list"` - - // The current state of the VPN connection. - State *string `locationName:"state" type:"string" enum:"VpnState"` - - // Any tags assigned to the VPN connection. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of VPN connection. - Type *string `locationName:"type" type:"string" enum:"GatewayType"` - - // Information about the VPN tunnel. - VgwTelemetry []*VgwTelemetry `locationName:"vgwTelemetry" locationNameList:"item" type:"list"` - - // The ID of the VPN connection. - VpnConnectionId *string `locationName:"vpnConnectionId" type:"string"` - - // The ID of the virtual private gateway at the AWS side of the VPN connection. - VpnGatewayId *string `locationName:"vpnGatewayId" type:"string"` -} - -// String returns the string representation -func (s VpnConnection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnConnection) GoString() string { - return s.String() -} - -// SetCategory sets the Category field's value. -func (s *VpnConnection) SetCategory(v string) *VpnConnection { - s.Category = &v - return s -} - -// SetCustomerGatewayConfiguration sets the CustomerGatewayConfiguration field's value. -func (s *VpnConnection) SetCustomerGatewayConfiguration(v string) *VpnConnection { - s.CustomerGatewayConfiguration = &v - return s -} - -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *VpnConnection) SetCustomerGatewayId(v string) *VpnConnection { - s.CustomerGatewayId = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *VpnConnection) SetOptions(v *VpnConnectionOptions) *VpnConnection { - s.Options = v - return s -} - -// SetRoutes sets the Routes field's value. -func (s *VpnConnection) SetRoutes(v []*VpnStaticRoute) *VpnConnection { - s.Routes = v - return s -} - -// SetState sets the State field's value. -func (s *VpnConnection) SetState(v string) *VpnConnection { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *VpnConnection) SetTags(v []*Tag) *VpnConnection { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *VpnConnection) SetType(v string) *VpnConnection { - s.Type = &v - return s -} - -// SetVgwTelemetry sets the VgwTelemetry field's value. -func (s *VpnConnection) SetVgwTelemetry(v []*VgwTelemetry) *VpnConnection { - s.VgwTelemetry = v - return s -} - -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *VpnConnection) SetVpnConnectionId(v string) *VpnConnection { - s.VpnConnectionId = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *VpnConnection) SetVpnGatewayId(v string) *VpnConnection { - s.VpnGatewayId = &v - return s -} - -// Describes VPN connection options. -type VpnConnectionOptions struct { - _ struct{} `type:"structure"` - - // Indicates whether the VPN connection uses static routes only. Static routes - // must be used for devices that don't support BGP. - StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` -} - -// String returns the string representation -func (s VpnConnectionOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnConnectionOptions) GoString() string { - return s.String() -} - -// SetStaticRoutesOnly sets the StaticRoutesOnly field's value. -func (s *VpnConnectionOptions) SetStaticRoutesOnly(v bool) *VpnConnectionOptions { - s.StaticRoutesOnly = &v - return s -} - -// Describes VPN connection options. -type VpnConnectionOptionsSpecification struct { - _ struct{} `type:"structure"` - - // Indicate whether the VPN connection uses static routes only. If you are creating - // a VPN connection for a device that does not support BGP, you must specify - // true. Use CreateVpnConnectionRoute to create a static route. - // - // Default: false - StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` - - // The tunnel options for the VPN connection. - TunnelOptions []*VpnTunnelOptionsSpecification `locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s VpnConnectionOptionsSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnConnectionOptionsSpecification) GoString() string { - return s.String() -} - -// SetStaticRoutesOnly sets the StaticRoutesOnly field's value. -func (s *VpnConnectionOptionsSpecification) SetStaticRoutesOnly(v bool) *VpnConnectionOptionsSpecification { - s.StaticRoutesOnly = &v - return s -} - -// SetTunnelOptions sets the TunnelOptions field's value. -func (s *VpnConnectionOptionsSpecification) SetTunnelOptions(v []*VpnTunnelOptionsSpecification) *VpnConnectionOptionsSpecification { - s.TunnelOptions = v - return s -} - -// Describes a virtual private gateway. -type VpnGateway struct { - _ struct{} `type:"structure"` - - // The private Autonomous System Number (ASN) for the Amazon side of a BGP session. - AmazonSideAsn *int64 `locationName:"amazonSideAsn" type:"long"` - - // The Availability Zone where the virtual private gateway was created, if applicable. - // This field may be empty or not returned. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The current state of the virtual private gateway. - State *string `locationName:"state" type:"string" enum:"VpnState"` - - // Any tags assigned to the virtual private gateway. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of VPN connection the virtual private gateway supports. - Type *string `locationName:"type" type:"string" enum:"GatewayType"` - - // Any VPCs attached to the virtual private gateway. - VpcAttachments []*VpcAttachment `locationName:"attachments" locationNameList:"item" type:"list"` - - // The ID of the virtual private gateway. - VpnGatewayId *string `locationName:"vpnGatewayId" type:"string"` -} - -// String returns the string representation -func (s VpnGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnGateway) GoString() string { - return s.String() -} - -// SetAmazonSideAsn sets the AmazonSideAsn field's value. -func (s *VpnGateway) SetAmazonSideAsn(v int64) *VpnGateway { - s.AmazonSideAsn = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *VpnGateway) SetAvailabilityZone(v string) *VpnGateway { - s.AvailabilityZone = &v - return s -} - -// SetState sets the State field's value. -func (s *VpnGateway) SetState(v string) *VpnGateway { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *VpnGateway) SetTags(v []*Tag) *VpnGateway { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *VpnGateway) SetType(v string) *VpnGateway { - s.Type = &v - return s -} - -// SetVpcAttachments sets the VpcAttachments field's value. -func (s *VpnGateway) SetVpcAttachments(v []*VpcAttachment) *VpnGateway { - s.VpcAttachments = v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *VpnGateway) SetVpnGatewayId(v string) *VpnGateway { - s.VpnGatewayId = &v - return s -} - -// Describes a static route for a VPN connection. -type VpnStaticRoute struct { - _ struct{} `type:"structure"` - - // The CIDR block associated with the local subnet of the customer data center. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // Indicates how the routes were provided. - Source *string `locationName:"source" type:"string" enum:"VpnStaticRouteSource"` - - // The current state of the static route. - State *string `locationName:"state" type:"string" enum:"VpnState"` -} - -// String returns the string representation -func (s VpnStaticRoute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnStaticRoute) GoString() string { - return s.String() -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *VpnStaticRoute) SetDestinationCidrBlock(v string) *VpnStaticRoute { - s.DestinationCidrBlock = &v - return s -} - -// SetSource sets the Source field's value. -func (s *VpnStaticRoute) SetSource(v string) *VpnStaticRoute { - s.Source = &v - return s -} - -// SetState sets the State field's value. -func (s *VpnStaticRoute) SetState(v string) *VpnStaticRoute { - s.State = &v - return s -} - -// The tunnel options for a VPN connection. -type VpnTunnelOptionsSpecification struct { - _ struct{} `type:"structure"` - - // The pre-shared key (PSK) to establish initial authentication between the - // virtual private gateway and customer gateway. - // - // Constraints: Allowed characters are alphanumeric characters and ._. Must - // be between 8 and 64 characters in length and cannot start with zero (0). - PreSharedKey *string `type:"string"` - - // The range of inside IP addresses for the tunnel. Any specified CIDR blocks - // must be unique across all VPN connections that use the same virtual private - // gateway. - // - // Constraints: A size /30 CIDR block from the 169.254.0.0/16 range. The following - // CIDR blocks are reserved and cannot be used: - // - // * 169.254.0.0/30 - // - // * 169.254.1.0/30 - // - // * 169.254.2.0/30 - // - // * 169.254.3.0/30 - // - // * 169.254.4.0/30 - // - // * 169.254.5.0/30 - // - // * 169.254.169.252/30 - TunnelInsideCidr *string `type:"string"` -} - -// String returns the string representation -func (s VpnTunnelOptionsSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnTunnelOptionsSpecification) GoString() string { - return s.String() -} - -// SetPreSharedKey sets the PreSharedKey field's value. -func (s *VpnTunnelOptionsSpecification) SetPreSharedKey(v string) *VpnTunnelOptionsSpecification { - s.PreSharedKey = &v - return s -} - -// SetTunnelInsideCidr sets the TunnelInsideCidr field's value. -func (s *VpnTunnelOptionsSpecification) SetTunnelInsideCidr(v string) *VpnTunnelOptionsSpecification { - s.TunnelInsideCidr = &v - return s -} - -const ( - // AccountAttributeNameSupportedPlatforms is a AccountAttributeName enum value - AccountAttributeNameSupportedPlatforms = "supported-platforms" - - // AccountAttributeNameDefaultVpc is a AccountAttributeName enum value - AccountAttributeNameDefaultVpc = "default-vpc" -) - -const ( - // ActivityStatusError is a ActivityStatus enum value - ActivityStatusError = "error" - - // ActivityStatusPendingFulfillment is a ActivityStatus enum value - ActivityStatusPendingFulfillment = "pending_fulfillment" - - // ActivityStatusPendingTermination is a ActivityStatus enum value - ActivityStatusPendingTermination = "pending_termination" - - // ActivityStatusFulfilled is a ActivityStatus enum value - ActivityStatusFulfilled = "fulfilled" -) - -const ( - // AffinityDefault is a Affinity enum value - AffinityDefault = "default" - - // AffinityHost is a Affinity enum value - AffinityHost = "host" -) - -const ( - // AllocationStateAvailable is a AllocationState enum value - AllocationStateAvailable = "available" - - // AllocationStateUnderAssessment is a AllocationState enum value - AllocationStateUnderAssessment = "under-assessment" - - // AllocationStatePermanentFailure is a AllocationState enum value - AllocationStatePermanentFailure = "permanent-failure" - - // AllocationStateReleased is a AllocationState enum value - AllocationStateReleased = "released" - - // AllocationStateReleasedPermanentFailure is a AllocationState enum value - AllocationStateReleasedPermanentFailure = "released-permanent-failure" -) - -const ( - // AllocationStrategyLowestPrice is a AllocationStrategy enum value - AllocationStrategyLowestPrice = "lowestPrice" - - // AllocationStrategyDiversified is a AllocationStrategy enum value - AllocationStrategyDiversified = "diversified" -) - -const ( - // ArchitectureValuesI386 is a ArchitectureValues enum value - ArchitectureValuesI386 = "i386" - - // ArchitectureValuesX8664 is a ArchitectureValues enum value - ArchitectureValuesX8664 = "x86_64" -) - -const ( - // AttachmentStatusAttaching is a AttachmentStatus enum value - AttachmentStatusAttaching = "attaching" - - // AttachmentStatusAttached is a AttachmentStatus enum value - AttachmentStatusAttached = "attached" - - // AttachmentStatusDetaching is a AttachmentStatus enum value - AttachmentStatusDetaching = "detaching" - - // AttachmentStatusDetached is a AttachmentStatus enum value - AttachmentStatusDetached = "detached" -) - -const ( - // AutoPlacementOn is a AutoPlacement enum value - AutoPlacementOn = "on" - - // AutoPlacementOff is a AutoPlacement enum value - AutoPlacementOff = "off" -) - -const ( - // AvailabilityZoneStateAvailable is a AvailabilityZoneState enum value - AvailabilityZoneStateAvailable = "available" - - // AvailabilityZoneStateInformation is a AvailabilityZoneState enum value - AvailabilityZoneStateInformation = "information" - - // AvailabilityZoneStateImpaired is a AvailabilityZoneState enum value - AvailabilityZoneStateImpaired = "impaired" - - // AvailabilityZoneStateUnavailable is a AvailabilityZoneState enum value - AvailabilityZoneStateUnavailable = "unavailable" -) - -const ( - // BatchStateSubmitted is a BatchState enum value - BatchStateSubmitted = "submitted" - - // BatchStateActive is a BatchState enum value - BatchStateActive = "active" - - // BatchStateCancelled is a BatchState enum value - BatchStateCancelled = "cancelled" - - // BatchStateFailed is a BatchState enum value - BatchStateFailed = "failed" - - // BatchStateCancelledRunning is a BatchState enum value - BatchStateCancelledRunning = "cancelled_running" - - // BatchStateCancelledTerminating is a BatchState enum value - BatchStateCancelledTerminating = "cancelled_terminating" - - // BatchStateModifying is a BatchState enum value - BatchStateModifying = "modifying" -) - -const ( - // BundleTaskStatePending is a BundleTaskState enum value - BundleTaskStatePending = "pending" - - // BundleTaskStateWaitingForShutdown is a BundleTaskState enum value - BundleTaskStateWaitingForShutdown = "waiting-for-shutdown" - - // BundleTaskStateBundling is a BundleTaskState enum value - BundleTaskStateBundling = "bundling" - - // BundleTaskStateStoring is a BundleTaskState enum value - BundleTaskStateStoring = "storing" - - // BundleTaskStateCancelling is a BundleTaskState enum value - BundleTaskStateCancelling = "cancelling" - - // BundleTaskStateComplete is a BundleTaskState enum value - BundleTaskStateComplete = "complete" - - // BundleTaskStateFailed is a BundleTaskState enum value - BundleTaskStateFailed = "failed" -) - -const ( - // CancelBatchErrorCodeFleetRequestIdDoesNotExist is a CancelBatchErrorCode enum value - CancelBatchErrorCodeFleetRequestIdDoesNotExist = "fleetRequestIdDoesNotExist" - - // CancelBatchErrorCodeFleetRequestIdMalformed is a CancelBatchErrorCode enum value - CancelBatchErrorCodeFleetRequestIdMalformed = "fleetRequestIdMalformed" - - // CancelBatchErrorCodeFleetRequestNotInCancellableState is a CancelBatchErrorCode enum value - CancelBatchErrorCodeFleetRequestNotInCancellableState = "fleetRequestNotInCancellableState" - - // CancelBatchErrorCodeUnexpectedError is a CancelBatchErrorCode enum value - CancelBatchErrorCodeUnexpectedError = "unexpectedError" -) - -const ( - // CancelSpotInstanceRequestStateActive is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateActive = "active" - - // CancelSpotInstanceRequestStateOpen is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateOpen = "open" - - // CancelSpotInstanceRequestStateClosed is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateClosed = "closed" - - // CancelSpotInstanceRequestStateCancelled is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateCancelled = "cancelled" - - // CancelSpotInstanceRequestStateCompleted is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateCompleted = "completed" -) - -const ( - // ConnectionNotificationStateEnabled is a ConnectionNotificationState enum value - ConnectionNotificationStateEnabled = "Enabled" - - // ConnectionNotificationStateDisabled is a ConnectionNotificationState enum value - ConnectionNotificationStateDisabled = "Disabled" -) - -const ( - // ConnectionNotificationTypeTopic is a ConnectionNotificationType enum value - ConnectionNotificationTypeTopic = "Topic" -) - -const ( - // ContainerFormatOva is a ContainerFormat enum value - ContainerFormatOva = "ova" -) - -const ( - // ConversionTaskStateActive is a ConversionTaskState enum value - ConversionTaskStateActive = "active" - - // ConversionTaskStateCancelling is a ConversionTaskState enum value - ConversionTaskStateCancelling = "cancelling" - - // ConversionTaskStateCancelled is a ConversionTaskState enum value - ConversionTaskStateCancelled = "cancelled" - - // ConversionTaskStateCompleted is a ConversionTaskState enum value - ConversionTaskStateCompleted = "completed" -) - -const ( - // CurrencyCodeValuesUsd is a CurrencyCodeValues enum value - CurrencyCodeValuesUsd = "USD" -) - -const ( - // DatafeedSubscriptionStateActive is a DatafeedSubscriptionState enum value - DatafeedSubscriptionStateActive = "Active" - - // DatafeedSubscriptionStateInactive is a DatafeedSubscriptionState enum value - DatafeedSubscriptionStateInactive = "Inactive" -) - -const ( - // DefaultTargetCapacityTypeSpot is a DefaultTargetCapacityType enum value - DefaultTargetCapacityTypeSpot = "spot" - - // DefaultTargetCapacityTypeOnDemand is a DefaultTargetCapacityType enum value - DefaultTargetCapacityTypeOnDemand = "on-demand" -) - -const ( - // DeleteFleetErrorCodeFleetIdDoesNotExist is a DeleteFleetErrorCode enum value - DeleteFleetErrorCodeFleetIdDoesNotExist = "fleetIdDoesNotExist" - - // DeleteFleetErrorCodeFleetIdMalformed is a DeleteFleetErrorCode enum value - DeleteFleetErrorCodeFleetIdMalformed = "fleetIdMalformed" - - // DeleteFleetErrorCodeFleetNotInDeletableState is a DeleteFleetErrorCode enum value - DeleteFleetErrorCodeFleetNotInDeletableState = "fleetNotInDeletableState" - - // DeleteFleetErrorCodeUnexpectedError is a DeleteFleetErrorCode enum value - DeleteFleetErrorCodeUnexpectedError = "unexpectedError" -) - -const ( - // DeviceTypeEbs is a DeviceType enum value - DeviceTypeEbs = "ebs" - - // DeviceTypeInstanceStore is a DeviceType enum value - DeviceTypeInstanceStore = "instance-store" -) - -const ( - // DiskImageFormatVmdk is a DiskImageFormat enum value - DiskImageFormatVmdk = "VMDK" - - // DiskImageFormatRaw is a DiskImageFormat enum value - DiskImageFormatRaw = "RAW" - - // DiskImageFormatVhd is a DiskImageFormat enum value - DiskImageFormatVhd = "VHD" -) - -const ( - // DomainTypeVpc is a DomainType enum value - DomainTypeVpc = "vpc" - - // DomainTypeStandard is a DomainType enum value - DomainTypeStandard = "standard" -) - -const ( - // ElasticGpuStateAttached is a ElasticGpuState enum value - ElasticGpuStateAttached = "ATTACHED" -) - -const ( - // ElasticGpuStatusOk is a ElasticGpuStatus enum value - ElasticGpuStatusOk = "OK" - - // ElasticGpuStatusImpaired is a ElasticGpuStatus enum value - ElasticGpuStatusImpaired = "IMPAIRED" -) - -const ( - // EventCodeInstanceReboot is a EventCode enum value - EventCodeInstanceReboot = "instance-reboot" - - // EventCodeSystemReboot is a EventCode enum value - EventCodeSystemReboot = "system-reboot" - - // EventCodeSystemMaintenance is a EventCode enum value - EventCodeSystemMaintenance = "system-maintenance" - - // EventCodeInstanceRetirement is a EventCode enum value - EventCodeInstanceRetirement = "instance-retirement" - - // EventCodeInstanceStop is a EventCode enum value - EventCodeInstanceStop = "instance-stop" -) - -const ( - // EventTypeInstanceChange is a EventType enum value - EventTypeInstanceChange = "instanceChange" - - // EventTypeFleetRequestChange is a EventType enum value - EventTypeFleetRequestChange = "fleetRequestChange" - - // EventTypeError is a EventType enum value - EventTypeError = "error" -) - -const ( - // ExcessCapacityTerminationPolicyNoTermination is a ExcessCapacityTerminationPolicy enum value - ExcessCapacityTerminationPolicyNoTermination = "noTermination" - - // ExcessCapacityTerminationPolicyDefault is a ExcessCapacityTerminationPolicy enum value - ExcessCapacityTerminationPolicyDefault = "default" -) - -const ( - // ExportEnvironmentCitrix is a ExportEnvironment enum value - ExportEnvironmentCitrix = "citrix" - - // ExportEnvironmentVmware is a ExportEnvironment enum value - ExportEnvironmentVmware = "vmware" - - // ExportEnvironmentMicrosoft is a ExportEnvironment enum value - ExportEnvironmentMicrosoft = "microsoft" -) - -const ( - // ExportTaskStateActive is a ExportTaskState enum value - ExportTaskStateActive = "active" - - // ExportTaskStateCancelling is a ExportTaskState enum value - ExportTaskStateCancelling = "cancelling" - - // ExportTaskStateCancelled is a ExportTaskState enum value - ExportTaskStateCancelled = "cancelled" - - // ExportTaskStateCompleted is a ExportTaskState enum value - ExportTaskStateCompleted = "completed" -) - -const ( - // FleetActivityStatusError is a FleetActivityStatus enum value - FleetActivityStatusError = "error" - - // FleetActivityStatusPendingFulfillment is a FleetActivityStatus enum value - FleetActivityStatusPendingFulfillment = "pending-fulfillment" - - // FleetActivityStatusPendingTermination is a FleetActivityStatus enum value - FleetActivityStatusPendingTermination = "pending-termination" - - // FleetActivityStatusFulfilled is a FleetActivityStatus enum value - FleetActivityStatusFulfilled = "fulfilled" -) - -const ( - // FleetEventTypeInstanceChange is a FleetEventType enum value - FleetEventTypeInstanceChange = "instance-change" - - // FleetEventTypeFleetChange is a FleetEventType enum value - FleetEventTypeFleetChange = "fleet-change" - - // FleetEventTypeServiceError is a FleetEventType enum value - FleetEventTypeServiceError = "service-error" -) - -const ( - // FleetExcessCapacityTerminationPolicyNoTermination is a FleetExcessCapacityTerminationPolicy enum value - FleetExcessCapacityTerminationPolicyNoTermination = "no-termination" - - // FleetExcessCapacityTerminationPolicyTermination is a FleetExcessCapacityTerminationPolicy enum value - FleetExcessCapacityTerminationPolicyTermination = "termination" -) - -const ( - // FleetStateCodeSubmitted is a FleetStateCode enum value - FleetStateCodeSubmitted = "submitted" - - // FleetStateCodeActive is a FleetStateCode enum value - FleetStateCodeActive = "active" - - // FleetStateCodeDeleted is a FleetStateCode enum value - FleetStateCodeDeleted = "deleted" - - // FleetStateCodeFailed is a FleetStateCode enum value - FleetStateCodeFailed = "failed" - - // FleetStateCodeDeletedRunning is a FleetStateCode enum value - FleetStateCodeDeletedRunning = "deleted-running" - - // FleetStateCodeDeletedTerminating is a FleetStateCode enum value - FleetStateCodeDeletedTerminating = "deleted-terminating" - - // FleetStateCodeModifying is a FleetStateCode enum value - FleetStateCodeModifying = "modifying" -) - -const ( - // FleetTypeRequest is a FleetType enum value - FleetTypeRequest = "request" - - // FleetTypeMaintain is a FleetType enum value - FleetTypeMaintain = "maintain" -) - -const ( - // FlowLogsResourceTypeVpc is a FlowLogsResourceType enum value - FlowLogsResourceTypeVpc = "VPC" - - // FlowLogsResourceTypeSubnet is a FlowLogsResourceType enum value - FlowLogsResourceTypeSubnet = "Subnet" - - // FlowLogsResourceTypeNetworkInterface is a FlowLogsResourceType enum value - FlowLogsResourceTypeNetworkInterface = "NetworkInterface" -) - -const ( - // FpgaImageAttributeNameDescription is a FpgaImageAttributeName enum value - FpgaImageAttributeNameDescription = "description" - - // FpgaImageAttributeNameName is a FpgaImageAttributeName enum value - FpgaImageAttributeNameName = "name" - - // FpgaImageAttributeNameLoadPermission is a FpgaImageAttributeName enum value - FpgaImageAttributeNameLoadPermission = "loadPermission" - - // FpgaImageAttributeNameProductCodes is a FpgaImageAttributeName enum value - FpgaImageAttributeNameProductCodes = "productCodes" -) - -const ( - // FpgaImageStateCodePending is a FpgaImageStateCode enum value - FpgaImageStateCodePending = "pending" - - // FpgaImageStateCodeFailed is a FpgaImageStateCode enum value - FpgaImageStateCodeFailed = "failed" - - // FpgaImageStateCodeAvailable is a FpgaImageStateCode enum value - FpgaImageStateCodeAvailable = "available" - - // FpgaImageStateCodeUnavailable is a FpgaImageStateCode enum value - FpgaImageStateCodeUnavailable = "unavailable" -) - -const ( - // GatewayTypeIpsec1 is a GatewayType enum value - GatewayTypeIpsec1 = "ipsec.1" -) - -const ( - // HostTenancyDedicated is a HostTenancy enum value - HostTenancyDedicated = "dedicated" - - // HostTenancyHost is a HostTenancy enum value - HostTenancyHost = "host" -) - -const ( - // HypervisorTypeOvm is a HypervisorType enum value - HypervisorTypeOvm = "ovm" - - // HypervisorTypeXen is a HypervisorType enum value - HypervisorTypeXen = "xen" -) - -const ( - // IamInstanceProfileAssociationStateAssociating is a IamInstanceProfileAssociationState enum value - IamInstanceProfileAssociationStateAssociating = "associating" - - // IamInstanceProfileAssociationStateAssociated is a IamInstanceProfileAssociationState enum value - IamInstanceProfileAssociationStateAssociated = "associated" - - // IamInstanceProfileAssociationStateDisassociating is a IamInstanceProfileAssociationState enum value - IamInstanceProfileAssociationStateDisassociating = "disassociating" - - // IamInstanceProfileAssociationStateDisassociated is a IamInstanceProfileAssociationState enum value - IamInstanceProfileAssociationStateDisassociated = "disassociated" -) - -const ( - // ImageAttributeNameDescription is a ImageAttributeName enum value - ImageAttributeNameDescription = "description" - - // ImageAttributeNameKernel is a ImageAttributeName enum value - ImageAttributeNameKernel = "kernel" - - // ImageAttributeNameRamdisk is a ImageAttributeName enum value - ImageAttributeNameRamdisk = "ramdisk" - - // ImageAttributeNameLaunchPermission is a ImageAttributeName enum value - ImageAttributeNameLaunchPermission = "launchPermission" - - // ImageAttributeNameProductCodes is a ImageAttributeName enum value - ImageAttributeNameProductCodes = "productCodes" - - // ImageAttributeNameBlockDeviceMapping is a ImageAttributeName enum value - ImageAttributeNameBlockDeviceMapping = "blockDeviceMapping" - - // ImageAttributeNameSriovNetSupport is a ImageAttributeName enum value - ImageAttributeNameSriovNetSupport = "sriovNetSupport" -) - -const ( - // ImageStatePending is a ImageState enum value - ImageStatePending = "pending" - - // ImageStateAvailable is a ImageState enum value - ImageStateAvailable = "available" - - // ImageStateInvalid is a ImageState enum value - ImageStateInvalid = "invalid" - - // ImageStateDeregistered is a ImageState enum value - ImageStateDeregistered = "deregistered" - - // ImageStateTransient is a ImageState enum value - ImageStateTransient = "transient" - - // ImageStateFailed is a ImageState enum value - ImageStateFailed = "failed" - - // ImageStateError is a ImageState enum value - ImageStateError = "error" -) - -const ( - // ImageTypeValuesMachine is a ImageTypeValues enum value - ImageTypeValuesMachine = "machine" - - // ImageTypeValuesKernel is a ImageTypeValues enum value - ImageTypeValuesKernel = "kernel" - - // ImageTypeValuesRamdisk is a ImageTypeValues enum value - ImageTypeValuesRamdisk = "ramdisk" -) - -const ( - // InstanceAttributeNameInstanceType is a InstanceAttributeName enum value - InstanceAttributeNameInstanceType = "instanceType" - - // InstanceAttributeNameKernel is a InstanceAttributeName enum value - InstanceAttributeNameKernel = "kernel" - - // InstanceAttributeNameRamdisk is a InstanceAttributeName enum value - InstanceAttributeNameRamdisk = "ramdisk" - - // InstanceAttributeNameUserData is a InstanceAttributeName enum value - InstanceAttributeNameUserData = "userData" - - // InstanceAttributeNameDisableApiTermination is a InstanceAttributeName enum value - InstanceAttributeNameDisableApiTermination = "disableApiTermination" - - // InstanceAttributeNameInstanceInitiatedShutdownBehavior is a InstanceAttributeName enum value - InstanceAttributeNameInstanceInitiatedShutdownBehavior = "instanceInitiatedShutdownBehavior" - - // InstanceAttributeNameRootDeviceName is a InstanceAttributeName enum value - InstanceAttributeNameRootDeviceName = "rootDeviceName" - - // InstanceAttributeNameBlockDeviceMapping is a InstanceAttributeName enum value - InstanceAttributeNameBlockDeviceMapping = "blockDeviceMapping" - - // InstanceAttributeNameProductCodes is a InstanceAttributeName enum value - InstanceAttributeNameProductCodes = "productCodes" - - // InstanceAttributeNameSourceDestCheck is a InstanceAttributeName enum value - InstanceAttributeNameSourceDestCheck = "sourceDestCheck" - - // InstanceAttributeNameGroupSet is a InstanceAttributeName enum value - InstanceAttributeNameGroupSet = "groupSet" - - // InstanceAttributeNameEbsOptimized is a InstanceAttributeName enum value - InstanceAttributeNameEbsOptimized = "ebsOptimized" - - // InstanceAttributeNameSriovNetSupport is a InstanceAttributeName enum value - InstanceAttributeNameSriovNetSupport = "sriovNetSupport" - - // InstanceAttributeNameEnaSupport is a InstanceAttributeName enum value - InstanceAttributeNameEnaSupport = "enaSupport" -) - -const ( - // InstanceHealthStatusHealthy is a InstanceHealthStatus enum value - InstanceHealthStatusHealthy = "healthy" - - // InstanceHealthStatusUnhealthy is a InstanceHealthStatus enum value - InstanceHealthStatusUnhealthy = "unhealthy" -) - -const ( - // InstanceInterruptionBehaviorHibernate is a InstanceInterruptionBehavior enum value - InstanceInterruptionBehaviorHibernate = "hibernate" - - // InstanceInterruptionBehaviorStop is a InstanceInterruptionBehavior enum value - InstanceInterruptionBehaviorStop = "stop" - - // InstanceInterruptionBehaviorTerminate is a InstanceInterruptionBehavior enum value - InstanceInterruptionBehaviorTerminate = "terminate" -) - -const ( - // InstanceLifecycleTypeSpot is a InstanceLifecycleType enum value - InstanceLifecycleTypeSpot = "spot" - - // InstanceLifecycleTypeScheduled is a InstanceLifecycleType enum value - InstanceLifecycleTypeScheduled = "scheduled" -) - -const ( - // InstanceStateNamePending is a InstanceStateName enum value - InstanceStateNamePending = "pending" - - // InstanceStateNameRunning is a InstanceStateName enum value - InstanceStateNameRunning = "running" - - // InstanceStateNameShuttingDown is a InstanceStateName enum value - InstanceStateNameShuttingDown = "shutting-down" - - // InstanceStateNameTerminated is a InstanceStateName enum value - InstanceStateNameTerminated = "terminated" - - // InstanceStateNameStopping is a InstanceStateName enum value - InstanceStateNameStopping = "stopping" - - // InstanceStateNameStopped is a InstanceStateName enum value - InstanceStateNameStopped = "stopped" -) - -const ( - // InstanceTypeT1Micro is a InstanceType enum value - InstanceTypeT1Micro = "t1.micro" - - // InstanceTypeT2Nano is a InstanceType enum value - InstanceTypeT2Nano = "t2.nano" - - // InstanceTypeT2Micro is a InstanceType enum value - InstanceTypeT2Micro = "t2.micro" - - // InstanceTypeT2Small is a InstanceType enum value - InstanceTypeT2Small = "t2.small" - - // InstanceTypeT2Medium is a InstanceType enum value - InstanceTypeT2Medium = "t2.medium" - - // InstanceTypeT2Large is a InstanceType enum value - InstanceTypeT2Large = "t2.large" - - // InstanceTypeT2Xlarge is a InstanceType enum value - InstanceTypeT2Xlarge = "t2.xlarge" - - // InstanceTypeT22xlarge is a InstanceType enum value - InstanceTypeT22xlarge = "t2.2xlarge" - - // InstanceTypeM1Small is a InstanceType enum value - InstanceTypeM1Small = "m1.small" - - // InstanceTypeM1Medium is a InstanceType enum value - InstanceTypeM1Medium = "m1.medium" - - // InstanceTypeM1Large is a InstanceType enum value - InstanceTypeM1Large = "m1.large" - - // InstanceTypeM1Xlarge is a InstanceType enum value - InstanceTypeM1Xlarge = "m1.xlarge" - - // InstanceTypeM3Medium is a InstanceType enum value - InstanceTypeM3Medium = "m3.medium" - - // InstanceTypeM3Large is a InstanceType enum value - InstanceTypeM3Large = "m3.large" - - // InstanceTypeM3Xlarge is a InstanceType enum value - InstanceTypeM3Xlarge = "m3.xlarge" - - // InstanceTypeM32xlarge is a InstanceType enum value - InstanceTypeM32xlarge = "m3.2xlarge" - - // InstanceTypeM4Large is a InstanceType enum value - InstanceTypeM4Large = "m4.large" - - // InstanceTypeM4Xlarge is a InstanceType enum value - InstanceTypeM4Xlarge = "m4.xlarge" - - // InstanceTypeM42xlarge is a InstanceType enum value - InstanceTypeM42xlarge = "m4.2xlarge" - - // InstanceTypeM44xlarge is a InstanceType enum value - InstanceTypeM44xlarge = "m4.4xlarge" - - // InstanceTypeM410xlarge is a InstanceType enum value - InstanceTypeM410xlarge = "m4.10xlarge" - - // InstanceTypeM416xlarge is a InstanceType enum value - InstanceTypeM416xlarge = "m4.16xlarge" - - // InstanceTypeM2Xlarge is a InstanceType enum value - InstanceTypeM2Xlarge = "m2.xlarge" - - // InstanceTypeM22xlarge is a InstanceType enum value - InstanceTypeM22xlarge = "m2.2xlarge" - - // InstanceTypeM24xlarge is a InstanceType enum value - InstanceTypeM24xlarge = "m2.4xlarge" - - // InstanceTypeCr18xlarge is a InstanceType enum value - InstanceTypeCr18xlarge = "cr1.8xlarge" - - // InstanceTypeR3Large is a InstanceType enum value - InstanceTypeR3Large = "r3.large" - - // InstanceTypeR3Xlarge is a InstanceType enum value - InstanceTypeR3Xlarge = "r3.xlarge" - - // InstanceTypeR32xlarge is a InstanceType enum value - InstanceTypeR32xlarge = "r3.2xlarge" - - // InstanceTypeR34xlarge is a InstanceType enum value - InstanceTypeR34xlarge = "r3.4xlarge" - - // InstanceTypeR38xlarge is a InstanceType enum value - InstanceTypeR38xlarge = "r3.8xlarge" - - // InstanceTypeR4Large is a InstanceType enum value - InstanceTypeR4Large = "r4.large" - - // InstanceTypeR4Xlarge is a InstanceType enum value - InstanceTypeR4Xlarge = "r4.xlarge" - - // InstanceTypeR42xlarge is a InstanceType enum value - InstanceTypeR42xlarge = "r4.2xlarge" - - // InstanceTypeR44xlarge is a InstanceType enum value - InstanceTypeR44xlarge = "r4.4xlarge" - - // InstanceTypeR48xlarge is a InstanceType enum value - InstanceTypeR48xlarge = "r4.8xlarge" - - // InstanceTypeR416xlarge is a InstanceType enum value - InstanceTypeR416xlarge = "r4.16xlarge" - - // InstanceTypeX116xlarge is a InstanceType enum value - InstanceTypeX116xlarge = "x1.16xlarge" - - // InstanceTypeX132xlarge is a InstanceType enum value - InstanceTypeX132xlarge = "x1.32xlarge" - - // InstanceTypeX1eXlarge is a InstanceType enum value - InstanceTypeX1eXlarge = "x1e.xlarge" - - // InstanceTypeX1e2xlarge is a InstanceType enum value - InstanceTypeX1e2xlarge = "x1e.2xlarge" - - // InstanceTypeX1e4xlarge is a InstanceType enum value - InstanceTypeX1e4xlarge = "x1e.4xlarge" - - // InstanceTypeX1e8xlarge is a InstanceType enum value - InstanceTypeX1e8xlarge = "x1e.8xlarge" - - // InstanceTypeX1e16xlarge is a InstanceType enum value - InstanceTypeX1e16xlarge = "x1e.16xlarge" - - // InstanceTypeX1e32xlarge is a InstanceType enum value - InstanceTypeX1e32xlarge = "x1e.32xlarge" - - // InstanceTypeI2Xlarge is a InstanceType enum value - InstanceTypeI2Xlarge = "i2.xlarge" - - // InstanceTypeI22xlarge is a InstanceType enum value - InstanceTypeI22xlarge = "i2.2xlarge" - - // InstanceTypeI24xlarge is a InstanceType enum value - InstanceTypeI24xlarge = "i2.4xlarge" - - // InstanceTypeI28xlarge is a InstanceType enum value - InstanceTypeI28xlarge = "i2.8xlarge" - - // InstanceTypeI3Large is a InstanceType enum value - InstanceTypeI3Large = "i3.large" - - // InstanceTypeI3Xlarge is a InstanceType enum value - InstanceTypeI3Xlarge = "i3.xlarge" - - // InstanceTypeI32xlarge is a InstanceType enum value - InstanceTypeI32xlarge = "i3.2xlarge" - - // InstanceTypeI34xlarge is a InstanceType enum value - InstanceTypeI34xlarge = "i3.4xlarge" - - // InstanceTypeI38xlarge is a InstanceType enum value - InstanceTypeI38xlarge = "i3.8xlarge" - - // InstanceTypeI316xlarge is a InstanceType enum value - InstanceTypeI316xlarge = "i3.16xlarge" - - // InstanceTypeI3Metal is a InstanceType enum value - InstanceTypeI3Metal = "i3.metal" - - // InstanceTypeHi14xlarge is a InstanceType enum value - InstanceTypeHi14xlarge = "hi1.4xlarge" - - // InstanceTypeHs18xlarge is a InstanceType enum value - InstanceTypeHs18xlarge = "hs1.8xlarge" - - // InstanceTypeC1Medium is a InstanceType enum value - InstanceTypeC1Medium = "c1.medium" - - // InstanceTypeC1Xlarge is a InstanceType enum value - InstanceTypeC1Xlarge = "c1.xlarge" - - // InstanceTypeC3Large is a InstanceType enum value - InstanceTypeC3Large = "c3.large" - - // InstanceTypeC3Xlarge is a InstanceType enum value - InstanceTypeC3Xlarge = "c3.xlarge" - - // InstanceTypeC32xlarge is a InstanceType enum value - InstanceTypeC32xlarge = "c3.2xlarge" - - // InstanceTypeC34xlarge is a InstanceType enum value - InstanceTypeC34xlarge = "c3.4xlarge" - - // InstanceTypeC38xlarge is a InstanceType enum value - InstanceTypeC38xlarge = "c3.8xlarge" - - // InstanceTypeC4Large is a InstanceType enum value - InstanceTypeC4Large = "c4.large" - - // InstanceTypeC4Xlarge is a InstanceType enum value - InstanceTypeC4Xlarge = "c4.xlarge" - - // InstanceTypeC42xlarge is a InstanceType enum value - InstanceTypeC42xlarge = "c4.2xlarge" - - // InstanceTypeC44xlarge is a InstanceType enum value - InstanceTypeC44xlarge = "c4.4xlarge" - - // InstanceTypeC48xlarge is a InstanceType enum value - InstanceTypeC48xlarge = "c4.8xlarge" - - // InstanceTypeC5Large is a InstanceType enum value - InstanceTypeC5Large = "c5.large" - - // InstanceTypeC5Xlarge is a InstanceType enum value - InstanceTypeC5Xlarge = "c5.xlarge" - - // InstanceTypeC52xlarge is a InstanceType enum value - InstanceTypeC52xlarge = "c5.2xlarge" - - // InstanceTypeC54xlarge is a InstanceType enum value - InstanceTypeC54xlarge = "c5.4xlarge" - - // InstanceTypeC59xlarge is a InstanceType enum value - InstanceTypeC59xlarge = "c5.9xlarge" - - // InstanceTypeC518xlarge is a InstanceType enum value - InstanceTypeC518xlarge = "c5.18xlarge" - - // InstanceTypeC5dLarge is a InstanceType enum value - InstanceTypeC5dLarge = "c5d.large" - - // InstanceTypeC5dXlarge is a InstanceType enum value - InstanceTypeC5dXlarge = "c5d.xlarge" - - // InstanceTypeC5d2xlarge is a InstanceType enum value - InstanceTypeC5d2xlarge = "c5d.2xlarge" - - // InstanceTypeC5d4xlarge is a InstanceType enum value - InstanceTypeC5d4xlarge = "c5d.4xlarge" - - // InstanceTypeC5d9xlarge is a InstanceType enum value - InstanceTypeC5d9xlarge = "c5d.9xlarge" - - // InstanceTypeC5d18xlarge is a InstanceType enum value - InstanceTypeC5d18xlarge = "c5d.18xlarge" - - // InstanceTypeCc14xlarge is a InstanceType enum value - InstanceTypeCc14xlarge = "cc1.4xlarge" - - // InstanceTypeCc28xlarge is a InstanceType enum value - InstanceTypeCc28xlarge = "cc2.8xlarge" - - // InstanceTypeG22xlarge is a InstanceType enum value - InstanceTypeG22xlarge = "g2.2xlarge" - - // InstanceTypeG28xlarge is a InstanceType enum value - InstanceTypeG28xlarge = "g2.8xlarge" - - // InstanceTypeG34xlarge is a InstanceType enum value - InstanceTypeG34xlarge = "g3.4xlarge" - - // InstanceTypeG38xlarge is a InstanceType enum value - InstanceTypeG38xlarge = "g3.8xlarge" - - // InstanceTypeG316xlarge is a InstanceType enum value - InstanceTypeG316xlarge = "g3.16xlarge" - - // InstanceTypeCg14xlarge is a InstanceType enum value - InstanceTypeCg14xlarge = "cg1.4xlarge" - - // InstanceTypeP2Xlarge is a InstanceType enum value - InstanceTypeP2Xlarge = "p2.xlarge" - - // InstanceTypeP28xlarge is a InstanceType enum value - InstanceTypeP28xlarge = "p2.8xlarge" - - // InstanceTypeP216xlarge is a InstanceType enum value - InstanceTypeP216xlarge = "p2.16xlarge" - - // InstanceTypeP32xlarge is a InstanceType enum value - InstanceTypeP32xlarge = "p3.2xlarge" - - // InstanceTypeP38xlarge is a InstanceType enum value - InstanceTypeP38xlarge = "p3.8xlarge" - - // InstanceTypeP316xlarge is a InstanceType enum value - InstanceTypeP316xlarge = "p3.16xlarge" - - // InstanceTypeD2Xlarge is a InstanceType enum value - InstanceTypeD2Xlarge = "d2.xlarge" - - // InstanceTypeD22xlarge is a InstanceType enum value - InstanceTypeD22xlarge = "d2.2xlarge" - - // InstanceTypeD24xlarge is a InstanceType enum value - InstanceTypeD24xlarge = "d2.4xlarge" - - // InstanceTypeD28xlarge is a InstanceType enum value - InstanceTypeD28xlarge = "d2.8xlarge" - - // InstanceTypeF12xlarge is a InstanceType enum value - InstanceTypeF12xlarge = "f1.2xlarge" - - // InstanceTypeF116xlarge is a InstanceType enum value - InstanceTypeF116xlarge = "f1.16xlarge" - - // InstanceTypeM5Large is a InstanceType enum value - InstanceTypeM5Large = "m5.large" - - // InstanceTypeM5Xlarge is a InstanceType enum value - InstanceTypeM5Xlarge = "m5.xlarge" - - // InstanceTypeM52xlarge is a InstanceType enum value - InstanceTypeM52xlarge = "m5.2xlarge" - - // InstanceTypeM54xlarge is a InstanceType enum value - InstanceTypeM54xlarge = "m5.4xlarge" - - // InstanceTypeM512xlarge is a InstanceType enum value - InstanceTypeM512xlarge = "m5.12xlarge" - - // InstanceTypeM524xlarge is a InstanceType enum value - InstanceTypeM524xlarge = "m5.24xlarge" - - // InstanceTypeH12xlarge is a InstanceType enum value - InstanceTypeH12xlarge = "h1.2xlarge" - - // InstanceTypeH14xlarge is a InstanceType enum value - InstanceTypeH14xlarge = "h1.4xlarge" - - // InstanceTypeH18xlarge is a InstanceType enum value - InstanceTypeH18xlarge = "h1.8xlarge" - - // InstanceTypeH116xlarge is a InstanceType enum value - InstanceTypeH116xlarge = "h1.16xlarge" -) - -const ( - // InterfacePermissionTypeInstanceAttach is a InterfacePermissionType enum value - InterfacePermissionTypeInstanceAttach = "INSTANCE-ATTACH" - - // InterfacePermissionTypeEipAssociate is a InterfacePermissionType enum value - InterfacePermissionTypeEipAssociate = "EIP-ASSOCIATE" -) - -const ( - // LaunchTemplateErrorCodeLaunchTemplateIdDoesNotExist is a LaunchTemplateErrorCode enum value - LaunchTemplateErrorCodeLaunchTemplateIdDoesNotExist = "launchTemplateIdDoesNotExist" - - // LaunchTemplateErrorCodeLaunchTemplateIdMalformed is a LaunchTemplateErrorCode enum value - LaunchTemplateErrorCodeLaunchTemplateIdMalformed = "launchTemplateIdMalformed" - - // LaunchTemplateErrorCodeLaunchTemplateNameDoesNotExist is a LaunchTemplateErrorCode enum value - LaunchTemplateErrorCodeLaunchTemplateNameDoesNotExist = "launchTemplateNameDoesNotExist" - - // LaunchTemplateErrorCodeLaunchTemplateNameMalformed is a LaunchTemplateErrorCode enum value - LaunchTemplateErrorCodeLaunchTemplateNameMalformed = "launchTemplateNameMalformed" - - // LaunchTemplateErrorCodeLaunchTemplateVersionDoesNotExist is a LaunchTemplateErrorCode enum value - LaunchTemplateErrorCodeLaunchTemplateVersionDoesNotExist = "launchTemplateVersionDoesNotExist" - - // LaunchTemplateErrorCodeUnexpectedError is a LaunchTemplateErrorCode enum value - LaunchTemplateErrorCodeUnexpectedError = "unexpectedError" -) - -const ( - // ListingStateAvailable is a ListingState enum value - ListingStateAvailable = "available" - - // ListingStateSold is a ListingState enum value - ListingStateSold = "sold" - - // ListingStateCancelled is a ListingState enum value - ListingStateCancelled = "cancelled" - - // ListingStatePending is a ListingState enum value - ListingStatePending = "pending" -) - -const ( - // ListingStatusActive is a ListingStatus enum value - ListingStatusActive = "active" - - // ListingStatusPending is a ListingStatus enum value - ListingStatusPending = "pending" - - // ListingStatusCancelled is a ListingStatus enum value - ListingStatusCancelled = "cancelled" - - // ListingStatusClosed is a ListingStatus enum value - ListingStatusClosed = "closed" -) - -const ( - // MarketTypeSpot is a MarketType enum value - MarketTypeSpot = "spot" -) - -const ( - // MonitoringStateDisabled is a MonitoringState enum value - MonitoringStateDisabled = "disabled" - - // MonitoringStateDisabling is a MonitoringState enum value - MonitoringStateDisabling = "disabling" - - // MonitoringStateEnabled is a MonitoringState enum value - MonitoringStateEnabled = "enabled" - - // MonitoringStatePending is a MonitoringState enum value - MonitoringStatePending = "pending" -) - -const ( - // MoveStatusMovingToVpc is a MoveStatus enum value - MoveStatusMovingToVpc = "movingToVpc" - - // MoveStatusRestoringToClassic is a MoveStatus enum value - MoveStatusRestoringToClassic = "restoringToClassic" -) - -const ( - // NatGatewayStatePending is a NatGatewayState enum value - NatGatewayStatePending = "pending" - - // NatGatewayStateFailed is a NatGatewayState enum value - NatGatewayStateFailed = "failed" - - // NatGatewayStateAvailable is a NatGatewayState enum value - NatGatewayStateAvailable = "available" - - // NatGatewayStateDeleting is a NatGatewayState enum value - NatGatewayStateDeleting = "deleting" - - // NatGatewayStateDeleted is a NatGatewayState enum value - NatGatewayStateDeleted = "deleted" -) - -const ( - // NetworkInterfaceAttributeDescription is a NetworkInterfaceAttribute enum value - NetworkInterfaceAttributeDescription = "description" - - // NetworkInterfaceAttributeGroupSet is a NetworkInterfaceAttribute enum value - NetworkInterfaceAttributeGroupSet = "groupSet" - - // NetworkInterfaceAttributeSourceDestCheck is a NetworkInterfaceAttribute enum value - NetworkInterfaceAttributeSourceDestCheck = "sourceDestCheck" - - // NetworkInterfaceAttributeAttachment is a NetworkInterfaceAttribute enum value - NetworkInterfaceAttributeAttachment = "attachment" -) - -const ( - // NetworkInterfacePermissionStateCodePending is a NetworkInterfacePermissionStateCode enum value - NetworkInterfacePermissionStateCodePending = "pending" - - // NetworkInterfacePermissionStateCodeGranted is a NetworkInterfacePermissionStateCode enum value - NetworkInterfacePermissionStateCodeGranted = "granted" - - // NetworkInterfacePermissionStateCodeRevoking is a NetworkInterfacePermissionStateCode enum value - NetworkInterfacePermissionStateCodeRevoking = "revoking" - - // NetworkInterfacePermissionStateCodeRevoked is a NetworkInterfacePermissionStateCode enum value - NetworkInterfacePermissionStateCodeRevoked = "revoked" -) - -const ( - // NetworkInterfaceStatusAvailable is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusAvailable = "available" - - // NetworkInterfaceStatusAssociated is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusAssociated = "associated" - - // NetworkInterfaceStatusAttaching is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusAttaching = "attaching" - - // NetworkInterfaceStatusInUse is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusInUse = "in-use" - - // NetworkInterfaceStatusDetaching is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusDetaching = "detaching" -) - -const ( - // NetworkInterfaceTypeInterface is a NetworkInterfaceType enum value - NetworkInterfaceTypeInterface = "interface" - - // NetworkInterfaceTypeNatGateway is a NetworkInterfaceType enum value - NetworkInterfaceTypeNatGateway = "natGateway" -) - -const ( - // OfferingClassTypeStandard is a OfferingClassType enum value - OfferingClassTypeStandard = "standard" - - // OfferingClassTypeConvertible is a OfferingClassType enum value - OfferingClassTypeConvertible = "convertible" -) - -const ( - // OfferingTypeValuesHeavyUtilization is a OfferingTypeValues enum value - OfferingTypeValuesHeavyUtilization = "Heavy Utilization" - - // OfferingTypeValuesMediumUtilization is a OfferingTypeValues enum value - OfferingTypeValuesMediumUtilization = "Medium Utilization" - - // OfferingTypeValuesLightUtilization is a OfferingTypeValues enum value - OfferingTypeValuesLightUtilization = "Light Utilization" - - // OfferingTypeValuesNoUpfront is a OfferingTypeValues enum value - OfferingTypeValuesNoUpfront = "No Upfront" - - // OfferingTypeValuesPartialUpfront is a OfferingTypeValues enum value - OfferingTypeValuesPartialUpfront = "Partial Upfront" - - // OfferingTypeValuesAllUpfront is a OfferingTypeValues enum value - OfferingTypeValuesAllUpfront = "All Upfront" -) - -const ( - // OperationTypeAdd is a OperationType enum value - OperationTypeAdd = "add" - - // OperationTypeRemove is a OperationType enum value - OperationTypeRemove = "remove" -) - -const ( - // PaymentOptionAllUpfront is a PaymentOption enum value - PaymentOptionAllUpfront = "AllUpfront" - - // PaymentOptionPartialUpfront is a PaymentOption enum value - PaymentOptionPartialUpfront = "PartialUpfront" - - // PaymentOptionNoUpfront is a PaymentOption enum value - PaymentOptionNoUpfront = "NoUpfront" -) - -const ( - // PermissionGroupAll is a PermissionGroup enum value - PermissionGroupAll = "all" -) - -const ( - // PlacementGroupStatePending is a PlacementGroupState enum value - PlacementGroupStatePending = "pending" - - // PlacementGroupStateAvailable is a PlacementGroupState enum value - PlacementGroupStateAvailable = "available" - - // PlacementGroupStateDeleting is a PlacementGroupState enum value - PlacementGroupStateDeleting = "deleting" - - // PlacementGroupStateDeleted is a PlacementGroupState enum value - PlacementGroupStateDeleted = "deleted" -) - -const ( - // PlacementStrategyCluster is a PlacementStrategy enum value - PlacementStrategyCluster = "cluster" - - // PlacementStrategySpread is a PlacementStrategy enum value - PlacementStrategySpread = "spread" -) - -const ( - // PlatformValuesWindows is a PlatformValues enum value - PlatformValuesWindows = "Windows" -) - -const ( - // PrincipalTypeAll is a PrincipalType enum value - PrincipalTypeAll = "All" - - // PrincipalTypeService is a PrincipalType enum value - PrincipalTypeService = "Service" - - // PrincipalTypeOrganizationUnit is a PrincipalType enum value - PrincipalTypeOrganizationUnit = "OrganizationUnit" - - // PrincipalTypeAccount is a PrincipalType enum value - PrincipalTypeAccount = "Account" - - // PrincipalTypeUser is a PrincipalType enum value - PrincipalTypeUser = "User" - - // PrincipalTypeRole is a PrincipalType enum value - PrincipalTypeRole = "Role" -) - -const ( - // ProductCodeValuesDevpay is a ProductCodeValues enum value - ProductCodeValuesDevpay = "devpay" - - // ProductCodeValuesMarketplace is a ProductCodeValues enum value - ProductCodeValuesMarketplace = "marketplace" -) - -const ( - // RIProductDescriptionLinuxUnix is a RIProductDescription enum value - RIProductDescriptionLinuxUnix = "Linux/UNIX" - - // RIProductDescriptionLinuxUnixamazonVpc is a RIProductDescription enum value - RIProductDescriptionLinuxUnixamazonVpc = "Linux/UNIX (Amazon VPC)" - - // RIProductDescriptionWindows is a RIProductDescription enum value - RIProductDescriptionWindows = "Windows" - - // RIProductDescriptionWindowsAmazonVpc is a RIProductDescription enum value - RIProductDescriptionWindowsAmazonVpc = "Windows (Amazon VPC)" -) - -const ( - // RecurringChargeFrequencyHourly is a RecurringChargeFrequency enum value - RecurringChargeFrequencyHourly = "Hourly" -) - -const ( - // ReportInstanceReasonCodesInstanceStuckInState is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesInstanceStuckInState = "instance-stuck-in-state" - - // ReportInstanceReasonCodesUnresponsive is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesUnresponsive = "unresponsive" - - // ReportInstanceReasonCodesNotAcceptingCredentials is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesNotAcceptingCredentials = "not-accepting-credentials" - - // ReportInstanceReasonCodesPasswordNotAvailable is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPasswordNotAvailable = "password-not-available" - - // ReportInstanceReasonCodesPerformanceNetwork is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPerformanceNetwork = "performance-network" - - // ReportInstanceReasonCodesPerformanceInstanceStore is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPerformanceInstanceStore = "performance-instance-store" - - // ReportInstanceReasonCodesPerformanceEbsVolume is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPerformanceEbsVolume = "performance-ebs-volume" - - // ReportInstanceReasonCodesPerformanceOther is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPerformanceOther = "performance-other" - - // ReportInstanceReasonCodesOther is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesOther = "other" -) - -const ( - // ReportStatusTypeOk is a ReportStatusType enum value - ReportStatusTypeOk = "ok" - - // ReportStatusTypeImpaired is a ReportStatusType enum value - ReportStatusTypeImpaired = "impaired" -) - -const ( - // ReservationStatePaymentPending is a ReservationState enum value - ReservationStatePaymentPending = "payment-pending" - - // ReservationStatePaymentFailed is a ReservationState enum value - ReservationStatePaymentFailed = "payment-failed" - - // ReservationStateActive is a ReservationState enum value - ReservationStateActive = "active" - - // ReservationStateRetired is a ReservationState enum value - ReservationStateRetired = "retired" -) - -const ( - // ReservedInstanceStatePaymentPending is a ReservedInstanceState enum value - ReservedInstanceStatePaymentPending = "payment-pending" - - // ReservedInstanceStateActive is a ReservedInstanceState enum value - ReservedInstanceStateActive = "active" - - // ReservedInstanceStatePaymentFailed is a ReservedInstanceState enum value - ReservedInstanceStatePaymentFailed = "payment-failed" - - // ReservedInstanceStateRetired is a ReservedInstanceState enum value - ReservedInstanceStateRetired = "retired" -) - -const ( - // ResetFpgaImageAttributeNameLoadPermission is a ResetFpgaImageAttributeName enum value - ResetFpgaImageAttributeNameLoadPermission = "loadPermission" -) - -const ( - // ResetImageAttributeNameLaunchPermission is a ResetImageAttributeName enum value - ResetImageAttributeNameLaunchPermission = "launchPermission" -) - -const ( - // ResourceTypeCustomerGateway is a ResourceType enum value - ResourceTypeCustomerGateway = "customer-gateway" - - // ResourceTypeDhcpOptions is a ResourceType enum value - ResourceTypeDhcpOptions = "dhcp-options" - - // ResourceTypeImage is a ResourceType enum value - ResourceTypeImage = "image" - - // ResourceTypeInstance is a ResourceType enum value - ResourceTypeInstance = "instance" - - // ResourceTypeInternetGateway is a ResourceType enum value - ResourceTypeInternetGateway = "internet-gateway" - - // ResourceTypeNetworkAcl is a ResourceType enum value - ResourceTypeNetworkAcl = "network-acl" - - // ResourceTypeNetworkInterface is a ResourceType enum value - ResourceTypeNetworkInterface = "network-interface" - - // ResourceTypeReservedInstances is a ResourceType enum value - ResourceTypeReservedInstances = "reserved-instances" - - // ResourceTypeRouteTable is a ResourceType enum value - ResourceTypeRouteTable = "route-table" - - // ResourceTypeSnapshot is a ResourceType enum value - ResourceTypeSnapshot = "snapshot" - - // ResourceTypeSpotInstancesRequest is a ResourceType enum value - ResourceTypeSpotInstancesRequest = "spot-instances-request" - - // ResourceTypeSubnet is a ResourceType enum value - ResourceTypeSubnet = "subnet" - - // ResourceTypeSecurityGroup is a ResourceType enum value - ResourceTypeSecurityGroup = "security-group" - - // ResourceTypeVolume is a ResourceType enum value - ResourceTypeVolume = "volume" - - // ResourceTypeVpc is a ResourceType enum value - ResourceTypeVpc = "vpc" - - // ResourceTypeVpnConnection is a ResourceType enum value - ResourceTypeVpnConnection = "vpn-connection" - - // ResourceTypeVpnGateway is a ResourceType enum value - ResourceTypeVpnGateway = "vpn-gateway" -) - -const ( - // RouteOriginCreateRouteTable is a RouteOrigin enum value - RouteOriginCreateRouteTable = "CreateRouteTable" - - // RouteOriginCreateRoute is a RouteOrigin enum value - RouteOriginCreateRoute = "CreateRoute" - - // RouteOriginEnableVgwRoutePropagation is a RouteOrigin enum value - RouteOriginEnableVgwRoutePropagation = "EnableVgwRoutePropagation" -) - -const ( - // RouteStateActive is a RouteState enum value - RouteStateActive = "active" - - // RouteStateBlackhole is a RouteState enum value - RouteStateBlackhole = "blackhole" -) - -const ( - // RuleActionAllow is a RuleAction enum value - RuleActionAllow = "allow" - - // RuleActionDeny is a RuleAction enum value - RuleActionDeny = "deny" -) - -const ( - // ServiceStatePending is a ServiceState enum value - ServiceStatePending = "Pending" - - // ServiceStateAvailable is a ServiceState enum value - ServiceStateAvailable = "Available" - - // ServiceStateDeleting is a ServiceState enum value - ServiceStateDeleting = "Deleting" - - // ServiceStateDeleted is a ServiceState enum value - ServiceStateDeleted = "Deleted" - - // ServiceStateFailed is a ServiceState enum value - ServiceStateFailed = "Failed" -) - -const ( - // ServiceTypeInterface is a ServiceType enum value - ServiceTypeInterface = "Interface" - - // ServiceTypeGateway is a ServiceType enum value - ServiceTypeGateway = "Gateway" -) - -const ( - // ShutdownBehaviorStop is a ShutdownBehavior enum value - ShutdownBehaviorStop = "stop" - - // ShutdownBehaviorTerminate is a ShutdownBehavior enum value - ShutdownBehaviorTerminate = "terminate" -) - -const ( - // SnapshotAttributeNameProductCodes is a SnapshotAttributeName enum value - SnapshotAttributeNameProductCodes = "productCodes" - - // SnapshotAttributeNameCreateVolumePermission is a SnapshotAttributeName enum value - SnapshotAttributeNameCreateVolumePermission = "createVolumePermission" -) - -const ( - // SnapshotStatePending is a SnapshotState enum value - SnapshotStatePending = "pending" - - // SnapshotStateCompleted is a SnapshotState enum value - SnapshotStateCompleted = "completed" - - // SnapshotStateError is a SnapshotState enum value - SnapshotStateError = "error" -) - -const ( - // SpotAllocationStrategyLowestPrice is a SpotAllocationStrategy enum value - SpotAllocationStrategyLowestPrice = "lowest-price" - - // SpotAllocationStrategyDiversified is a SpotAllocationStrategy enum value - SpotAllocationStrategyDiversified = "diversified" -) - -const ( - // SpotInstanceInterruptionBehaviorHibernate is a SpotInstanceInterruptionBehavior enum value - SpotInstanceInterruptionBehaviorHibernate = "hibernate" - - // SpotInstanceInterruptionBehaviorStop is a SpotInstanceInterruptionBehavior enum value - SpotInstanceInterruptionBehaviorStop = "stop" - - // SpotInstanceInterruptionBehaviorTerminate is a SpotInstanceInterruptionBehavior enum value - SpotInstanceInterruptionBehaviorTerminate = "terminate" -) - -const ( - // SpotInstanceStateOpen is a SpotInstanceState enum value - SpotInstanceStateOpen = "open" - - // SpotInstanceStateActive is a SpotInstanceState enum value - SpotInstanceStateActive = "active" - - // SpotInstanceStateClosed is a SpotInstanceState enum value - SpotInstanceStateClosed = "closed" - - // SpotInstanceStateCancelled is a SpotInstanceState enum value - SpotInstanceStateCancelled = "cancelled" - - // SpotInstanceStateFailed is a SpotInstanceState enum value - SpotInstanceStateFailed = "failed" -) - -const ( - // SpotInstanceTypeOneTime is a SpotInstanceType enum value - SpotInstanceTypeOneTime = "one-time" - - // SpotInstanceTypePersistent is a SpotInstanceType enum value - SpotInstanceTypePersistent = "persistent" -) - -const ( - // StatePendingAcceptance is a State enum value - StatePendingAcceptance = "PendingAcceptance" - - // StatePending is a State enum value - StatePending = "Pending" - - // StateAvailable is a State enum value - StateAvailable = "Available" - - // StateDeleting is a State enum value - StateDeleting = "Deleting" - - // StateDeleted is a State enum value - StateDeleted = "Deleted" - - // StateRejected is a State enum value - StateRejected = "Rejected" - - // StateFailed is a State enum value - StateFailed = "Failed" - - // StateExpired is a State enum value - StateExpired = "Expired" -) - -const ( - // StatusMoveInProgress is a Status enum value - StatusMoveInProgress = "MoveInProgress" - - // StatusInVpc is a Status enum value - StatusInVpc = "InVpc" - - // StatusInClassic is a Status enum value - StatusInClassic = "InClassic" -) - -const ( - // StatusNameReachability is a StatusName enum value - StatusNameReachability = "reachability" -) - -const ( - // StatusTypePassed is a StatusType enum value - StatusTypePassed = "passed" - - // StatusTypeFailed is a StatusType enum value - StatusTypeFailed = "failed" - - // StatusTypeInsufficientData is a StatusType enum value - StatusTypeInsufficientData = "insufficient-data" - - // StatusTypeInitializing is a StatusType enum value - StatusTypeInitializing = "initializing" -) - -const ( - // SubnetCidrBlockStateCodeAssociating is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeAssociating = "associating" - - // SubnetCidrBlockStateCodeAssociated is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeAssociated = "associated" - - // SubnetCidrBlockStateCodeDisassociating is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeDisassociating = "disassociating" - - // SubnetCidrBlockStateCodeDisassociated is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeDisassociated = "disassociated" - - // SubnetCidrBlockStateCodeFailing is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeFailing = "failing" - - // SubnetCidrBlockStateCodeFailed is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeFailed = "failed" -) - -const ( - // SubnetStatePending is a SubnetState enum value - SubnetStatePending = "pending" - - // SubnetStateAvailable is a SubnetState enum value - SubnetStateAvailable = "available" -) - -const ( - // SummaryStatusOk is a SummaryStatus enum value - SummaryStatusOk = "ok" - - // SummaryStatusImpaired is a SummaryStatus enum value - SummaryStatusImpaired = "impaired" - - // SummaryStatusInsufficientData is a SummaryStatus enum value - SummaryStatusInsufficientData = "insufficient-data" - - // SummaryStatusNotApplicable is a SummaryStatus enum value - SummaryStatusNotApplicable = "not-applicable" - - // SummaryStatusInitializing is a SummaryStatus enum value - SummaryStatusInitializing = "initializing" -) - -const ( - // TelemetryStatusUp is a TelemetryStatus enum value - TelemetryStatusUp = "UP" - - // TelemetryStatusDown is a TelemetryStatus enum value - TelemetryStatusDown = "DOWN" -) - -const ( - // TenancyDefault is a Tenancy enum value - TenancyDefault = "default" - - // TenancyDedicated is a Tenancy enum value - TenancyDedicated = "dedicated" - - // TenancyHost is a Tenancy enum value - TenancyHost = "host" -) - -const ( - // TrafficTypeAccept is a TrafficType enum value - TrafficTypeAccept = "ACCEPT" - - // TrafficTypeReject is a TrafficType enum value - TrafficTypeReject = "REJECT" - - // TrafficTypeAll is a TrafficType enum value - TrafficTypeAll = "ALL" -) - -const ( - // UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed is a UnsuccessfulInstanceCreditSpecificationErrorCode enum value - UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed = "InvalidInstanceID.Malformed" - - // UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdNotFound is a UnsuccessfulInstanceCreditSpecificationErrorCode enum value - UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdNotFound = "InvalidInstanceID.NotFound" - - // UnsuccessfulInstanceCreditSpecificationErrorCodeIncorrectInstanceState is a UnsuccessfulInstanceCreditSpecificationErrorCode enum value - UnsuccessfulInstanceCreditSpecificationErrorCodeIncorrectInstanceState = "IncorrectInstanceState" - - // UnsuccessfulInstanceCreditSpecificationErrorCodeInstanceCreditSpecificationNotSupported is a UnsuccessfulInstanceCreditSpecificationErrorCode enum value - UnsuccessfulInstanceCreditSpecificationErrorCodeInstanceCreditSpecificationNotSupported = "InstanceCreditSpecification.NotSupported" -) - -const ( - // VirtualizationTypeHvm is a VirtualizationType enum value - VirtualizationTypeHvm = "hvm" - - // VirtualizationTypeParavirtual is a VirtualizationType enum value - VirtualizationTypeParavirtual = "paravirtual" -) - -const ( - // VolumeAttachmentStateAttaching is a VolumeAttachmentState enum value - VolumeAttachmentStateAttaching = "attaching" - - // VolumeAttachmentStateAttached is a VolumeAttachmentState enum value - VolumeAttachmentStateAttached = "attached" - - // VolumeAttachmentStateDetaching is a VolumeAttachmentState enum value - VolumeAttachmentStateDetaching = "detaching" - - // VolumeAttachmentStateDetached is a VolumeAttachmentState enum value - VolumeAttachmentStateDetached = "detached" - - // VolumeAttachmentStateBusy is a VolumeAttachmentState enum value - VolumeAttachmentStateBusy = "busy" -) - -const ( - // VolumeAttributeNameAutoEnableIo is a VolumeAttributeName enum value - VolumeAttributeNameAutoEnableIo = "autoEnableIO" - - // VolumeAttributeNameProductCodes is a VolumeAttributeName enum value - VolumeAttributeNameProductCodes = "productCodes" -) - -const ( - // VolumeModificationStateModifying is a VolumeModificationState enum value - VolumeModificationStateModifying = "modifying" - - // VolumeModificationStateOptimizing is a VolumeModificationState enum value - VolumeModificationStateOptimizing = "optimizing" - - // VolumeModificationStateCompleted is a VolumeModificationState enum value - VolumeModificationStateCompleted = "completed" - - // VolumeModificationStateFailed is a VolumeModificationState enum value - VolumeModificationStateFailed = "failed" -) - -const ( - // VolumeStateCreating is a VolumeState enum value - VolumeStateCreating = "creating" - - // VolumeStateAvailable is a VolumeState enum value - VolumeStateAvailable = "available" - - // VolumeStateInUse is a VolumeState enum value - VolumeStateInUse = "in-use" - - // VolumeStateDeleting is a VolumeState enum value - VolumeStateDeleting = "deleting" - - // VolumeStateDeleted is a VolumeState enum value - VolumeStateDeleted = "deleted" - - // VolumeStateError is a VolumeState enum value - VolumeStateError = "error" -) - -const ( - // VolumeStatusInfoStatusOk is a VolumeStatusInfoStatus enum value - VolumeStatusInfoStatusOk = "ok" - - // VolumeStatusInfoStatusImpaired is a VolumeStatusInfoStatus enum value - VolumeStatusInfoStatusImpaired = "impaired" - - // VolumeStatusInfoStatusInsufficientData is a VolumeStatusInfoStatus enum value - VolumeStatusInfoStatusInsufficientData = "insufficient-data" -) - -const ( - // VolumeStatusNameIoEnabled is a VolumeStatusName enum value - VolumeStatusNameIoEnabled = "io-enabled" - - // VolumeStatusNameIoPerformance is a VolumeStatusName enum value - VolumeStatusNameIoPerformance = "io-performance" -) - -const ( - // VolumeTypeStandard is a VolumeType enum value - VolumeTypeStandard = "standard" - - // VolumeTypeIo1 is a VolumeType enum value - VolumeTypeIo1 = "io1" - - // VolumeTypeGp2 is a VolumeType enum value - VolumeTypeGp2 = "gp2" - - // VolumeTypeSc1 is a VolumeType enum value - VolumeTypeSc1 = "sc1" - - // VolumeTypeSt1 is a VolumeType enum value - VolumeTypeSt1 = "st1" -) - -const ( - // VpcAttributeNameEnableDnsSupport is a VpcAttributeName enum value - VpcAttributeNameEnableDnsSupport = "enableDnsSupport" - - // VpcAttributeNameEnableDnsHostnames is a VpcAttributeName enum value - VpcAttributeNameEnableDnsHostnames = "enableDnsHostnames" -) - -const ( - // VpcCidrBlockStateCodeAssociating is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeAssociating = "associating" - - // VpcCidrBlockStateCodeAssociated is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeAssociated = "associated" - - // VpcCidrBlockStateCodeDisassociating is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeDisassociating = "disassociating" - - // VpcCidrBlockStateCodeDisassociated is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeDisassociated = "disassociated" - - // VpcCidrBlockStateCodeFailing is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeFailing = "failing" - - // VpcCidrBlockStateCodeFailed is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeFailed = "failed" -) - -const ( - // VpcEndpointTypeInterface is a VpcEndpointType enum value - VpcEndpointTypeInterface = "Interface" - - // VpcEndpointTypeGateway is a VpcEndpointType enum value - VpcEndpointTypeGateway = "Gateway" -) - -const ( - // VpcPeeringConnectionStateReasonCodeInitiatingRequest is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeInitiatingRequest = "initiating-request" - - // VpcPeeringConnectionStateReasonCodePendingAcceptance is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodePendingAcceptance = "pending-acceptance" - - // VpcPeeringConnectionStateReasonCodeActive is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeActive = "active" - - // VpcPeeringConnectionStateReasonCodeDeleted is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeDeleted = "deleted" - - // VpcPeeringConnectionStateReasonCodeRejected is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeRejected = "rejected" - - // VpcPeeringConnectionStateReasonCodeFailed is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeFailed = "failed" - - // VpcPeeringConnectionStateReasonCodeExpired is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeExpired = "expired" - - // VpcPeeringConnectionStateReasonCodeProvisioning is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeProvisioning = "provisioning" - - // VpcPeeringConnectionStateReasonCodeDeleting is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeDeleting = "deleting" -) - -const ( - // VpcStatePending is a VpcState enum value - VpcStatePending = "pending" - - // VpcStateAvailable is a VpcState enum value - VpcStateAvailable = "available" -) - -const ( - // VpcTenancyDefault is a VpcTenancy enum value - VpcTenancyDefault = "default" -) - -const ( - // VpnStatePending is a VpnState enum value - VpnStatePending = "pending" - - // VpnStateAvailable is a VpnState enum value - VpnStateAvailable = "available" - - // VpnStateDeleting is a VpnState enum value - VpnStateDeleting = "deleting" - - // VpnStateDeleted is a VpnState enum value - VpnStateDeleted = "deleted" -) - -const ( - // VpnStaticRouteSourceStatic is a VpnStaticRouteSource enum value - VpnStaticRouteSourceStatic = "Static" -) - -const ( - // ScopeAvailabilityZone is a scope enum value - ScopeAvailabilityZone = "Availability Zone" - - // ScopeRegion is a scope enum value - ScopeRegion = "Region" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go deleted file mode 100644 index 7b42719d6..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go +++ /dev/null @@ -1,120 +0,0 @@ -package ec2 - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdkrand" -) - -type retryer struct { - client.DefaultRetryer -} - -func (d retryer) RetryRules(r *request.Request) time.Duration { - switch r.Operation.Name { - case opModifyNetworkInterfaceAttribute: - fallthrough - case opAssignPrivateIpAddresses: - return customRetryRule(r) - default: - return d.DefaultRetryer.RetryRules(r) - } -} - -func customRetryRule(r *request.Request) time.Duration { - retryTimes := []time.Duration{ - time.Second, - 3 * time.Second, - 5 * time.Second, - } - - count := r.RetryCount - if count >= len(retryTimes) { - count = len(retryTimes) - 1 - } - - minTime := int(retryTimes[count]) - return time.Duration(sdkrand.SeededRand.Intn(minTime) + minTime) -} - -func setCustomRetryer(c *client.Client) { - maxRetries := aws.IntValue(c.Config.MaxRetries) - if c.Config.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { - maxRetries = 3 - } - - c.Retryer = retryer{ - DefaultRetryer: client.DefaultRetryer{ - NumMaxRetries: maxRetries, - }, - } -} - -func init() { - initClient = func(c *client.Client) { - if c.Config.Retryer == nil { - // Only override the retryer with a custom one if the config - // does not already contain a retryer - setCustomRetryer(c) - } - } - initRequest = func(r *request.Request) { - if r.Operation.Name == opCopySnapshot { // fill the PresignedURL parameter - r.Handlers.Build.PushFront(fillPresignedURL) - } - } -} - -func fillPresignedURL(r *request.Request) { - if !r.ParamsFilled() { - return - } - - origParams := r.Params.(*CopySnapshotInput) - - // Stop if PresignedURL/DestinationRegion is set - if origParams.PresignedUrl != nil || origParams.DestinationRegion != nil { - return - } - - origParams.DestinationRegion = r.Config.Region - newParams := awsutil.CopyOf(r.Params).(*CopySnapshotInput) - - // Create a new request based on the existing request. We will use this to - // presign the CopySnapshot request against the source region. - cfg := r.Config.Copy(aws.NewConfig(). - WithEndpoint(""). - WithRegion(aws.StringValue(origParams.SourceRegion))) - - clientInfo := r.ClientInfo - resolved, err := r.Config.EndpointResolver.EndpointFor( - clientInfo.ServiceName, aws.StringValue(cfg.Region), - func(opt *endpoints.Options) { - opt.DisableSSL = aws.BoolValue(cfg.DisableSSL) - opt.UseDualStack = aws.BoolValue(cfg.UseDualStack) - }, - ) - if err != nil { - r.Error = err - return - } - - clientInfo.Endpoint = resolved.URL - clientInfo.SigningRegion = resolved.SigningRegion - - // Presign a CopySnapshot request with modified params - req := request.New(*cfg, clientInfo, r.Handlers, r.Retryer, r.Operation, newParams, r.Data) - url, err := req.Presign(5 * time.Minute) // 5 minutes should be enough. - if err != nil { // bubble error back up to original request - r.Error = err - return - } - - // We have our URL, set it on params - origParams.PresignedUrl = &url -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go deleted file mode 100644 index 909e05a14..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/doc.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ec2 provides the client and types for making API -// requests to Amazon Elastic Compute Cloud. -// -// Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity -// in the AWS Cloud. Using Amazon EC2 eliminates the need to invest in hardware -// up front, so you can develop and deploy applications faster. -// -// See https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15 for more information on this service. -// -// See ec2 package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/ -// -// Using the Client -// -// To contact Amazon Elastic Compute Cloud with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Elastic Compute Cloud client EC2 for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#New -package ec2 diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go deleted file mode 100644 index 3d61d7e35..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ec2 diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go deleted file mode 100644 index ba4433d38..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ec2 - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/private/protocol/ec2query" -) - -// EC2 provides the API operation methods for making requests to -// Amazon Elastic Compute Cloud. See this package's package overview docs -// for details on the service. -// -// EC2 methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type EC2 struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ec2" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the EC2 client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// // Create a EC2 client from just a session. -// svc := ec2.New(mySession) -// -// // Create a EC2 client with additional configuration -// svc := ec2.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2 { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EC2 { - svc := &EC2{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-11-15", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a EC2 operation and runs any -// custom request initialization. -func (c *EC2) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go deleted file mode 100644 index 0469f0f01..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go +++ /dev/null @@ -1,1626 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ec2 - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilBundleTaskComplete uses the Amazon EC2 API operation -// DescribeBundleTasks to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error { - return c.WaitUntilBundleTaskCompleteWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilBundleTaskCompleteWithContext is an extended version of WaitUntilBundleTaskComplete. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilBundleTaskCompleteWithContext(ctx aws.Context, input *DescribeBundleTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilBundleTaskComplete", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "BundleTasks[].State", - Expected: "complete", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "BundleTasks[].State", - Expected: "failed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeBundleTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeBundleTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilConversionTaskCancelled uses the Amazon EC2 API operation -// DescribeConversionTasks to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInput) error { - return c.WaitUntilConversionTaskCancelledWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilConversionTaskCancelledWithContext is an extended version of WaitUntilConversionTaskCancelled. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilConversionTaskCancelledWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilConversionTaskCancelled", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "cancelled", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeConversionTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeConversionTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilConversionTaskCompleted uses the Amazon EC2 API operation -// DescribeConversionTasks to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInput) error { - return c.WaitUntilConversionTaskCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilConversionTaskCompletedWithContext is an extended version of WaitUntilConversionTaskCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilConversionTaskCompletedWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilConversionTaskCompleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "completed", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "cancelled", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "cancelling", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeConversionTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeConversionTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilConversionTaskDeleted uses the Amazon EC2 API operation -// DescribeConversionTasks to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput) error { - return c.WaitUntilConversionTaskDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilConversionTaskDeletedWithContext is an extended version of WaitUntilConversionTaskDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilConversionTaskDeletedWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilConversionTaskDeleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "deleted", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeConversionTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeConversionTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilCustomerGatewayAvailable uses the Amazon EC2 API operation -// DescribeCustomerGateways to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error { - return c.WaitUntilCustomerGatewayAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilCustomerGatewayAvailableWithContext is an extended version of WaitUntilCustomerGatewayAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilCustomerGatewayAvailableWithContext(ctx aws.Context, input *DescribeCustomerGatewaysInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilCustomerGatewayAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "CustomerGateways[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "CustomerGateways[].State", - Expected: "deleted", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "CustomerGateways[].State", - Expected: "deleting", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeCustomerGatewaysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeCustomerGatewaysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilExportTaskCancelled uses the Amazon EC2 API operation -// DescribeExportTasks to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) error { - return c.WaitUntilExportTaskCancelledWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilExportTaskCancelledWithContext is an extended version of WaitUntilExportTaskCancelled. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilExportTaskCancelledWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilExportTaskCancelled", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ExportTasks[].State", - Expected: "cancelled", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeExportTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeExportTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilExportTaskCompleted uses the Amazon EC2 API operation -// DescribeExportTasks to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) error { - return c.WaitUntilExportTaskCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilExportTaskCompletedWithContext is an extended version of WaitUntilExportTaskCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilExportTaskCompletedWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilExportTaskCompleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ExportTasks[].State", - Expected: "completed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeExportTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeExportTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilImageAvailable uses the Amazon EC2 API operation -// DescribeImages to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error { - return c.WaitUntilImageAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilImageAvailableWithContext is an extended version of WaitUntilImageAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilImageAvailableWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilImageAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Images[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Images[].State", - Expected: "failed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeImagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeImagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilImageExists uses the Amazon EC2 API operation -// DescribeImages to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilImageExists(input *DescribeImagesInput) error { - return c.WaitUntilImageExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilImageExistsWithContext is an extended version of WaitUntilImageExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilImageExistsWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilImageExists", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(Images[]) > `0`", - Expected: true, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidAMIID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeImagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeImagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceExists uses the Amazon EC2 API operation -// DescribeInstances to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error { - return c.WaitUntilInstanceExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceExistsWithContext is an extended version of WaitUntilInstanceExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilInstanceExistsWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceExists", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(Reservations[]) > `0`", - Expected: true, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidInstanceID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceRunning uses the Amazon EC2 API operation -// DescribeInstances to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error { - return c.WaitUntilInstanceRunningWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceRunningWithContext is an extended version of WaitUntilInstanceRunning. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilInstanceRunningWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceRunning", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "running", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "shutting-down", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "stopping", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidInstanceID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceStatusOk uses the Amazon EC2 API operation -// DescribeInstanceStatus to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error { - return c.WaitUntilInstanceStatusOkWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceStatusOkWithContext is an extended version of WaitUntilInstanceStatusOk. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilInstanceStatusOkWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceStatusOk", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "InstanceStatuses[].InstanceStatus.Status", - Expected: "ok", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidInstanceID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstanceStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstanceStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceStopped uses the Amazon EC2 API operation -// DescribeInstances to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error { - return c.WaitUntilInstanceStoppedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceStoppedWithContext is an extended version of WaitUntilInstanceStopped. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilInstanceStoppedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceStopped", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "stopped", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "pending", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceTerminated uses the Amazon EC2 API operation -// DescribeInstances to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error { - return c.WaitUntilInstanceTerminatedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceTerminatedWithContext is an extended version of WaitUntilInstanceTerminated. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilInstanceTerminatedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceTerminated", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "pending", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "stopping", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilKeyPairExists uses the Amazon EC2 API operation -// DescribeKeyPairs to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error { - return c.WaitUntilKeyPairExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilKeyPairExistsWithContext is an extended version of WaitUntilKeyPairExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilKeyPairExistsWithContext(ctx aws.Context, input *DescribeKeyPairsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilKeyPairExists", - MaxAttempts: 6, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(KeyPairs[].KeyName) > `0`", - Expected: true, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidKeyPair.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeKeyPairsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeKeyPairsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilNatGatewayAvailable uses the Amazon EC2 API operation -// DescribeNatGateways to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilNatGatewayAvailable(input *DescribeNatGatewaysInput) error { - return c.WaitUntilNatGatewayAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilNatGatewayAvailableWithContext is an extended version of WaitUntilNatGatewayAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilNatGatewayAvailableWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilNatGatewayAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "NatGateways[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", - Expected: "failed", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", - Expected: "deleting", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", - Expected: "deleted", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "NatGatewayNotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeNatGatewaysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeNatGatewaysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilNetworkInterfaceAvailable uses the Amazon EC2 API operation -// DescribeNetworkInterfaces to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error { - return c.WaitUntilNetworkInterfaceAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilNetworkInterfaceAvailableWithContext is an extended version of WaitUntilNetworkInterfaceAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilNetworkInterfaceAvailableWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilNetworkInterfaceAvailable", - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(20 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "NetworkInterfaces[].Status", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidNetworkInterfaceID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeNetworkInterfacesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeNetworkInterfacesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilPasswordDataAvailable uses the Amazon EC2 API operation -// GetPasswordData to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error { - return c.WaitUntilPasswordDataAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilPasswordDataAvailableWithContext is an extended version of WaitUntilPasswordDataAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilPasswordDataAvailableWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilPasswordDataAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(PasswordData) > `0`", - Expected: true, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetPasswordDataInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetPasswordDataRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilSnapshotCompleted uses the Amazon EC2 API operation -// DescribeSnapshots to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error { - return c.WaitUntilSnapshotCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilSnapshotCompletedWithContext is an extended version of WaitUntilSnapshotCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilSnapshotCompletedWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilSnapshotCompleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Snapshots[].State", - Expected: "completed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilSpotInstanceRequestFulfilled uses the Amazon EC2 API operation -// DescribeSpotInstanceRequests to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceRequestsInput) error { - return c.WaitUntilSpotInstanceRequestFulfilledWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilSpotInstanceRequestFulfilledWithContext is an extended version of WaitUntilSpotInstanceRequestFulfilled. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilSpotInstanceRequestFulfilledWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilSpotInstanceRequestFulfilled", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "fulfilled", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "request-canceled-and-instance-running", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "schedule-expired", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "canceled-before-fulfillment", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "bad-parameters", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "system-error", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidSpotInstanceRequestID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeSpotInstanceRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilSubnetAvailable uses the Amazon EC2 API operation -// DescribeSubnets to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error { - return c.WaitUntilSubnetAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilSubnetAvailableWithContext is an extended version of WaitUntilSubnetAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilSubnetAvailableWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilSubnetAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Subnets[].State", - Expected: "available", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeSubnetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSubnetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilSystemStatusOk uses the Amazon EC2 API operation -// DescribeInstanceStatus to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error { - return c.WaitUntilSystemStatusOkWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilSystemStatusOkWithContext is an extended version of WaitUntilSystemStatusOk. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilSystemStatusOkWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilSystemStatusOk", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "InstanceStatuses[].SystemStatus.Status", - Expected: "ok", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstanceStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstanceStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVolumeAvailable uses the Amazon EC2 API operation -// DescribeVolumes to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error { - return c.WaitUntilVolumeAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVolumeAvailableWithContext is an extended version of WaitUntilVolumeAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVolumeAvailableWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVolumeAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Volumes[].State", - Expected: "deleted", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVolumeDeleted uses the Amazon EC2 API operation -// DescribeVolumes to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error { - return c.WaitUntilVolumeDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVolumeDeletedWithContext is an extended version of WaitUntilVolumeDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVolumeDeletedWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVolumeDeleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", - Expected: "deleted", - }, - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidVolume.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVolumeInUse uses the Amazon EC2 API operation -// DescribeVolumes to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error { - return c.WaitUntilVolumeInUseWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVolumeInUseWithContext is an extended version of WaitUntilVolumeInUse. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVolumeInUseWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVolumeInUse", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", - Expected: "in-use", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Volumes[].State", - Expected: "deleted", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpcAvailable uses the Amazon EC2 API operation -// DescribeVpcs to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error { - return c.WaitUntilVpcAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpcAvailableWithContext is an extended version of WaitUntilVpcAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVpcAvailableWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpcAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Vpcs[].State", - Expected: "available", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpcsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpcExists uses the Amazon EC2 API operation -// DescribeVpcs to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVpcExists(input *DescribeVpcsInput) error { - return c.WaitUntilVpcExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpcExistsWithContext is an extended version of WaitUntilVpcExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVpcExistsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpcExists", - MaxAttempts: 5, - Delay: request.ConstantWaiterDelay(1 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidVpcID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpcsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpcPeeringConnectionDeleted uses the Amazon EC2 API operation -// DescribeVpcPeeringConnections to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVpcPeeringConnectionDeleted(input *DescribeVpcPeeringConnectionsInput) error { - return c.WaitUntilVpcPeeringConnectionDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpcPeeringConnectionDeletedWithContext is an extended version of WaitUntilVpcPeeringConnectionDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVpcPeeringConnectionDeletedWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpcPeeringConnectionDeleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "VpcPeeringConnections[].Status.Code", - Expected: "deleted", - }, - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidVpcPeeringConnectionID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpcPeeringConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpcPeeringConnectionExists uses the Amazon EC2 API operation -// DescribeVpcPeeringConnections to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVpcPeeringConnectionExists(input *DescribeVpcPeeringConnectionsInput) error { - return c.WaitUntilVpcPeeringConnectionExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpcPeeringConnectionExistsWithContext is an extended version of WaitUntilVpcPeeringConnectionExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVpcPeeringConnectionExistsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpcPeeringConnectionExists", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidVpcPeeringConnectionID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpcPeeringConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpnConnectionAvailable uses the Amazon EC2 API operation -// DescribeVpnConnections to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput) error { - return c.WaitUntilVpnConnectionAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpnConnectionAvailableWithContext is an extended version of WaitUntilVpnConnectionAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVpnConnectionAvailableWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpnConnectionAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "VpnConnections[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", - Expected: "deleting", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", - Expected: "deleted", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpnConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpnConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpnConnectionDeleted uses the Amazon EC2 API operation -// DescribeVpnConnections to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *EC2) WaitUntilVpnConnectionDeleted(input *DescribeVpnConnectionsInput) error { - return c.WaitUntilVpnConnectionDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpnConnectionDeletedWithContext is an extended version of WaitUntilVpnConnectionDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WaitUntilVpnConnectionDeletedWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpnConnectionDeleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "VpnConnections[].State", - Expected: "deleted", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", - Expected: "pending", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpnConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpnConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go deleted file mode 100644 index d0b0b4dba..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go +++ /dev/null @@ -1,11156 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opCreateCluster = "CreateCluster" - -// CreateClusterRequest generates a "aws/request.Request" representing the -// client's request for the CreateCluster operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateCluster for more information on using the CreateCluster -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateClusterRequest method. -// req, resp := client.CreateClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateCluster -func (c *ECS) CreateClusterRequest(input *CreateClusterInput) (req *request.Request, output *CreateClusterOutput) { - op := &request.Operation{ - Name: opCreateCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateClusterInput{} - } - - output = &CreateClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCluster API operation for Amazon EC2 Container Service. -// -// Creates a new Amazon ECS cluster. By default, your account receives a default -// cluster when you launch your first container instance. However, you can create -// your own cluster with a unique name with the CreateCluster action. -// -// When you call the CreateCluster API operation, Amazon ECS attempts to create -// the service-linked role for your account so that required resources in other -// AWS services can be managed on your behalf. However, if the IAM user that -// makes the call does not have permissions to create the service-linked role, -// it is not created. For more information, see Using Service-Linked Roles for -// Amazon ECS (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation CreateCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateCluster -func (c *ECS) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) { - req, out := c.CreateClusterRequest(input) - return out, req.Send() -} - -// CreateClusterWithContext is the same as CreateCluster with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCluster for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) CreateClusterWithContext(ctx aws.Context, input *CreateClusterInput, opts ...request.Option) (*CreateClusterOutput, error) { - req, out := c.CreateClusterRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateService = "CreateService" - -// CreateServiceRequest generates a "aws/request.Request" representing the -// client's request for the CreateService operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateService for more information on using the CreateService -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the CreateServiceRequest method. -// req, resp := client.CreateServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateService -func (c *ECS) CreateServiceRequest(input *CreateServiceInput) (req *request.Request, output *CreateServiceOutput) { - op := &request.Operation{ - Name: opCreateService, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateServiceInput{} - } - - output = &CreateServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateService API operation for Amazon EC2 Container Service. -// -// Runs and maintains a desired number of tasks from a specified task definition. -// If the number of tasks running in a service drops below desiredCount, Amazon -// ECS spawns another copy of the task in the specified cluster. To update an -// existing service, see UpdateService. -// -// In addition to maintaining the desired count of tasks in your service, you -// can optionally run your service behind a load balancer. The load balancer -// distributes traffic across the tasks that are associated with the service. -// For more information, see Service Load Balancing (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// You can optionally specify a deployment configuration for your service. During -// a deployment, the service scheduler uses the minimumHealthyPercent and maximumPercent -// parameters to determine the deployment strategy. The deployment is triggered -// by changing the task definition or the desired count of a service with an -// UpdateService operation. -// -// The minimumHealthyPercent represents a lower limit on the number of your -// service's tasks that must remain in the RUNNING state during a deployment, -// as a percentage of the desiredCount (rounded up to the nearest integer). -// This parameter enables you to deploy without using additional cluster capacity. -// For example, if your service has a desiredCount of four tasks and a minimumHealthyPercent -// of 50%, the scheduler can stop two existing tasks to free up cluster capacity -// before starting two new tasks. Tasks for services that do not use a load -// balancer are considered healthy if they are in the RUNNING state. Tasks for -// services that do use a load balancer are considered healthy if they are in -// the RUNNING state and the container instance they are hosted on is reported -// as healthy by the load balancer. The default value for minimumHealthyPercent -// is 50% in the console and 100% for the AWS CLI, the AWS SDKs, and the APIs. -// -// The maximumPercent parameter represents an upper limit on the number of your -// service's tasks that are allowed in the RUNNING or PENDING state during a -// deployment, as a percentage of the desiredCount (rounded down to the nearest -// integer). This parameter enables you to define the deployment batch size. -// For example, if your service has a desiredCount of four tasks and a maximumPercent -// value of 200%, the scheduler can start four new tasks before stopping the -// four older tasks (provided that the cluster resources required to do this -// are available). The default value for maximumPercent is 200%. -// -// When the service scheduler launches new tasks, it determines task placement -// in your cluster using the following logic: -// -// * Determine which of the container instances in your cluster can support -// your service's task definition (for example, they have the required CPU, -// memory, ports, and container instance attributes). -// -// * By default, the service scheduler attempts to balance tasks across Availability -// Zones in this manner (although you can choose a different placement strategy) -// with the placementStrategy parameter): -// -// Sort the valid container instances, giving priority to instances that have -// the fewest number of running tasks for this service in their respective -// Availability Zone. For example, if zone A has one running service task -// and zones B and C each have zero, valid container instances in either -// zone B or C are considered optimal for placement. -// -// Place the new service task on a valid container instance in an optimal Availability -// Zone (based on the previous steps), favoring container instances with -// the fewest number of running tasks for this service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation CreateService for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" -// The specified task is not supported in this region. -// -// * ErrCodePlatformUnknownException "PlatformUnknownException" -// The specified platform version does not exist. -// -// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException" -// The specified platform version does not satisfy the task definition’s required -// capabilities. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have authorization to perform the requested action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateService -func (c *ECS) CreateService(input *CreateServiceInput) (*CreateServiceOutput, error) { - req, out := c.CreateServiceRequest(input) - return out, req.Send() -} - -// CreateServiceWithContext is the same as CreateService with the addition of -// the ability to pass a context and additional request options. -// -// See CreateService for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) CreateServiceWithContext(ctx aws.Context, input *CreateServiceInput, opts ...request.Option) (*CreateServiceOutput, error) { - req, out := c.CreateServiceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAttributes = "DeleteAttributes" - -// DeleteAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAttributes operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteAttributes for more information on using the DeleteAttributes -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteAttributesRequest method. -// req, resp := client.DeleteAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAttributes -func (c *ECS) DeleteAttributesRequest(input *DeleteAttributesInput) (req *request.Request, output *DeleteAttributesOutput) { - op := &request.Operation{ - Name: opDeleteAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAttributesInput{} - } - - output = &DeleteAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteAttributes API operation for Amazon EC2 Container Service. -// -// Deletes one or more custom attributes from an Amazon ECS resource. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DeleteAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeTargetNotFoundException "TargetNotFoundException" -// The specified target could not be found. You can view your available container -// instances with ListContainerInstances. Amazon ECS container instances are -// cluster-specific and region-specific. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAttributes -func (c *ECS) DeleteAttributes(input *DeleteAttributesInput) (*DeleteAttributesOutput, error) { - req, out := c.DeleteAttributesRequest(input) - return out, req.Send() -} - -// DeleteAttributesWithContext is the same as DeleteAttributes with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAttributes for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DeleteAttributesWithContext(ctx aws.Context, input *DeleteAttributesInput, opts ...request.Option) (*DeleteAttributesOutput, error) { - req, out := c.DeleteAttributesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCluster = "DeleteCluster" - -// DeleteClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCluster operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteCluster for more information on using the DeleteCluster -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteClusterRequest method. -// req, resp := client.DeleteClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteCluster -func (c *ECS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { - op := &request.Operation{ - Name: opDeleteCluster, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteClusterInput{} - } - - output = &DeleteClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCluster API operation for Amazon EC2 Container Service. -// -// Deletes the specified cluster. You must deregister all container instances -// from this cluster before you may delete it. You can list the container instances -// in a cluster with ListContainerInstances and deregister them with DeregisterContainerInstance. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DeleteCluster for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeClusterContainsContainerInstancesException "ClusterContainsContainerInstancesException" -// You cannot delete a cluster that has registered container instances. You -// must first deregister the container instances before you can delete the cluster. -// For more information, see DeregisterContainerInstance. -// -// * ErrCodeClusterContainsServicesException "ClusterContainsServicesException" -// You cannot delete a cluster that contains services. You must first update -// the service to reduce its desired task count to 0 and then delete the service. -// For more information, see UpdateService and DeleteService. -// -// * ErrCodeClusterContainsTasksException "ClusterContainsTasksException" -// You cannot delete a cluster that has active tasks. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteCluster -func (c *ECS) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) - return out, req.Send() -} - -// DeleteClusterWithContext is the same as DeleteCluster with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCluster for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteService = "DeleteService" - -// DeleteServiceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteService operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteService for more information on using the DeleteService -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeleteServiceRequest method. -// req, resp := client.DeleteServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteService -func (c *ECS) DeleteServiceRequest(input *DeleteServiceInput) (req *request.Request, output *DeleteServiceOutput) { - op := &request.Operation{ - Name: opDeleteService, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteServiceInput{} - } - - output = &DeleteServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteService API operation for Amazon EC2 Container Service. -// -// Deletes a specified service within a cluster. You can delete a service if -// you have no running tasks in it and the desired task count is zero. If the -// service is actively maintaining tasks, you cannot delete it, and you must -// update the service to a desired task count of zero. For more information, -// see UpdateService. -// -// When you delete a service, if there are still running tasks that require -// cleanup, the service status moves from ACTIVE to DRAINING, and the service -// is no longer visible in the console or in ListServices API operations. After -// the tasks have stopped, then the service status moves from DRAINING to INACTIVE. -// Services in the DRAINING or INACTIVE status can still be viewed with DescribeServices -// API operations. However, in the future, INACTIVE services may be cleaned -// up and purged from Amazon ECS record keeping, and DescribeServices API operations -// on those services return a ServiceNotFoundException error. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DeleteService for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" -// The specified service could not be found. You can view your available services -// with ListServices. Amazon ECS services are cluster-specific and region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteService -func (c *ECS) DeleteService(input *DeleteServiceInput) (*DeleteServiceOutput, error) { - req, out := c.DeleteServiceRequest(input) - return out, req.Send() -} - -// DeleteServiceWithContext is the same as DeleteService with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteService for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DeleteServiceWithContext(ctx aws.Context, input *DeleteServiceInput, opts ...request.Option) (*DeleteServiceOutput, error) { - req, out := c.DeleteServiceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterContainerInstance = "DeregisterContainerInstance" - -// DeregisterContainerInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterContainerInstance operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeregisterContainerInstance for more information on using the DeregisterContainerInstance -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeregisterContainerInstanceRequest method. -// req, resp := client.DeregisterContainerInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterContainerInstance -func (c *ECS) DeregisterContainerInstanceRequest(input *DeregisterContainerInstanceInput) (req *request.Request, output *DeregisterContainerInstanceOutput) { - op := &request.Operation{ - Name: opDeregisterContainerInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterContainerInstanceInput{} - } - - output = &DeregisterContainerInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterContainerInstance API operation for Amazon EC2 Container Service. -// -// Deregisters an Amazon ECS container instance from the specified cluster. -// This instance is no longer available to run tasks. -// -// If you intend to use the container instance for some other purpose after -// deregistration, you should stop all of the tasks running on the container -// instance before deregistration. That prevents any orphaned tasks from consuming -// resources. -// -// Deregistering a container instance removes the instance from a cluster, but -// it does not terminate the EC2 instance; if you are finished using the instance, -// be sure to terminate it in the Amazon EC2 console to stop billing. -// -// If you terminate a running container instance, Amazon ECS automatically deregisters -// the instance from your cluster (stopped container instances or instances -// with disconnected agents are not automatically deregistered when terminated). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DeregisterContainerInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterContainerInstance -func (c *ECS) DeregisterContainerInstance(input *DeregisterContainerInstanceInput) (*DeregisterContainerInstanceOutput, error) { - req, out := c.DeregisterContainerInstanceRequest(input) - return out, req.Send() -} - -// DeregisterContainerInstanceWithContext is the same as DeregisterContainerInstance with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterContainerInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DeregisterContainerInstanceWithContext(ctx aws.Context, input *DeregisterContainerInstanceInput, opts ...request.Option) (*DeregisterContainerInstanceOutput, error) { - req, out := c.DeregisterContainerInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterTaskDefinition = "DeregisterTaskDefinition" - -// DeregisterTaskDefinitionRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterTaskDefinition operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeregisterTaskDefinition for more information on using the DeregisterTaskDefinition -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DeregisterTaskDefinitionRequest method. -// req, resp := client.DeregisterTaskDefinitionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterTaskDefinition -func (c *ECS) DeregisterTaskDefinitionRequest(input *DeregisterTaskDefinitionInput) (req *request.Request, output *DeregisterTaskDefinitionOutput) { - op := &request.Operation{ - Name: opDeregisterTaskDefinition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterTaskDefinitionInput{} - } - - output = &DeregisterTaskDefinitionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterTaskDefinition API operation for Amazon EC2 Container Service. -// -// Deregisters the specified task definition by family and revision. Upon deregistration, -// the task definition is marked as INACTIVE. Existing tasks and services that -// reference an INACTIVE task definition continue to run without disruption. -// Existing services that reference an INACTIVE task definition can still scale -// up or down by modifying the service's desired count. -// -// You cannot use an INACTIVE task definition to run new tasks or create new -// services, and you cannot update an existing service to reference an INACTIVE -// task definition (although there may be up to a 10-minute window following -// deregistration where these restrictions have not yet taken effect). -// -// At this time, INACTIVE task definitions remain discoverable in your account -// indefinitely; however, this behavior is subject to change in the future, -// so you should not rely on INACTIVE task definitions persisting beyond the -// lifecycle of any associated tasks and services. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DeregisterTaskDefinition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterTaskDefinition -func (c *ECS) DeregisterTaskDefinition(input *DeregisterTaskDefinitionInput) (*DeregisterTaskDefinitionOutput, error) { - req, out := c.DeregisterTaskDefinitionRequest(input) - return out, req.Send() -} - -// DeregisterTaskDefinitionWithContext is the same as DeregisterTaskDefinition with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterTaskDefinition for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DeregisterTaskDefinitionWithContext(ctx aws.Context, input *DeregisterTaskDefinitionInput, opts ...request.Option) (*DeregisterTaskDefinitionOutput, error) { - req, out := c.DeregisterTaskDefinitionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeClusters = "DescribeClusters" - -// DescribeClustersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClusters operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeClusters for more information on using the DescribeClusters -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeClustersRequest method. -// req, resp := client.DescribeClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeClusters -func (c *ECS) DescribeClustersRequest(input *DescribeClustersInput) (req *request.Request, output *DescribeClustersOutput) { - op := &request.Operation{ - Name: opDescribeClusters, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeClustersInput{} - } - - output = &DescribeClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClusters API operation for Amazon EC2 Container Service. -// -// Describes one or more of your clusters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeClusters -func (c *ECS) DescribeClusters(input *DescribeClustersInput) (*DescribeClustersOutput, error) { - req, out := c.DescribeClustersRequest(input) - return out, req.Send() -} - -// DescribeClustersWithContext is the same as DescribeClusters with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeClusters for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DescribeClustersWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.Option) (*DescribeClustersOutput, error) { - req, out := c.DescribeClustersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeContainerInstances = "DescribeContainerInstances" - -// DescribeContainerInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeContainerInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeContainerInstances for more information on using the DescribeContainerInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeContainerInstancesRequest method. -// req, resp := client.DescribeContainerInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeContainerInstances -func (c *ECS) DescribeContainerInstancesRequest(input *DescribeContainerInstancesInput) (req *request.Request, output *DescribeContainerInstancesOutput) { - op := &request.Operation{ - Name: opDescribeContainerInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeContainerInstancesInput{} - } - - output = &DescribeContainerInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeContainerInstances API operation for Amazon EC2 Container Service. -// -// Describes Amazon Elastic Container Service container instances. Returns metadata -// about registered and remaining resources on each container instance requested. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeContainerInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeContainerInstances -func (c *ECS) DescribeContainerInstances(input *DescribeContainerInstancesInput) (*DescribeContainerInstancesOutput, error) { - req, out := c.DescribeContainerInstancesRequest(input) - return out, req.Send() -} - -// DescribeContainerInstancesWithContext is the same as DescribeContainerInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeContainerInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DescribeContainerInstancesWithContext(ctx aws.Context, input *DescribeContainerInstancesInput, opts ...request.Option) (*DescribeContainerInstancesOutput, error) { - req, out := c.DescribeContainerInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeServices = "DescribeServices" - -// DescribeServicesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeServices operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeServices for more information on using the DescribeServices -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeServicesRequest method. -// req, resp := client.DescribeServicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeServices -func (c *ECS) DescribeServicesRequest(input *DescribeServicesInput) (req *request.Request, output *DescribeServicesOutput) { - op := &request.Operation{ - Name: opDescribeServices, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeServicesInput{} - } - - output = &DescribeServicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeServices API operation for Amazon EC2 Container Service. -// -// Describes the specified services running in your cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeServices for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeServices -func (c *ECS) DescribeServices(input *DescribeServicesInput) (*DescribeServicesOutput, error) { - req, out := c.DescribeServicesRequest(input) - return out, req.Send() -} - -// DescribeServicesWithContext is the same as DescribeServices with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeServices for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DescribeServicesWithContext(ctx aws.Context, input *DescribeServicesInput, opts ...request.Option) (*DescribeServicesOutput, error) { - req, out := c.DescribeServicesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTaskDefinition = "DescribeTaskDefinition" - -// DescribeTaskDefinitionRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTaskDefinition operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeTaskDefinition for more information on using the DescribeTaskDefinition -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeTaskDefinitionRequest method. -// req, resp := client.DescribeTaskDefinitionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskDefinition -func (c *ECS) DescribeTaskDefinitionRequest(input *DescribeTaskDefinitionInput) (req *request.Request, output *DescribeTaskDefinitionOutput) { - op := &request.Operation{ - Name: opDescribeTaskDefinition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTaskDefinitionInput{} - } - - output = &DescribeTaskDefinitionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTaskDefinition API operation for Amazon EC2 Container Service. -// -// Describes a task definition. You can specify a family and revision to find -// information about a specific task definition, or you can simply specify the -// family to find the latest ACTIVE revision in that family. -// -// You can only describe INACTIVE task definitions while an active task or service -// references them. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeTaskDefinition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskDefinition -func (c *ECS) DescribeTaskDefinition(input *DescribeTaskDefinitionInput) (*DescribeTaskDefinitionOutput, error) { - req, out := c.DescribeTaskDefinitionRequest(input) - return out, req.Send() -} - -// DescribeTaskDefinitionWithContext is the same as DescribeTaskDefinition with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTaskDefinition for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DescribeTaskDefinitionWithContext(ctx aws.Context, input *DescribeTaskDefinitionInput, opts ...request.Option) (*DescribeTaskDefinitionOutput, error) { - req, out := c.DescribeTaskDefinitionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTasks = "DescribeTasks" - -// DescribeTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTasks operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeTasks for more information on using the DescribeTasks -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeTasksRequest method. -// req, resp := client.DescribeTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTasks -func (c *ECS) DescribeTasksRequest(input *DescribeTasksInput) (req *request.Request, output *DescribeTasksOutput) { - op := &request.Operation{ - Name: opDescribeTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTasksInput{} - } - - output = &DescribeTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTasks API operation for Amazon EC2 Container Service. -// -// Describes a specified task or tasks. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DescribeTasks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTasks -func (c *ECS) DescribeTasks(input *DescribeTasksInput) (*DescribeTasksOutput, error) { - req, out := c.DescribeTasksRequest(input) - return out, req.Send() -} - -// DescribeTasksWithContext is the same as DescribeTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTasks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DescribeTasksWithContext(ctx aws.Context, input *DescribeTasksInput, opts ...request.Option) (*DescribeTasksOutput, error) { - req, out := c.DescribeTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDiscoverPollEndpoint = "DiscoverPollEndpoint" - -// DiscoverPollEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DiscoverPollEndpoint operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DiscoverPollEndpoint for more information on using the DiscoverPollEndpoint -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DiscoverPollEndpointRequest method. -// req, resp := client.DiscoverPollEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DiscoverPollEndpoint -func (c *ECS) DiscoverPollEndpointRequest(input *DiscoverPollEndpointInput) (req *request.Request, output *DiscoverPollEndpointOutput) { - op := &request.Operation{ - Name: opDiscoverPollEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DiscoverPollEndpointInput{} - } - - output = &DiscoverPollEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// DiscoverPollEndpoint API operation for Amazon EC2 Container Service. -// -// This action is only used by the Amazon ECS agent, and it is not intended -// for use outside of the agent. -// -// Returns an endpoint for the Amazon ECS agent to poll for updates. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation DiscoverPollEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DiscoverPollEndpoint -func (c *ECS) DiscoverPollEndpoint(input *DiscoverPollEndpointInput) (*DiscoverPollEndpointOutput, error) { - req, out := c.DiscoverPollEndpointRequest(input) - return out, req.Send() -} - -// DiscoverPollEndpointWithContext is the same as DiscoverPollEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See DiscoverPollEndpoint for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) DiscoverPollEndpointWithContext(ctx aws.Context, input *DiscoverPollEndpointInput, opts ...request.Option) (*DiscoverPollEndpointOutput, error) { - req, out := c.DiscoverPollEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAttributes = "ListAttributes" - -// ListAttributesRequest generates a "aws/request.Request" representing the -// client's request for the ListAttributes operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListAttributes for more information on using the ListAttributes -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListAttributesRequest method. -// req, resp := client.ListAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAttributes -func (c *ECS) ListAttributesRequest(input *ListAttributesInput) (req *request.Request, output *ListAttributesOutput) { - op := &request.Operation{ - Name: opListAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAttributesInput{} - } - - output = &ListAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAttributes API operation for Amazon EC2 Container Service. -// -// Lists the attributes for Amazon ECS resources within a specified target type -// and cluster. When you specify a target type and cluster, ListAttributes returns -// a list of attribute objects, one for each attribute on each resource. You -// can filter the list of results to a single attribute name to only return -// results that have that name. You can also filter the results by attribute -// name and value, for example, to see which container instances in a cluster -// are running a Linux AMI (ecs.os-type=linux). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAttributes -func (c *ECS) ListAttributes(input *ListAttributesInput) (*ListAttributesOutput, error) { - req, out := c.ListAttributesRequest(input) - return out, req.Send() -} - -// ListAttributesWithContext is the same as ListAttributes with the addition of -// the ability to pass a context and additional request options. -// -// See ListAttributes for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListAttributesWithContext(ctx aws.Context, input *ListAttributesInput, opts ...request.Option) (*ListAttributesOutput, error) { - req, out := c.ListAttributesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListClusters = "ListClusters" - -// ListClustersRequest generates a "aws/request.Request" representing the -// client's request for the ListClusters operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListClusters for more information on using the ListClusters -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListClustersRequest method. -// req, resp := client.ListClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListClusters -func (c *ECS) ListClustersRequest(input *ListClustersInput) (req *request.Request, output *ListClustersOutput) { - op := &request.Operation{ - Name: opListClusters, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListClustersInput{} - } - - output = &ListClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListClusters API operation for Amazon EC2 Container Service. -// -// Returns a list of existing clusters. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListClusters for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListClusters -func (c *ECS) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) - return out, req.Send() -} - -// ListClustersWithContext is the same as ListClusters with the addition of -// the ability to pass a context and additional request options. -// -// See ListClusters for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListClustersWithContext(ctx aws.Context, input *ListClustersInput, opts ...request.Option) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListClustersPages iterates over the pages of a ListClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListClusters method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListClusters operation. -// pageNum := 0 -// err := client.ListClustersPages(params, -// func(page *ListClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListClustersPages(input *ListClustersInput, fn func(*ListClustersOutput, bool) bool) error { - return c.ListClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListClustersPagesWithContext same as ListClustersPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersInput, fn func(*ListClustersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListContainerInstances = "ListContainerInstances" - -// ListContainerInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListContainerInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListContainerInstances for more information on using the ListContainerInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListContainerInstancesRequest method. -// req, resp := client.ListContainerInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListContainerInstances -func (c *ECS) ListContainerInstancesRequest(input *ListContainerInstancesInput) (req *request.Request, output *ListContainerInstancesOutput) { - op := &request.Operation{ - Name: opListContainerInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListContainerInstancesInput{} - } - - output = &ListContainerInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListContainerInstances API operation for Amazon EC2 Container Service. -// -// Returns a list of container instances in a specified cluster. You can filter -// the results of a ListContainerInstances operation with cluster query language -// statements inside the filter parameter. For more information, see Cluster -// Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListContainerInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListContainerInstances -func (c *ECS) ListContainerInstances(input *ListContainerInstancesInput) (*ListContainerInstancesOutput, error) { - req, out := c.ListContainerInstancesRequest(input) - return out, req.Send() -} - -// ListContainerInstancesWithContext is the same as ListContainerInstances with the addition of -// the ability to pass a context and additional request options. -// -// See ListContainerInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListContainerInstancesWithContext(ctx aws.Context, input *ListContainerInstancesInput, opts ...request.Option) (*ListContainerInstancesOutput, error) { - req, out := c.ListContainerInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListContainerInstancesPages iterates over the pages of a ListContainerInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListContainerInstances method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListContainerInstances operation. -// pageNum := 0 -// err := client.ListContainerInstancesPages(params, -// func(page *ListContainerInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListContainerInstancesPages(input *ListContainerInstancesInput, fn func(*ListContainerInstancesOutput, bool) bool) error { - return c.ListContainerInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListContainerInstancesPagesWithContext same as ListContainerInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListContainerInstancesPagesWithContext(ctx aws.Context, input *ListContainerInstancesInput, fn func(*ListContainerInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListContainerInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListContainerInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListContainerInstancesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListServices = "ListServices" - -// ListServicesRequest generates a "aws/request.Request" representing the -// client's request for the ListServices operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListServices for more information on using the ListServices -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListServicesRequest method. -// req, resp := client.ListServicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListServices -func (c *ECS) ListServicesRequest(input *ListServicesInput) (req *request.Request, output *ListServicesOutput) { - op := &request.Operation{ - Name: opListServices, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListServicesInput{} - } - - output = &ListServicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServices API operation for Amazon EC2 Container Service. -// -// Lists the services that are running in a specified cluster. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListServices for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListServices -func (c *ECS) ListServices(input *ListServicesInput) (*ListServicesOutput, error) { - req, out := c.ListServicesRequest(input) - return out, req.Send() -} - -// ListServicesWithContext is the same as ListServices with the addition of -// the ability to pass a context and additional request options. -// -// See ListServices for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListServicesWithContext(ctx aws.Context, input *ListServicesInput, opts ...request.Option) (*ListServicesOutput, error) { - req, out := c.ListServicesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListServicesPages iterates over the pages of a ListServices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServices method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListServices operation. -// pageNum := 0 -// err := client.ListServicesPages(params, -// func(page *ListServicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListServicesPages(input *ListServicesInput, fn func(*ListServicesOutput, bool) bool) error { - return c.ListServicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServicesPagesWithContext same as ListServicesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListServicesPagesWithContext(ctx aws.Context, input *ListServicesInput, fn func(*ListServicesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListServicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListServicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTaskDefinitionFamilies = "ListTaskDefinitionFamilies" - -// ListTaskDefinitionFamiliesRequest generates a "aws/request.Request" representing the -// client's request for the ListTaskDefinitionFamilies operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTaskDefinitionFamilies for more information on using the ListTaskDefinitionFamilies -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListTaskDefinitionFamiliesRequest method. -// req, resp := client.ListTaskDefinitionFamiliesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionFamilies -func (c *ECS) ListTaskDefinitionFamiliesRequest(input *ListTaskDefinitionFamiliesInput) (req *request.Request, output *ListTaskDefinitionFamiliesOutput) { - op := &request.Operation{ - Name: opListTaskDefinitionFamilies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTaskDefinitionFamiliesInput{} - } - - output = &ListTaskDefinitionFamiliesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTaskDefinitionFamilies API operation for Amazon EC2 Container Service. -// -// Returns a list of task definition families that are registered to your account -// (which may include task definition families that no longer have any ACTIVE -// task definition revisions). -// -// You can filter out task definition families that do not contain any ACTIVE -// task definition revisions by setting the status parameter to ACTIVE. You -// can also filter the results with the familyPrefix parameter. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListTaskDefinitionFamilies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitionFamilies -func (c *ECS) ListTaskDefinitionFamilies(input *ListTaskDefinitionFamiliesInput) (*ListTaskDefinitionFamiliesOutput, error) { - req, out := c.ListTaskDefinitionFamiliesRequest(input) - return out, req.Send() -} - -// ListTaskDefinitionFamiliesWithContext is the same as ListTaskDefinitionFamilies with the addition of -// the ability to pass a context and additional request options. -// -// See ListTaskDefinitionFamilies for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTaskDefinitionFamiliesWithContext(ctx aws.Context, input *ListTaskDefinitionFamiliesInput, opts ...request.Option) (*ListTaskDefinitionFamiliesOutput, error) { - req, out := c.ListTaskDefinitionFamiliesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTaskDefinitionFamiliesPages iterates over the pages of a ListTaskDefinitionFamilies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTaskDefinitionFamilies method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTaskDefinitionFamilies operation. -// pageNum := 0 -// err := client.ListTaskDefinitionFamiliesPages(params, -// func(page *ListTaskDefinitionFamiliesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTaskDefinitionFamiliesPages(input *ListTaskDefinitionFamiliesInput, fn func(*ListTaskDefinitionFamiliesOutput, bool) bool) error { - return c.ListTaskDefinitionFamiliesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTaskDefinitionFamiliesPagesWithContext same as ListTaskDefinitionFamiliesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTaskDefinitionFamiliesPagesWithContext(ctx aws.Context, input *ListTaskDefinitionFamiliesInput, fn func(*ListTaskDefinitionFamiliesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTaskDefinitionFamiliesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTaskDefinitionFamiliesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTaskDefinitionFamiliesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTaskDefinitions = "ListTaskDefinitions" - -// ListTaskDefinitionsRequest generates a "aws/request.Request" representing the -// client's request for the ListTaskDefinitions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTaskDefinitions for more information on using the ListTaskDefinitions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListTaskDefinitionsRequest method. -// req, resp := client.ListTaskDefinitionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitions -func (c *ECS) ListTaskDefinitionsRequest(input *ListTaskDefinitionsInput) (req *request.Request, output *ListTaskDefinitionsOutput) { - op := &request.Operation{ - Name: opListTaskDefinitions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTaskDefinitionsInput{} - } - - output = &ListTaskDefinitionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTaskDefinitions API operation for Amazon EC2 Container Service. -// -// Returns a list of task definitions that are registered to your account. You -// can filter the results by family name with the familyPrefix parameter or -// by status with the status parameter. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListTaskDefinitions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTaskDefinitions -func (c *ECS) ListTaskDefinitions(input *ListTaskDefinitionsInput) (*ListTaskDefinitionsOutput, error) { - req, out := c.ListTaskDefinitionsRequest(input) - return out, req.Send() -} - -// ListTaskDefinitionsWithContext is the same as ListTaskDefinitions with the addition of -// the ability to pass a context and additional request options. -// -// See ListTaskDefinitions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTaskDefinitionsWithContext(ctx aws.Context, input *ListTaskDefinitionsInput, opts ...request.Option) (*ListTaskDefinitionsOutput, error) { - req, out := c.ListTaskDefinitionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTaskDefinitionsPages iterates over the pages of a ListTaskDefinitions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTaskDefinitions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTaskDefinitions operation. -// pageNum := 0 -// err := client.ListTaskDefinitionsPages(params, -// func(page *ListTaskDefinitionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTaskDefinitionsPages(input *ListTaskDefinitionsInput, fn func(*ListTaskDefinitionsOutput, bool) bool) error { - return c.ListTaskDefinitionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTaskDefinitionsPagesWithContext same as ListTaskDefinitionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTaskDefinitionsPagesWithContext(ctx aws.Context, input *ListTaskDefinitionsInput, fn func(*ListTaskDefinitionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTaskDefinitionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTaskDefinitionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTaskDefinitionsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTasks = "ListTasks" - -// ListTasksRequest generates a "aws/request.Request" representing the -// client's request for the ListTasks operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTasks for more information on using the ListTasks -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the ListTasksRequest method. -// req, resp := client.ListTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasks -func (c *ECS) ListTasksRequest(input *ListTasksInput) (req *request.Request, output *ListTasksOutput) { - op := &request.Operation{ - Name: opListTasks, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTasksInput{} - } - - output = &ListTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTasks API operation for Amazon EC2 Container Service. -// -// Returns a list of tasks for a specified cluster. You can filter the results -// by family name, by a particular container instance, or by the desired status -// of the task with the family, containerInstance, and desiredStatus parameters. -// -// Recently stopped tasks might appear in the returned results. Currently, stopped -// tasks appear in the returned results for at least one hour. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation ListTasks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" -// The specified service could not be found. You can view your available services -// with ListServices. Amazon ECS services are cluster-specific and region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasks -func (c *ECS) ListTasks(input *ListTasksInput) (*ListTasksOutput, error) { - req, out := c.ListTasksRequest(input) - return out, req.Send() -} - -// ListTasksWithContext is the same as ListTasks with the addition of -// the ability to pass a context and additional request options. -// -// See ListTasks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTasksWithContext(ctx aws.Context, input *ListTasksInput, opts ...request.Option) (*ListTasksOutput, error) { - req, out := c.ListTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTasksPages iterates over the pages of a ListTasks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTasks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTasks operation. -// pageNum := 0 -// err := client.ListTasksPages(params, -// func(page *ListTasksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ECS) ListTasksPages(input *ListTasksInput, fn func(*ListTasksOutput, bool) bool) error { - return c.ListTasksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTasksPagesWithContext same as ListTasksPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) ListTasksPagesWithContext(ctx aws.Context, input *ListTasksInput, fn func(*ListTasksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTasksOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opPutAttributes = "PutAttributes" - -// PutAttributesRequest generates a "aws/request.Request" representing the -// client's request for the PutAttributes operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutAttributes for more information on using the PutAttributes -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the PutAttributesRequest method. -// req, resp := client.PutAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAttributes -func (c *ECS) PutAttributesRequest(input *PutAttributesInput) (req *request.Request, output *PutAttributesOutput) { - op := &request.Operation{ - Name: opPutAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutAttributesInput{} - } - - output = &PutAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutAttributes API operation for Amazon EC2 Container Service. -// -// Create or update an attribute on an Amazon ECS resource. If the attribute -// does not exist, it is created. If the attribute exists, its value is replaced -// with the specified value. To delete an attribute, use DeleteAttributes. For -// more information, see Attributes (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes) -// in the Amazon Elastic Container Service Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation PutAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeTargetNotFoundException "TargetNotFoundException" -// The specified target could not be found. You can view your available container -// instances with ListContainerInstances. Amazon ECS container instances are -// cluster-specific and region-specific. -// -// * ErrCodeAttributeLimitExceededException "AttributeLimitExceededException" -// You can apply up to 10 custom attributes per resource. You can view the attributes -// of a resource with ListAttributes. You can remove existing attributes on -// a resource with DeleteAttributes. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAttributes -func (c *ECS) PutAttributes(input *PutAttributesInput) (*PutAttributesOutput, error) { - req, out := c.PutAttributesRequest(input) - return out, req.Send() -} - -// PutAttributesWithContext is the same as PutAttributes with the addition of -// the ability to pass a context and additional request options. -// -// See PutAttributes for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) PutAttributesWithContext(ctx aws.Context, input *PutAttributesInput, opts ...request.Option) (*PutAttributesOutput, error) { - req, out := c.PutAttributesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterContainerInstance = "RegisterContainerInstance" - -// RegisterContainerInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RegisterContainerInstance operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RegisterContainerInstance for more information on using the RegisterContainerInstance -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RegisterContainerInstanceRequest method. -// req, resp := client.RegisterContainerInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterContainerInstance -func (c *ECS) RegisterContainerInstanceRequest(input *RegisterContainerInstanceInput) (req *request.Request, output *RegisterContainerInstanceOutput) { - op := &request.Operation{ - Name: opRegisterContainerInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterContainerInstanceInput{} - } - - output = &RegisterContainerInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterContainerInstance API operation for Amazon EC2 Container Service. -// -// This action is only used by the Amazon ECS agent, and it is not intended -// for use outside of the agent. -// -// Registers an EC2 instance into the specified cluster. This instance becomes -// available to place containers on. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation RegisterContainerInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterContainerInstance -func (c *ECS) RegisterContainerInstance(input *RegisterContainerInstanceInput) (*RegisterContainerInstanceOutput, error) { - req, out := c.RegisterContainerInstanceRequest(input) - return out, req.Send() -} - -// RegisterContainerInstanceWithContext is the same as RegisterContainerInstance with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterContainerInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) RegisterContainerInstanceWithContext(ctx aws.Context, input *RegisterContainerInstanceInput, opts ...request.Option) (*RegisterContainerInstanceOutput, error) { - req, out := c.RegisterContainerInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterTaskDefinition = "RegisterTaskDefinition" - -// RegisterTaskDefinitionRequest generates a "aws/request.Request" representing the -// client's request for the RegisterTaskDefinition operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RegisterTaskDefinition for more information on using the RegisterTaskDefinition -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RegisterTaskDefinitionRequest method. -// req, resp := client.RegisterTaskDefinitionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterTaskDefinition -func (c *ECS) RegisterTaskDefinitionRequest(input *RegisterTaskDefinitionInput) (req *request.Request, output *RegisterTaskDefinitionOutput) { - op := &request.Operation{ - Name: opRegisterTaskDefinition, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterTaskDefinitionInput{} - } - - output = &RegisterTaskDefinitionOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterTaskDefinition API operation for Amazon EC2 Container Service. -// -// Registers a new task definition from the supplied family and containerDefinitions. -// Optionally, you can add data volumes to your containers with the volumes -// parameter. For more information about task definition parameters and defaults, -// see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// You can specify an IAM role for your task with the taskRoleArn parameter. -// When you specify an IAM role for a task, its containers can then use the -// latest versions of the AWS CLI or SDKs to make API requests to the AWS services -// that are specified in the IAM policy associated with the role. For more information, -// see IAM Roles for Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// You can specify a Docker networking mode for the containers in your task -// definition with the networkMode parameter. The available network modes correspond -// to those described in Network settings (https://docs.docker.com/engine/reference/run/#/network-settings) -// in the Docker run reference. If you specify the awsvpc network mode, the -// task is allocated an Elastic Network Interface, and you must specify a NetworkConfiguration -// when you create a service or run a task with the task definition. For more -// information, see Task Networking (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation RegisterTaskDefinition for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterTaskDefinition -func (c *ECS) RegisterTaskDefinition(input *RegisterTaskDefinitionInput) (*RegisterTaskDefinitionOutput, error) { - req, out := c.RegisterTaskDefinitionRequest(input) - return out, req.Send() -} - -// RegisterTaskDefinitionWithContext is the same as RegisterTaskDefinition with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterTaskDefinition for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) RegisterTaskDefinitionWithContext(ctx aws.Context, input *RegisterTaskDefinitionInput, opts ...request.Option) (*RegisterTaskDefinitionOutput, error) { - req, out := c.RegisterTaskDefinitionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRunTask = "RunTask" - -// RunTaskRequest generates a "aws/request.Request" representing the -// client's request for the RunTask operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RunTask for more information on using the RunTask -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the RunTaskRequest method. -// req, resp := client.RunTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RunTask -func (c *ECS) RunTaskRequest(input *RunTaskInput) (req *request.Request, output *RunTaskOutput) { - op := &request.Operation{ - Name: opRunTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RunTaskInput{} - } - - output = &RunTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// RunTask API operation for Amazon EC2 Container Service. -// -// Starts a new task using the specified task definition. -// -// You can allow Amazon ECS to place tasks for you, or you can customize how -// Amazon ECS places tasks using placement constraints and placement strategies. -// For more information, see Scheduling Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// Alternatively, you can use StartTask to use your own scheduler or place tasks -// manually on specific container instances. -// -// The Amazon ECS API follows an eventual consistency model, due to the distributed -// nature of the system supporting the API. This means that the result of an -// API command you run that affects your Amazon ECS resources might not be immediately -// visible to all subsequent commands you run. You should keep this in mind -// when you carry out an API command that immediately follows a previous API -// command. -// -// To manage eventual consistency, you can do the following: -// -// * Confirm the state of the resource before you run a command to modify -// it. Run the DescribeTasks command using an exponential backoff algorithm -// to ensure that you allow enough time for the previous command to propagate -// through the system. To do this, run the DescribeTasks command repeatedly, -// starting with a couple of seconds of wait time, and increasing gradually -// up to five minutes of wait time. -// -// * Add wait time between subsequent commands, even if the DescribeTasks -// command returns an accurate response. Apply an exponential backoff algorithm -// starting with a couple of seconds of wait time, and increase gradually -// up to about five minutes of wait time. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation RunTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" -// The specified task is not supported in this region. -// -// * ErrCodePlatformUnknownException "PlatformUnknownException" -// The specified platform version does not exist. -// -// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException" -// The specified platform version does not satisfy the task definition’s required -// capabilities. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have authorization to perform the requested action. -// -// * ErrCodeBlockedException "BlockedException" -// Your AWS account has been blocked. Contact AWS Support (http://aws.amazon.com/contact-us/) -// for more information. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RunTask -func (c *ECS) RunTask(input *RunTaskInput) (*RunTaskOutput, error) { - req, out := c.RunTaskRequest(input) - return out, req.Send() -} - -// RunTaskWithContext is the same as RunTask with the addition of -// the ability to pass a context and additional request options. -// -// See RunTask for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) RunTaskWithContext(ctx aws.Context, input *RunTaskInput, opts ...request.Option) (*RunTaskOutput, error) { - req, out := c.RunTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartTask = "StartTask" - -// StartTaskRequest generates a "aws/request.Request" representing the -// client's request for the StartTask operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StartTask for more information on using the StartTask -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the StartTaskRequest method. -// req, resp := client.StartTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StartTask -func (c *ECS) StartTaskRequest(input *StartTaskInput) (req *request.Request, output *StartTaskOutput) { - op := &request.Operation{ - Name: opStartTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartTaskInput{} - } - - output = &StartTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartTask API operation for Amazon EC2 Container Service. -// -// Starts a new task from the specified task definition on the specified container -// instance or instances. -// -// Alternatively, you can use RunTask to place tasks for you. For more information, -// see Scheduling Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation StartTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StartTask -func (c *ECS) StartTask(input *StartTaskInput) (*StartTaskOutput, error) { - req, out := c.StartTaskRequest(input) - return out, req.Send() -} - -// StartTaskWithContext is the same as StartTask with the addition of -// the ability to pass a context and additional request options. -// -// See StartTask for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) StartTaskWithContext(ctx aws.Context, input *StartTaskInput, opts ...request.Option) (*StartTaskOutput, error) { - req, out := c.StartTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopTask = "StopTask" - -// StopTaskRequest generates a "aws/request.Request" representing the -// client's request for the StopTask operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StopTask for more information on using the StopTask -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the StopTaskRequest method. -// req, resp := client.StopTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StopTask -func (c *ECS) StopTaskRequest(input *StopTaskInput) (req *request.Request, output *StopTaskOutput) { - op := &request.Operation{ - Name: opStopTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopTaskInput{} - } - - output = &StopTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopTask API operation for Amazon EC2 Container Service. -// -// Stops a running task. -// -// When StopTask is called on a task, the equivalent of docker stop is issued -// to the containers running in the task. This results in a SIGTERM and a default -// 30-second timeout, after which SIGKILL is sent and the containers are forcibly -// stopped. If the container handles the SIGTERM gracefully and exits within -// 30 seconds from receiving it, no SIGKILL is sent. -// -// The default 30-second timeout can be configured on the Amazon ECS container -// agent with the ECS_CONTAINER_STOP_TIMEOUT variable. For more information, -// see Amazon ECS Container Agent Configuration (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation StopTask for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StopTask -func (c *ECS) StopTask(input *StopTaskInput) (*StopTaskOutput, error) { - req, out := c.StopTaskRequest(input) - return out, req.Send() -} - -// StopTaskWithContext is the same as StopTask with the addition of -// the ability to pass a context and additional request options. -// -// See StopTask for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) StopTaskWithContext(ctx aws.Context, input *StopTaskInput, opts ...request.Option) (*StopTaskOutput, error) { - req, out := c.StopTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSubmitContainerStateChange = "SubmitContainerStateChange" - -// SubmitContainerStateChangeRequest generates a "aws/request.Request" representing the -// client's request for the SubmitContainerStateChange operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See SubmitContainerStateChange for more information on using the SubmitContainerStateChange -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the SubmitContainerStateChangeRequest method. -// req, resp := client.SubmitContainerStateChangeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitContainerStateChange -func (c *ECS) SubmitContainerStateChangeRequest(input *SubmitContainerStateChangeInput) (req *request.Request, output *SubmitContainerStateChangeOutput) { - op := &request.Operation{ - Name: opSubmitContainerStateChange, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SubmitContainerStateChangeInput{} - } - - output = &SubmitContainerStateChangeOutput{} - req = c.newRequest(op, input, output) - return -} - -// SubmitContainerStateChange API operation for Amazon EC2 Container Service. -// -// This action is only used by the Amazon ECS agent, and it is not intended -// for use outside of the agent. -// -// Sent to acknowledge that a container changed states. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation SubmitContainerStateChange for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have authorization to perform the requested action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitContainerStateChange -func (c *ECS) SubmitContainerStateChange(input *SubmitContainerStateChangeInput) (*SubmitContainerStateChangeOutput, error) { - req, out := c.SubmitContainerStateChangeRequest(input) - return out, req.Send() -} - -// SubmitContainerStateChangeWithContext is the same as SubmitContainerStateChange with the addition of -// the ability to pass a context and additional request options. -// -// See SubmitContainerStateChange for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) SubmitContainerStateChangeWithContext(ctx aws.Context, input *SubmitContainerStateChangeInput, opts ...request.Option) (*SubmitContainerStateChangeOutput, error) { - req, out := c.SubmitContainerStateChangeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSubmitTaskStateChange = "SubmitTaskStateChange" - -// SubmitTaskStateChangeRequest generates a "aws/request.Request" representing the -// client's request for the SubmitTaskStateChange operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See SubmitTaskStateChange for more information on using the SubmitTaskStateChange -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the SubmitTaskStateChangeRequest method. -// req, resp := client.SubmitTaskStateChangeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitTaskStateChange -func (c *ECS) SubmitTaskStateChangeRequest(input *SubmitTaskStateChangeInput) (req *request.Request, output *SubmitTaskStateChangeOutput) { - op := &request.Operation{ - Name: opSubmitTaskStateChange, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SubmitTaskStateChangeInput{} - } - - output = &SubmitTaskStateChangeOutput{} - req = c.newRequest(op, input, output) - return -} - -// SubmitTaskStateChange API operation for Amazon EC2 Container Service. -// -// This action is only used by the Amazon ECS agent, and it is not intended -// for use outside of the agent. -// -// Sent to acknowledge that a task changed states. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation SubmitTaskStateChange for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have authorization to perform the requested action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitTaskStateChange -func (c *ECS) SubmitTaskStateChange(input *SubmitTaskStateChangeInput) (*SubmitTaskStateChangeOutput, error) { - req, out := c.SubmitTaskStateChangeRequest(input) - return out, req.Send() -} - -// SubmitTaskStateChangeWithContext is the same as SubmitTaskStateChange with the addition of -// the ability to pass a context and additional request options. -// -// See SubmitTaskStateChange for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) SubmitTaskStateChangeWithContext(ctx aws.Context, input *SubmitTaskStateChangeInput, opts ...request.Option) (*SubmitTaskStateChangeOutput, error) { - req, out := c.SubmitTaskStateChangeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateContainerAgent = "UpdateContainerAgent" - -// UpdateContainerAgentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateContainerAgent operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateContainerAgent for more information on using the UpdateContainerAgent -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateContainerAgentRequest method. -// req, resp := client.UpdateContainerAgentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerAgent -func (c *ECS) UpdateContainerAgentRequest(input *UpdateContainerAgentInput) (req *request.Request, output *UpdateContainerAgentOutput) { - op := &request.Operation{ - Name: opUpdateContainerAgent, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateContainerAgentInput{} - } - - output = &UpdateContainerAgentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateContainerAgent API operation for Amazon EC2 Container Service. -// -// Updates the Amazon ECS container agent on a specified container instance. -// Updating the Amazon ECS container agent does not interrupt running tasks -// or services on the container instance. The process for updating the agent -// differs depending on whether your container instance was launched with the -// Amazon ECS-optimized AMI or another operating system. -// -// UpdateContainerAgent requires the Amazon ECS-optimized AMI or Amazon Linux -// with the ecs-init service installed and running. For help updating the Amazon -// ECS container agent on other operating systems, see Manually Updating the -// Amazon ECS Container Agent (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html#manually_update_agent) -// in the Amazon Elastic Container Service Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation UpdateContainerAgent for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeUpdateInProgressException "UpdateInProgressException" -// There is already a current Amazon ECS container agent update in progress -// on the specified container instance. If the container agent becomes disconnected -// while it is in a transitional stage, such as PENDING or STAGING, the update -// process can get stuck in that state. However, when the agent reconnects, -// it resumes where it stopped previously. -// -// * ErrCodeNoUpdateAvailableException "NoUpdateAvailableException" -// There is no update available for this Amazon ECS container agent. This could -// be because the agent is already running the latest version, or it is so old -// that there is no update path to the current version. -// -// * ErrCodeMissingVersionException "MissingVersionException" -// Amazon ECS is unable to determine the current version of the Amazon ECS container -// agent on the container instance and does not have enough information to proceed -// with an update. This could be because the agent running on the container -// instance is an older or custom version that does not use our version information. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerAgent -func (c *ECS) UpdateContainerAgent(input *UpdateContainerAgentInput) (*UpdateContainerAgentOutput, error) { - req, out := c.UpdateContainerAgentRequest(input) - return out, req.Send() -} - -// UpdateContainerAgentWithContext is the same as UpdateContainerAgent with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateContainerAgent for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) UpdateContainerAgentWithContext(ctx aws.Context, input *UpdateContainerAgentInput, opts ...request.Option) (*UpdateContainerAgentOutput, error) { - req, out := c.UpdateContainerAgentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateContainerInstancesState = "UpdateContainerInstancesState" - -// UpdateContainerInstancesStateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateContainerInstancesState operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateContainerInstancesState for more information on using the UpdateContainerInstancesState -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateContainerInstancesStateRequest method. -// req, resp := client.UpdateContainerInstancesStateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerInstancesState -func (c *ECS) UpdateContainerInstancesStateRequest(input *UpdateContainerInstancesStateInput) (req *request.Request, output *UpdateContainerInstancesStateOutput) { - op := &request.Operation{ - Name: opUpdateContainerInstancesState, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateContainerInstancesStateInput{} - } - - output = &UpdateContainerInstancesStateOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateContainerInstancesState API operation for Amazon EC2 Container Service. -// -// Modifies the status of an Amazon ECS container instance. -// -// You can change the status of a container instance to DRAINING to manually -// remove an instance from a cluster, for example to perform system updates, -// update the Docker daemon, or scale down the cluster size. -// -// When you set a container instance to DRAINING, Amazon ECS prevents new tasks -// from being scheduled for placement on the container instance and replacement -// service tasks are started on other container instances in the cluster if -// the resources are available. Service tasks on the container instance that -// are in the PENDING state are stopped immediately. -// -// Service tasks on the container instance that are in the RUNNING state are -// stopped and replaced according to the service's deployment configuration -// parameters, minimumHealthyPercent and maximumPercent. You can change the -// deployment configuration of your service using UpdateService. -// -// * If minimumHealthyPercent is below 100%, the scheduler can ignore desiredCount -// temporarily during task replacement. For example, desiredCount is four -// tasks, a minimum of 50% allows the scheduler to stop two existing tasks -// before starting two new tasks. If the minimum is 100%, the service scheduler -// can't remove existing tasks until the replacement tasks are considered -// healthy. Tasks for services that do not use a load balancer are considered -// healthy if they are in the RUNNING state. Tasks for services that use -// a load balancer are considered healthy if they are in the RUNNING state -// and the container instance they are hosted on is reported as healthy by -// the load balancer. -// -// * The maximumPercent parameter represents an upper limit on the number -// of running tasks during task replacement, which enables you to define -// the replacement batch size. For example, if desiredCount of four tasks, -// a maximum of 200% starts four new tasks before stopping the four tasks -// to be drained (provided that the cluster resources required to do this -// are available). If the maximum is 100%, then replacement tasks can't start -// until the draining tasks have stopped. -// -// Any PENDING or RUNNING tasks that do not belong to a service are not affected; -// you must wait for them to finish or stop them manually. -// -// A container instance has completed draining when it has no more RUNNING tasks. -// You can verify this using ListTasks. -// -// When you set a container instance to ACTIVE, the Amazon ECS scheduler can -// begin scheduling tasks on the instance again. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation UpdateContainerInstancesState for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerInstancesState -func (c *ECS) UpdateContainerInstancesState(input *UpdateContainerInstancesStateInput) (*UpdateContainerInstancesStateOutput, error) { - req, out := c.UpdateContainerInstancesStateRequest(input) - return out, req.Send() -} - -// UpdateContainerInstancesStateWithContext is the same as UpdateContainerInstancesState with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateContainerInstancesState for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) UpdateContainerInstancesStateWithContext(ctx aws.Context, input *UpdateContainerInstancesStateInput, opts ...request.Option) (*UpdateContainerInstancesStateOutput, error) { - req, out := c.UpdateContainerInstancesStateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateService = "UpdateService" - -// UpdateServiceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateService operation. The "output" return -// value will be populated with the request's response once the request completes -// successfuly. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateService for more information on using the UpdateService -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the UpdateServiceRequest method. -// req, resp := client.UpdateServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateService -func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Request, output *UpdateServiceOutput) { - op := &request.Operation{ - Name: opUpdateService, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateServiceInput{} - } - - output = &UpdateServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateService API operation for Amazon EC2 Container Service. -// -// Modifies the desired count, deployment configuration, network configuration, -// or task definition used in a service. -// -// You can add to or subtract from the number of instantiations of a task definition -// in a service by specifying the cluster that the service is running in and -// a new desiredCount parameter. -// -// If you have updated the Docker image of your application, you can create -// a new task definition with that image and deploy it to your service. The -// service scheduler uses the minimum healthy percent and maximum percent parameters -// (in the service's deployment configuration) to determine the deployment strategy. -// -// If your updated Docker image uses the same tag as what is in the existing -// task definition for your service (for example, my_image:latest), you do not -// need to create a new revision of your task definition. You can update the -// service using the forceNewDeployment option. The new tasks launched by the -// deployment pull the current image/tag combination from your repository when -// they start. -// -// You can also update the deployment configuration of a service. When a deployment -// is triggered by updating the task definition of a service, the service scheduler -// uses the deployment configuration parameters, minimumHealthyPercent and maximumPercent, -// to determine the deployment strategy. -// -// * If minimumHealthyPercent is below 100%, the scheduler can ignore desiredCount -// temporarily during a deployment. For example, if desiredCount is four -// tasks, a minimum of 50% allows the scheduler to stop two existing tasks -// before starting two new tasks. Tasks for services that do not use a load -// balancer are considered healthy if they are in the RUNNING state. Tasks -// for services that use a load balancer are considered healthy if they are -// in the RUNNING state and the container instance they are hosted on is -// reported as healthy by the load balancer. -// -// * The maximumPercent parameter represents an upper limit on the number -// of running tasks during a deployment, which enables you to define the -// deployment batch size. For example, if desiredCount is four tasks, a maximum -// of 200% starts four new tasks before stopping the four older tasks (provided -// that the cluster resources required to do this are available). -// -// When UpdateService stops a task during a deployment, the equivalent of docker -// stop is issued to the containers running in the task. This results in a SIGTERM -// and a 30-second timeout, after which SIGKILL is sent and the containers are -// forcibly stopped. If the container handles the SIGTERM gracefully and exits -// within 30 seconds from receiving it, no SIGKILL is sent. -// -// When the service scheduler launches new tasks, it determines task placement -// in your cluster with the following logic: -// -// * Determine which of the container instances in your cluster can support -// your service's task definition (for example, they have the required CPU, -// memory, ports, and container instance attributes). -// -// * By default, the service scheduler attempts to balance tasks across Availability -// Zones in this manner (although you can choose a different placement strategy): -// -// Sort the valid container instances by the fewest number of running tasks -// for this service in the same Availability Zone as the instance. For example, -// if zone A has one running service task and zones B and C each have zero, -// valid container instances in either zone B or C are considered optimal -// for placement. -// -// Place the new service task on a valid container instance in an optimal Availability -// Zone (based on the previous steps), favoring container instances with -// the fewest number of running tasks for this service. -// -// When the service scheduler stops running tasks, it attempts to maintain balance -// across the Availability Zones in your cluster using the following logic: -// -// * Sort the container instances by the largest number of running tasks -// for this service in the same Availability Zone as the instance. For example, -// if zone A has one running service task and zones B and C each have two, -// container instances in either zone B or C are considered optimal for termination. -// -// * Stop the task on a container instance in an optimal Availability Zone -// (based on the previous steps), favoring container instances with the largest -// number of running tasks for this service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon EC2 Container Service's -// API operation UpdateService for usage and error information. -// -// Returned Error Codes: -// * ErrCodeServerException "ServerException" -// These errors are usually caused by a server issue. -// -// * ErrCodeClientException "ClientException" -// These errors are usually caused by a client action, such as using an action -// or resource on behalf of a user that doesn't have permissions to use the -// action or resource, or specifying an identifier that is not valid. -// -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" -// The specified cluster could not be found. You can view your available clusters -// with ListClusters. Amazon ECS clusters are region-specific. -// -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" -// The specified service could not be found. You can view your available services -// with ListServices. Amazon ECS services are cluster-specific and region-specific. -// -// * ErrCodeServiceNotActiveException "ServiceNotActiveException" -// The specified service is not active. You can't update a service that is inactive. -// If you have previously deleted a service, you can re-create it with CreateService. -// -// * ErrCodePlatformUnknownException "PlatformUnknownException" -// The specified platform version does not exist. -// -// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException" -// The specified platform version does not satisfy the task definition’s required -// capabilities. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have authorization to perform the requested action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateService -func (c *ECS) UpdateService(input *UpdateServiceInput) (*UpdateServiceOutput, error) { - req, out := c.UpdateServiceRequest(input) - return out, req.Send() -} - -// UpdateServiceWithContext is the same as UpdateService with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateService for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) UpdateServiceWithContext(ctx aws.Context, input *UpdateServiceInput, opts ...request.Option) (*UpdateServiceOutput, error) { - req, out := c.UpdateServiceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// An object representing a container instance or task attachment. -type Attachment struct { - _ struct{} `type:"structure"` - - // Details of the attachment. For Elastic Network Interfaces, this includes - // the network interface ID, the MAC address, the subnet ID, and the private - // IPv4 address. - Details []*KeyValuePair `locationName:"details" type:"list"` - - // The unique identifier for the attachment. - Id *string `locationName:"id" type:"string"` - - // The status of the attachment. Valid values are PRECREATED, CREATED, ATTACHING, - // ATTACHED, DETACHING, DETACHED, and DELETED. - Status *string `locationName:"status" type:"string"` - - // The type of the attachment, such as ElasticNetworkInterface. - Type *string `locationName:"type" type:"string"` -} - -// String returns the string representation -func (s Attachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Attachment) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *Attachment) SetDetails(v []*KeyValuePair) *Attachment { - s.Details = v - return s -} - -// SetId sets the Id field's value. -func (s *Attachment) SetId(v string) *Attachment { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Attachment) SetStatus(v string) *Attachment { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *Attachment) SetType(v string) *Attachment { - s.Type = &v - return s -} - -// An object representing a change in state for a task attachment. -type AttachmentStateChange struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the attachment. - // - // AttachmentArn is a required field - AttachmentArn *string `locationName:"attachmentArn" type:"string" required:"true"` - - // The status of the attachment. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachmentStateChange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachmentStateChange) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachmentStateChange) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachmentStateChange"} - if s.AttachmentArn == nil { - invalidParams.Add(request.NewErrParamRequired("AttachmentArn")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttachmentArn sets the AttachmentArn field's value. -func (s *AttachmentStateChange) SetAttachmentArn(v string) *AttachmentStateChange { - s.AttachmentArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AttachmentStateChange) SetStatus(v string) *AttachmentStateChange { - s.Status = &v - return s -} - -// An attribute is a name-value pair associated with an Amazon ECS object. Attributes -// enable you to extend the Amazon ECS data model by adding custom metadata -// to your resources. For more information, see Attributes (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes) -// in the Amazon Elastic Container Service Developer Guide. -type Attribute struct { - _ struct{} `type:"structure"` - - // The name of the attribute. Up to 128 letters (uppercase and lowercase), numbers, - // hyphens, underscores, and periods are allowed. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The ID of the target. You can specify the short form ID for a resource or - // the full Amazon Resource Name (ARN). - TargetId *string `locationName:"targetId" type:"string"` - - // The type of the target with which to attach the attribute. This parameter - // is required if you use the short form ID for a resource instead of the full - // ARN. - TargetType *string `locationName:"targetType" type:"string" enum:"TargetType"` - - // The value of the attribute. Up to 128 letters (uppercase and lowercase), - // numbers, hyphens, underscores, periods, at signs (@), forward slashes, colons, - // and spaces are allowed. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s Attribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Attribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Attribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Attribute"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *Attribute) SetName(v string) *Attribute { - s.Name = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *Attribute) SetTargetId(v string) *Attribute { - s.TargetId = &v - return s -} - -// SetTargetType sets the TargetType field's value. -func (s *Attribute) SetTargetType(v string) *Attribute { - s.TargetType = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Attribute) SetValue(v string) *Attribute { - s.Value = &v - return s -} - -// An object representing the networking details for a task or service. -type AwsVpcConfiguration struct { - _ struct{} `type:"structure"` - - // Whether the task's elastic network interface receives a public IP address. - AssignPublicIp *string `locationName:"assignPublicIp" type:"string" enum:"AssignPublicIp"` - - // The security groups associated with the task or service. If you do not specify - // a security group, the default security group for the VPC is used. There is - // a limit of 5 security groups able to be specified per AwsVpcConfiguration. - SecurityGroups []*string `locationName:"securityGroups" type:"list"` - - // The subnets associated with the task or service. There is a limit of 10 subnets - // able to be specified per AwsVpcConfiguration. - // - // Subnets is a required field - Subnets []*string `locationName:"subnets" type:"list" required:"true"` -} - -// String returns the string representation -func (s AwsVpcConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AwsVpcConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AwsVpcConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AwsVpcConfiguration"} - if s.Subnets == nil { - invalidParams.Add(request.NewErrParamRequired("Subnets")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssignPublicIp sets the AssignPublicIp field's value. -func (s *AwsVpcConfiguration) SetAssignPublicIp(v string) *AwsVpcConfiguration { - s.AssignPublicIp = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *AwsVpcConfiguration) SetSecurityGroups(v []*string) *AwsVpcConfiguration { - s.SecurityGroups = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *AwsVpcConfiguration) SetSubnets(v []*string) *AwsVpcConfiguration { - s.Subnets = v - return s -} - -// A regional grouping of one or more container instances on which you can run -// task requests. Each account receives a default cluster the first time you -// use the Amazon ECS service, but you may also create other clusters. Clusters -// may contain more than one instance type simultaneously. -type Cluster struct { - _ struct{} `type:"structure"` - - // The number of services that are running on the cluster in an ACTIVE state. - // You can view these services with ListServices. - ActiveServicesCount *int64 `locationName:"activeServicesCount" type:"integer"` - - // The Amazon Resource Name (ARN) that identifies the cluster. The ARN contains - // the arn:aws:ecs namespace, followed by the region of the cluster, the AWS - // account ID of the cluster owner, the cluster namespace, and then the cluster - // name. For example, arn:aws:ecs:region:012345678910:cluster/test.. - ClusterArn *string `locationName:"clusterArn" type:"string"` - - // A user-generated string that you use to identify your cluster. - ClusterName *string `locationName:"clusterName" type:"string"` - - // The number of tasks in the cluster that are in the PENDING state. - PendingTasksCount *int64 `locationName:"pendingTasksCount" type:"integer"` - - // The number of container instances registered into the cluster. - RegisteredContainerInstancesCount *int64 `locationName:"registeredContainerInstancesCount" type:"integer"` - - // The number of tasks in the cluster that are in the RUNNING state. - RunningTasksCount *int64 `locationName:"runningTasksCount" type:"integer"` - - // Additional information about your clusters that are separated by launch type, - // including: - // - // * runningEC2TasksCount - // - // * RunningFargateTasksCount - // - // * pendingEC2TasksCount - // - // * pendingFargateTasksCount - // - // * activeEC2ServiceCount - // - // * activeFargateServiceCount - // - // * drainingEC2ServiceCount - // - // * drainingFargateServiceCount - Statistics []*KeyValuePair `locationName:"statistics" type:"list"` - - // The status of the cluster. The valid values are ACTIVE or INACTIVE. ACTIVE - // indicates that you can register container instances with the cluster and - // the associated instances can accept tasks. - Status *string `locationName:"status" type:"string"` -} - -// String returns the string representation -func (s Cluster) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Cluster) GoString() string { - return s.String() -} - -// SetActiveServicesCount sets the ActiveServicesCount field's value. -func (s *Cluster) SetActiveServicesCount(v int64) *Cluster { - s.ActiveServicesCount = &v - return s -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *Cluster) SetClusterArn(v string) *Cluster { - s.ClusterArn = &v - return s -} - -// SetClusterName sets the ClusterName field's value. -func (s *Cluster) SetClusterName(v string) *Cluster { - s.ClusterName = &v - return s -} - -// SetPendingTasksCount sets the PendingTasksCount field's value. -func (s *Cluster) SetPendingTasksCount(v int64) *Cluster { - s.PendingTasksCount = &v - return s -} - -// SetRegisteredContainerInstancesCount sets the RegisteredContainerInstancesCount field's value. -func (s *Cluster) SetRegisteredContainerInstancesCount(v int64) *Cluster { - s.RegisteredContainerInstancesCount = &v - return s -} - -// SetRunningTasksCount sets the RunningTasksCount field's value. -func (s *Cluster) SetRunningTasksCount(v int64) *Cluster { - s.RunningTasksCount = &v - return s -} - -// SetStatistics sets the Statistics field's value. -func (s *Cluster) SetStatistics(v []*KeyValuePair) *Cluster { - s.Statistics = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Cluster) SetStatus(v string) *Cluster { - s.Status = &v - return s -} - -// A Docker container that is part of a task. -type Container struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the container. - ContainerArn *string `locationName:"containerArn" type:"string"` - - // The exit code returned from the container. - ExitCode *int64 `locationName:"exitCode" type:"integer"` - - // The health status of the container. If health checks are not configured for - // this container in its task definition, then it reports health status as UNKNOWN. - HealthStatus *string `locationName:"healthStatus" type:"string" enum:"HealthStatus"` - - // The last known status of the container. - LastStatus *string `locationName:"lastStatus" type:"string"` - - // The name of the container. - Name *string `locationName:"name" type:"string"` - - // The network bindings associated with the container. - NetworkBindings []*NetworkBinding `locationName:"networkBindings" type:"list"` - - // The network interfaces associated with the container. - NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaces" type:"list"` - - // A short (255 max characters) human-readable string to provide additional - // details about a running or stopped container. - Reason *string `locationName:"reason" type:"string"` - - // The ARN of the task. - TaskArn *string `locationName:"taskArn" type:"string"` -} - -// String returns the string representation -func (s Container) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Container) GoString() string { - return s.String() -} - -// SetContainerArn sets the ContainerArn field's value. -func (s *Container) SetContainerArn(v string) *Container { - s.ContainerArn = &v - return s -} - -// SetExitCode sets the ExitCode field's value. -func (s *Container) SetExitCode(v int64) *Container { - s.ExitCode = &v - return s -} - -// SetHealthStatus sets the HealthStatus field's value. -func (s *Container) SetHealthStatus(v string) *Container { - s.HealthStatus = &v - return s -} - -// SetLastStatus sets the LastStatus field's value. -func (s *Container) SetLastStatus(v string) *Container { - s.LastStatus = &v - return s -} - -// SetName sets the Name field's value. -func (s *Container) SetName(v string) *Container { - s.Name = &v - return s -} - -// SetNetworkBindings sets the NetworkBindings field's value. -func (s *Container) SetNetworkBindings(v []*NetworkBinding) *Container { - s.NetworkBindings = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *Container) SetNetworkInterfaces(v []*NetworkInterface) *Container { - s.NetworkInterfaces = v - return s -} - -// SetReason sets the Reason field's value. -func (s *Container) SetReason(v string) *Container { - s.Reason = &v - return s -} - -// SetTaskArn sets the TaskArn field's value. -func (s *Container) SetTaskArn(v string) *Container { - s.TaskArn = &v - return s -} - -// Container definitions are used in task definitions to describe the different -// containers that are launched as part of a task. -type ContainerDefinition struct { - _ struct{} `type:"structure"` - - // The command that is passed to the container. This parameter maps to Cmd in - // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the COMMAND parameter to docker run (https://docs.docker.com/engine/reference/run/). - // For more information, see https://docs.docker.com/engine/reference/builder/#cmd - // (https://docs.docker.com/engine/reference/builder/#cmd). - Command []*string `locationName:"command" type:"list"` - - // The number of cpu units reserved for the container. This parameter maps to - // CpuShares in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --cpu-shares option to docker run (https://docs.docker.com/engine/reference/run/). - // - // This field is optional for tasks using the Fargate launch type, and the only - // requirement is that the total amount of CPU reserved for all containers within - // a task be lower than the task-level cpu value. - // - // You can determine the number of CPU units that are available per EC2 instance - // type by multiplying the vCPUs listed for that instance type on the Amazon - // EC2 Instances (http://aws.amazon.com/ec2/instance-types/) detail page by - // 1,024. - // - // For example, if you run a single-container task on a single-core instance - // type with 512 CPU units specified for that container, and that is the only - // task running on the container instance, that container could use the full - // 1,024 CPU unit share at any given time. However, if you launched another - // copy of the same task on that container instance, each task would be guaranteed - // a minimum of 512 CPU units when needed, and each container could float to - // higher CPU usage if the other container was not using it, but if both tasks - // were 100% active all of the time, they would be limited to 512 CPU units. - // - // Linux containers share unallocated CPU units with other containers on the - // container instance with the same ratio as their allocated amount. For example, - // if you run a single-container task on a single-core instance type with 512 - // CPU units specified for that container, and that is the only task running - // on the container instance, that container could use the full 1,024 CPU unit - // share at any given time. However, if you launched another copy of the same - // task on that container instance, each task would be guaranteed a minimum - // of 512 CPU units when needed, and each container could float to higher CPU - // usage if the other container was not using it, but if both tasks were 100% - // active all of the time, they would be limited to 512 CPU units. - // - // On Linux container instances, the Docker daemon on the container instance - // uses the CPU value to calculate the relative CPU share ratios for running - // containers. For more information, see CPU share constraint (https://docs.docker.com/engine/reference/run/#cpu-share-constraint) - // in the Docker documentation. The minimum valid CPU share value that the Linux - // kernel allows is 2; however, the CPU parameter is not required, and you can - // use CPU values below 2 in your container definitions. For CPU values below - // 2 (including null), the behavior varies based on your Amazon ECS container - // agent version: - // - // * Agent versions less than or equal to 1.1.0: Null and zero CPU values - // are passed to Docker as 0, which Docker then converts to 1,024 CPU shares. - // CPU values of 1 are passed to Docker as 1, which the Linux kernel converts - // to 2 CPU shares. - // - // * Agent versions greater than or equal to 1.2.0: Null, zero, and CPU values - // of 1 are passed to Docker as 2. - // - // On Windows container instances, the CPU limit is enforced as an absolute - // limit, or a quota. Windows containers only have access to the specified amount - // of CPU that is described in the task definition. - Cpu *int64 `locationName:"cpu" type:"integer"` - - // When this parameter is true, networking is disabled within the container. - // This parameter maps to NetworkDisabled in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/). - // - // This parameter is not supported for Windows containers. - DisableNetworking *bool `locationName:"disableNetworking" type:"boolean"` - - // A list of DNS search domains that are presented to the container. This parameter - // maps to DnsSearch in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --dns-search option to docker run (https://docs.docker.com/engine/reference/run/). - // - // This parameter is not supported for Windows containers. - DnsSearchDomains []*string `locationName:"dnsSearchDomains" type:"list"` - - // A list of DNS servers that are presented to the container. This parameter - // maps to Dns in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --dns option to docker run (https://docs.docker.com/engine/reference/run/). - // - // This parameter is not supported for Windows containers. - DnsServers []*string `locationName:"dnsServers" type:"list"` - - // A key/value map of labels to add to the container. This parameter maps to - // Labels in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --label option to docker run (https://docs.docker.com/engine/reference/run/). - // This parameter requires version 1.18 of the Docker Remote API or greater - // on your container instance. To check the Docker Remote API version on your - // container instance, log in to your container instance and run the following - // command: sudo docker version | grep "Server API version" - DockerLabels map[string]*string `locationName:"dockerLabels" type:"map"` - - // A list of strings to provide custom labels for SELinux and AppArmor multi-level - // security systems. This field is not valid for containers in tasks using the - // Fargate launch type. - // - // This parameter maps to SecurityOpt in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --security-opt option to docker run (https://docs.docker.com/engine/reference/run/). - // - // The Amazon ECS container agent running on a container instance must register - // with the ECS_SELINUX_CAPABLE=true or ECS_APPARMOR_CAPABLE=true environment - // variables before containers placed on that instance can use these security - // options. For more information, see Amazon ECS Container Agent Configuration - // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) - // in the Amazon Elastic Container Service Developer Guide. - // - // This parameter is not supported for Windows containers. - DockerSecurityOptions []*string `locationName:"dockerSecurityOptions" type:"list"` - - // Early versions of the Amazon ECS container agent do not properly handle entryPoint - // parameters. If you have problems using entryPoint, update your container - // agent or enter your commands and arguments as command array items instead. - // - // The entry point that is passed to the container. This parameter maps to Entrypoint - // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --entrypoint option to docker run (https://docs.docker.com/engine/reference/run/). - // For more information, see https://docs.docker.com/engine/reference/builder/#entrypoint - // (https://docs.docker.com/engine/reference/builder/#entrypoint). - EntryPoint []*string `locationName:"entryPoint" type:"list"` - - // The environment variables to pass to a container. This parameter maps to - // Env in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --env option to docker run (https://docs.docker.com/engine/reference/run/). - // - // We do not recommend using plaintext environment variables for sensitive information, - // such as credential data. - Environment []*KeyValuePair `locationName:"environment" type:"list"` - - // If the essential parameter of a container is marked as true, and that container - // fails or stops for any reason, all other containers that are part of the - // task are stopped. If the essential parameter of a container is marked as - // false, then its failure does not affect the rest of the containers in a task. - // If this parameter is omitted, a container is assumed to be essential. - // - // All tasks must have at least one essential container. If you have an application - // that is composed of multiple containers, you should group containers that - // are used for a common purpose into components, and separate the different - // components into multiple task definitions. For more information, see Application - // Architecture (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html) - // in the Amazon Elastic Container Service Developer Guide. - Essential *bool `locationName:"essential" type:"boolean"` - - // A list of hostnames and IP address mappings to append to the /etc/hosts file - // on the container. If using the Fargate launch type, this may be used to list - // non-Fargate hosts you want the container to talk to. This parameter maps - // to ExtraHosts in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --add-host option to docker run (https://docs.docker.com/engine/reference/run/). - // - // This parameter is not supported for Windows containers. - ExtraHosts []*HostEntry `locationName:"extraHosts" type:"list"` - - // The health check command and associated configuration parameters for the - // container. This parameter maps to HealthCheck in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the HEALTHCHECK parameter of docker run (https://docs.docker.com/engine/reference/run/). - HealthCheck *HealthCheck `locationName:"healthCheck" type:"structure"` - - // The hostname to use for your container. This parameter maps to Hostname in - // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --hostname option to docker run (https://docs.docker.com/engine/reference/run/). - // - // The hostname parameter is not supported if using the awsvpc networkMode. - Hostname *string `locationName:"hostname" type:"string"` - - // The image used to start a container. This string is passed directly to the - // Docker daemon. Images in the Docker Hub registry are available by default. - // Other repositories are specified with either repository-url/image:tag or - // repository-url/image@digest. Up to 255 letters (uppercase and lowercase), - // numbers, hyphens, underscores, colons, periods, forward slashes, and number - // signs are allowed. This parameter maps to Image in the Create a container - // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the IMAGE parameter of docker run (https://docs.docker.com/engine/reference/run/). - // - // * When a new task starts, the Amazon ECS container agent pulls the latest - // version of the specified image and tag for the container to use. However, - // subsequent updates to a repository image are not propagated to already - // running tasks. - // - // * Images in Amazon ECR repositories can be specified by either using the - // full registry/repository:tag or registry/repository@digest. For example, - // 012345678910.dkr.ecr..amazonaws.com/:latest - // or 012345678910.dkr.ecr..amazonaws.com/@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE. - // - // - // * Images in official repositories on Docker Hub use a single name (for - // example, ubuntu or mongo). - // - // * Images in other repositories on Docker Hub are qualified with an organization - // name (for example, amazon/amazon-ecs-agent). - // - // * Images in other online repositories are qualified further by a domain - // name (for example, quay.io/assemblyline/ubuntu). - Image *string `locationName:"image" type:"string"` - - // The link parameter allows containers to communicate with each other without - // the need for port mappings. Only supported if the network mode of a task - // definition is set to bridge. The name:internalName construct is analogous - // to name:alias in Docker links. Up to 255 letters (uppercase and lowercase), - // numbers, hyphens, and underscores are allowed. For more information about - // linking Docker containers, go to https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/ - // (https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/). - // This parameter maps to Links in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --link option to docker run (https://docs.docker.com/engine/reference/commandline/run/). - // - // This parameter is not supported for Windows containers. - // - // Containers that are collocated on a single container instance may be able - // to communicate with each other without requiring links or host port mappings. - // Network isolation is achieved on the container instance using security groups - // and VPC settings. - Links []*string `locationName:"links" type:"list"` - - // Linux-specific modifications that are applied to the container, such as Linux - // KernelCapabilities. - // - // This parameter is not supported for Windows containers. - LinuxParameters *LinuxParameters `locationName:"linuxParameters" type:"structure"` - - // The log configuration specification for the container. - // - // If using the Fargate launch type, the only supported value is awslogs. - // - // This parameter maps to LogConfig in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --log-driver option to docker run (https://docs.docker.com/engine/reference/run/). - // By default, containers use the same logging driver that the Docker daemon - // uses; however the container may use a different logging driver than the Docker - // daemon by specifying a log driver with this parameter in the container definition. - // To use a different logging driver for a container, the log system must be - // configured properly on the container instance (or on a different log server - // for remote logging options). For more information on the options for different - // supported log drivers, see Configure logging drivers (https://docs.docker.com/engine/admin/logging/overview/) - // in the Docker documentation. - // - // Amazon ECS currently supports a subset of the logging drivers available to - // the Docker daemon (shown in the LogConfiguration data type). Additional log - // drivers may be available in future releases of the Amazon ECS container agent. - // - // This parameter requires version 1.18 of the Docker Remote API or greater - // on your container instance. To check the Docker Remote API version on your - // container instance, log in to your container instance and run the following - // command: sudo docker version | grep "Server API version" - // - // The Amazon ECS container agent running on a container instance must register - // the logging drivers available on that instance with the ECS_AVAILABLE_LOGGING_DRIVERS - // environment variable before containers placed on that instance can use these - // log configuration options. For more information, see Amazon ECS Container - // Agent Configuration (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) - // in the Amazon Elastic Container Service Developer Guide. - LogConfiguration *LogConfiguration `locationName:"logConfiguration" type:"structure"` - - // The hard limit (in MiB) of memory to present to the container. If your container - // attempts to exceed the memory specified here, the container is killed. This - // parameter maps to Memory in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --memory option to docker run (https://docs.docker.com/engine/reference/run/). - // - // If your containers are part of a task using the Fargate launch type, this - // field is optional and the only requirement is that the total amount of memory - // reserved for all containers within a task be lower than the task memory value. - // - // For containers that are part of a task using the EC2 launch type, you must - // specify a non-zero integer for one or both of memory or memoryReservation - // in container definitions. If you specify both, memory must be greater than - // memoryReservation. If you specify memoryReservation, then that value is subtracted - // from the available memory resources for the container instance on which the - // container is placed; otherwise, the value of memory is used. - // - // The Docker daemon reserves a minimum of 4 MiB of memory for a container, - // so you should not specify fewer than 4 MiB of memory for your containers. - Memory *int64 `locationName:"memory" type:"integer"` - - // The soft limit (in MiB) of memory to reserve for the container. When system - // memory is under heavy contention, Docker attempts to keep the container memory - // to this soft limit; however, your container can consume more memory when - // it needs to, up to either the hard limit specified with the memory parameter - // (if applicable), or all of the available memory on the container instance, - // whichever comes first. This parameter maps to MemoryReservation in the Create - // a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --memory-reservation option to docker run (https://docs.docker.com/engine/reference/run/). - // - // You must specify a non-zero integer for one or both of memory or memoryReservation - // in container definitions. If you specify both, memory must be greater than - // memoryReservation. If you specify memoryReservation, then that value is subtracted - // from the available memory resources for the container instance on which the - // container is placed; otherwise, the value of memory is used. - // - // For example, if your container normally uses 128 MiB of memory, but occasionally - // bursts to 256 MiB of memory for short periods of time, you can set a memoryReservation - // of 128 MiB, and a memory hard limit of 300 MiB. This configuration would - // allow the container to only reserve 128 MiB of memory from the remaining - // resources on the container instance, but also allow the container to consume - // more memory resources when needed. - // - // The Docker daemon reserves a minimum of 4 MiB of memory for a container, - // so you should not specify fewer than 4 MiB of memory for your containers. - MemoryReservation *int64 `locationName:"memoryReservation" type:"integer"` - - // The mount points for data volumes in your container. - // - // This parameter maps to Volumes in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --volume option to docker run (https://docs.docker.com/engine/reference/run/). - // - // Windows containers can mount whole directories on the same drive as $env:ProgramData. - // Windows containers cannot mount directories on a different drive, and mount - // point cannot be across drives. - MountPoints []*MountPoint `locationName:"mountPoints" type:"list"` - - // The name of a container. If you are linking multiple containers together - // in a task definition, the name of one container can be entered in the links - // of another container to connect the containers. Up to 255 letters (uppercase - // and lowercase), numbers, hyphens, and underscores are allowed. This parameter - // maps to name in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --name option to docker run (https://docs.docker.com/engine/reference/run/). - Name *string `locationName:"name" type:"string"` - - // The list of port mappings for the container. Port mappings allow containers - // to access ports on the host container instance to send or receive traffic. - // - // For task definitions that use the awsvpc network mode, you should only specify - // the containerPort. The hostPort can be left blank or it must be the same - // value as the containerPort. - // - // Port mappings on Windows use the NetNAT gateway address rather than localhost. - // There is no loopback for port mappings on Windows, so you cannot access a - // container's mapped port from the host itself. - // - // This parameter maps to PortBindings in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --publish option to docker run (https://docs.docker.com/engine/reference/run/). - // If the network mode of a task definition is set to none, then you can't specify - // port mappings. If the network mode of a task definition is set to host, then - // host ports must either be undefined or they must match the container port - // in the port mapping. - // - // After a task reaches the RUNNING status, manual and automatic host and container - // port assignments are visible in the Network Bindings section of a container - // description for a selected task in the Amazon ECS console, or the networkBindings - // section DescribeTasks responses. - PortMappings []*PortMapping `locationName:"portMappings" type:"list"` - - // When this parameter is true, the container is given elevated privileges on - // the host container instance (similar to the root user). This parameter maps - // to Privileged in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --privileged option to docker run (https://docs.docker.com/engine/reference/run/). - // - // This parameter is not supported for Windows containers or tasks using the - // Fargate launch type. - Privileged *bool `locationName:"privileged" type:"boolean"` - - // When this parameter is true, the container is given read-only access to its - // root file system. This parameter maps to ReadonlyRootfs in the Create a container - // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --read-only option to docker run. - // - // This parameter is not supported for Windows containers. - ReadonlyRootFilesystem *bool `locationName:"readonlyRootFilesystem" type:"boolean"` - - // A list of ulimits to set in the container. This parameter maps to Ulimits - // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --ulimit option to docker run (https://docs.docker.com/engine/reference/run/). - // Valid naming values are displayed in the Ulimit data type. This parameter - // requires version 1.18 of the Docker Remote API or greater on your container - // instance. To check the Docker Remote API version on your container instance, - // log in to your container instance and run the following command: sudo docker - // version | grep "Server API version" - // - // This parameter is not supported for Windows containers. - Ulimits []*Ulimit `locationName:"ulimits" type:"list"` - - // The user name to use inside the container. This parameter maps to User in - // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --user option to docker run (https://docs.docker.com/engine/reference/run/). - // - // This parameter is not supported for Windows containers. - User *string `locationName:"user" type:"string"` - - // Data volumes to mount from another container. This parameter maps to VolumesFrom - // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --volumes-from option to docker run (https://docs.docker.com/engine/reference/run/). - VolumesFrom []*VolumeFrom `locationName:"volumesFrom" type:"list"` - - // The working directory in which to run commands inside the container. This - // parameter maps to WorkingDir in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --workdir option to docker run (https://docs.docker.com/engine/reference/run/). - WorkingDirectory *string `locationName:"workingDirectory" type:"string"` -} - -// String returns the string representation -func (s ContainerDefinition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContainerDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContainerDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContainerDefinition"} - if s.ExtraHosts != nil { - for i, v := range s.ExtraHosts { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ExtraHosts", i), err.(request.ErrInvalidParams)) - } - } - } - if s.HealthCheck != nil { - if err := s.HealthCheck.Validate(); err != nil { - invalidParams.AddNested("HealthCheck", err.(request.ErrInvalidParams)) - } - } - if s.LinuxParameters != nil { - if err := s.LinuxParameters.Validate(); err != nil { - invalidParams.AddNested("LinuxParameters", err.(request.ErrInvalidParams)) - } - } - if s.LogConfiguration != nil { - if err := s.LogConfiguration.Validate(); err != nil { - invalidParams.AddNested("LogConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Ulimits != nil { - for i, v := range s.Ulimits { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Ulimits", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommand sets the Command field's value. -func (s *ContainerDefinition) SetCommand(v []*string) *ContainerDefinition { - s.Command = v - return s -} - -// SetCpu sets the Cpu field's value. -func (s *ContainerDefinition) SetCpu(v int64) *ContainerDefinition { - s.Cpu = &v - return s -} - -// SetDisableNetworking sets the DisableNetworking field's value. -func (s *ContainerDefinition) SetDisableNetworking(v bool) *ContainerDefinition { - s.DisableNetworking = &v - return s -} - -// SetDnsSearchDomains sets the DnsSearchDomains field's value. -func (s *ContainerDefinition) SetDnsSearchDomains(v []*string) *ContainerDefinition { - s.DnsSearchDomains = v - return s -} - -// SetDnsServers sets the DnsServers field's value. -func (s *ContainerDefinition) SetDnsServers(v []*string) *ContainerDefinition { - s.DnsServers = v - return s -} - -// SetDockerLabels sets the DockerLabels field's value. -func (s *ContainerDefinition) SetDockerLabels(v map[string]*string) *ContainerDefinition { - s.DockerLabels = v - return s -} - -// SetDockerSecurityOptions sets the DockerSecurityOptions field's value. -func (s *ContainerDefinition) SetDockerSecurityOptions(v []*string) *ContainerDefinition { - s.DockerSecurityOptions = v - return s -} - -// SetEntryPoint sets the EntryPoint field's value. -func (s *ContainerDefinition) SetEntryPoint(v []*string) *ContainerDefinition { - s.EntryPoint = v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *ContainerDefinition) SetEnvironment(v []*KeyValuePair) *ContainerDefinition { - s.Environment = v - return s -} - -// SetEssential sets the Essential field's value. -func (s *ContainerDefinition) SetEssential(v bool) *ContainerDefinition { - s.Essential = &v - return s -} - -// SetExtraHosts sets the ExtraHosts field's value. -func (s *ContainerDefinition) SetExtraHosts(v []*HostEntry) *ContainerDefinition { - s.ExtraHosts = v - return s -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *ContainerDefinition) SetHealthCheck(v *HealthCheck) *ContainerDefinition { - s.HealthCheck = v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *ContainerDefinition) SetHostname(v string) *ContainerDefinition { - s.Hostname = &v - return s -} - -// SetImage sets the Image field's value. -func (s *ContainerDefinition) SetImage(v string) *ContainerDefinition { - s.Image = &v - return s -} - -// SetLinks sets the Links field's value. -func (s *ContainerDefinition) SetLinks(v []*string) *ContainerDefinition { - s.Links = v - return s -} - -// SetLinuxParameters sets the LinuxParameters field's value. -func (s *ContainerDefinition) SetLinuxParameters(v *LinuxParameters) *ContainerDefinition { - s.LinuxParameters = v - return s -} - -// SetLogConfiguration sets the LogConfiguration field's value. -func (s *ContainerDefinition) SetLogConfiguration(v *LogConfiguration) *ContainerDefinition { - s.LogConfiguration = v - return s -} - -// SetMemory sets the Memory field's value. -func (s *ContainerDefinition) SetMemory(v int64) *ContainerDefinition { - s.Memory = &v - return s -} - -// SetMemoryReservation sets the MemoryReservation field's value. -func (s *ContainerDefinition) SetMemoryReservation(v int64) *ContainerDefinition { - s.MemoryReservation = &v - return s -} - -// SetMountPoints sets the MountPoints field's value. -func (s *ContainerDefinition) SetMountPoints(v []*MountPoint) *ContainerDefinition { - s.MountPoints = v - return s -} - -// SetName sets the Name field's value. -func (s *ContainerDefinition) SetName(v string) *ContainerDefinition { - s.Name = &v - return s -} - -// SetPortMappings sets the PortMappings field's value. -func (s *ContainerDefinition) SetPortMappings(v []*PortMapping) *ContainerDefinition { - s.PortMappings = v - return s -} - -// SetPrivileged sets the Privileged field's value. -func (s *ContainerDefinition) SetPrivileged(v bool) *ContainerDefinition { - s.Privileged = &v - return s -} - -// SetReadonlyRootFilesystem sets the ReadonlyRootFilesystem field's value. -func (s *ContainerDefinition) SetReadonlyRootFilesystem(v bool) *ContainerDefinition { - s.ReadonlyRootFilesystem = &v - return s -} - -// SetUlimits sets the Ulimits field's value. -func (s *ContainerDefinition) SetUlimits(v []*Ulimit) *ContainerDefinition { - s.Ulimits = v - return s -} - -// SetUser sets the User field's value. -func (s *ContainerDefinition) SetUser(v string) *ContainerDefinition { - s.User = &v - return s -} - -// SetVolumesFrom sets the VolumesFrom field's value. -func (s *ContainerDefinition) SetVolumesFrom(v []*VolumeFrom) *ContainerDefinition { - s.VolumesFrom = v - return s -} - -// SetWorkingDirectory sets the WorkingDirectory field's value. -func (s *ContainerDefinition) SetWorkingDirectory(v string) *ContainerDefinition { - s.WorkingDirectory = &v - return s -} - -// An EC2 instance that is running the Amazon ECS agent and has been registered -// with a cluster. -type ContainerInstance struct { - _ struct{} `type:"structure"` - - // This parameter returns true if the agent is connected to Amazon ECS. Registered - // instances with an agent that may be unhealthy or stopped return false. Instances - // without a connected agent can't accept placement requests. - AgentConnected *bool `locationName:"agentConnected" type:"boolean"` - - // The status of the most recent agent update. If an update has never been requested, - // this value is NULL. - AgentUpdateStatus *string `locationName:"agentUpdateStatus" type:"string" enum:"AgentUpdateStatus"` - - // The Elastic Network Interfaces associated with the container instance. - Attachments []*Attachment `locationName:"attachments" type:"list"` - - // The attributes set for the container instance, either by the Amazon ECS container - // agent at instance registration or manually with the PutAttributes operation. - Attributes []*Attribute `locationName:"attributes" type:"list"` - - // The Amazon Resource Name (ARN) of the container instance. The ARN contains - // the arn:aws:ecs namespace, followed by the region of the container instance, - // the AWS account ID of the container instance owner, the container-instance - // namespace, and then the container instance ID. For example, arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID. - ContainerInstanceArn *string `locationName:"containerInstanceArn" type:"string"` - - // The EC2 instance ID of the container instance. - Ec2InstanceId *string `locationName:"ec2InstanceId" type:"string"` - - // The number of tasks on the container instance that are in the PENDING status. - PendingTasksCount *int64 `locationName:"pendingTasksCount" type:"integer"` - - // The Unix time stamp for when the container instance was registered. - RegisteredAt *time.Time `locationName:"registeredAt" type:"timestamp" timestampFormat:"unix"` - - // For CPU and memory resource types, this parameter describes the amount of - // each resource that was available on the container instance when the container - // agent registered it with Amazon ECS; this value represents the total amount - // of CPU and memory that can be allocated on this container instance to tasks. - // For port resource types, this parameter describes the ports that were reserved - // by the Amazon ECS container agent when it registered the container instance - // with Amazon ECS. - RegisteredResources []*Resource `locationName:"registeredResources" type:"list"` - - // For CPU and memory resource types, this parameter describes the remaining - // CPU and memory that has not already been allocated to tasks and is therefore - // available for new tasks. For port resource types, this parameter describes - // the ports that were reserved by the Amazon ECS container agent (at instance - // registration time) and any task containers that have reserved port mappings - // on the host (with the host or bridge network mode). Any port that is not - // specified here is available for new tasks. - RemainingResources []*Resource `locationName:"remainingResources" type:"list"` - - // The number of tasks on the container instance that are in the RUNNING status. - RunningTasksCount *int64 `locationName:"runningTasksCount" type:"integer"` - - // The status of the container instance. The valid values are ACTIVE, INACTIVE, - // or DRAINING. ACTIVE indicates that the container instance can accept tasks. - // DRAINING indicates that new tasks are not placed on the container instance - // and any service tasks running on the container instance are removed if possible. - // For more information, see Container Instance Draining (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-draining.html) - // in the Amazon Elastic Container Service Developer Guide. - Status *string `locationName:"status" type:"string"` - - // The version counter for the container instance. Every time a container instance - // experiences a change that triggers a CloudWatch event, the version counter - // is incremented. If you are replicating your Amazon ECS container instance - // state with CloudWatch Events, you can compare the version of a container - // instance reported by the Amazon ECS APIs with the version reported in CloudWatch - // Events for the container instance (inside the detail object) to verify that - // the version in your event stream is current. - Version *int64 `locationName:"version" type:"long"` - - // The version information for the Amazon ECS container agent and Docker daemon - // running on the container instance. - VersionInfo *VersionInfo `locationName:"versionInfo" type:"structure"` -} - -// String returns the string representation -func (s ContainerInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContainerInstance) GoString() string { - return s.String() -} - -// SetAgentConnected sets the AgentConnected field's value. -func (s *ContainerInstance) SetAgentConnected(v bool) *ContainerInstance { - s.AgentConnected = &v - return s -} - -// SetAgentUpdateStatus sets the AgentUpdateStatus field's value. -func (s *ContainerInstance) SetAgentUpdateStatus(v string) *ContainerInstance { - s.AgentUpdateStatus = &v - return s -} - -// SetAttachments sets the Attachments field's value. -func (s *ContainerInstance) SetAttachments(v []*Attachment) *ContainerInstance { - s.Attachments = v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *ContainerInstance) SetAttributes(v []*Attribute) *ContainerInstance { - s.Attributes = v - return s -} - -// SetContainerInstanceArn sets the ContainerInstanceArn field's value. -func (s *ContainerInstance) SetContainerInstanceArn(v string) *ContainerInstance { - s.ContainerInstanceArn = &v - return s -} - -// SetEc2InstanceId sets the Ec2InstanceId field's value. -func (s *ContainerInstance) SetEc2InstanceId(v string) *ContainerInstance { - s.Ec2InstanceId = &v - return s -} - -// SetPendingTasksCount sets the PendingTasksCount field's value. -func (s *ContainerInstance) SetPendingTasksCount(v int64) *ContainerInstance { - s.PendingTasksCount = &v - return s -} - -// SetRegisteredAt sets the RegisteredAt field's value. -func (s *ContainerInstance) SetRegisteredAt(v time.Time) *ContainerInstance { - s.RegisteredAt = &v - return s -} - -// SetRegisteredResources sets the RegisteredResources field's value. -func (s *ContainerInstance) SetRegisteredResources(v []*Resource) *ContainerInstance { - s.RegisteredResources = v - return s -} - -// SetRemainingResources sets the RemainingResources field's value. -func (s *ContainerInstance) SetRemainingResources(v []*Resource) *ContainerInstance { - s.RemainingResources = v - return s -} - -// SetRunningTasksCount sets the RunningTasksCount field's value. -func (s *ContainerInstance) SetRunningTasksCount(v int64) *ContainerInstance { - s.RunningTasksCount = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ContainerInstance) SetStatus(v string) *ContainerInstance { - s.Status = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *ContainerInstance) SetVersion(v int64) *ContainerInstance { - s.Version = &v - return s -} - -// SetVersionInfo sets the VersionInfo field's value. -func (s *ContainerInstance) SetVersionInfo(v *VersionInfo) *ContainerInstance { - s.VersionInfo = v - return s -} - -// The overrides that should be sent to a container. -type ContainerOverride struct { - _ struct{} `type:"structure"` - - // The command to send to the container that overrides the default command from - // the Docker image or the task definition. You must also specify a container - // name. - Command []*string `locationName:"command" type:"list"` - - // The number of cpu units reserved for the container, instead of the default - // value from the task definition. You must also specify a container name. - Cpu *int64 `locationName:"cpu" type:"integer"` - - // The environment variables to send to the container. You can add new environment - // variables, which are added to the container at launch, or you can override - // the existing environment variables from the Docker image or the task definition. - // You must also specify a container name. - Environment []*KeyValuePair `locationName:"environment" type:"list"` - - // The hard limit (in MiB) of memory to present to the container, instead of - // the default value from the task definition. If your container attempts to - // exceed the memory specified here, the container is killed. You must also - // specify a container name. - Memory *int64 `locationName:"memory" type:"integer"` - - // The soft limit (in MiB) of memory to reserve for the container, instead of - // the default value from the task definition. You must also specify a container - // name. - MemoryReservation *int64 `locationName:"memoryReservation" type:"integer"` - - // The name of the container that receives the override. This parameter is required - // if any override is specified. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s ContainerOverride) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContainerOverride) GoString() string { - return s.String() -} - -// SetCommand sets the Command field's value. -func (s *ContainerOverride) SetCommand(v []*string) *ContainerOverride { - s.Command = v - return s -} - -// SetCpu sets the Cpu field's value. -func (s *ContainerOverride) SetCpu(v int64) *ContainerOverride { - s.Cpu = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *ContainerOverride) SetEnvironment(v []*KeyValuePair) *ContainerOverride { - s.Environment = v - return s -} - -// SetMemory sets the Memory field's value. -func (s *ContainerOverride) SetMemory(v int64) *ContainerOverride { - s.Memory = &v - return s -} - -// SetMemoryReservation sets the MemoryReservation field's value. -func (s *ContainerOverride) SetMemoryReservation(v int64) *ContainerOverride { - s.MemoryReservation = &v - return s -} - -// SetName sets the Name field's value. -func (s *ContainerOverride) SetName(v string) *ContainerOverride { - s.Name = &v - return s -} - -// An object representing a change in state for a container. -type ContainerStateChange struct { - _ struct{} `type:"structure"` - - // The name of the container. - ContainerName *string `locationName:"containerName" type:"string"` - - // The exit code for the container, if the state change is a result of the container - // exiting. - ExitCode *int64 `locationName:"exitCode" type:"integer"` - - // Any network bindings associated with the container. - NetworkBindings []*NetworkBinding `locationName:"networkBindings" type:"list"` - - // The reason for the state change. - Reason *string `locationName:"reason" type:"string"` - - // The status of the container. - Status *string `locationName:"status" type:"string"` -} - -// String returns the string representation -func (s ContainerStateChange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ContainerStateChange) GoString() string { - return s.String() -} - -// SetContainerName sets the ContainerName field's value. -func (s *ContainerStateChange) SetContainerName(v string) *ContainerStateChange { - s.ContainerName = &v - return s -} - -// SetExitCode sets the ExitCode field's value. -func (s *ContainerStateChange) SetExitCode(v int64) *ContainerStateChange { - s.ExitCode = &v - return s -} - -// SetNetworkBindings sets the NetworkBindings field's value. -func (s *ContainerStateChange) SetNetworkBindings(v []*NetworkBinding) *ContainerStateChange { - s.NetworkBindings = v - return s -} - -// SetReason sets the Reason field's value. -func (s *ContainerStateChange) SetReason(v string) *ContainerStateChange { - s.Reason = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ContainerStateChange) SetStatus(v string) *ContainerStateChange { - s.Status = &v - return s -} - -type CreateClusterInput struct { - _ struct{} `type:"structure"` - - // The name of your cluster. If you do not specify a name for your cluster, - // you create a cluster named default. Up to 255 letters (uppercase and lowercase), - // numbers, hyphens, and underscores are allowed. - ClusterName *string `locationName:"clusterName" type:"string"` -} - -// String returns the string representation -func (s CreateClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterInput) GoString() string { - return s.String() -} - -// SetClusterName sets the ClusterName field's value. -func (s *CreateClusterInput) SetClusterName(v string) *CreateClusterInput { - s.ClusterName = &v - return s -} - -type CreateClusterOutput struct { - _ struct{} `type:"structure"` - - // The full description of your new cluster. - Cluster *Cluster `locationName:"cluster" type:"structure"` -} - -// String returns the string representation -func (s CreateClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *CreateClusterOutput) SetCluster(v *Cluster) *CreateClusterOutput { - s.Cluster = v - return s -} - -type CreateServiceInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. Up to 32 ASCII characters are allowed. - ClientToken *string `locationName:"clientToken" type:"string"` - - // The short name or full Amazon Resource Name (ARN) of the cluster on which - // to run your service. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // Optional deployment parameters that control how many tasks run during the - // deployment and the ordering of stopping and starting tasks. - DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"` - - // The number of instantiations of the specified task definition to place and - // keep running on your cluster. - // - // DesiredCount is a required field - DesiredCount *int64 `locationName:"desiredCount" type:"integer" required:"true"` - - // The period of time, in seconds, that the Amazon ECS service scheduler should - // ignore unhealthy Elastic Load Balancing target health checks after a task - // has first started. This is only valid if your service is configured to use - // a load balancer. If your service's tasks take a while to start and respond - // to Elastic Load Balancing health checks, you can specify a health check grace - // period of up to 1,800 seconds during which the ECS service scheduler ignores - // health check status. This grace period can prevent the ECS service scheduler - // from marking tasks as unhealthy and stopping them before they have time to - // come up. - HealthCheckGracePeriodSeconds *int64 `locationName:"healthCheckGracePeriodSeconds" type:"integer"` - - // The launch type on which to run your service. - LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` - - // A load balancer object representing the load balancer to use with your service. - // Currently, you are limited to one load balancer or target group per service. - // After you create a service, the load balancer name or target group ARN, container - // name, and container port specified in the service definition are immutable. - // - // For Classic Load Balancers, this object must contain the load balancer name, - // the container name (as it appears in a container definition), and the container - // port to access from the load balancer. When a task from this service is placed - // on a container instance, the container instance is registered with the load - // balancer specified here. - // - // For Application Load Balancers and Network Load Balancers, this object must - // contain the load balancer target group ARN, the container name (as it appears - // in a container definition), and the container port to access from the load - // balancer. When a task from this service is placed on a container instance, - // the container instance and port combination is registered as a target in - // the target group specified here. - // - // Services with tasks that use the awsvpc network mode (for example, those - // with the Fargate launch type) only support Application Load Balancers and - // Network Load Balancers; Classic Load Balancers are not supported. Also, when - // you create any target groups for these services, you must choose ip as the - // target type, not instance, because tasks that use the awsvpc network mode - // are associated with an elastic network interface, not an Amazon EC2 instance. - LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"` - - // The network configuration for the service. This parameter is required for - // task definitions that use the awsvpc network mode to receive their own Elastic - // Network Interface, and it is not supported for other network modes. For more - // information, see Task Networking (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) - // in the Amazon Elastic Container Service Developer Guide. - NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"` - - // An array of placement constraint objects to use for tasks in your service. - // You can specify a maximum of 10 constraints per task (this limit includes - // constraints in the task definition and those specified at run time). - PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The placement strategy objects to use for tasks in your service. You can - // specify a maximum of five strategy rules per service. - PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"` - - // The platform version on which to run your service. If one is not specified, - // the latest version is used by default. - PlatformVersion *string `locationName:"platformVersion" type:"string"` - - // The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon - // ECS to make calls to your load balancer on your behalf. This parameter is - // only permitted if you are using a load balancer with your service and your - // task definition does not use the awsvpc network mode. If you specify the - // role parameter, you must also specify a load balancer object with the loadBalancers - // parameter. - // - // If your account has already created the Amazon ECS service-linked role, that - // role is used by default for your service unless you specify a role here. - // The service-linked role is required if your task definition uses the awsvpc - // network mode, in which case you should not specify a role here. For more - // information, see Using Service-Linked Roles for Amazon ECS (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) - // in the Amazon Elastic Container Service Developer Guide. - // - // If your specified role has a path other than /, then you must either specify - // the full role ARN (this is recommended) or prefix the role name with the - // path. For example, if a role with the name bar has a path of /foo/ then you - // would specify /foo/bar as the role name. For more information, see Friendly - // Names and Paths (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) - // in the IAM User Guide. - Role *string `locationName:"role" type:"string"` - - // The name of your service. Up to 255 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. Service names must be unique within - // a cluster, but you can have similarly named services in multiple clusters - // within a region or across multiple regions. - // - // ServiceName is a required field - ServiceName *string `locationName:"serviceName" type:"string" required:"true"` - - // The details of the service discovery registries you want to assign to this - // service. For more information, see Service Discovery (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html). - // - // Service discovery is supported for Fargate tasks if using platform version - // v1.1.0 or later. For more information, see AWS Fargate Platform Versions - // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html). - ServiceRegistries []*ServiceRegistry `locationName:"serviceRegistries" type:"list"` - - // The family and revision (family:revision) or full ARN of the task definition - // to run in your service. If a revision is not specified, the latest ACTIVE - // revision is used. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateServiceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateServiceInput"} - if s.DesiredCount == nil { - invalidParams.Add(request.NewErrParamRequired("DesiredCount")) - } - if s.ServiceName == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceName")) - } - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - if s.NetworkConfiguration != nil { - if err := s.NetworkConfiguration.Validate(); err != nil { - invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateServiceInput) SetClientToken(v string) *CreateServiceInput { - s.ClientToken = &v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *CreateServiceInput) SetCluster(v string) *CreateServiceInput { - s.Cluster = &v - return s -} - -// SetDeploymentConfiguration sets the DeploymentConfiguration field's value. -func (s *CreateServiceInput) SetDeploymentConfiguration(v *DeploymentConfiguration) *CreateServiceInput { - s.DeploymentConfiguration = v - return s -} - -// SetDesiredCount sets the DesiredCount field's value. -func (s *CreateServiceInput) SetDesiredCount(v int64) *CreateServiceInput { - s.DesiredCount = &v - return s -} - -// SetHealthCheckGracePeriodSeconds sets the HealthCheckGracePeriodSeconds field's value. -func (s *CreateServiceInput) SetHealthCheckGracePeriodSeconds(v int64) *CreateServiceInput { - s.HealthCheckGracePeriodSeconds = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *CreateServiceInput) SetLaunchType(v string) *CreateServiceInput { - s.LaunchType = &v - return s -} - -// SetLoadBalancers sets the LoadBalancers field's value. -func (s *CreateServiceInput) SetLoadBalancers(v []*LoadBalancer) *CreateServiceInput { - s.LoadBalancers = v - return s -} - -// SetNetworkConfiguration sets the NetworkConfiguration field's value. -func (s *CreateServiceInput) SetNetworkConfiguration(v *NetworkConfiguration) *CreateServiceInput { - s.NetworkConfiguration = v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *CreateServiceInput) SetPlacementConstraints(v []*PlacementConstraint) *CreateServiceInput { - s.PlacementConstraints = v - return s -} - -// SetPlacementStrategy sets the PlacementStrategy field's value. -func (s *CreateServiceInput) SetPlacementStrategy(v []*PlacementStrategy) *CreateServiceInput { - s.PlacementStrategy = v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *CreateServiceInput) SetPlatformVersion(v string) *CreateServiceInput { - s.PlatformVersion = &v - return s -} - -// SetRole sets the Role field's value. -func (s *CreateServiceInput) SetRole(v string) *CreateServiceInput { - s.Role = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *CreateServiceInput) SetServiceName(v string) *CreateServiceInput { - s.ServiceName = &v - return s -} - -// SetServiceRegistries sets the ServiceRegistries field's value. -func (s *CreateServiceInput) SetServiceRegistries(v []*ServiceRegistry) *CreateServiceInput { - s.ServiceRegistries = v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *CreateServiceInput) SetTaskDefinition(v string) *CreateServiceInput { - s.TaskDefinition = &v - return s -} - -type CreateServiceOutput struct { - _ struct{} `type:"structure"` - - // The full description of your service following the create call. - Service *Service `locationName:"service" type:"structure"` -} - -// String returns the string representation -func (s CreateServiceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateServiceOutput) GoString() string { - return s.String() -} - -// SetService sets the Service field's value. -func (s *CreateServiceOutput) SetService(v *Service) *CreateServiceOutput { - s.Service = v - return s -} - -type DeleteAttributesInput struct { - _ struct{} `type:"structure"` - - // The attributes to delete from your resource. You can specify up to 10 attributes - // per request. For custom attributes, specify the attribute name and target - // ID, but do not specify the value. If you specify the target ID using the - // short form, you must also specify the target type. - // - // Attributes is a required field - Attributes []*Attribute `locationName:"attributes" type:"list" required:"true"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that contains - // the resource to delete attributes. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` -} - -// String returns the string representation -func (s DeleteAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *DeleteAttributesInput) SetAttributes(v []*Attribute) *DeleteAttributesInput { - s.Attributes = v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteAttributesInput) SetCluster(v string) *DeleteAttributesInput { - s.Cluster = &v - return s -} - -type DeleteAttributesOutput struct { - _ struct{} `type:"structure"` - - // A list of attribute objects that were successfully deleted from your resource. - Attributes []*Attribute `locationName:"attributes" type:"list"` -} - -// String returns the string representation -func (s DeleteAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *DeleteAttributesOutput) SetAttributes(v []*Attribute) *DeleteAttributesOutput { - s.Attributes = v - return s -} - -type DeleteClusterInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster to delete. - // - // Cluster is a required field - Cluster *string `locationName:"cluster" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteClusterInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"} - if s.Cluster == nil { - invalidParams.Add(request.NewErrParamRequired("Cluster")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteClusterInput) SetCluster(v string) *DeleteClusterInput { - s.Cluster = &v - return s -} - -type DeleteClusterOutput struct { - _ struct{} `type:"structure"` - - // The full description of the deleted cluster. - Cluster *Cluster `locationName:"cluster" type:"structure"` -} - -// String returns the string representation -func (s DeleteClusterOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteClusterOutput) SetCluster(v *Cluster) *DeleteClusterOutput { - s.Cluster = v - return s -} - -type DeleteServiceInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the service to delete. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The name of the service to delete. - // - // Service is a required field - Service *string `locationName:"service" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteServiceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServiceInput"} - if s.Service == nil { - invalidParams.Add(request.NewErrParamRequired("Service")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteServiceInput) SetCluster(v string) *DeleteServiceInput { - s.Cluster = &v - return s -} - -// SetService sets the Service field's value. -func (s *DeleteServiceInput) SetService(v string) *DeleteServiceInput { - s.Service = &v - return s -} - -type DeleteServiceOutput struct { - _ struct{} `type:"structure"` - - // The full description of the deleted service. - Service *Service `locationName:"service" type:"structure"` -} - -// String returns the string representation -func (s DeleteServiceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteServiceOutput) GoString() string { - return s.String() -} - -// SetService sets the Service field's value. -func (s *DeleteServiceOutput) SetService(v *Service) *DeleteServiceOutput { - s.Service = v - return s -} - -// The details of an Amazon ECS service deployment. -type Deployment struct { - _ struct{} `type:"structure"` - - // The Unix time stamp for when the service was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The most recent desired count of tasks that was specified for the service - // to deploy or maintain. - DesiredCount *int64 `locationName:"desiredCount" type:"integer"` - - // The ID of the deployment. - Id *string `locationName:"id" type:"string"` - - // The launch type on which your service is running. - LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` - - // The VPC subnet and security group configuration for tasks that receive their - // own Elastic Network Interface by using the awsvpc networking mode. - NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"` - - // The number of tasks in the deployment that are in the PENDING status. - PendingCount *int64 `locationName:"pendingCount" type:"integer"` - - // The platform version on which your service is running. - PlatformVersion *string `locationName:"platformVersion" type:"string"` - - // The number of tasks in the deployment that are in the RUNNING status. - RunningCount *int64 `locationName:"runningCount" type:"integer"` - - // The status of the deployment. Valid values are PRIMARY (for the most recent - // deployment), ACTIVE (for previous deployments that still have tasks running, - // but are being replaced with the PRIMARY deployment), and INACTIVE (for deployments - // that have been completely replaced). - Status *string `locationName:"status" type:"string"` - - // The most recent task definition that was specified for the service to use. - TaskDefinition *string `locationName:"taskDefinition" type:"string"` - - // The Unix time stamp for when the service was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s Deployment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Deployment) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Deployment) SetCreatedAt(v time.Time) *Deployment { - s.CreatedAt = &v - return s -} - -// SetDesiredCount sets the DesiredCount field's value. -func (s *Deployment) SetDesiredCount(v int64) *Deployment { - s.DesiredCount = &v - return s -} - -// SetId sets the Id field's value. -func (s *Deployment) SetId(v string) *Deployment { - s.Id = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *Deployment) SetLaunchType(v string) *Deployment { - s.LaunchType = &v - return s -} - -// SetNetworkConfiguration sets the NetworkConfiguration field's value. -func (s *Deployment) SetNetworkConfiguration(v *NetworkConfiguration) *Deployment { - s.NetworkConfiguration = v - return s -} - -// SetPendingCount sets the PendingCount field's value. -func (s *Deployment) SetPendingCount(v int64) *Deployment { - s.PendingCount = &v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *Deployment) SetPlatformVersion(v string) *Deployment { - s.PlatformVersion = &v - return s -} - -// SetRunningCount sets the RunningCount field's value. -func (s *Deployment) SetRunningCount(v int64) *Deployment { - s.RunningCount = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Deployment) SetStatus(v string) *Deployment { - s.Status = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *Deployment) SetTaskDefinition(v string) *Deployment { - s.TaskDefinition = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Deployment) SetUpdatedAt(v time.Time) *Deployment { - s.UpdatedAt = &v - return s -} - -// Optional deployment parameters that control how many tasks run during the -// deployment and the ordering of stopping and starting tasks. -type DeploymentConfiguration struct { - _ struct{} `type:"structure"` - - // The upper limit (as a percentage of the service's desiredCount) of the number - // of tasks that are allowed in the RUNNING or PENDING state in a service during - // a deployment. The maximum number of tasks during a deployment is the desiredCount - // multiplied by maximumPercent/100, rounded down to the nearest integer value. - MaximumPercent *int64 `locationName:"maximumPercent" type:"integer"` - - // The lower limit (as a percentage of the service's desiredCount) of the number - // of running tasks that must remain in the RUNNING state in a service during - // a deployment. The minimum number of healthy tasks during a deployment is - // the desiredCount multiplied by minimumHealthyPercent/100, rounded up to the - // nearest integer value. - MinimumHealthyPercent *int64 `locationName:"minimumHealthyPercent" type:"integer"` -} - -// String returns the string representation -func (s DeploymentConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentConfiguration) GoString() string { - return s.String() -} - -// SetMaximumPercent sets the MaximumPercent field's value. -func (s *DeploymentConfiguration) SetMaximumPercent(v int64) *DeploymentConfiguration { - s.MaximumPercent = &v - return s -} - -// SetMinimumHealthyPercent sets the MinimumHealthyPercent field's value. -func (s *DeploymentConfiguration) SetMinimumHealthyPercent(v int64) *DeploymentConfiguration { - s.MinimumHealthyPercent = &v - return s -} - -type DeregisterContainerInstanceInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container instance to deregister. If you do not specify a cluster, the - // default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance ID or full ARN of the container instance to deregister. - // The ARN contains the arn:aws:ecs namespace, followed by the region of the - // container instance, the AWS account ID of the container instance owner, the - // container-instance namespace, and then the container instance ID. For example, - // arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID. - // - // ContainerInstance is a required field - ContainerInstance *string `locationName:"containerInstance" type:"string" required:"true"` - - // Forces the deregistration of the container instance. If you have tasks running - // on the container instance when you deregister it with the force option, these - // tasks remain running until you terminate the instance or the tasks stop through - // some other means, but they are orphaned (no longer monitored or accounted - // for by Amazon ECS). If an orphaned task on your container instance is part - // of an Amazon ECS service, then the service scheduler starts another copy - // of that task, on a different container instance if possible. - // - // Any containers in orphaned service tasks that are registered with a Classic - // Load Balancer or an Application Load Balancer target group are deregistered. - // They begin connection draining according to the settings on the load balancer - // or target group. - Force *bool `locationName:"force" type:"boolean"` -} - -// String returns the string representation -func (s DeregisterContainerInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterContainerInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterContainerInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterContainerInstanceInput"} - if s.ContainerInstance == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstance")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DeregisterContainerInstanceInput) SetCluster(v string) *DeregisterContainerInstanceInput { - s.Cluster = &v - return s -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *DeregisterContainerInstanceInput) SetContainerInstance(v string) *DeregisterContainerInstanceInput { - s.ContainerInstance = &v - return s -} - -// SetForce sets the Force field's value. -func (s *DeregisterContainerInstanceInput) SetForce(v bool) *DeregisterContainerInstanceInput { - s.Force = &v - return s -} - -type DeregisterContainerInstanceOutput struct { - _ struct{} `type:"structure"` - - // The container instance that was deregistered. - ContainerInstance *ContainerInstance `locationName:"containerInstance" type:"structure"` -} - -// String returns the string representation -func (s DeregisterContainerInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterContainerInstanceOutput) GoString() string { - return s.String() -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *DeregisterContainerInstanceOutput) SetContainerInstance(v *ContainerInstance) *DeregisterContainerInstanceOutput { - s.ContainerInstance = v - return s -} - -type DeregisterTaskDefinitionInput struct { - _ struct{} `type:"structure"` - - // The family and revision (family:revision) or full Amazon Resource Name (ARN) - // of the task definition to deregister. You must specify a revision. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterTaskDefinitionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTaskDefinitionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterTaskDefinitionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterTaskDefinitionInput"} - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *DeregisterTaskDefinitionInput) SetTaskDefinition(v string) *DeregisterTaskDefinitionInput { - s.TaskDefinition = &v - return s -} - -type DeregisterTaskDefinitionOutput struct { - _ struct{} `type:"structure"` - - // The full description of the deregistered task. - TaskDefinition *TaskDefinition `locationName:"taskDefinition" type:"structure"` -} - -// String returns the string representation -func (s DeregisterTaskDefinitionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterTaskDefinitionOutput) GoString() string { - return s.String() -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *DeregisterTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *DeregisterTaskDefinitionOutput { - s.TaskDefinition = v - return s -} - -type DescribeClustersInput struct { - _ struct{} `type:"structure"` - - // A list of up to 100 cluster names or full cluster Amazon Resource Name (ARN) - // entries. If you do not specify a cluster, the default cluster is assumed. - Clusters []*string `locationName:"clusters" type:"list"` - - // Additional information about your clusters to be separated by launch type, - // including: - // - // * runningEC2TasksCount - // - // * runningFargateTasksCount - // - // * pendingEC2TasksCount - // - // * pendingFargateTasksCount - // - // * activeEC2ServiceCount - // - // * activeFargateServiceCount - // - // * drainingEC2ServiceCount - // - // * drainingFargateServiceCount - Include []*string `locationName:"include" type:"list"` -} - -// String returns the string representation -func (s DescribeClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClustersInput) GoString() string { - return s.String() -} - -// SetClusters sets the Clusters field's value. -func (s *DescribeClustersInput) SetClusters(v []*string) *DescribeClustersInput { - s.Clusters = v - return s -} - -// SetInclude sets the Include field's value. -func (s *DescribeClustersInput) SetInclude(v []*string) *DescribeClustersInput { - s.Include = v - return s -} - -type DescribeClustersOutput struct { - _ struct{} `type:"structure"` - - // The list of clusters. - Clusters []*Cluster `locationName:"clusters" type:"list"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` -} - -// String returns the string representation -func (s DescribeClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClustersOutput) GoString() string { - return s.String() -} - -// SetClusters sets the Clusters field's value. -func (s *DescribeClustersOutput) SetClusters(v []*Cluster) *DescribeClustersOutput { - s.Clusters = v - return s -} - -// SetFailures sets the Failures field's value. -func (s *DescribeClustersOutput) SetFailures(v []*Failure) *DescribeClustersOutput { - s.Failures = v - return s -} - -type DescribeContainerInstancesInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container instances to describe. If you do not specify a cluster, the - // default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // A list of up to 100 container instance IDs or full Amazon Resource Name (ARN) - // entries. - // - // ContainerInstances is a required field - ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeContainerInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeContainerInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeContainerInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeContainerInstancesInput"} - if s.ContainerInstances == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstances")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DescribeContainerInstancesInput) SetCluster(v string) *DescribeContainerInstancesInput { - s.Cluster = &v - return s -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *DescribeContainerInstancesInput) SetContainerInstances(v []*string) *DescribeContainerInstancesInput { - s.ContainerInstances = v - return s -} - -type DescribeContainerInstancesOutput struct { - _ struct{} `type:"structure"` - - // The list of container instances. - ContainerInstances []*ContainerInstance `locationName:"containerInstances" type:"list"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` -} - -// String returns the string representation -func (s DescribeContainerInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeContainerInstancesOutput) GoString() string { - return s.String() -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *DescribeContainerInstancesOutput) SetContainerInstances(v []*ContainerInstance) *DescribeContainerInstancesOutput { - s.ContainerInstances = v - return s -} - -// SetFailures sets the Failures field's value. -func (s *DescribeContainerInstancesOutput) SetFailures(v []*Failure) *DescribeContainerInstancesOutput { - s.Failures = v - return s -} - -type DescribeServicesInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN)the cluster that hosts the - // service to describe. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // A list of services to describe. You may specify up to 10 services to describe - // in a single operation. - // - // Services is a required field - Services []*string `locationName:"services" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeServicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeServicesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeServicesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeServicesInput"} - if s.Services == nil { - invalidParams.Add(request.NewErrParamRequired("Services")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DescribeServicesInput) SetCluster(v string) *DescribeServicesInput { - s.Cluster = &v - return s -} - -// SetServices sets the Services field's value. -func (s *DescribeServicesInput) SetServices(v []*string) *DescribeServicesInput { - s.Services = v - return s -} - -type DescribeServicesOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` - - // The list of services described. - Services []*Service `locationName:"services" type:"list"` -} - -// String returns the string representation -func (s DescribeServicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeServicesOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *DescribeServicesOutput) SetFailures(v []*Failure) *DescribeServicesOutput { - s.Failures = v - return s -} - -// SetServices sets the Services field's value. -func (s *DescribeServicesOutput) SetServices(v []*Service) *DescribeServicesOutput { - s.Services = v - return s -} - -type DescribeTaskDefinitionInput struct { - _ struct{} `type:"structure"` - - // The family for the latest ACTIVE revision, family and revision (family:revision) - // for a specific revision in the family, or full Amazon Resource Name (ARN) - // of the task definition to describe. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeTaskDefinitionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTaskDefinitionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTaskDefinitionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTaskDefinitionInput"} - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *DescribeTaskDefinitionInput) SetTaskDefinition(v string) *DescribeTaskDefinitionInput { - s.TaskDefinition = &v - return s -} - -type DescribeTaskDefinitionOutput struct { - _ struct{} `type:"structure"` - - // The full task definition description. - TaskDefinition *TaskDefinition `locationName:"taskDefinition" type:"structure"` -} - -// String returns the string representation -func (s DescribeTaskDefinitionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTaskDefinitionOutput) GoString() string { - return s.String() -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *DescribeTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *DescribeTaskDefinitionOutput { - s.TaskDefinition = v - return s -} - -type DescribeTasksInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the task to describe. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // A list of up to 100 task IDs or full ARN entries. - // - // Tasks is a required field - Tasks []*string `locationName:"tasks" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTasksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTasksInput"} - if s.Tasks == nil { - invalidParams.Add(request.NewErrParamRequired("Tasks")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *DescribeTasksInput) SetCluster(v string) *DescribeTasksInput { - s.Cluster = &v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *DescribeTasksInput) SetTasks(v []*string) *DescribeTasksInput { - s.Tasks = v - return s -} - -type DescribeTasksOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` - - // The list of tasks. - Tasks []*Task `locationName:"tasks" type:"list"` -} - -// String returns the string representation -func (s DescribeTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTasksOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *DescribeTasksOutput) SetFailures(v []*Failure) *DescribeTasksOutput { - s.Failures = v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *DescribeTasksOutput) SetTasks(v []*Task) *DescribeTasksOutput { - s.Tasks = v - return s -} - -// An object representing a container instance host device. -type Device struct { - _ struct{} `type:"structure"` - - // The path inside the container at which to expose the host device. - ContainerPath *string `locationName:"containerPath" type:"string"` - - // The path for the device on the host container instance. - // - // HostPath is a required field - HostPath *string `locationName:"hostPath" type:"string" required:"true"` - - // The explicit permissions to provide to the container for the device. By default, - // the container has permissions for read, write, and mknod for the device. - Permissions []*string `locationName:"permissions" type:"list"` -} - -// String returns the string representation -func (s Device) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Device) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Device) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Device"} - if s.HostPath == nil { - invalidParams.Add(request.NewErrParamRequired("HostPath")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContainerPath sets the ContainerPath field's value. -func (s *Device) SetContainerPath(v string) *Device { - s.ContainerPath = &v - return s -} - -// SetHostPath sets the HostPath field's value. -func (s *Device) SetHostPath(v string) *Device { - s.HostPath = &v - return s -} - -// SetPermissions sets the Permissions field's value. -func (s *Device) SetPermissions(v []*string) *Device { - s.Permissions = v - return s -} - -type DiscoverPollEndpointInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that the - // container instance belongs to. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance ID or full ARN of the container instance. The ARN - // contains the arn:aws:ecs namespace, followed by the region of the container - // instance, the AWS account ID of the container instance owner, the container-instance - // namespace, and then the container instance ID. For example, arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID. - ContainerInstance *string `locationName:"containerInstance" type:"string"` -} - -// String returns the string representation -func (s DiscoverPollEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiscoverPollEndpointInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *DiscoverPollEndpointInput) SetCluster(v string) *DiscoverPollEndpointInput { - s.Cluster = &v - return s -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *DiscoverPollEndpointInput) SetContainerInstance(v string) *DiscoverPollEndpointInput { - s.ContainerInstance = &v - return s -} - -type DiscoverPollEndpointOutput struct { - _ struct{} `type:"structure"` - - // The endpoint for the Amazon ECS agent to poll. - Endpoint *string `locationName:"endpoint" type:"string"` - - // The telemetry endpoint for the Amazon ECS agent. - TelemetryEndpoint *string `locationName:"telemetryEndpoint" type:"string"` -} - -// String returns the string representation -func (s DiscoverPollEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiscoverPollEndpointOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *DiscoverPollEndpointOutput) SetEndpoint(v string) *DiscoverPollEndpointOutput { - s.Endpoint = &v - return s -} - -// SetTelemetryEndpoint sets the TelemetryEndpoint field's value. -func (s *DiscoverPollEndpointOutput) SetTelemetryEndpoint(v string) *DiscoverPollEndpointOutput { - s.TelemetryEndpoint = &v - return s -} - -// A failed resource. -type Failure struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the failed resource. - Arn *string `locationName:"arn" type:"string"` - - // The reason for the failure. - Reason *string `locationName:"reason" type:"string"` -} - -// String returns the string representation -func (s Failure) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Failure) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Failure) SetArn(v string) *Failure { - s.Arn = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *Failure) SetReason(v string) *Failure { - s.Reason = &v - return s -} - -// An object representing a container health check. Health check parameters -// that are specified in a container definition override any Docker health checks -// that exist in the container image (such as those specified in a parent image -// or from the image's Dockerfile). -type HealthCheck struct { - _ struct{} `type:"structure"` - - // A string array representing the command that the container runs to determine - // if it is healthy. The string array must start with CMD to execute the command - // arguments directly, or CMD-SHELL to run the command with the container's - // default shell. For example: - // - // [ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ] - // - // An exit code of 0 indicates success, and non-zero exit code indicates failure. - // For more information, see HealthCheck in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/). - // - // Command is a required field - Command []*string `locationName:"command" type:"list" required:"true"` - - // The time period in seconds between each health check execution. You may specify - // between 5 and 300 seconds. The default value is 30 seconds. - Interval *int64 `locationName:"interval" type:"integer"` - - // The number of times to retry a failed health check before the container is - // considered unhealthy. You may specify between 1 and 10 retries. The default - // value is 3 retries. - Retries *int64 `locationName:"retries" type:"integer"` - - // The optional grace period within which to provide containers time to bootstrap - // before failed health checks count towards the maximum number of retries. - // You may specify between 0 and 300 seconds. The startPeriod is disabled by - // default. - // - // If a health check succeeds within the startPeriod, then the container is - // considered healthy and any subsequent failures count toward the maximum number - // of retries. - StartPeriod *int64 `locationName:"startPeriod" type:"integer"` - - // The time period in seconds to wait for a health check to succeed before it - // is considered a failure. You may specify between 2 and 60 seconds. The default - // value is 5 seconds. - Timeout *int64 `locationName:"timeout" type:"integer"` -} - -// String returns the string representation -func (s HealthCheck) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HealthCheck) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HealthCheck) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HealthCheck"} - if s.Command == nil { - invalidParams.Add(request.NewErrParamRequired("Command")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommand sets the Command field's value. -func (s *HealthCheck) SetCommand(v []*string) *HealthCheck { - s.Command = v - return s -} - -// SetInterval sets the Interval field's value. -func (s *HealthCheck) SetInterval(v int64) *HealthCheck { - s.Interval = &v - return s -} - -// SetRetries sets the Retries field's value. -func (s *HealthCheck) SetRetries(v int64) *HealthCheck { - s.Retries = &v - return s -} - -// SetStartPeriod sets the StartPeriod field's value. -func (s *HealthCheck) SetStartPeriod(v int64) *HealthCheck { - s.StartPeriod = &v - return s -} - -// SetTimeout sets the Timeout field's value. -func (s *HealthCheck) SetTimeout(v int64) *HealthCheck { - s.Timeout = &v - return s -} - -// Hostnames and IP address entries that are added to the /etc/hosts file of -// a container via the extraHosts parameter of its ContainerDefinition. -type HostEntry struct { - _ struct{} `type:"structure"` - - // The hostname to use in the /etc/hosts entry. - // - // Hostname is a required field - Hostname *string `locationName:"hostname" type:"string" required:"true"` - - // The IP address to use in the /etc/hosts entry. - // - // IpAddress is a required field - IpAddress *string `locationName:"ipAddress" type:"string" required:"true"` -} - -// String returns the string representation -func (s HostEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostEntry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HostEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HostEntry"} - if s.Hostname == nil { - invalidParams.Add(request.NewErrParamRequired("Hostname")) - } - if s.IpAddress == nil { - invalidParams.Add(request.NewErrParamRequired("IpAddress")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostname sets the Hostname field's value. -func (s *HostEntry) SetHostname(v string) *HostEntry { - s.Hostname = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *HostEntry) SetIpAddress(v string) *HostEntry { - s.IpAddress = &v - return s -} - -// Details on a container instance host volume. -type HostVolumeProperties struct { - _ struct{} `type:"structure"` - - // The path on the host container instance that is presented to the container. - // If this parameter is empty, then the Docker daemon has assigned a host path - // for you. If the host parameter contains a sourcePath file location, then - // the data volume persists at the specified location on the host container - // instance until you delete it manually. If the sourcePath value does not exist - // on the host container instance, the Docker daemon creates it. If the location - // does exist, the contents of the source path folder are exported. - // - // If you are using the Fargate launch type, the sourcePath parameter is not - // supported. - SourcePath *string `locationName:"sourcePath" type:"string"` -} - -// String returns the string representation -func (s HostVolumeProperties) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostVolumeProperties) GoString() string { - return s.String() -} - -// SetSourcePath sets the SourcePath field's value. -func (s *HostVolumeProperties) SetSourcePath(v string) *HostVolumeProperties { - s.SourcePath = &v - return s -} - -// The Linux capabilities for the container that are added to or dropped from -// the default configuration provided by Docker. For more information on the -// default capabilities and the non-default available capabilities, see Runtime -// privilege and Linux capabilities (https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) -// in the Docker run reference. For more detailed information on these Linux -// capabilities, see the capabilities(7) (http://man7.org/linux/man-pages/man7/capabilities.7.html) -// Linux manual page. -type KernelCapabilities struct { - _ struct{} `type:"structure"` - - // The Linux capabilities for the container that have been added to the default - // configuration provided by Docker. This parameter maps to CapAdd in the Create - // a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --cap-add option to docker run (https://docs.docker.com/engine/reference/run/). - // - // If you are using tasks that use the Fargate launch type, the add parameter - // is not supported. - // - // Valid values: "ALL" | "AUDIT_CONTROL" | "AUDIT_WRITE" | "BLOCK_SUSPEND" | - // "CHOWN" | "DAC_OVERRIDE" | "DAC_READ_SEARCH" | "FOWNER" | "FSETID" | "IPC_LOCK" - // | "IPC_OWNER" | "KILL" | "LEASE" | "LINUX_IMMUTABLE" | "MAC_ADMIN" | "MAC_OVERRIDE" - // | "MKNOD" | "NET_ADMIN" | "NET_BIND_SERVICE" | "NET_BROADCAST" | "NET_RAW" - // | "SETFCAP" | "SETGID" | "SETPCAP" | "SETUID" | "SYS_ADMIN" | "SYS_BOOT" - // | "SYS_CHROOT" | "SYS_MODULE" | "SYS_NICE" | "SYS_PACCT" | "SYS_PTRACE" | - // "SYS_RAWIO" | "SYS_RESOURCE" | "SYS_TIME" | "SYS_TTY_CONFIG" | "SYSLOG" | - // "WAKE_ALARM" - Add []*string `locationName:"add" type:"list"` - - // The Linux capabilities for the container that have been removed from the - // default configuration provided by Docker. This parameter maps to CapDrop - // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --cap-drop option to docker run (https://docs.docker.com/engine/reference/run/). - // - // Valid values: "ALL" | "AUDIT_CONTROL" | "AUDIT_WRITE" | "BLOCK_SUSPEND" | - // "CHOWN" | "DAC_OVERRIDE" | "DAC_READ_SEARCH" | "FOWNER" | "FSETID" | "IPC_LOCK" - // | "IPC_OWNER" | "KILL" | "LEASE" | "LINUX_IMMUTABLE" | "MAC_ADMIN" | "MAC_OVERRIDE" - // | "MKNOD" | "NET_ADMIN" | "NET_BIND_SERVICE" | "NET_BROADCAST" | "NET_RAW" - // | "SETFCAP" | "SETGID" | "SETPCAP" | "SETUID" | "SYS_ADMIN" | "SYS_BOOT" - // | "SYS_CHROOT" | "SYS_MODULE" | "SYS_NICE" | "SYS_PACCT" | "SYS_PTRACE" | - // "SYS_RAWIO" | "SYS_RESOURCE" | "SYS_TIME" | "SYS_TTY_CONFIG" | "SYSLOG" | - // "WAKE_ALARM" - Drop []*string `locationName:"drop" type:"list"` -} - -// String returns the string representation -func (s KernelCapabilities) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KernelCapabilities) GoString() string { - return s.String() -} - -// SetAdd sets the Add field's value. -func (s *KernelCapabilities) SetAdd(v []*string) *KernelCapabilities { - s.Add = v - return s -} - -// SetDrop sets the Drop field's value. -func (s *KernelCapabilities) SetDrop(v []*string) *KernelCapabilities { - s.Drop = v - return s -} - -// A key and value pair object. -type KeyValuePair struct { - _ struct{} `type:"structure"` - - // The name of the key value pair. For environment variables, this is the name - // of the environment variable. - Name *string `locationName:"name" type:"string"` - - // The value of the key value pair. For environment variables, this is the value - // of the environment variable. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s KeyValuePair) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyValuePair) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *KeyValuePair) SetName(v string) *KeyValuePair { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *KeyValuePair) SetValue(v string) *KeyValuePair { - s.Value = &v - return s -} - -// Linux-specific options that are applied to the container, such as Linux KernelCapabilities. -type LinuxParameters struct { - _ struct{} `type:"structure"` - - // The Linux capabilities for the container that are added to or dropped from - // the default configuration provided by Docker. - // - // If you are using tasks that use the Fargate launch type, capabilities is - // supported but the add parameter is not supported. - Capabilities *KernelCapabilities `locationName:"capabilities" type:"structure"` - - // Any host devices to expose to the container. This parameter maps to Devices - // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/) - // and the --device option to docker run (https://docs.docker.com/engine/reference/run/). - // - // If you are using tasks that use the Fargate launch type, the devices parameter - // is not supported. - Devices []*Device `locationName:"devices" type:"list"` - - // Run an init process inside the container that forwards signals and reaps - // processes. This parameter maps to the --init option to docker run (https://docs.docker.com/engine/reference/run/). - // This parameter requires version 1.25 of the Docker Remote API or greater - // on your container instance. To check the Docker Remote API version on your - // container instance, log in to your container instance and run the following - // command: sudo docker version | grep "Server API version" - InitProcessEnabled *bool `locationName:"initProcessEnabled" type:"boolean"` - - // The value for the size (in MiB) of the /dev/shm volume. This parameter maps - // to the --shm-size option to docker run (https://docs.docker.com/engine/reference/run/). - // - // If you are using tasks that use the Fargate launch type, the sharedMemorySize - // parameter is not supported. - SharedMemorySize *int64 `locationName:"sharedMemorySize" type:"integer"` - - // The container path, mount options, and size (in MiB) of the tmpfs mount. - // This parameter maps to the --tmpfs option to docker run (https://docs.docker.com/engine/reference/run/). - // - // If you are using tasks that use the Fargate launch type, the tmpfs parameter - // is not supported. - Tmpfs []*Tmpfs `locationName:"tmpfs" type:"list"` -} - -// String returns the string representation -func (s LinuxParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LinuxParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LinuxParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LinuxParameters"} - if s.Devices != nil { - for i, v := range s.Devices { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Devices", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tmpfs != nil { - for i, v := range s.Tmpfs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tmpfs", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilities sets the Capabilities field's value. -func (s *LinuxParameters) SetCapabilities(v *KernelCapabilities) *LinuxParameters { - s.Capabilities = v - return s -} - -// SetDevices sets the Devices field's value. -func (s *LinuxParameters) SetDevices(v []*Device) *LinuxParameters { - s.Devices = v - return s -} - -// SetInitProcessEnabled sets the InitProcessEnabled field's value. -func (s *LinuxParameters) SetInitProcessEnabled(v bool) *LinuxParameters { - s.InitProcessEnabled = &v - return s -} - -// SetSharedMemorySize sets the SharedMemorySize field's value. -func (s *LinuxParameters) SetSharedMemorySize(v int64) *LinuxParameters { - s.SharedMemorySize = &v - return s -} - -// SetTmpfs sets the Tmpfs field's value. -func (s *LinuxParameters) SetTmpfs(v []*Tmpfs) *LinuxParameters { - s.Tmpfs = v - return s -} - -type ListAttributesInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute with which to filter the results. - AttributeName *string `locationName:"attributeName" type:"string"` - - // The value of the attribute with which to filter results. You must also specify - // an attribute name to use this parameter. - AttributeValue *string `locationName:"attributeValue" type:"string"` - - // The short name or full Amazon Resource Name (ARN) of the cluster to list - // attributes. If you do not specify a cluster, the default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The maximum number of cluster results returned by ListAttributes in paginated - // output. When this parameter is used, ListAttributes only returns maxResults - // results in a single page along with a nextToken response element. The remaining - // results of the initial request can be seen by sending another ListAttributes - // request with the returned nextToken value. This value can be between 1 and - // 100. If this parameter is not used, then ListAttributes returns up to 100 - // results and a nextToken value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListAttributes request - // where maxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // nextToken value. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The type of the target with which to list attributes. - // - // TargetType is a required field - TargetType *string `locationName:"targetType" type:"string" required:"true" enum:"TargetType"` -} - -// String returns the string representation -func (s ListAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAttributesInput"} - if s.TargetType == nil { - invalidParams.Add(request.NewErrParamRequired("TargetType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *ListAttributesInput) SetAttributeName(v string) *ListAttributesInput { - s.AttributeName = &v - return s -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *ListAttributesInput) SetAttributeValue(v string) *ListAttributesInput { - s.AttributeValue = &v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *ListAttributesInput) SetCluster(v string) *ListAttributesInput { - s.Cluster = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAttributesInput) SetMaxResults(v int64) *ListAttributesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAttributesInput) SetNextToken(v string) *ListAttributesInput { - s.NextToken = &v - return s -} - -// SetTargetType sets the TargetType field's value. -func (s *ListAttributesInput) SetTargetType(v string) *ListAttributesInput { - s.TargetType = &v - return s -} - -type ListAttributesOutput struct { - _ struct{} `type:"structure"` - - // A list of attribute objects that meet the criteria of the request. - Attributes []*Attribute `locationName:"attributes" type:"list"` - - // The nextToken value to include in a future ListAttributes request. When the - // results of a ListAttributes request exceed maxResults, this value can be - // used to retrieve the next page of results. This value is null when there - // are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *ListAttributesOutput) SetAttributes(v []*Attribute) *ListAttributesOutput { - s.Attributes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAttributesOutput) SetNextToken(v string) *ListAttributesOutput { - s.NextToken = &v - return s -} - -type ListClustersInput struct { - _ struct{} `type:"structure"` - - // The maximum number of cluster results returned by ListClusters in paginated - // output. When this parameter is used, ListClusters only returns maxResults - // results in a single page along with a nextToken response element. The remaining - // results of the initial request can be seen by sending another ListClusters - // request with the returned nextToken value. This value can be between 1 and - // 100. If this parameter is not used, then ListClusters returns up to 100 results - // and a nextToken value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListClusters request - // where maxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // nextToken value. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListClustersInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListClustersInput) GoString() string { - return s.String() -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListClustersInput) SetMaxResults(v int64) *ListClustersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListClustersInput) SetNextToken(v string) *ListClustersInput { - s.NextToken = &v - return s -} - -type ListClustersOutput struct { - _ struct{} `type:"structure"` - - // The list of full Amazon Resource Name (ARN) entries for each cluster associated - // with your account. - ClusterArns []*string `locationName:"clusterArns" type:"list"` - - // The nextToken value to include in a future ListClusters request. When the - // results of a ListClusters request exceed maxResults, this value can be used - // to retrieve the next page of results. This value is null when there are no - // more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListClustersOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListClustersOutput) GoString() string { - return s.String() -} - -// SetClusterArns sets the ClusterArns field's value. -func (s *ListClustersOutput) SetClusterArns(v []*string) *ListClustersOutput { - s.ClusterArns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListClustersOutput) SetNextToken(v string) *ListClustersOutput { - s.NextToken = &v - return s -} - -type ListContainerInstancesInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container instances to list. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // You can filter the results of a ListContainerInstances operation with cluster - // query language statements. For more information, see Cluster Query Language - // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) - // in the Amazon Elastic Container Service Developer Guide. - Filter *string `locationName:"filter" type:"string"` - - // The maximum number of container instance results returned by ListContainerInstances - // in paginated output. When this parameter is used, ListContainerInstances - // only returns maxResults results in a single page along with a nextToken response - // element. The remaining results of the initial request can be seen by sending - // another ListContainerInstances request with the returned nextToken value. - // This value can be between 1 and 100. If this parameter is not used, then - // ListContainerInstances returns up to 100 results and a nextToken value if - // applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListContainerInstances - // request where maxResults was used and the results exceeded the value of that - // parameter. Pagination continues from the end of the previous results that - // returned the nextToken value. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // Filters the container instances by status. For example, if you specify the - // DRAINING status, the results include only container instances that have been - // set to DRAINING using UpdateContainerInstancesState. If you do not specify - // this parameter, the default is to include container instances set to ACTIVE - // and DRAINING. - Status *string `locationName:"status" type:"string" enum:"ContainerInstanceStatus"` -} - -// String returns the string representation -func (s ListContainerInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListContainerInstancesInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ListContainerInstancesInput) SetCluster(v string) *ListContainerInstancesInput { - s.Cluster = &v - return s -} - -// SetFilter sets the Filter field's value. -func (s *ListContainerInstancesInput) SetFilter(v string) *ListContainerInstancesInput { - s.Filter = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListContainerInstancesInput) SetMaxResults(v int64) *ListContainerInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListContainerInstancesInput) SetNextToken(v string) *ListContainerInstancesInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListContainerInstancesInput) SetStatus(v string) *ListContainerInstancesInput { - s.Status = &v - return s -} - -type ListContainerInstancesOutput struct { - _ struct{} `type:"structure"` - - // The list of container instances with full ARN entries for each container - // instance associated with the specified cluster. - ContainerInstanceArns []*string `locationName:"containerInstanceArns" type:"list"` - - // The nextToken value to include in a future ListContainerInstances request. - // When the results of a ListContainerInstances request exceed maxResults, this - // value can be used to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListContainerInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListContainerInstancesOutput) GoString() string { - return s.String() -} - -// SetContainerInstanceArns sets the ContainerInstanceArns field's value. -func (s *ListContainerInstancesOutput) SetContainerInstanceArns(v []*string) *ListContainerInstancesOutput { - s.ContainerInstanceArns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListContainerInstancesOutput) SetNextToken(v string) *ListContainerInstancesOutput { - s.NextToken = &v - return s -} - -type ListServicesInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the services to list. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The launch type for services you want to list. - LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` - - // The maximum number of service results returned by ListServices in paginated - // output. When this parameter is used, ListServices only returns maxResults - // results in a single page along with a nextToken response element. The remaining - // results of the initial request can be seen by sending another ListServices - // request with the returned nextToken value. This value can be between 1 and - // 10. If this parameter is not used, then ListServices returns up to 10 results - // and a nextToken value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListServices request - // where maxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // nextToken value. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListServicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListServicesInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ListServicesInput) SetCluster(v string) *ListServicesInput { - s.Cluster = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *ListServicesInput) SetLaunchType(v string) *ListServicesInput { - s.LaunchType = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListServicesInput) SetMaxResults(v int64) *ListServicesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServicesInput) SetNextToken(v string) *ListServicesInput { - s.NextToken = &v - return s -} - -type ListServicesOutput struct { - _ struct{} `type:"structure"` - - // The nextToken value to include in a future ListServices request. When the - // results of a ListServices request exceed maxResults, this value can be used - // to retrieve the next page of results. This value is null when there are no - // more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The list of full ARN entries for each service associated with the specified - // cluster. - ServiceArns []*string `locationName:"serviceArns" type:"list"` -} - -// String returns the string representation -func (s ListServicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListServicesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServicesOutput) SetNextToken(v string) *ListServicesOutput { - s.NextToken = &v - return s -} - -// SetServiceArns sets the ServiceArns field's value. -func (s *ListServicesOutput) SetServiceArns(v []*string) *ListServicesOutput { - s.ServiceArns = v - return s -} - -type ListTaskDefinitionFamiliesInput struct { - _ struct{} `type:"structure"` - - // The familyPrefix is a string that is used to filter the results of ListTaskDefinitionFamilies. - // If you specify a familyPrefix, only task definition family names that begin - // with the familyPrefix string are returned. - FamilyPrefix *string `locationName:"familyPrefix" type:"string"` - - // The maximum number of task definition family results returned by ListTaskDefinitionFamilies - // in paginated output. When this parameter is used, ListTaskDefinitions only - // returns maxResults results in a single page along with a nextToken response - // element. The remaining results of the initial request can be seen by sending - // another ListTaskDefinitionFamilies request with the returned nextToken value. - // This value can be between 1 and 100. If this parameter is not used, then - // ListTaskDefinitionFamilies returns up to 100 results and a nextToken value - // if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListTaskDefinitionFamilies - // request where maxResults was used and the results exceeded the value of that - // parameter. Pagination continues from the end of the previous results that - // returned the nextToken value. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The task definition family status with which to filter the ListTaskDefinitionFamilies - // results. By default, both ACTIVE and INACTIVE task definition families are - // listed. If this parameter is set to ACTIVE, only task definition families - // that have an ACTIVE task definition revision are returned. If this parameter - // is set to INACTIVE, only task definition families that do not have any ACTIVE - // task definition revisions are returned. If you paginate the resulting output, - // be sure to keep the status value constant in each subsequent request. - Status *string `locationName:"status" type:"string" enum:"TaskDefinitionFamilyStatus"` -} - -// String returns the string representation -func (s ListTaskDefinitionFamiliesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTaskDefinitionFamiliesInput) GoString() string { - return s.String() -} - -// SetFamilyPrefix sets the FamilyPrefix field's value. -func (s *ListTaskDefinitionFamiliesInput) SetFamilyPrefix(v string) *ListTaskDefinitionFamiliesInput { - s.FamilyPrefix = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTaskDefinitionFamiliesInput) SetMaxResults(v int64) *ListTaskDefinitionFamiliesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTaskDefinitionFamiliesInput) SetNextToken(v string) *ListTaskDefinitionFamiliesInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListTaskDefinitionFamiliesInput) SetStatus(v string) *ListTaskDefinitionFamiliesInput { - s.Status = &v - return s -} - -type ListTaskDefinitionFamiliesOutput struct { - _ struct{} `type:"structure"` - - // The list of task definition family names that match the ListTaskDefinitionFamilies - // request. - Families []*string `locationName:"families" type:"list"` - - // The nextToken value to include in a future ListTaskDefinitionFamilies request. - // When the results of a ListTaskDefinitionFamilies request exceed maxResults, - // this value can be used to retrieve the next page of results. This value is - // null when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListTaskDefinitionFamiliesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTaskDefinitionFamiliesOutput) GoString() string { - return s.String() -} - -// SetFamilies sets the Families field's value. -func (s *ListTaskDefinitionFamiliesOutput) SetFamilies(v []*string) *ListTaskDefinitionFamiliesOutput { - s.Families = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTaskDefinitionFamiliesOutput) SetNextToken(v string) *ListTaskDefinitionFamiliesOutput { - s.NextToken = &v - return s -} - -type ListTaskDefinitionsInput struct { - _ struct{} `type:"structure"` - - // The full family name with which to filter the ListTaskDefinitions results. - // Specifying a familyPrefix limits the listed task definitions to task definition - // revisions that belong to that family. - FamilyPrefix *string `locationName:"familyPrefix" type:"string"` - - // The maximum number of task definition results returned by ListTaskDefinitions - // in paginated output. When this parameter is used, ListTaskDefinitions only - // returns maxResults results in a single page along with a nextToken response - // element. The remaining results of the initial request can be seen by sending - // another ListTaskDefinitions request with the returned nextToken value. This - // value can be between 1 and 100. If this parameter is not used, then ListTaskDefinitions - // returns up to 100 results and a nextToken value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListTaskDefinitions - // request where maxResults was used and the results exceeded the value of that - // parameter. Pagination continues from the end of the previous results that - // returned the nextToken value. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The order in which to sort the results. Valid values are ASC and DESC. By - // default (ASC), task definitions are listed lexicographically by family name - // and in ascending numerical order by revision so that the newest task definitions - // in a family are listed last. Setting this parameter to DESC reverses the - // sort order on family name and revision so that the newest task definitions - // in a family are listed first. - Sort *string `locationName:"sort" type:"string" enum:"SortOrder"` - - // The task definition status with which to filter the ListTaskDefinitions results. - // By default, only ACTIVE task definitions are listed. By setting this parameter - // to INACTIVE, you can view task definitions that are INACTIVE as long as an - // active task or service still references them. If you paginate the resulting - // output, be sure to keep the status value constant in each subsequent request. - Status *string `locationName:"status" type:"string" enum:"TaskDefinitionStatus"` -} - -// String returns the string representation -func (s ListTaskDefinitionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTaskDefinitionsInput) GoString() string { - return s.String() -} - -// SetFamilyPrefix sets the FamilyPrefix field's value. -func (s *ListTaskDefinitionsInput) SetFamilyPrefix(v string) *ListTaskDefinitionsInput { - s.FamilyPrefix = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTaskDefinitionsInput) SetMaxResults(v int64) *ListTaskDefinitionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTaskDefinitionsInput) SetNextToken(v string) *ListTaskDefinitionsInput { - s.NextToken = &v - return s -} - -// SetSort sets the Sort field's value. -func (s *ListTaskDefinitionsInput) SetSort(v string) *ListTaskDefinitionsInput { - s.Sort = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListTaskDefinitionsInput) SetStatus(v string) *ListTaskDefinitionsInput { - s.Status = &v - return s -} - -type ListTaskDefinitionsOutput struct { - _ struct{} `type:"structure"` - - // The nextToken value to include in a future ListTaskDefinitions request. When - // the results of a ListTaskDefinitions request exceed maxResults, this value - // can be used to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The list of task definition Amazon Resource Name (ARN) entries for the ListTaskDefinitions - // request. - TaskDefinitionArns []*string `locationName:"taskDefinitionArns" type:"list"` -} - -// String returns the string representation -func (s ListTaskDefinitionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTaskDefinitionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTaskDefinitionsOutput) SetNextToken(v string) *ListTaskDefinitionsOutput { - s.NextToken = &v - return s -} - -// SetTaskDefinitionArns sets the TaskDefinitionArns field's value. -func (s *ListTaskDefinitionsOutput) SetTaskDefinitionArns(v []*string) *ListTaskDefinitionsOutput { - s.TaskDefinitionArns = v - return s -} - -type ListTasksInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the tasks to list. If you do not specify a cluster, the default cluster is - // assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance ID or full ARN of the container instance with which - // to filter the ListTasks results. Specifying a containerInstance limits the - // results to tasks that belong to that container instance. - ContainerInstance *string `locationName:"containerInstance" type:"string"` - - // The task desired status with which to filter the ListTasks results. Specifying - // a desiredStatus of STOPPED limits the results to tasks that Amazon ECS has - // set the desired status to STOPPED, which can be useful for debugging tasks - // that are not starting properly or have died or finished. The default status - // filter is RUNNING, which shows tasks that Amazon ECS has set the desired - // status to RUNNING. - // - // Although you can filter results based on a desired status of PENDING, this - // does not return any results because Amazon ECS never sets the desired status - // of a task to that value (only a task's lastStatus may have a value of PENDING). - DesiredStatus *string `locationName:"desiredStatus" type:"string" enum:"DesiredStatus"` - - // The name of the family with which to filter the ListTasks results. Specifying - // a family limits the results to tasks that belong to that family. - Family *string `locationName:"family" type:"string"` - - // The launch type for services you want to list. - LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` - - // The maximum number of task results returned by ListTasks in paginated output. - // When this parameter is used, ListTasks only returns maxResults results in - // a single page along with a nextToken response element. The remaining results - // of the initial request can be seen by sending another ListTasks request with - // the returned nextToken value. This value can be between 1 and 100. If this - // parameter is not used, then ListTasks returns up to 100 results and a nextToken - // value if applicable. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The nextToken value returned from a previous paginated ListTasks request - // where maxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // nextToken value. - // - // This token should be treated as an opaque identifier that is only used to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `locationName:"nextToken" type:"string"` - - // The name of the service with which to filter the ListTasks results. Specifying - // a serviceName limits the results to tasks that belong to that service. - ServiceName *string `locationName:"serviceName" type:"string"` - - // The startedBy value with which to filter the task results. Specifying a startedBy - // value limits the results to tasks that were started with that value. - StartedBy *string `locationName:"startedBy" type:"string"` -} - -// String returns the string representation -func (s ListTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTasksInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *ListTasksInput) SetCluster(v string) *ListTasksInput { - s.Cluster = &v - return s -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *ListTasksInput) SetContainerInstance(v string) *ListTasksInput { - s.ContainerInstance = &v - return s -} - -// SetDesiredStatus sets the DesiredStatus field's value. -func (s *ListTasksInput) SetDesiredStatus(v string) *ListTasksInput { - s.DesiredStatus = &v - return s -} - -// SetFamily sets the Family field's value. -func (s *ListTasksInput) SetFamily(v string) *ListTasksInput { - s.Family = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *ListTasksInput) SetLaunchType(v string) *ListTasksInput { - s.LaunchType = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTasksInput) SetMaxResults(v int64) *ListTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTasksInput) SetNextToken(v string) *ListTasksInput { - s.NextToken = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *ListTasksInput) SetServiceName(v string) *ListTasksInput { - s.ServiceName = &v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *ListTasksInput) SetStartedBy(v string) *ListTasksInput { - s.StartedBy = &v - return s -} - -type ListTasksOutput struct { - _ struct{} `type:"structure"` - - // The nextToken value to include in a future ListTasks request. When the results - // of a ListTasks request exceed maxResults, this value can be used to retrieve - // the next page of results. This value is null when there are no more results - // to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The list of task ARN entries for the ListTasks request. - TaskArns []*string `locationName:"taskArns" type:"list"` -} - -// String returns the string representation -func (s ListTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTasksOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTasksOutput) SetNextToken(v string) *ListTasksOutput { - s.NextToken = &v - return s -} - -// SetTaskArns sets the TaskArns field's value. -func (s *ListTasksOutput) SetTaskArns(v []*string) *ListTasksOutput { - s.TaskArns = v - return s -} - -// Details on a load balancer that is used with a service. -// -// Services with tasks that use the awsvpc network mode (for example, those -// with the Fargate launch type) only support Application Load Balancers and -// Network Load Balancers; Classic Load Balancers are not supported. Also, when -// you create any target groups for these services, you must choose ip as the -// target type, not instance, because tasks that use the awsvpc network mode -// are associated with an elastic network interface, not an Amazon EC2 instance. -type LoadBalancer struct { - _ struct{} `type:"structure"` - - // The name of the container (as it appears in a container definition) to associate - // with the load balancer. - ContainerName *string `locationName:"containerName" type:"string"` - - // The port on the container to associate with the load balancer. This port - // must correspond to a containerPort in the service's task definition. Your - // container instances must allow ingress traffic on the hostPort of the port - // mapping. - ContainerPort *int64 `locationName:"containerPort" type:"integer"` - - // The name of a load balancer. - LoadBalancerName *string `locationName:"loadBalancerName" type:"string"` - - // The full Amazon Resource Name (ARN) of the Elastic Load Balancing target - // group associated with a service. - // - // If your service's task definition uses the awsvpc network mode (which is - // required for the Fargate launch type), you must choose ip as the target type, - // not instance, because tasks that use the awsvpc network mode are associated - // with an elastic network interface, not an Amazon EC2 instance. - TargetGroupArn *string `locationName:"targetGroupArn" type:"string"` -} - -// String returns the string representation -func (s LoadBalancer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoadBalancer) GoString() string { - return s.String() -} - -// SetContainerName sets the ContainerName field's value. -func (s *LoadBalancer) SetContainerName(v string) *LoadBalancer { - s.ContainerName = &v - return s -} - -// SetContainerPort sets the ContainerPort field's value. -func (s *LoadBalancer) SetContainerPort(v int64) *LoadBalancer { - s.ContainerPort = &v - return s -} - -// SetLoadBalancerName sets the LoadBalancerName field's value. -func (s *LoadBalancer) SetLoadBalancerName(v string) *LoadBalancer { - s.LoadBalancerName = &v - return s -} - -// SetTargetGroupArn sets the TargetGroupArn field's value. -func (s *LoadBalancer) SetTargetGroupArn(v string) *LoadBalancer { - s.TargetGroupArn = &v - return s -} - -// Log configuration options to send to a custom log driver for the container. -type LogConfiguration struct { - _ struct{} `type:"structure"` - - // The log driver to use for the container. The valid values listed for this - // parameter are log drivers that the Amazon ECS container agent can communicate - // with by default. If using the Fargate launch type, the only supported value - // is awslogs. For more information about using the awslogs driver, see Using - // the awslogs Log Driver (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) - // in the Amazon Elastic Container Service Developer Guide. - // - // If you have a custom driver that is not listed above that you would like - // to work with the Amazon ECS container agent, you can fork the Amazon ECS - // container agent project that is available on GitHub (https://github.com/aws/amazon-ecs-agent) - // and customize it to work with that driver. We encourage you to submit pull - // requests for changes that you would like to have included. However, Amazon - // Web Services does not currently support running modified copies of this software. - // - // This parameter requires version 1.18 of the Docker Remote API or greater - // on your container instance. To check the Docker Remote API version on your - // container instance, log in to your container instance and run the following - // command: sudo docker version | grep "Server API version" - // - // LogDriver is a required field - LogDriver *string `locationName:"logDriver" type:"string" required:"true" enum:"LogDriver"` - - // The configuration options to send to the log driver. This parameter requires - // version 1.19 of the Docker Remote API or greater on your container instance. - // To check the Docker Remote API version on your container instance, log in - // to your container instance and run the following command: sudo docker version - // | grep "Server API version" - Options map[string]*string `locationName:"options" type:"map"` -} - -// String returns the string representation -func (s LogConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LogConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LogConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LogConfiguration"} - if s.LogDriver == nil { - invalidParams.Add(request.NewErrParamRequired("LogDriver")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogDriver sets the LogDriver field's value. -func (s *LogConfiguration) SetLogDriver(v string) *LogConfiguration { - s.LogDriver = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *LogConfiguration) SetOptions(v map[string]*string) *LogConfiguration { - s.Options = v - return s -} - -// Details on a volume mount point that is used in a container definition. -type MountPoint struct { - _ struct{} `type:"structure"` - - // The path on the container to mount the host volume at. - ContainerPath *string `locationName:"containerPath" type:"string"` - - // If this value is true, the container has read-only access to the volume. - // If this value is false, then the container can write to the volume. The default - // value is false. - ReadOnly *bool `locationName:"readOnly" type:"boolean"` - - // The name of the volume to mount. - SourceVolume *string `locationName:"sourceVolume" type:"string"` -} - -// String returns the string representation -func (s MountPoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MountPoint) GoString() string { - return s.String() -} - -// SetContainerPath sets the ContainerPath field's value. -func (s *MountPoint) SetContainerPath(v string) *MountPoint { - s.ContainerPath = &v - return s -} - -// SetReadOnly sets the ReadOnly field's value. -func (s *MountPoint) SetReadOnly(v bool) *MountPoint { - s.ReadOnly = &v - return s -} - -// SetSourceVolume sets the SourceVolume field's value. -func (s *MountPoint) SetSourceVolume(v string) *MountPoint { - s.SourceVolume = &v - return s -} - -// Details on the network bindings between a container and its host container -// instance. After a task reaches the RUNNING status, manual and automatic host -// and container port assignments are visible in the networkBindings section -// of DescribeTasks API responses. -type NetworkBinding struct { - _ struct{} `type:"structure"` - - // The IP address that the container is bound to on the container instance. - BindIP *string `locationName:"bindIP" type:"string"` - - // The port number on the container that is used with the network binding. - ContainerPort *int64 `locationName:"containerPort" type:"integer"` - - // The port number on the host that is used with the network binding. - HostPort *int64 `locationName:"hostPort" type:"integer"` - - // The protocol used for the network binding. - Protocol *string `locationName:"protocol" type:"string" enum:"TransportProtocol"` -} - -// String returns the string representation -func (s NetworkBinding) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkBinding) GoString() string { - return s.String() -} - -// SetBindIP sets the BindIP field's value. -func (s *NetworkBinding) SetBindIP(v string) *NetworkBinding { - s.BindIP = &v - return s -} - -// SetContainerPort sets the ContainerPort field's value. -func (s *NetworkBinding) SetContainerPort(v int64) *NetworkBinding { - s.ContainerPort = &v - return s -} - -// SetHostPort sets the HostPort field's value. -func (s *NetworkBinding) SetHostPort(v int64) *NetworkBinding { - s.HostPort = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *NetworkBinding) SetProtocol(v string) *NetworkBinding { - s.Protocol = &v - return s -} - -// An object representing the network configuration for a task or service. -type NetworkConfiguration struct { - _ struct{} `type:"structure"` - - // The VPC subnets and security groups associated with a task. - AwsvpcConfiguration *AwsVpcConfiguration `locationName:"awsvpcConfiguration" type:"structure"` -} - -// String returns the string representation -func (s NetworkConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NetworkConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NetworkConfiguration"} - if s.AwsvpcConfiguration != nil { - if err := s.AwsvpcConfiguration.Validate(); err != nil { - invalidParams.AddNested("AwsvpcConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsvpcConfiguration sets the AwsvpcConfiguration field's value. -func (s *NetworkConfiguration) SetAwsvpcConfiguration(v *AwsVpcConfiguration) *NetworkConfiguration { - s.AwsvpcConfiguration = v - return s -} - -// An object representing the Elastic Network Interface for tasks that use the -// awsvpc network mode. -type NetworkInterface struct { - _ struct{} `type:"structure"` - - // The attachment ID for the network interface. - AttachmentId *string `locationName:"attachmentId" type:"string"` - - // The private IPv6 address for the network interface. - Ipv6Address *string `locationName:"ipv6Address" type:"string"` - - // The private IPv4 address for the network interface. - PrivateIpv4Address *string `locationName:"privateIpv4Address" type:"string"` -} - -// String returns the string representation -func (s NetworkInterface) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterface) GoString() string { - return s.String() -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *NetworkInterface) SetAttachmentId(v string) *NetworkInterface { - s.AttachmentId = &v - return s -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *NetworkInterface) SetIpv6Address(v string) *NetworkInterface { - s.Ipv6Address = &v - return s -} - -// SetPrivateIpv4Address sets the PrivateIpv4Address field's value. -func (s *NetworkInterface) SetPrivateIpv4Address(v string) *NetworkInterface { - s.PrivateIpv4Address = &v - return s -} - -// An object representing a constraint on task placement. For more information, -// see Task Placement Constraints (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) -// in the Amazon Elastic Container Service Developer Guide. -type PlacementConstraint struct { - _ struct{} `type:"structure"` - - // A cluster query language expression to apply to the constraint. Note you - // cannot specify an expression if the constraint type is distinctInstance. - // For more information, see Cluster Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) - // in the Amazon Elastic Container Service Developer Guide. - Expression *string `locationName:"expression" type:"string"` - - // The type of constraint. Use distinctInstance to ensure that each task in - // a particular group is running on a different container instance. Use memberOf - // to restrict the selection to a group of valid candidates. The value distinctInstance - // is not supported in task definitions. - Type *string `locationName:"type" type:"string" enum:"PlacementConstraintType"` -} - -// String returns the string representation -func (s PlacementConstraint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlacementConstraint) GoString() string { - return s.String() -} - -// SetExpression sets the Expression field's value. -func (s *PlacementConstraint) SetExpression(v string) *PlacementConstraint { - s.Expression = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlacementConstraint) SetType(v string) *PlacementConstraint { - s.Type = &v - return s -} - -// The task placement strategy for a task or service. For more information, -// see Task Placement Strategies (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) -// in the Amazon Elastic Container Service Developer Guide. -type PlacementStrategy struct { - _ struct{} `type:"structure"` - - // The field to apply the placement strategy against. For the spread placement - // strategy, valid values are instanceId (or host, which has the same effect), - // or any platform or custom attribute that is applied to a container instance, - // such as attribute:ecs.availability-zone. For the binpack placement strategy, - // valid values are cpu and memory. For the random placement strategy, this - // field is not used. - Field *string `locationName:"field" type:"string"` - - // The type of placement strategy. The random placement strategy randomly places - // tasks on available candidates. The spread placement strategy spreads placement - // across available candidates evenly based on the field parameter. The binpack - // strategy places tasks on available candidates that have the least available - // amount of the resource that is specified with the field parameter. For example, - // if you binpack on memory, a task is placed on the instance with the least - // amount of remaining memory (but still enough to run the task). - Type *string `locationName:"type" type:"string" enum:"PlacementStrategyType"` -} - -// String returns the string representation -func (s PlacementStrategy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlacementStrategy) GoString() string { - return s.String() -} - -// SetField sets the Field field's value. -func (s *PlacementStrategy) SetField(v string) *PlacementStrategy { - s.Field = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlacementStrategy) SetType(v string) *PlacementStrategy { - s.Type = &v - return s -} - -// Port mappings allow containers to access ports on the host container instance -// to send or receive traffic. Port mappings are specified as part of the container -// definition. -// -// If using containers in a task with the awsvpc or host network mode, exposed -// ports should be specified using containerPort. The hostPort can be left blank -// or it must be the same value as the containerPort. -// -// After a task reaches the RUNNING status, manual and automatic host and container -// port assignments are visible in the networkBindings section of DescribeTasks -// API responses. -type PortMapping struct { - _ struct{} `type:"structure"` - - // The port number on the container that is bound to the user-specified or automatically - // assigned host port. - // - // If using containers in a task with the awsvpc or host network mode, exposed - // ports should be specified using containerPort. - // - // If using containers in a task with the bridge network mode and you specify - // a container port and not a host port, your container automatically receives - // a host port in the ephemeral port range (for more information, see hostPort). - // Port mappings that are automatically assigned in this way do not count toward - // the 100 reserved ports limit of a container instance. - ContainerPort *int64 `locationName:"containerPort" type:"integer"` - - // The port number on the container instance to reserve for your container. - // - // If using containers in a task with the awsvpc or host network mode, the hostPort - // can either be left blank or set to the same value as the containerPort. - // - // If using containers in a task with the bridge network mode, you can specify - // a non-reserved host port for your container port mapping, or you can omit - // the hostPort (or set it to 0) while specifying a containerPort and your container - // automatically receives a port in the ephemeral port range for your container - // instance operating system and Docker version. - // - // The default ephemeral port range for Docker version 1.6.0 and later is listed - // on the instance under /proc/sys/net/ipv4/ip_local_port_range; if this kernel - // parameter is unavailable, the default ephemeral port range from 49153 through - // 65535 is used. You should not attempt to specify a host port in the ephemeral - // port range as these are reserved for automatic assignment. In general, ports - // below 32768 are outside of the ephemeral port range. - // - // The default ephemeral port range from 49153 through 65535 is always used - // for Docker versions before 1.6.0. - // - // The default reserved ports are 22 for SSH, the Docker ports 2375 and 2376, - // and the Amazon ECS container agent ports 51678 and 51679. Any host port that - // was previously specified in a running task is also reserved while the task - // is running (after a task stops, the host port is released). The current reserved - // ports are displayed in the remainingResources of DescribeContainerInstances - // output, and a container instance may have up to 100 reserved ports at a time, - // including the default reserved ports (automatically assigned ports do not - // count toward the 100 reserved ports limit). - HostPort *int64 `locationName:"hostPort" type:"integer"` - - // The protocol used for the port mapping. Valid values are tcp and udp. The - // default is tcp. - Protocol *string `locationName:"protocol" type:"string" enum:"TransportProtocol"` -} - -// String returns the string representation -func (s PortMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PortMapping) GoString() string { - return s.String() -} - -// SetContainerPort sets the ContainerPort field's value. -func (s *PortMapping) SetContainerPort(v int64) *PortMapping { - s.ContainerPort = &v - return s -} - -// SetHostPort sets the HostPort field's value. -func (s *PortMapping) SetHostPort(v int64) *PortMapping { - s.HostPort = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *PortMapping) SetProtocol(v string) *PortMapping { - s.Protocol = &v - return s -} - -type PutAttributesInput struct { - _ struct{} `type:"structure"` - - // The attributes to apply to your resource. You can specify up to 10 custom - // attributes per resource. You can specify up to 10 attributes in a single - // call. - // - // Attributes is a required field - Attributes []*Attribute `locationName:"attributes" type:"list" required:"true"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that contains - // the resource to apply attributes. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` -} - -// String returns the string representation -func (s PutAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *PutAttributesInput) SetAttributes(v []*Attribute) *PutAttributesInput { - s.Attributes = v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *PutAttributesInput) SetCluster(v string) *PutAttributesInput { - s.Cluster = &v - return s -} - -type PutAttributesOutput struct { - _ struct{} `type:"structure"` - - // The attributes applied to your resource. - Attributes []*Attribute `locationName:"attributes" type:"list"` -} - -// String returns the string representation -func (s PutAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *PutAttributesOutput) SetAttributes(v []*Attribute) *PutAttributesOutput { - s.Attributes = v - return s -} - -type RegisterContainerInstanceInput struct { - _ struct{} `type:"structure"` - - // The container instance attributes that this container instance supports. - Attributes []*Attribute `locationName:"attributes" type:"list"` - - // The short name or full Amazon Resource Name (ARN) of the cluster with which - // to register your container instance. If you do not specify a cluster, the - // default cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The ARN of the container instance (if it was previously registered). - ContainerInstanceArn *string `locationName:"containerInstanceArn" type:"string"` - - // The instance identity document for the EC2 instance to register. This document - // can be found by running the following command from the instance: curl http://169.254.169.254/latest/dynamic/instance-identity/document/ - InstanceIdentityDocument *string `locationName:"instanceIdentityDocument" type:"string"` - - // The instance identity document signature for the EC2 instance to register. - // This signature can be found by running the following command from the instance: - // curl http://169.254.169.254/latest/dynamic/instance-identity/signature/ - InstanceIdentityDocumentSignature *string `locationName:"instanceIdentityDocumentSignature" type:"string"` - - // The resources available on the instance. - TotalResources []*Resource `locationName:"totalResources" type:"list"` - - // The version information for the Amazon ECS container agent and Docker daemon - // running on the container instance. - VersionInfo *VersionInfo `locationName:"versionInfo" type:"structure"` -} - -// String returns the string representation -func (s RegisterContainerInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterContainerInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterContainerInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterContainerInstanceInput"} - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *RegisterContainerInstanceInput) SetAttributes(v []*Attribute) *RegisterContainerInstanceInput { - s.Attributes = v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *RegisterContainerInstanceInput) SetCluster(v string) *RegisterContainerInstanceInput { - s.Cluster = &v - return s -} - -// SetContainerInstanceArn sets the ContainerInstanceArn field's value. -func (s *RegisterContainerInstanceInput) SetContainerInstanceArn(v string) *RegisterContainerInstanceInput { - s.ContainerInstanceArn = &v - return s -} - -// SetInstanceIdentityDocument sets the InstanceIdentityDocument field's value. -func (s *RegisterContainerInstanceInput) SetInstanceIdentityDocument(v string) *RegisterContainerInstanceInput { - s.InstanceIdentityDocument = &v - return s -} - -// SetInstanceIdentityDocumentSignature sets the InstanceIdentityDocumentSignature field's value. -func (s *RegisterContainerInstanceInput) SetInstanceIdentityDocumentSignature(v string) *RegisterContainerInstanceInput { - s.InstanceIdentityDocumentSignature = &v - return s -} - -// SetTotalResources sets the TotalResources field's value. -func (s *RegisterContainerInstanceInput) SetTotalResources(v []*Resource) *RegisterContainerInstanceInput { - s.TotalResources = v - return s -} - -// SetVersionInfo sets the VersionInfo field's value. -func (s *RegisterContainerInstanceInput) SetVersionInfo(v *VersionInfo) *RegisterContainerInstanceInput { - s.VersionInfo = v - return s -} - -type RegisterContainerInstanceOutput struct { - _ struct{} `type:"structure"` - - // The container instance that was registered. - ContainerInstance *ContainerInstance `locationName:"containerInstance" type:"structure"` -} - -// String returns the string representation -func (s RegisterContainerInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterContainerInstanceOutput) GoString() string { - return s.String() -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *RegisterContainerInstanceOutput) SetContainerInstance(v *ContainerInstance) *RegisterContainerInstanceOutput { - s.ContainerInstance = v - return s -} - -type RegisterTaskDefinitionInput struct { - _ struct{} `type:"structure"` - - // A list of container definitions in JSON format that describe the different - // containers that make up your task. - // - // ContainerDefinitions is a required field - ContainerDefinitions []*ContainerDefinition `locationName:"containerDefinitions" type:"list" required:"true"` - - // The number of CPU units used by the task. It can be expressed as an integer - // using CPU units, for example 1024, or as a string using vCPUs, for example - // 1 vCPU or 1 vcpu, in a task definition but will be converted to an integer - // indicating the CPU units when the task definition is registered. - // - // Task-level CPU and memory parameters are ignored for Windows containers. - // We recommend specifying container-level resources for Windows containers. - // - // If using the EC2 launch type, this field is optional. Supported values are - // between 128 CPU units (0.125 vCPUs) and 10240 CPU units (10 vCPUs). - // - // If using the Fargate launch type, this field is required and you must use - // one of the following values, which determines your range of supported values - // for the memory parameter: - // - // * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), - // 2048 (2 GB) - // - // * 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 - // (3 GB), 4096 (4 GB) - // - // * 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 - // (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - // - // * 2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 - // (16 GB) in increments of 1024 (1 GB) - // - // * 4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 - // (30 GB) in increments of 1024 (1 GB) - Cpu *string `locationName:"cpu" type:"string"` - - // The Amazon Resource Name (ARN) of the task execution role that the Amazon - // ECS container agent and the Docker daemon can assume. - ExecutionRoleArn *string `locationName:"executionRoleArn" type:"string"` - - // You must specify a family for a task definition, which allows you to track - // multiple versions of the same task definition. The family is used as a name - // for your task definition. Up to 255 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. - // - // Family is a required field - Family *string `locationName:"family" type:"string" required:"true"` - - // The amount of memory (in MiB) used by the task. It can be expressed as an - // integer using MiB, for example 1024, or as a string using GB, for example - // 1GB or 1 GB, in a task definition but will be converted to an integer indicating - // the MiB when the task definition is registered. - // - // Task-level CPU and memory parameters are ignored for Windows containers. - // We recommend specifying container-level resources for Windows containers. - // - // If using the EC2 launch type, this field is optional. - // - // If using the Fargate launch type, this field is required and you must use - // one of the following values, which determines your range of supported values - // for the cpu parameter: - // - // * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 - // vCPU) - // - // * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: - // 512 (.5 vCPU) - // - // * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 - // (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU) - // - // * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - - // Available cpu values: 2048 (2 vCPU) - // - // * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - - // Available cpu values: 4096 (4 vCPU) - Memory *string `locationName:"memory" type:"string"` - - // The Docker networking mode to use for the containers in the task. The valid - // values are none, bridge, awsvpc, and host. The default Docker network mode - // is bridge. If using the Fargate launch type, the awsvpc network mode is required. - // If using the EC2 launch type, any network mode can be used. If the network - // mode is set to none, you can't specify port mappings in your container definitions, - // and the task's containers do not have external connectivity. The host and - // awsvpc network modes offer the highest networking performance for containers - // because they use the EC2 network stack instead of the virtualized network - // stack provided by the bridge mode. - // - // With the host and awsvpc network modes, exposed container ports are mapped - // directly to the corresponding host port (for the host network mode) or the - // attached elastic network interface port (for the awsvpc network mode), so - // you cannot take advantage of dynamic host port mappings. - // - // If the network mode is awsvpc, the task is allocated an Elastic Network Interface, - // and you must specify a NetworkConfiguration when you create a service or - // run a task with the task definition. For more information, see Task Networking - // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) - // in the Amazon Elastic Container Service Developer Guide. - // - // If the network mode is host, you can't run multiple instantiations of the - // same task on a single container instance when port mappings are used. - // - // Docker for Windows uses different network modes than Docker for Linux. When - // you register a task definition with Windows containers, you must not specify - // a network mode. - // - // For more information, see Network settings (https://docs.docker.com/engine/reference/run/#network-settings) - // in the Docker run reference. - NetworkMode *string `locationName:"networkMode" type:"string" enum:"NetworkMode"` - - // An array of placement constraint objects to use for the task. You can specify - // a maximum of 10 constraints per task (this limit includes constraints in - // the task definition and those specified at run time). - PlacementConstraints []*TaskDefinitionPlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The launch type required by the task. If no value is specified, it defaults - // to EC2. - RequiresCompatibilities []*string `locationName:"requiresCompatibilities" type:"list"` - - // The short name or full Amazon Resource Name (ARN) of the IAM role that containers - // in this task can assume. All containers in this task are granted the permissions - // that are specified in this role. For more information, see IAM Roles for - // Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) - // in the Amazon Elastic Container Service Developer Guide. - TaskRoleArn *string `locationName:"taskRoleArn" type:"string"` - - // A list of volume definitions in JSON format that containers in your task - // may use. - Volumes []*Volume `locationName:"volumes" type:"list"` -} - -// String returns the string representation -func (s RegisterTaskDefinitionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTaskDefinitionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterTaskDefinitionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterTaskDefinitionInput"} - if s.ContainerDefinitions == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerDefinitions")) - } - if s.Family == nil { - invalidParams.Add(request.NewErrParamRequired("Family")) - } - if s.ContainerDefinitions != nil { - for i, v := range s.ContainerDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContainerDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContainerDefinitions sets the ContainerDefinitions field's value. -func (s *RegisterTaskDefinitionInput) SetContainerDefinitions(v []*ContainerDefinition) *RegisterTaskDefinitionInput { - s.ContainerDefinitions = v - return s -} - -// SetCpu sets the Cpu field's value. -func (s *RegisterTaskDefinitionInput) SetCpu(v string) *RegisterTaskDefinitionInput { - s.Cpu = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *RegisterTaskDefinitionInput) SetExecutionRoleArn(v string) *RegisterTaskDefinitionInput { - s.ExecutionRoleArn = &v - return s -} - -// SetFamily sets the Family field's value. -func (s *RegisterTaskDefinitionInput) SetFamily(v string) *RegisterTaskDefinitionInput { - s.Family = &v - return s -} - -// SetMemory sets the Memory field's value. -func (s *RegisterTaskDefinitionInput) SetMemory(v string) *RegisterTaskDefinitionInput { - s.Memory = &v - return s -} - -// SetNetworkMode sets the NetworkMode field's value. -func (s *RegisterTaskDefinitionInput) SetNetworkMode(v string) *RegisterTaskDefinitionInput { - s.NetworkMode = &v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *RegisterTaskDefinitionInput) SetPlacementConstraints(v []*TaskDefinitionPlacementConstraint) *RegisterTaskDefinitionInput { - s.PlacementConstraints = v - return s -} - -// SetRequiresCompatibilities sets the RequiresCompatibilities field's value. -func (s *RegisterTaskDefinitionInput) SetRequiresCompatibilities(v []*string) *RegisterTaskDefinitionInput { - s.RequiresCompatibilities = v - return s -} - -// SetTaskRoleArn sets the TaskRoleArn field's value. -func (s *RegisterTaskDefinitionInput) SetTaskRoleArn(v string) *RegisterTaskDefinitionInput { - s.TaskRoleArn = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *RegisterTaskDefinitionInput) SetVolumes(v []*Volume) *RegisterTaskDefinitionInput { - s.Volumes = v - return s -} - -type RegisterTaskDefinitionOutput struct { - _ struct{} `type:"structure"` - - // The full description of the registered task definition. - TaskDefinition *TaskDefinition `locationName:"taskDefinition" type:"structure"` -} - -// String returns the string representation -func (s RegisterTaskDefinitionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterTaskDefinitionOutput) GoString() string { - return s.String() -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *RegisterTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *RegisterTaskDefinitionOutput { - s.TaskDefinition = v - return s -} - -// Describes the resources available for a container instance. -type Resource struct { - _ struct{} `type:"structure"` - - // When the doubleValue type is set, the value of the resource must be a double - // precision floating-point type. - DoubleValue *float64 `locationName:"doubleValue" type:"double"` - - // When the integerValue type is set, the value of the resource must be an integer. - IntegerValue *int64 `locationName:"integerValue" type:"integer"` - - // When the longValue type is set, the value of the resource must be an extended - // precision floating-point type. - LongValue *int64 `locationName:"longValue" type:"long"` - - // The name of the resource, such as CPU, MEMORY, PORTS, PORTS_UDP, or a user-defined - // resource. - Name *string `locationName:"name" type:"string"` - - // When the stringSetValue type is set, the value of the resource must be a - // string type. - StringSetValue []*string `locationName:"stringSetValue" type:"list"` - - // The type of the resource, such as INTEGER, DOUBLE, LONG, or STRINGSET. - Type *string `locationName:"type" type:"string"` -} - -// String returns the string representation -func (s Resource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Resource) GoString() string { - return s.String() -} - -// SetDoubleValue sets the DoubleValue field's value. -func (s *Resource) SetDoubleValue(v float64) *Resource { - s.DoubleValue = &v - return s -} - -// SetIntegerValue sets the IntegerValue field's value. -func (s *Resource) SetIntegerValue(v int64) *Resource { - s.IntegerValue = &v - return s -} - -// SetLongValue sets the LongValue field's value. -func (s *Resource) SetLongValue(v int64) *Resource { - s.LongValue = &v - return s -} - -// SetName sets the Name field's value. -func (s *Resource) SetName(v string) *Resource { - s.Name = &v - return s -} - -// SetStringSetValue sets the StringSetValue field's value. -func (s *Resource) SetStringSetValue(v []*string) *Resource { - s.StringSetValue = v - return s -} - -// SetType sets the Type field's value. -func (s *Resource) SetType(v string) *Resource { - s.Type = &v - return s -} - -type RunTaskInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster on which - // to run your task. If you do not specify a cluster, the default cluster is - // assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The number of instantiations of the specified task to place on your cluster. - // You can specify up to 10 tasks per call. - Count *int64 `locationName:"count" type:"integer"` - - // The name of the task group to associate with the task. The default value - // is the family name of the task definition (for example, family:my-family-name). - Group *string `locationName:"group" type:"string"` - - // The launch type on which to run your task. - LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` - - // The network configuration for the task. This parameter is required for task - // definitions that use the awsvpc network mode to receive their own Elastic - // Network Interface, and it is not supported for other network modes. For more - // information, see Task Networking (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) - // in the Amazon Elastic Container Service Developer Guide. - NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"` - - // A list of container overrides in JSON format that specify the name of a container - // in the specified task definition and the overrides it should receive. You - // can override the default command for a container (that is specified in the - // task definition or Docker image) with a command override. You can also override - // existing environment variables (that are specified in the task definition - // or Docker image) on a container or add new environment variables to it with - // an environment override. - // - // A total of 8192 characters are allowed for overrides. This limit includes - // the JSON formatting characters of the override structure. - Overrides *TaskOverride `locationName:"overrides" type:"structure"` - - // An array of placement constraint objects to use for the task. You can specify - // up to 10 constraints per task (including constraints in the task definition - // and those specified at run time). - PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The placement strategy objects to use for the task. You can specify a maximum - // of five strategy rules per task. - PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"` - - // The platform version on which to run your task. If one is not specified, - // the latest version is used by default. - PlatformVersion *string `locationName:"platformVersion" type:"string"` - - // An optional tag specified when a task is started. For example if you automatically - // trigger a task to run a batch process job, you could apply a unique identifier - // for that job to your task with the startedBy parameter. You can then identify - // which tasks belong to that job by filtering the results of a ListTasks call - // with the startedBy value. Up to 36 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. - // - // If a task is started by an Amazon ECS service, then the startedBy parameter - // contains the deployment ID of the service that starts it. - StartedBy *string `locationName:"startedBy" type:"string"` - - // The family and revision (family:revision) or full ARN of the task definition - // to run. If a revision is not specified, the latest ACTIVE revision is used. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s RunTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunTaskInput"} - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - if s.NetworkConfiguration != nil { - if err := s.NetworkConfiguration.Validate(); err != nil { - invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *RunTaskInput) SetCluster(v string) *RunTaskInput { - s.Cluster = &v - return s -} - -// SetCount sets the Count field's value. -func (s *RunTaskInput) SetCount(v int64) *RunTaskInput { - s.Count = &v - return s -} - -// SetGroup sets the Group field's value. -func (s *RunTaskInput) SetGroup(v string) *RunTaskInput { - s.Group = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *RunTaskInput) SetLaunchType(v string) *RunTaskInput { - s.LaunchType = &v - return s -} - -// SetNetworkConfiguration sets the NetworkConfiguration field's value. -func (s *RunTaskInput) SetNetworkConfiguration(v *NetworkConfiguration) *RunTaskInput { - s.NetworkConfiguration = v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *RunTaskInput) SetOverrides(v *TaskOverride) *RunTaskInput { - s.Overrides = v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *RunTaskInput) SetPlacementConstraints(v []*PlacementConstraint) *RunTaskInput { - s.PlacementConstraints = v - return s -} - -// SetPlacementStrategy sets the PlacementStrategy field's value. -func (s *RunTaskInput) SetPlacementStrategy(v []*PlacementStrategy) *RunTaskInput { - s.PlacementStrategy = v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *RunTaskInput) SetPlatformVersion(v string) *RunTaskInput { - s.PlatformVersion = &v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *RunTaskInput) SetStartedBy(v string) *RunTaskInput { - s.StartedBy = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *RunTaskInput) SetTaskDefinition(v string) *RunTaskInput { - s.TaskDefinition = &v - return s -} - -type RunTaskOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` - - // A full description of the tasks that were run. The tasks that were successfully - // placed on your cluster are described here. - Tasks []*Task `locationName:"tasks" type:"list"` -} - -// String returns the string representation -func (s RunTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunTaskOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *RunTaskOutput) SetFailures(v []*Failure) *RunTaskOutput { - s.Failures = v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *RunTaskOutput) SetTasks(v []*Task) *RunTaskOutput { - s.Tasks = v - return s -} - -// Details on a service within a cluster -type Service struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the cluster that hosts the service. - ClusterArn *string `locationName:"clusterArn" type:"string"` - - // The Unix time stamp for when the service was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // Optional deployment parameters that control how many tasks run during the - // deployment and the ordering of stopping and starting tasks. - DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"` - - // The current state of deployments for the service. - Deployments []*Deployment `locationName:"deployments" type:"list"` - - // The desired number of instantiations of the task definition to keep running - // on the service. This value is specified when the service is created with - // CreateService, and it can be modified with UpdateService. - DesiredCount *int64 `locationName:"desiredCount" type:"integer"` - - // The event stream for your service. A maximum of 100 of the latest events - // are displayed. - Events []*ServiceEvent `locationName:"events" type:"list"` - - // The period of time, in seconds, that the Amazon ECS service scheduler ignores - // unhealthy Elastic Load Balancing target health checks after a task has first - // started. - HealthCheckGracePeriodSeconds *int64 `locationName:"healthCheckGracePeriodSeconds" type:"integer"` - - // The launch type on which your service is running. - LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` - - // A list of Elastic Load Balancing load balancer objects, containing the load - // balancer name, the container name (as it appears in a container definition), - // and the container port to access from the load balancer. - // - // Services with tasks that use the awsvpc network mode (for example, those - // with the Fargate launch type) only support Application Load Balancers and - // Network Load Balancers; Classic Load Balancers are not supported. Also, when - // you create any target groups for these services, you must choose ip as the - // target type, not instance, because tasks that use the awsvpc network mode - // are associated with an elastic network interface, not an Amazon EC2 instance. - LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"` - - // The VPC subnet and security group configuration for tasks that receive their - // own Elastic Network Interface by using the awsvpc networking mode. - NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"` - - // The number of tasks in the cluster that are in the PENDING state. - PendingCount *int64 `locationName:"pendingCount" type:"integer"` - - // The placement constraints for the tasks in the service. - PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The placement strategy that determines how tasks for the service are placed. - PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"` - - // The platform version on which your task is running. For more information, - // see AWS Fargate Platform Versions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) - // in the Amazon Elastic Container Service Developer Guide. - PlatformVersion *string `locationName:"platformVersion" type:"string"` - - // The ARN of the IAM role associated with the service that allows the Amazon - // ECS container agent to register container instances with an Elastic Load - // Balancing load balancer. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The number of tasks in the cluster that are in the RUNNING state. - RunningCount *int64 `locationName:"runningCount" type:"integer"` - - // The ARN that identifies the service. The ARN contains the arn:aws:ecs namespace, - // followed by the region of the service, the AWS account ID of the service - // owner, the service namespace, and then the service name. For example, arn:aws:ecs:region:012345678910:service/my-service. - ServiceArn *string `locationName:"serviceArn" type:"string"` - - // The name of your service. Up to 255 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. Service names must be unique within - // a cluster, but you can have similarly named services in multiple clusters - // within a region or across multiple regions. - ServiceName *string `locationName:"serviceName" type:"string"` - - ServiceRegistries []*ServiceRegistry `locationName:"serviceRegistries" type:"list"` - - // The status of the service. The valid values are ACTIVE, DRAINING, or INACTIVE. - Status *string `locationName:"status" type:"string"` - - // The task definition to use for tasks in the service. This value is specified - // when the service is created with CreateService, and it can be modified with - // UpdateService. - TaskDefinition *string `locationName:"taskDefinition" type:"string"` -} - -// String returns the string representation -func (s Service) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Service) GoString() string { - return s.String() -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *Service) SetClusterArn(v string) *Service { - s.ClusterArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Service) SetCreatedAt(v time.Time) *Service { - s.CreatedAt = &v - return s -} - -// SetDeploymentConfiguration sets the DeploymentConfiguration field's value. -func (s *Service) SetDeploymentConfiguration(v *DeploymentConfiguration) *Service { - s.DeploymentConfiguration = v - return s -} - -// SetDeployments sets the Deployments field's value. -func (s *Service) SetDeployments(v []*Deployment) *Service { - s.Deployments = v - return s -} - -// SetDesiredCount sets the DesiredCount field's value. -func (s *Service) SetDesiredCount(v int64) *Service { - s.DesiredCount = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *Service) SetEvents(v []*ServiceEvent) *Service { - s.Events = v - return s -} - -// SetHealthCheckGracePeriodSeconds sets the HealthCheckGracePeriodSeconds field's value. -func (s *Service) SetHealthCheckGracePeriodSeconds(v int64) *Service { - s.HealthCheckGracePeriodSeconds = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *Service) SetLaunchType(v string) *Service { - s.LaunchType = &v - return s -} - -// SetLoadBalancers sets the LoadBalancers field's value. -func (s *Service) SetLoadBalancers(v []*LoadBalancer) *Service { - s.LoadBalancers = v - return s -} - -// SetNetworkConfiguration sets the NetworkConfiguration field's value. -func (s *Service) SetNetworkConfiguration(v *NetworkConfiguration) *Service { - s.NetworkConfiguration = v - return s -} - -// SetPendingCount sets the PendingCount field's value. -func (s *Service) SetPendingCount(v int64) *Service { - s.PendingCount = &v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *Service) SetPlacementConstraints(v []*PlacementConstraint) *Service { - s.PlacementConstraints = v - return s -} - -// SetPlacementStrategy sets the PlacementStrategy field's value. -func (s *Service) SetPlacementStrategy(v []*PlacementStrategy) *Service { - s.PlacementStrategy = v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *Service) SetPlatformVersion(v string) *Service { - s.PlatformVersion = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *Service) SetRoleArn(v string) *Service { - s.RoleArn = &v - return s -} - -// SetRunningCount sets the RunningCount field's value. -func (s *Service) SetRunningCount(v int64) *Service { - s.RunningCount = &v - return s -} - -// SetServiceArn sets the ServiceArn field's value. -func (s *Service) SetServiceArn(v string) *Service { - s.ServiceArn = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *Service) SetServiceName(v string) *Service { - s.ServiceName = &v - return s -} - -// SetServiceRegistries sets the ServiceRegistries field's value. -func (s *Service) SetServiceRegistries(v []*ServiceRegistry) *Service { - s.ServiceRegistries = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Service) SetStatus(v string) *Service { - s.Status = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *Service) SetTaskDefinition(v string) *Service { - s.TaskDefinition = &v - return s -} - -// Details on an event associated with a service. -type ServiceEvent struct { - _ struct{} `type:"structure"` - - // The Unix time stamp for when the event was triggered. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The ID string of the event. - Id *string `locationName:"id" type:"string"` - - // The event message. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s ServiceEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceEvent) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServiceEvent) SetCreatedAt(v time.Time) *ServiceEvent { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *ServiceEvent) SetId(v string) *ServiceEvent { - s.Id = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ServiceEvent) SetMessage(v string) *ServiceEvent { - s.Message = &v - return s -} - -// Details of the service registry. -type ServiceRegistry struct { - _ struct{} `type:"structure"` - - // The container name value, already specified in the task definition, to be - // used for your service discovery service. If the task definition that your - // service task specifies uses the bridge or host network mode, you must specify - // a containerName and containerPort combination from the task definition. If - // the task definition that your service task specifies uses the awsvpc network - // mode and a type SRV DNS record is used, you must specify either a containerName - // and containerPort combination or a port value, but not both. - ContainerName *string `locationName:"containerName" type:"string"` - - // The port value, already specified in the task definition, to be used for - // your service discovery service. If the task definition your service task - // specifies uses the bridge or host network mode, you must specify a containerName - // and containerPort combination from the task definition. If the task definition - // your service task specifies uses the awsvpc network mode and a type SRV DNS - // record is used, you must specify either a containerName and containerPort - // combination or a port value, but not both. - ContainerPort *int64 `locationName:"containerPort" type:"integer"` - - // The port value used if your service discovery service specified an SRV record. - // This field is required if both the awsvpc network mode and SRV records are - // used. - Port *int64 `locationName:"port" type:"integer"` - - // The Amazon Resource Name (ARN) of the service registry. The currently supported - // service registry is Amazon Route 53 Auto Naming. For more information, see - // Service (https://docs.aws.amazon.com/Route53/latest/APIReference/API_autonaming_Service.html). - RegistryArn *string `locationName:"registryArn" type:"string"` -} - -// String returns the string representation -func (s ServiceRegistry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServiceRegistry) GoString() string { - return s.String() -} - -// SetContainerName sets the ContainerName field's value. -func (s *ServiceRegistry) SetContainerName(v string) *ServiceRegistry { - s.ContainerName = &v - return s -} - -// SetContainerPort sets the ContainerPort field's value. -func (s *ServiceRegistry) SetContainerPort(v int64) *ServiceRegistry { - s.ContainerPort = &v - return s -} - -// SetPort sets the Port field's value. -func (s *ServiceRegistry) SetPort(v int64) *ServiceRegistry { - s.Port = &v - return s -} - -// SetRegistryArn sets the RegistryArn field's value. -func (s *ServiceRegistry) SetRegistryArn(v string) *ServiceRegistry { - s.RegistryArn = &v - return s -} - -type StartTaskInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster on which - // to start your task. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance IDs or full ARN entries for the container instances - // on which you would like to place your task. You can specify up to 10 container - // instances. - // - // ContainerInstances is a required field - ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"` - - // The name of the task group to associate with the task. The default value - // is the family name of the task definition (for example, family:my-family-name). - Group *string `locationName:"group" type:"string"` - - // The VPC subnet and security group configuration for tasks that receive their - // own Elastic Network Interface by using the awsvpc networking mode. - NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"` - - // A list of container overrides in JSON format that specify the name of a container - // in the specified task definition and the overrides it should receive. You - // can override the default command for a container (that is specified in the - // task definition or Docker image) with a command override. You can also override - // existing environment variables (that are specified in the task definition - // or Docker image) on a container or add new environment variables to it with - // an environment override. - // - // A total of 8192 characters are allowed for overrides. This limit includes - // the JSON formatting characters of the override structure. - Overrides *TaskOverride `locationName:"overrides" type:"structure"` - - // An optional tag specified when a task is started. For example if you automatically - // trigger a task to run a batch process job, you could apply a unique identifier - // for that job to your task with the startedBy parameter. You can then identify - // which tasks belong to that job by filtering the results of a ListTasks call - // with the startedBy value. Up to 36 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. - // - // If a task is started by an Amazon ECS service, then the startedBy parameter - // contains the deployment ID of the service that starts it. - StartedBy *string `locationName:"startedBy" type:"string"` - - // The family and revision (family:revision) or full ARN of the task definition - // to start. If a revision is not specified, the latest ACTIVE revision is used. - // - // TaskDefinition is a required field - TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"` -} - -// String returns the string representation -func (s StartTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartTaskInput"} - if s.ContainerInstances == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstances")) - } - if s.TaskDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) - } - if s.NetworkConfiguration != nil { - if err := s.NetworkConfiguration.Validate(); err != nil { - invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *StartTaskInput) SetCluster(v string) *StartTaskInput { - s.Cluster = &v - return s -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *StartTaskInput) SetContainerInstances(v []*string) *StartTaskInput { - s.ContainerInstances = v - return s -} - -// SetGroup sets the Group field's value. -func (s *StartTaskInput) SetGroup(v string) *StartTaskInput { - s.Group = &v - return s -} - -// SetNetworkConfiguration sets the NetworkConfiguration field's value. -func (s *StartTaskInput) SetNetworkConfiguration(v *NetworkConfiguration) *StartTaskInput { - s.NetworkConfiguration = v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *StartTaskInput) SetOverrides(v *TaskOverride) *StartTaskInput { - s.Overrides = v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *StartTaskInput) SetStartedBy(v string) *StartTaskInput { - s.StartedBy = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *StartTaskInput) SetTaskDefinition(v string) *StartTaskInput { - s.TaskDefinition = &v - return s -} - -type StartTaskOutput struct { - _ struct{} `type:"structure"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` - - // A full description of the tasks that were started. Each task that was successfully - // placed on your container instances is described. - Tasks []*Task `locationName:"tasks" type:"list"` -} - -// String returns the string representation -func (s StartTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartTaskOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *StartTaskOutput) SetFailures(v []*Failure) *StartTaskOutput { - s.Failures = v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *StartTaskOutput) SetTasks(v []*Task) *StartTaskOutput { - s.Tasks = v - return s -} - -type StopTaskInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the task to stop. If you do not specify a cluster, the default cluster is - // assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // An optional message specified when a task is stopped. For example, if you - // are using a custom scheduler, you can use this parameter to specify the reason - // for stopping the task here, and the message appears in subsequent DescribeTasks - // API operations on this task. Up to 255 characters are allowed in this message. - Reason *string `locationName:"reason" type:"string"` - - // The task ID or full ARN entry of the task to stop. - // - // Task is a required field - Task *string `locationName:"task" type:"string" required:"true"` -} - -// String returns the string representation -func (s StopTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopTaskInput"} - if s.Task == nil { - invalidParams.Add(request.NewErrParamRequired("Task")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *StopTaskInput) SetCluster(v string) *StopTaskInput { - s.Cluster = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *StopTaskInput) SetReason(v string) *StopTaskInput { - s.Reason = &v - return s -} - -// SetTask sets the Task field's value. -func (s *StopTaskInput) SetTask(v string) *StopTaskInput { - s.Task = &v - return s -} - -type StopTaskOutput struct { - _ struct{} `type:"structure"` - - // The task that was stopped. - Task *Task `locationName:"task" type:"structure"` -} - -// String returns the string representation -func (s StopTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopTaskOutput) GoString() string { - return s.String() -} - -// SetTask sets the Task field's value. -func (s *StopTaskOutput) SetTask(v *Task) *StopTaskOutput { - s.Task = v - return s -} - -type SubmitContainerStateChangeInput struct { - _ struct{} `type:"structure"` - - // The short name or full ARN of the cluster that hosts the container. - Cluster *string `locationName:"cluster" type:"string"` - - // The name of the container. - ContainerName *string `locationName:"containerName" type:"string"` - - // The exit code returned for the state change request. - ExitCode *int64 `locationName:"exitCode" type:"integer"` - - // The network bindings of the container. - NetworkBindings []*NetworkBinding `locationName:"networkBindings" type:"list"` - - // The reason for the state change request. - Reason *string `locationName:"reason" type:"string"` - - // The status of the state change request. - Status *string `locationName:"status" type:"string"` - - // The task ID or full Amazon Resource Name (ARN) of the task that hosts the - // container. - Task *string `locationName:"task" type:"string"` -} - -// String returns the string representation -func (s SubmitContainerStateChangeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubmitContainerStateChangeInput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *SubmitContainerStateChangeInput) SetCluster(v string) *SubmitContainerStateChangeInput { - s.Cluster = &v - return s -} - -// SetContainerName sets the ContainerName field's value. -func (s *SubmitContainerStateChangeInput) SetContainerName(v string) *SubmitContainerStateChangeInput { - s.ContainerName = &v - return s -} - -// SetExitCode sets the ExitCode field's value. -func (s *SubmitContainerStateChangeInput) SetExitCode(v int64) *SubmitContainerStateChangeInput { - s.ExitCode = &v - return s -} - -// SetNetworkBindings sets the NetworkBindings field's value. -func (s *SubmitContainerStateChangeInput) SetNetworkBindings(v []*NetworkBinding) *SubmitContainerStateChangeInput { - s.NetworkBindings = v - return s -} - -// SetReason sets the Reason field's value. -func (s *SubmitContainerStateChangeInput) SetReason(v string) *SubmitContainerStateChangeInput { - s.Reason = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SubmitContainerStateChangeInput) SetStatus(v string) *SubmitContainerStateChangeInput { - s.Status = &v - return s -} - -// SetTask sets the Task field's value. -func (s *SubmitContainerStateChangeInput) SetTask(v string) *SubmitContainerStateChangeInput { - s.Task = &v - return s -} - -type SubmitContainerStateChangeOutput struct { - _ struct{} `type:"structure"` - - // Acknowledgement of the state change. - Acknowledgment *string `locationName:"acknowledgment" type:"string"` -} - -// String returns the string representation -func (s SubmitContainerStateChangeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubmitContainerStateChangeOutput) GoString() string { - return s.String() -} - -// SetAcknowledgment sets the Acknowledgment field's value. -func (s *SubmitContainerStateChangeOutput) SetAcknowledgment(v string) *SubmitContainerStateChangeOutput { - s.Acknowledgment = &v - return s -} - -type SubmitTaskStateChangeInput struct { - _ struct{} `type:"structure"` - - // Any attachments associated with the state change request. - Attachments []*AttachmentStateChange `locationName:"attachments" type:"list"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the task. - Cluster *string `locationName:"cluster" type:"string"` - - // Any containers associated with the state change request. - Containers []*ContainerStateChange `locationName:"containers" type:"list"` - - // The Unix time stamp for when the task execution stopped. - ExecutionStoppedAt *time.Time `locationName:"executionStoppedAt" type:"timestamp" timestampFormat:"unix"` - - // The Unix time stamp for when the container image pull began. - PullStartedAt *time.Time `locationName:"pullStartedAt" type:"timestamp" timestampFormat:"unix"` - - // The Unix time stamp for when the container image pull completed. - PullStoppedAt *time.Time `locationName:"pullStoppedAt" type:"timestamp" timestampFormat:"unix"` - - // The reason for the state change request. - Reason *string `locationName:"reason" type:"string"` - - // The status of the state change request. - Status *string `locationName:"status" type:"string"` - - // The task ID or full ARN of the task in the state change request. - Task *string `locationName:"task" type:"string"` -} - -// String returns the string representation -func (s SubmitTaskStateChangeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubmitTaskStateChangeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SubmitTaskStateChangeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SubmitTaskStateChangeInput"} - if s.Attachments != nil { - for i, v := range s.Attachments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attachments", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttachments sets the Attachments field's value. -func (s *SubmitTaskStateChangeInput) SetAttachments(v []*AttachmentStateChange) *SubmitTaskStateChangeInput { - s.Attachments = v - return s -} - -// SetCluster sets the Cluster field's value. -func (s *SubmitTaskStateChangeInput) SetCluster(v string) *SubmitTaskStateChangeInput { - s.Cluster = &v - return s -} - -// SetContainers sets the Containers field's value. -func (s *SubmitTaskStateChangeInput) SetContainers(v []*ContainerStateChange) *SubmitTaskStateChangeInput { - s.Containers = v - return s -} - -// SetExecutionStoppedAt sets the ExecutionStoppedAt field's value. -func (s *SubmitTaskStateChangeInput) SetExecutionStoppedAt(v time.Time) *SubmitTaskStateChangeInput { - s.ExecutionStoppedAt = &v - return s -} - -// SetPullStartedAt sets the PullStartedAt field's value. -func (s *SubmitTaskStateChangeInput) SetPullStartedAt(v time.Time) *SubmitTaskStateChangeInput { - s.PullStartedAt = &v - return s -} - -// SetPullStoppedAt sets the PullStoppedAt field's value. -func (s *SubmitTaskStateChangeInput) SetPullStoppedAt(v time.Time) *SubmitTaskStateChangeInput { - s.PullStoppedAt = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *SubmitTaskStateChangeInput) SetReason(v string) *SubmitTaskStateChangeInput { - s.Reason = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SubmitTaskStateChangeInput) SetStatus(v string) *SubmitTaskStateChangeInput { - s.Status = &v - return s -} - -// SetTask sets the Task field's value. -func (s *SubmitTaskStateChangeInput) SetTask(v string) *SubmitTaskStateChangeInput { - s.Task = &v - return s -} - -type SubmitTaskStateChangeOutput struct { - _ struct{} `type:"structure"` - - // Acknowledgement of the state change. - Acknowledgment *string `locationName:"acknowledgment" type:"string"` -} - -// String returns the string representation -func (s SubmitTaskStateChangeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubmitTaskStateChangeOutput) GoString() string { - return s.String() -} - -// SetAcknowledgment sets the Acknowledgment field's value. -func (s *SubmitTaskStateChangeOutput) SetAcknowledgment(v string) *SubmitTaskStateChangeOutput { - s.Acknowledgment = &v - return s -} - -// Details on a task in a cluster. -type Task struct { - _ struct{} `type:"structure"` - - // The Elastic Network Adapter associated with the task if the task uses the - // awsvpc network mode. - Attachments []*Attachment `locationName:"attachments" type:"list"` - - // The ARN of the cluster that hosts the task. - ClusterArn *string `locationName:"clusterArn" type:"string"` - - // The connectivity status of a task. - Connectivity *string `locationName:"connectivity" type:"string" enum:"Connectivity"` - - // The Unix time stamp for when the task last went into CONNECTED status. - ConnectivityAt *time.Time `locationName:"connectivityAt" type:"timestamp" timestampFormat:"unix"` - - // The ARN of the container instances that host the task. - ContainerInstanceArn *string `locationName:"containerInstanceArn" type:"string"` - - // The containers associated with the task. - Containers []*Container `locationName:"containers" type:"list"` - - // The number of CPU units used by the task. It can be expressed as an integer - // using CPU units, for example 1024, or as a string using vCPUs, for example - // 1 vCPU or 1 vcpu, in a task definition but is converted to an integer indicating - // the CPU units when the task definition is registered. - // - // If using the EC2 launch type, this field is optional. Supported values are - // between 128 CPU units (0.125 vCPUs) and 10240 CPU units (10 vCPUs). - // - // If using the Fargate launch type, this field is required and you must use - // one of the following values, which determines your range of supported values - // for the memory parameter: - // - // * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), - // 2048 (2 GB) - // - // * 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 - // (3 GB), 4096 (4 GB) - // - // * 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 - // (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - // - // * 2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 - // (16 GB) in increments of 1024 (1 GB) - // - // * 4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 - // (30 GB) in increments of 1024 (1 GB) - Cpu *string `locationName:"cpu" type:"string"` - - // The Unix time stamp for when the task was created (the task entered the PENDING - // state). - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"` - - // The desired status of the task. - DesiredStatus *string `locationName:"desiredStatus" type:"string"` - - // The Unix time stamp for when the task execution stopped. - ExecutionStoppedAt *time.Time `locationName:"executionStoppedAt" type:"timestamp" timestampFormat:"unix"` - - // The name of the task group associated with the task. - Group *string `locationName:"group" type:"string"` - - // The health status for the task, which is determined by the health of the - // essential containers in the task. If all essential containers in the task - // are reporting as HEALTHY, then the task status also reports as HEALTHY. If - // any essential containers in the task are reporting as UNHEALTHY or UNKNOWN, - // then the task status also reports as UNHEALTHY or UNKNOWN, accordingly. - // - // The Amazon ECS container agent does not monitor or report on Docker health - // checks that are embedded in a container image (such as those specified in - // a parent image or from the image's Dockerfile) and not specified in the container - // definition. Health check parameters that are specified in a container definition - // override any Docker health checks that exist in the container image. - HealthStatus *string `locationName:"healthStatus" type:"string" enum:"HealthStatus"` - - // The last known status of the task. - LastStatus *string `locationName:"lastStatus" type:"string"` - - // The launch type on which your task is running. - LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` - - // The amount of memory (in MiB) used by the task. It can be expressed as an - // integer using MiB, for example 1024, or as a string using GB, for example - // 1GB or 1 GB, in a task definition but is converted to an integer indicating - // the MiB when the task definition is registered. - // - // If using the EC2 launch type, this field is optional. - // - // If using the Fargate launch type, this field is required and you must use - // one of the following values, which determines your range of supported values - // for the cpu parameter: - // - // * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 - // vCPU) - // - // * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: - // 512 (.5 vCPU) - // - // * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 - // (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU) - // - // * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - - // Available cpu values: 2048 (2 vCPU) - // - // * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - - // Available cpu values: 4096 (4 vCPU) - Memory *string `locationName:"memory" type:"string"` - - // One or more container overrides. - Overrides *TaskOverride `locationName:"overrides" type:"structure"` - - // The platform version on which your task is running. For more information, - // see AWS Fargate Platform Versions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) - // in the Amazon Elastic Container Service Developer Guide. - PlatformVersion *string `locationName:"platformVersion" type:"string"` - - // The Unix time stamp for when the container image pull began. - PullStartedAt *time.Time `locationName:"pullStartedAt" type:"timestamp" timestampFormat:"unix"` - - // The Unix time stamp for when the container image pull completed. - PullStoppedAt *time.Time `locationName:"pullStoppedAt" type:"timestamp" timestampFormat:"unix"` - - // The Unix time stamp for when the task started (the task transitioned from - // the PENDING state to the RUNNING state). - StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"unix"` - - // The tag specified when a task is started. If the task is started by an Amazon - // ECS service, then the startedBy parameter contains the deployment ID of the - // service that starts it. - StartedBy *string `locationName:"startedBy" type:"string"` - - // The Unix time stamp for when the task was stopped (the task transitioned - // from the RUNNING state to the STOPPED state). - StoppedAt *time.Time `locationName:"stoppedAt" type:"timestamp" timestampFormat:"unix"` - - // The reason the task was stopped. - StoppedReason *string `locationName:"stoppedReason" type:"string"` - - // The Unix time stamp for when the task will stop (transitions from the RUNNING - // state to STOPPED). - StoppingAt *time.Time `locationName:"stoppingAt" type:"timestamp" timestampFormat:"unix"` - - // The Amazon Resource Name (ARN) of the task. - TaskArn *string `locationName:"taskArn" type:"string"` - - // The ARN of the task definition that creates the task. - TaskDefinitionArn *string `locationName:"taskDefinitionArn" type:"string"` - - // The version counter for the task. Every time a task experiences a change - // that triggers a CloudWatch event, the version counter is incremented. If - // you are replicating your Amazon ECS task state with CloudWatch Events, you - // can compare the version of a task reported by the Amazon ECS APIs with the - // version reported in CloudWatch Events for the task (inside the detail object) - // to verify that the version in your event stream is current. - Version *int64 `locationName:"version" type:"long"` -} - -// String returns the string representation -func (s Task) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Task) GoString() string { - return s.String() -} - -// SetAttachments sets the Attachments field's value. -func (s *Task) SetAttachments(v []*Attachment) *Task { - s.Attachments = v - return s -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *Task) SetClusterArn(v string) *Task { - s.ClusterArn = &v - return s -} - -// SetConnectivity sets the Connectivity field's value. -func (s *Task) SetConnectivity(v string) *Task { - s.Connectivity = &v - return s -} - -// SetConnectivityAt sets the ConnectivityAt field's value. -func (s *Task) SetConnectivityAt(v time.Time) *Task { - s.ConnectivityAt = &v - return s -} - -// SetContainerInstanceArn sets the ContainerInstanceArn field's value. -func (s *Task) SetContainerInstanceArn(v string) *Task { - s.ContainerInstanceArn = &v - return s -} - -// SetContainers sets the Containers field's value. -func (s *Task) SetContainers(v []*Container) *Task { - s.Containers = v - return s -} - -// SetCpu sets the Cpu field's value. -func (s *Task) SetCpu(v string) *Task { - s.Cpu = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Task) SetCreatedAt(v time.Time) *Task { - s.CreatedAt = &v - return s -} - -// SetDesiredStatus sets the DesiredStatus field's value. -func (s *Task) SetDesiredStatus(v string) *Task { - s.DesiredStatus = &v - return s -} - -// SetExecutionStoppedAt sets the ExecutionStoppedAt field's value. -func (s *Task) SetExecutionStoppedAt(v time.Time) *Task { - s.ExecutionStoppedAt = &v - return s -} - -// SetGroup sets the Group field's value. -func (s *Task) SetGroup(v string) *Task { - s.Group = &v - return s -} - -// SetHealthStatus sets the HealthStatus field's value. -func (s *Task) SetHealthStatus(v string) *Task { - s.HealthStatus = &v - return s -} - -// SetLastStatus sets the LastStatus field's value. -func (s *Task) SetLastStatus(v string) *Task { - s.LastStatus = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *Task) SetLaunchType(v string) *Task { - s.LaunchType = &v - return s -} - -// SetMemory sets the Memory field's value. -func (s *Task) SetMemory(v string) *Task { - s.Memory = &v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *Task) SetOverrides(v *TaskOverride) *Task { - s.Overrides = v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *Task) SetPlatformVersion(v string) *Task { - s.PlatformVersion = &v - return s -} - -// SetPullStartedAt sets the PullStartedAt field's value. -func (s *Task) SetPullStartedAt(v time.Time) *Task { - s.PullStartedAt = &v - return s -} - -// SetPullStoppedAt sets the PullStoppedAt field's value. -func (s *Task) SetPullStoppedAt(v time.Time) *Task { - s.PullStoppedAt = &v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *Task) SetStartedAt(v time.Time) *Task { - s.StartedAt = &v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *Task) SetStartedBy(v string) *Task { - s.StartedBy = &v - return s -} - -// SetStoppedAt sets the StoppedAt field's value. -func (s *Task) SetStoppedAt(v time.Time) *Task { - s.StoppedAt = &v - return s -} - -// SetStoppedReason sets the StoppedReason field's value. -func (s *Task) SetStoppedReason(v string) *Task { - s.StoppedReason = &v - return s -} - -// SetStoppingAt sets the StoppingAt field's value. -func (s *Task) SetStoppingAt(v time.Time) *Task { - s.StoppingAt = &v - return s -} - -// SetTaskArn sets the TaskArn field's value. -func (s *Task) SetTaskArn(v string) *Task { - s.TaskArn = &v - return s -} - -// SetTaskDefinitionArn sets the TaskDefinitionArn field's value. -func (s *Task) SetTaskDefinitionArn(v string) *Task { - s.TaskDefinitionArn = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *Task) SetVersion(v int64) *Task { - s.Version = &v - return s -} - -// Details of a task definition. -type TaskDefinition struct { - _ struct{} `type:"structure"` - - // The launch type to use with your task. For more information, see Amazon ECS - // Launch Types (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) - // in the Amazon Elastic Container Service Developer Guide. - Compatibilities []*string `locationName:"compatibilities" type:"list"` - - // A list of container definitions in JSON format that describe the different - // containers that make up your task. For more information about container definition - // parameters and defaults, see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) - // in the Amazon Elastic Container Service Developer Guide. - ContainerDefinitions []*ContainerDefinition `locationName:"containerDefinitions" type:"list"` - - // The number of cpu units used by the task. If using the EC2 launch type, this - // field is optional and any value can be used. If using the Fargate launch - // type, this field is required and you must use one of the following values, - // which determines your range of valid values for the memory parameter: - // - // * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB), - // 2048 (2 GB) - // - // * 512 (.5 vCPU) - Available memory values: 1024 (1 GB), 2048 (2 GB), 3072 - // (3 GB), 4096 (4 GB) - // - // * 1024 (1 vCPU) - Available memory values: 2048 (2 GB), 3072 (3 GB), 4096 - // (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - // - // * 2048 (2 vCPU) - Available memory values: Between 4096 (4 GB) and 16384 - // (16 GB) in increments of 1024 (1 GB) - // - // * 4096 (4 vCPU) - Available memory values: Between 8192 (8 GB) and 30720 - // (30 GB) in increments of 1024 (1 GB) - Cpu *string `locationName:"cpu" type:"string"` - - // The Amazon Resource Name (ARN) of the task execution role that the Amazon - // ECS container agent and the Docker daemon can assume. - ExecutionRoleArn *string `locationName:"executionRoleArn" type:"string"` - - // The family of your task definition, used as the definition name. - Family *string `locationName:"family" type:"string"` - - // The amount (in MiB) of memory used by the task. If using the EC2 launch type, - // this field is optional and any value can be used. If using the Fargate launch - // type, this field is required and you must use one of the following values, - // which determines your range of valid values for the cpu parameter: - // - // * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 - // vCPU) - // - // * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: - // 512 (.5 vCPU) - // - // * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 - // (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU) - // - // * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - - // Available cpu values: 2048 (2 vCPU) - // - // * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - - // Available cpu values: 4096 (4 vCPU) - Memory *string `locationName:"memory" type:"string"` - - // The Docker networking mode to use for the containers in the task. The valid - // values are none, bridge, awsvpc, and host. The default Docker network mode - // is bridge. If using the Fargate launch type, the awsvpc network mode is required. - // If using the EC2 launch type, any network mode can be used. If the network - // mode is set to none, you can't specify port mappings in your container definitions, - // and the task's containers do not have external connectivity. The host and - // awsvpc network modes offer the highest networking performance for containers - // because they use the EC2 network stack instead of the virtualized network - // stack provided by the bridge mode. - // - // With the host and awsvpc network modes, exposed container ports are mapped - // directly to the corresponding host port (for the host network mode) or the - // attached elastic network interface port (for the awsvpc network mode), so - // you cannot take advantage of dynamic host port mappings. - // - // If the network mode is awsvpc, the task is allocated an Elastic Network Interface, - // and you must specify a NetworkConfiguration when you create a service or - // run a task with the task definition. For more information, see Task Networking - // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) - // in the Amazon Elastic Container Service Developer Guide. - // - // Currently, only the Amazon ECS-optimized AMI, other Amazon Linux variants - // with the ecs-init package, or AWS Fargate infrastructure support the awsvpc - // network mode. - // - // If the network mode is host, you can't run multiple instantiations of the - // same task on a single container instance when port mappings are used. - // - // Docker for Windows uses different network modes than Docker for Linux. When - // you register a task definition with Windows containers, you must not specify - // a network mode. If you use the console to register a task definition with - // Windows containers, you must choose the network mode object. - // - // For more information, see Network settings (https://docs.docker.com/engine/reference/run/#network-settings) - // in the Docker run reference. - NetworkMode *string `locationName:"networkMode" type:"string" enum:"NetworkMode"` - - // An array of placement constraint objects to use for tasks. This field is - // not valid if using the Fargate launch type for your task. - PlacementConstraints []*TaskDefinitionPlacementConstraint `locationName:"placementConstraints" type:"list"` - - // The container instance attributes required by your task. This field is not - // valid if using the Fargate launch type for your task. - RequiresAttributes []*Attribute `locationName:"requiresAttributes" type:"list"` - - // The launch type the task is using. - RequiresCompatibilities []*string `locationName:"requiresCompatibilities" type:"list"` - - // The revision of the task in a particular family. The revision is a version - // number of a task definition in a family. When you register a task definition - // for the first time, the revision is 1; each time you register a new revision - // of a task definition in the same family, the revision value always increases - // by one (even if you have deregistered previous revisions in this family). - Revision *int64 `locationName:"revision" type:"integer"` - - // The status of the task definition. - Status *string `locationName:"status" type:"string" enum:"TaskDefinitionStatus"` - - // The full Amazon Resource Name (ARN) of the task definition. - TaskDefinitionArn *string `locationName:"taskDefinitionArn" type:"string"` - - // The ARN of the IAM role that containers in this task can assume. All containers - // in this task are granted the permissions that are specified in this role. - // - // IAM roles for tasks on Windows require that the -EnableTaskIAMRole option - // is set when you launch the Amazon ECS-optimized Windows AMI. Your containers - // must also run some configuration code in order to take advantage of the feature. - // For more information, see Windows IAM Roles for Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html) - // in the Amazon Elastic Container Service Developer Guide. - TaskRoleArn *string `locationName:"taskRoleArn" type:"string"` - - // The list of volumes in a task. - // - // If you are using the Fargate launch type, the host and sourcePath parameters - // are not supported. - // - // For more information about volume definition parameters and defaults, see - // Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) - // in the Amazon Elastic Container Service Developer Guide. - Volumes []*Volume `locationName:"volumes" type:"list"` -} - -// String returns the string representation -func (s TaskDefinition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TaskDefinition) GoString() string { - return s.String() -} - -// SetCompatibilities sets the Compatibilities field's value. -func (s *TaskDefinition) SetCompatibilities(v []*string) *TaskDefinition { - s.Compatibilities = v - return s -} - -// SetContainerDefinitions sets the ContainerDefinitions field's value. -func (s *TaskDefinition) SetContainerDefinitions(v []*ContainerDefinition) *TaskDefinition { - s.ContainerDefinitions = v - return s -} - -// SetCpu sets the Cpu field's value. -func (s *TaskDefinition) SetCpu(v string) *TaskDefinition { - s.Cpu = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *TaskDefinition) SetExecutionRoleArn(v string) *TaskDefinition { - s.ExecutionRoleArn = &v - return s -} - -// SetFamily sets the Family field's value. -func (s *TaskDefinition) SetFamily(v string) *TaskDefinition { - s.Family = &v - return s -} - -// SetMemory sets the Memory field's value. -func (s *TaskDefinition) SetMemory(v string) *TaskDefinition { - s.Memory = &v - return s -} - -// SetNetworkMode sets the NetworkMode field's value. -func (s *TaskDefinition) SetNetworkMode(v string) *TaskDefinition { - s.NetworkMode = &v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *TaskDefinition) SetPlacementConstraints(v []*TaskDefinitionPlacementConstraint) *TaskDefinition { - s.PlacementConstraints = v - return s -} - -// SetRequiresAttributes sets the RequiresAttributes field's value. -func (s *TaskDefinition) SetRequiresAttributes(v []*Attribute) *TaskDefinition { - s.RequiresAttributes = v - return s -} - -// SetRequiresCompatibilities sets the RequiresCompatibilities field's value. -func (s *TaskDefinition) SetRequiresCompatibilities(v []*string) *TaskDefinition { - s.RequiresCompatibilities = v - return s -} - -// SetRevision sets the Revision field's value. -func (s *TaskDefinition) SetRevision(v int64) *TaskDefinition { - s.Revision = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TaskDefinition) SetStatus(v string) *TaskDefinition { - s.Status = &v - return s -} - -// SetTaskDefinitionArn sets the TaskDefinitionArn field's value. -func (s *TaskDefinition) SetTaskDefinitionArn(v string) *TaskDefinition { - s.TaskDefinitionArn = &v - return s -} - -// SetTaskRoleArn sets the TaskRoleArn field's value. -func (s *TaskDefinition) SetTaskRoleArn(v string) *TaskDefinition { - s.TaskRoleArn = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *TaskDefinition) SetVolumes(v []*Volume) *TaskDefinition { - s.Volumes = v - return s -} - -// An object representing a constraint on task placement in the task definition. -// -// If you are using the Fargate launch type, task placement constraints are -// not supported. -// -// For more information, see Task Placement Constraints (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) -// in the Amazon Elastic Container Service Developer Guide. -type TaskDefinitionPlacementConstraint struct { - _ struct{} `type:"structure"` - - // A cluster query language expression to apply to the constraint. For more - // information, see Cluster Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) - // in the Amazon Elastic Container Service Developer Guide. - Expression *string `locationName:"expression" type:"string"` - - // The type of constraint. The DistinctInstance constraint ensures that each - // task in a particular group is running on a different container instance. - // The MemberOf constraint restricts selection to be from a group of valid candidates. - Type *string `locationName:"type" type:"string" enum:"TaskDefinitionPlacementConstraintType"` -} - -// String returns the string representation -func (s TaskDefinitionPlacementConstraint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TaskDefinitionPlacementConstraint) GoString() string { - return s.String() -} - -// SetExpression sets the Expression field's value. -func (s *TaskDefinitionPlacementConstraint) SetExpression(v string) *TaskDefinitionPlacementConstraint { - s.Expression = &v - return s -} - -// SetType sets the Type field's value. -func (s *TaskDefinitionPlacementConstraint) SetType(v string) *TaskDefinitionPlacementConstraint { - s.Type = &v - return s -} - -// The overrides associated with a task. -type TaskOverride struct { - _ struct{} `type:"structure"` - - // One or more container overrides sent to a task. - ContainerOverrides []*ContainerOverride `locationName:"containerOverrides" type:"list"` - - // The Amazon Resource Name (ARN) of the task execution role that the Amazon - // ECS container agent and the Docker daemon can assume. - ExecutionRoleArn *string `locationName:"executionRoleArn" type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role that containers in this task - // can assume. All containers in this task are granted the permissions that - // are specified in this role. - TaskRoleArn *string `locationName:"taskRoleArn" type:"string"` -} - -// String returns the string representation -func (s TaskOverride) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TaskOverride) GoString() string { - return s.String() -} - -// SetContainerOverrides sets the ContainerOverrides field's value. -func (s *TaskOverride) SetContainerOverrides(v []*ContainerOverride) *TaskOverride { - s.ContainerOverrides = v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *TaskOverride) SetExecutionRoleArn(v string) *TaskOverride { - s.ExecutionRoleArn = &v - return s -} - -// SetTaskRoleArn sets the TaskRoleArn field's value. -func (s *TaskOverride) SetTaskRoleArn(v string) *TaskOverride { - s.TaskRoleArn = &v - return s -} - -// The container path, mount options, and size of the tmpfs mount. -type Tmpfs struct { - _ struct{} `type:"structure"` - - // The absolute file path where the tmpfs volume will be mounted. - // - // ContainerPath is a required field - ContainerPath *string `locationName:"containerPath" type:"string" required:"true"` - - // The list of tmpfs volume mount options. - // - // Valid values: "defaults" | "ro" | "rw" | "suid" | "nosuid" | "dev" | "nodev" - // | "exec" | "noexec" | "sync" | "async" | "dirsync" | "remount" | "mand" | - // "nomand" | "atime" | "noatime" | "diratime" | "nodiratime" | "bind" | "rbind" - // | "unbindable" | "runbindable" | "private" | "rprivate" | "shared" | "rshared" - // | "slave" | "rslave" | "relatime" | "norelatime" | "strictatime" | "nostrictatime" - MountOptions []*string `locationName:"mountOptions" type:"list"` - - // The size (in MiB) of the tmpfs volume. - // - // Size is a required field - Size *int64 `locationName:"size" type:"integer" required:"true"` -} - -// String returns the string representation -func (s Tmpfs) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tmpfs) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tmpfs) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tmpfs"} - if s.ContainerPath == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerPath")) - } - if s.Size == nil { - invalidParams.Add(request.NewErrParamRequired("Size")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContainerPath sets the ContainerPath field's value. -func (s *Tmpfs) SetContainerPath(v string) *Tmpfs { - s.ContainerPath = &v - return s -} - -// SetMountOptions sets the MountOptions field's value. -func (s *Tmpfs) SetMountOptions(v []*string) *Tmpfs { - s.MountOptions = v - return s -} - -// SetSize sets the Size field's value. -func (s *Tmpfs) SetSize(v int64) *Tmpfs { - s.Size = &v - return s -} - -// The ulimit settings to pass to the container. -type Ulimit struct { - _ struct{} `type:"structure"` - - // The hard limit for the ulimit type. - // - // HardLimit is a required field - HardLimit *int64 `locationName:"hardLimit" type:"integer" required:"true"` - - // The type of the ulimit. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true" enum:"UlimitName"` - - // The soft limit for the ulimit type. - // - // SoftLimit is a required field - SoftLimit *int64 `locationName:"softLimit" type:"integer" required:"true"` -} - -// String returns the string representation -func (s Ulimit) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Ulimit) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Ulimit) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ulimit"} - if s.HardLimit == nil { - invalidParams.Add(request.NewErrParamRequired("HardLimit")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.SoftLimit == nil { - invalidParams.Add(request.NewErrParamRequired("SoftLimit")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHardLimit sets the HardLimit field's value. -func (s *Ulimit) SetHardLimit(v int64) *Ulimit { - s.HardLimit = &v - return s -} - -// SetName sets the Name field's value. -func (s *Ulimit) SetName(v string) *Ulimit { - s.Name = &v - return s -} - -// SetSoftLimit sets the SoftLimit field's value. -func (s *Ulimit) SetSoftLimit(v int64) *Ulimit { - s.SoftLimit = &v - return s -} - -type UpdateContainerAgentInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that your - // container instance is running on. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // The container instance ID or full ARN entries for the container instance - // on which you would like to update the Amazon ECS container agent. - // - // ContainerInstance is a required field - ContainerInstance *string `locationName:"containerInstance" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateContainerAgentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContainerAgentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateContainerAgentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateContainerAgentInput"} - if s.ContainerInstance == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstance")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *UpdateContainerAgentInput) SetCluster(v string) *UpdateContainerAgentInput { - s.Cluster = &v - return s -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *UpdateContainerAgentInput) SetContainerInstance(v string) *UpdateContainerAgentInput { - s.ContainerInstance = &v - return s -} - -type UpdateContainerAgentOutput struct { - _ struct{} `type:"structure"` - - // The container instance for which the container agent was updated. - ContainerInstance *ContainerInstance `locationName:"containerInstance" type:"structure"` -} - -// String returns the string representation -func (s UpdateContainerAgentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContainerAgentOutput) GoString() string { - return s.String() -} - -// SetContainerInstance sets the ContainerInstance field's value. -func (s *UpdateContainerAgentOutput) SetContainerInstance(v *ContainerInstance) *UpdateContainerAgentOutput { - s.ContainerInstance = v - return s -} - -type UpdateContainerInstancesStateInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that hosts - // the container instance to update. If you do not specify a cluster, the default - // cluster is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // A list of container instance IDs or full ARN entries. - // - // ContainerInstances is a required field - ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"` - - // The container instance state with which to update the container instance. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ContainerInstanceStatus"` -} - -// String returns the string representation -func (s UpdateContainerInstancesStateInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContainerInstancesStateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateContainerInstancesStateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateContainerInstancesStateInput"} - if s.ContainerInstances == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerInstances")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *UpdateContainerInstancesStateInput) SetCluster(v string) *UpdateContainerInstancesStateInput { - s.Cluster = &v - return s -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *UpdateContainerInstancesStateInput) SetContainerInstances(v []*string) *UpdateContainerInstancesStateInput { - s.ContainerInstances = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateContainerInstancesStateInput) SetStatus(v string) *UpdateContainerInstancesStateInput { - s.Status = &v - return s -} - -type UpdateContainerInstancesStateOutput struct { - _ struct{} `type:"structure"` - - // The list of container instances. - ContainerInstances []*ContainerInstance `locationName:"containerInstances" type:"list"` - - // Any failures associated with the call. - Failures []*Failure `locationName:"failures" type:"list"` -} - -// String returns the string representation -func (s UpdateContainerInstancesStateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateContainerInstancesStateOutput) GoString() string { - return s.String() -} - -// SetContainerInstances sets the ContainerInstances field's value. -func (s *UpdateContainerInstancesStateOutput) SetContainerInstances(v []*ContainerInstance) *UpdateContainerInstancesStateOutput { - s.ContainerInstances = v - return s -} - -// SetFailures sets the Failures field's value. -func (s *UpdateContainerInstancesStateOutput) SetFailures(v []*Failure) *UpdateContainerInstancesStateOutput { - s.Failures = v - return s -} - -type UpdateServiceInput struct { - _ struct{} `type:"structure"` - - // The short name or full Amazon Resource Name (ARN) of the cluster that your - // service is running on. If you do not specify a cluster, the default cluster - // is assumed. - Cluster *string `locationName:"cluster" type:"string"` - - // Optional deployment parameters that control how many tasks run during the - // deployment and the ordering of stopping and starting tasks. - DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"` - - // The number of instantiations of the task to place and keep running in your - // service. - DesiredCount *int64 `locationName:"desiredCount" type:"integer"` - - // Whether to force a new deployment of the service. Deployments are not forced - // by default. You can use this option to trigger a new deployment with no service - // definition changes. For example, you can update a service's tasks to use - // a newer Docker image with the same image/tag combination (my_image:latest) - // or to roll Fargate tasks onto a newer platform version. - ForceNewDeployment *bool `locationName:"forceNewDeployment" type:"boolean"` - - // The period of time, in seconds, that the Amazon ECS service scheduler should - // ignore unhealthy Elastic Load Balancing target health checks after a task - // has first started. This is only valid if your service is configured to use - // a load balancer. If your service's tasks take a while to start and respond - // to Elastic Load Balancing health checks, you can specify a health check grace - // period of up to 1,800 seconds during which the ECS service scheduler ignores - // the Elastic Load Balancing health check status. This grace period can prevent - // the ECS service scheduler from marking tasks as unhealthy and stopping them - // before they have time to come up. - HealthCheckGracePeriodSeconds *int64 `locationName:"healthCheckGracePeriodSeconds" type:"integer"` - - // The network configuration for the service. This parameter is required for - // task definitions that use the awsvpc network mode to receive their own elastic - // network interface, and it is not supported for other network modes. For more - // information, see Task Networking (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) - // in the Amazon Elastic Container Service Developer Guide. - // - // Updating a service to add a subnet to a list of existing subnets does not - // trigger a service deployment. For example, if your network configuration - // change is to keep the existing subnets and simply add another subnet to the - // network configuration, this does not trigger a new service deployment. - NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"` - - // The platform version you want to update your service to run. - PlatformVersion *string `locationName:"platformVersion" type:"string"` - - // The name of the service to update. - // - // Service is a required field - Service *string `locationName:"service" type:"string" required:"true"` - - // The family and revision (family:revision) or full ARN of the task definition - // to run in your service. If a revision is not specified, the latest ACTIVE - // revision is used. If you modify the task definition with UpdateService, Amazon - // ECS spawns a task with the new version of the task definition and then stops - // an old task after the new version is running. - TaskDefinition *string `locationName:"taskDefinition" type:"string"` -} - -// String returns the string representation -func (s UpdateServiceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateServiceInput"} - if s.Service == nil { - invalidParams.Add(request.NewErrParamRequired("Service")) - } - if s.NetworkConfiguration != nil { - if err := s.NetworkConfiguration.Validate(); err != nil { - invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCluster sets the Cluster field's value. -func (s *UpdateServiceInput) SetCluster(v string) *UpdateServiceInput { - s.Cluster = &v - return s -} - -// SetDeploymentConfiguration sets the DeploymentConfiguration field's value. -func (s *UpdateServiceInput) SetDeploymentConfiguration(v *DeploymentConfiguration) *UpdateServiceInput { - s.DeploymentConfiguration = v - return s -} - -// SetDesiredCount sets the DesiredCount field's value. -func (s *UpdateServiceInput) SetDesiredCount(v int64) *UpdateServiceInput { - s.DesiredCount = &v - return s -} - -// SetForceNewDeployment sets the ForceNewDeployment field's value. -func (s *UpdateServiceInput) SetForceNewDeployment(v bool) *UpdateServiceInput { - s.ForceNewDeployment = &v - return s -} - -// SetHealthCheckGracePeriodSeconds sets the HealthCheckGracePeriodSeconds field's value. -func (s *UpdateServiceInput) SetHealthCheckGracePeriodSeconds(v int64) *UpdateServiceInput { - s.HealthCheckGracePeriodSeconds = &v - return s -} - -// SetNetworkConfiguration sets the NetworkConfiguration field's value. -func (s *UpdateServiceInput) SetNetworkConfiguration(v *NetworkConfiguration) *UpdateServiceInput { - s.NetworkConfiguration = v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *UpdateServiceInput) SetPlatformVersion(v string) *UpdateServiceInput { - s.PlatformVersion = &v - return s -} - -// SetService sets the Service field's value. -func (s *UpdateServiceInput) SetService(v string) *UpdateServiceInput { - s.Service = &v - return s -} - -// SetTaskDefinition sets the TaskDefinition field's value. -func (s *UpdateServiceInput) SetTaskDefinition(v string) *UpdateServiceInput { - s.TaskDefinition = &v - return s -} - -type UpdateServiceOutput struct { - _ struct{} `type:"structure"` - - // The full description of your service following the update call. - Service *Service `locationName:"service" type:"structure"` -} - -// String returns the string representation -func (s UpdateServiceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateServiceOutput) GoString() string { - return s.String() -} - -// SetService sets the Service field's value. -func (s *UpdateServiceOutput) SetService(v *Service) *UpdateServiceOutput { - s.Service = v - return s -} - -// The Docker and Amazon ECS container agent version information about a container -// instance. -type VersionInfo struct { - _ struct{} `type:"structure"` - - // The Git commit hash for the Amazon ECS container agent build on the amazon-ecs-agent - // (https://github.com/aws/amazon-ecs-agent/commits/master) GitHub repository. - AgentHash *string `locationName:"agentHash" type:"string"` - - // The version number of the Amazon ECS container agent. - AgentVersion *string `locationName:"agentVersion" type:"string"` - - // The Docker version running on the container instance. - DockerVersion *string `locationName:"dockerVersion" type:"string"` -} - -// String returns the string representation -func (s VersionInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VersionInfo) GoString() string { - return s.String() -} - -// SetAgentHash sets the AgentHash field's value. -func (s *VersionInfo) SetAgentHash(v string) *VersionInfo { - s.AgentHash = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *VersionInfo) SetAgentVersion(v string) *VersionInfo { - s.AgentVersion = &v - return s -} - -// SetDockerVersion sets the DockerVersion field's value. -func (s *VersionInfo) SetDockerVersion(v string) *VersionInfo { - s.DockerVersion = &v - return s -} - -// A data volume used in a task definition. -type Volume struct { - _ struct{} `type:"structure"` - - // The contents of the host parameter determine whether your data volume persists - // on the host container instance and where it is stored. If the host parameter - // is empty, then the Docker daemon assigns a host path for your data volume, - // but the data is not guaranteed to persist after the containers associated - // with it stop running. - // - // Windows containers can mount whole directories on the same drive as $env:ProgramData. - // Windows containers cannot mount directories on a different drive, and mount - // point cannot be across drives. For example, you can mount C:\my\path:C:\my\path - // and D:\:D:\, but not D:\my\path:C:\my\path or D:\:C:\my\path. - Host *HostVolumeProperties `locationName:"host" type:"structure"` - - // The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, - // hyphens, and underscores are allowed. This name is referenced in the sourceVolume - // parameter of container definition mountPoints. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s Volume) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Volume) GoString() string { - return s.String() -} - -// SetHost sets the Host field's value. -func (s *Volume) SetHost(v *HostVolumeProperties) *Volume { - s.Host = v - return s -} - -// SetName sets the Name field's value. -func (s *Volume) SetName(v string) *Volume { - s.Name = &v - return s -} - -// Details on a data volume from another container in the same task definition. -type VolumeFrom struct { - _ struct{} `type:"structure"` - - // If this value is true, the container has read-only access to the volume. - // If this value is false, then the container can write to the volume. The default - // value is false. - ReadOnly *bool `locationName:"readOnly" type:"boolean"` - - // The name of another container within the same task definition to mount volumes - // from. - SourceContainer *string `locationName:"sourceContainer" type:"string"` -} - -// String returns the string representation -func (s VolumeFrom) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeFrom) GoString() string { - return s.String() -} - -// SetReadOnly sets the ReadOnly field's value. -func (s *VolumeFrom) SetReadOnly(v bool) *VolumeFrom { - s.ReadOnly = &v - return s -} - -// SetSourceContainer sets the SourceContainer field's value. -func (s *VolumeFrom) SetSourceContainer(v string) *VolumeFrom { - s.SourceContainer = &v - return s -} - -const ( - // AgentUpdateStatusPending is a AgentUpdateStatus enum value - AgentUpdateStatusPending = "PENDING" - - // AgentUpdateStatusStaging is a AgentUpdateStatus enum value - AgentUpdateStatusStaging = "STAGING" - - // AgentUpdateStatusStaged is a AgentUpdateStatus enum value - AgentUpdateStatusStaged = "STAGED" - - // AgentUpdateStatusUpdating is a AgentUpdateStatus enum value - AgentUpdateStatusUpdating = "UPDATING" - - // AgentUpdateStatusUpdated is a AgentUpdateStatus enum value - AgentUpdateStatusUpdated = "UPDATED" - - // AgentUpdateStatusFailed is a AgentUpdateStatus enum value - AgentUpdateStatusFailed = "FAILED" -) - -const ( - // AssignPublicIpEnabled is a AssignPublicIp enum value - AssignPublicIpEnabled = "ENABLED" - - // AssignPublicIpDisabled is a AssignPublicIp enum value - AssignPublicIpDisabled = "DISABLED" -) - -const ( - // ClusterFieldStatistics is a ClusterField enum value - ClusterFieldStatistics = "STATISTICS" -) - -const ( - // CompatibilityEc2 is a Compatibility enum value - CompatibilityEc2 = "EC2" - - // CompatibilityFargate is a Compatibility enum value - CompatibilityFargate = "FARGATE" -) - -const ( - // ConnectivityConnected is a Connectivity enum value - ConnectivityConnected = "CONNECTED" - - // ConnectivityDisconnected is a Connectivity enum value - ConnectivityDisconnected = "DISCONNECTED" -) - -const ( - // ContainerInstanceStatusActive is a ContainerInstanceStatus enum value - ContainerInstanceStatusActive = "ACTIVE" - - // ContainerInstanceStatusDraining is a ContainerInstanceStatus enum value - ContainerInstanceStatusDraining = "DRAINING" -) - -const ( - // DesiredStatusRunning is a DesiredStatus enum value - DesiredStatusRunning = "RUNNING" - - // DesiredStatusPending is a DesiredStatus enum value - DesiredStatusPending = "PENDING" - - // DesiredStatusStopped is a DesiredStatus enum value - DesiredStatusStopped = "STOPPED" -) - -const ( - // DeviceCgroupPermissionRead is a DeviceCgroupPermission enum value - DeviceCgroupPermissionRead = "read" - - // DeviceCgroupPermissionWrite is a DeviceCgroupPermission enum value - DeviceCgroupPermissionWrite = "write" - - // DeviceCgroupPermissionMknod is a DeviceCgroupPermission enum value - DeviceCgroupPermissionMknod = "mknod" -) - -const ( - // HealthStatusHealthy is a HealthStatus enum value - HealthStatusHealthy = "HEALTHY" - - // HealthStatusUnhealthy is a HealthStatus enum value - HealthStatusUnhealthy = "UNHEALTHY" - - // HealthStatusUnknown is a HealthStatus enum value - HealthStatusUnknown = "UNKNOWN" -) - -const ( - // LaunchTypeEc2 is a LaunchType enum value - LaunchTypeEc2 = "EC2" - - // LaunchTypeFargate is a LaunchType enum value - LaunchTypeFargate = "FARGATE" -) - -const ( - // LogDriverJsonFile is a LogDriver enum value - LogDriverJsonFile = "json-file" - - // LogDriverSyslog is a LogDriver enum value - LogDriverSyslog = "syslog" - - // LogDriverJournald is a LogDriver enum value - LogDriverJournald = "journald" - - // LogDriverGelf is a LogDriver enum value - LogDriverGelf = "gelf" - - // LogDriverFluentd is a LogDriver enum value - LogDriverFluentd = "fluentd" - - // LogDriverAwslogs is a LogDriver enum value - LogDriverAwslogs = "awslogs" - - // LogDriverSplunk is a LogDriver enum value - LogDriverSplunk = "splunk" -) - -const ( - // NetworkModeBridge is a NetworkMode enum value - NetworkModeBridge = "bridge" - - // NetworkModeHost is a NetworkMode enum value - NetworkModeHost = "host" - - // NetworkModeAwsvpc is a NetworkMode enum value - NetworkModeAwsvpc = "awsvpc" - - // NetworkModeNone is a NetworkMode enum value - NetworkModeNone = "none" -) - -const ( - // PlacementConstraintTypeDistinctInstance is a PlacementConstraintType enum value - PlacementConstraintTypeDistinctInstance = "distinctInstance" - - // PlacementConstraintTypeMemberOf is a PlacementConstraintType enum value - PlacementConstraintTypeMemberOf = "memberOf" -) - -const ( - // PlacementStrategyTypeRandom is a PlacementStrategyType enum value - PlacementStrategyTypeRandom = "random" - - // PlacementStrategyTypeSpread is a PlacementStrategyType enum value - PlacementStrategyTypeSpread = "spread" - - // PlacementStrategyTypeBinpack is a PlacementStrategyType enum value - PlacementStrategyTypeBinpack = "binpack" -) - -const ( - // SortOrderAsc is a SortOrder enum value - SortOrderAsc = "ASC" - - // SortOrderDesc is a SortOrder enum value - SortOrderDesc = "DESC" -) - -const ( - // TargetTypeContainerInstance is a TargetType enum value - TargetTypeContainerInstance = "container-instance" -) - -const ( - // TaskDefinitionFamilyStatusActive is a TaskDefinitionFamilyStatus enum value - TaskDefinitionFamilyStatusActive = "ACTIVE" - - // TaskDefinitionFamilyStatusInactive is a TaskDefinitionFamilyStatus enum value - TaskDefinitionFamilyStatusInactive = "INACTIVE" - - // TaskDefinitionFamilyStatusAll is a TaskDefinitionFamilyStatus enum value - TaskDefinitionFamilyStatusAll = "ALL" -) - -const ( - // TaskDefinitionPlacementConstraintTypeMemberOf is a TaskDefinitionPlacementConstraintType enum value - TaskDefinitionPlacementConstraintTypeMemberOf = "memberOf" -) - -const ( - // TaskDefinitionStatusActive is a TaskDefinitionStatus enum value - TaskDefinitionStatusActive = "ACTIVE" - - // TaskDefinitionStatusInactive is a TaskDefinitionStatus enum value - TaskDefinitionStatusInactive = "INACTIVE" -) - -const ( - // TransportProtocolTcp is a TransportProtocol enum value - TransportProtocolTcp = "tcp" - - // TransportProtocolUdp is a TransportProtocol enum value - TransportProtocolUdp = "udp" -) - -const ( - // UlimitNameCore is a UlimitName enum value - UlimitNameCore = "core" - - // UlimitNameCpu is a UlimitName enum value - UlimitNameCpu = "cpu" - - // UlimitNameData is a UlimitName enum value - UlimitNameData = "data" - - // UlimitNameFsize is a UlimitName enum value - UlimitNameFsize = "fsize" - - // UlimitNameLocks is a UlimitName enum value - UlimitNameLocks = "locks" - - // UlimitNameMemlock is a UlimitName enum value - UlimitNameMemlock = "memlock" - - // UlimitNameMsgqueue is a UlimitName enum value - UlimitNameMsgqueue = "msgqueue" - - // UlimitNameNice is a UlimitName enum value - UlimitNameNice = "nice" - - // UlimitNameNofile is a UlimitName enum value - UlimitNameNofile = "nofile" - - // UlimitNameNproc is a UlimitName enum value - UlimitNameNproc = "nproc" - - // UlimitNameRss is a UlimitName enum value - UlimitNameRss = "rss" - - // UlimitNameRtprio is a UlimitName enum value - UlimitNameRtprio = "rtprio" - - // UlimitNameRttime is a UlimitName enum value - UlimitNameRttime = "rttime" - - // UlimitNameSigpending is a UlimitName enum value - UlimitNameSigpending = "sigpending" - - // UlimitNameStack is a UlimitName enum value - UlimitNameStack = "stack" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/doc.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/doc.go deleted file mode 100644 index 1d59f5b64..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/doc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ecs provides the client and types for making API -// requests to Amazon EC2 Container Service. -// -// Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, -// container management service that makes it easy to run, stop, and manage -// Docker containers on a cluster. You can host your cluster on a serverless -// infrastructure that is managed by Amazon ECS by launching your services or -// tasks using the Fargate launch type. For more control, you can host your -// tasks on a cluster of Amazon Elastic Compute Cloud (Amazon EC2) instances -// that you manage by using the EC2 launch type. For more information about -// launch types, see Amazon ECS Launch Types (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html). -// -// Amazon ECS lets you launch and stop container-based applications with simple -// API calls, allows you to get the state of your cluster from a centralized -// service, and gives you access to many familiar Amazon EC2 features. -// -// You can use Amazon ECS to schedule the placement of containers across your -// cluster based on your resource needs, isolation policies, and availability -// requirements. Amazon ECS eliminates the need for you to operate your own -// cluster management and configuration management systems or worry about scaling -// your management infrastructure. -// -// See https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13 for more information on this service. -// -// See ecs package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/ -// -// Using the Client -// -// To contact Amazon EC2 Container Service with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon EC2 Container Service client ECS for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#New -package ecs diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go deleted file mode 100644 index 619efc778..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have authorization to perform the requested action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeAttributeLimitExceededException for service response error code - // "AttributeLimitExceededException". - // - // You can apply up to 10 custom attributes per resource. You can view the attributes - // of a resource with ListAttributes. You can remove existing attributes on - // a resource with DeleteAttributes. - ErrCodeAttributeLimitExceededException = "AttributeLimitExceededException" - - // ErrCodeBlockedException for service response error code - // "BlockedException". - // - // Your AWS account has been blocked. Contact AWS Support (http://aws.amazon.com/contact-us/) - // for more information. - ErrCodeBlockedException = "BlockedException" - - // ErrCodeClientException for service response error code - // "ClientException". - // - // These errors are usually caused by a client action, such as using an action - // or resource on behalf of a user that doesn't have permissions to use the - // action or resource, or specifying an identifier that is not valid. - ErrCodeClientException = "ClientException" - - // ErrCodeClusterContainsContainerInstancesException for service response error code - // "ClusterContainsContainerInstancesException". - // - // You cannot delete a cluster that has registered container instances. You - // must first deregister the container instances before you can delete the cluster. - // For more information, see DeregisterContainerInstance. - ErrCodeClusterContainsContainerInstancesException = "ClusterContainsContainerInstancesException" - - // ErrCodeClusterContainsServicesException for service response error code - // "ClusterContainsServicesException". - // - // You cannot delete a cluster that contains services. You must first update - // the service to reduce its desired task count to 0 and then delete the service. - // For more information, see UpdateService and DeleteService. - ErrCodeClusterContainsServicesException = "ClusterContainsServicesException" - - // ErrCodeClusterContainsTasksException for service response error code - // "ClusterContainsTasksException". - // - // You cannot delete a cluster that has active tasks. - ErrCodeClusterContainsTasksException = "ClusterContainsTasksException" - - // ErrCodeClusterNotFoundException for service response error code - // "ClusterNotFoundException". - // - // The specified cluster could not be found. You can view your available clusters - // with ListClusters. Amazon ECS clusters are region-specific. - ErrCodeClusterNotFoundException = "ClusterNotFoundException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // The specified parameter is invalid. Review the available parameters for the - // API request. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeMissingVersionException for service response error code - // "MissingVersionException". - // - // Amazon ECS is unable to determine the current version of the Amazon ECS container - // agent on the container instance and does not have enough information to proceed - // with an update. This could be because the agent running on the container - // instance is an older or custom version that does not use our version information. - ErrCodeMissingVersionException = "MissingVersionException" - - // ErrCodeNoUpdateAvailableException for service response error code - // "NoUpdateAvailableException". - // - // There is no update available for this Amazon ECS container agent. This could - // be because the agent is already running the latest version, or it is so old - // that there is no update path to the current version. - ErrCodeNoUpdateAvailableException = "NoUpdateAvailableException" - - // ErrCodePlatformTaskDefinitionIncompatibilityException for service response error code - // "PlatformTaskDefinitionIncompatibilityException". - // - // The specified platform version does not satisfy the task definition’s required - // capabilities. - ErrCodePlatformTaskDefinitionIncompatibilityException = "PlatformTaskDefinitionIncompatibilityException" - - // ErrCodePlatformUnknownException for service response error code - // "PlatformUnknownException". - // - // The specified platform version does not exist. - ErrCodePlatformUnknownException = "PlatformUnknownException" - - // ErrCodeServerException for service response error code - // "ServerException". - // - // These errors are usually caused by a server issue. - ErrCodeServerException = "ServerException" - - // ErrCodeServiceNotActiveException for service response error code - // "ServiceNotActiveException". - // - // The specified service is not active. You can't update a service that is inactive. - // If you have previously deleted a service, you can re-create it with CreateService. - ErrCodeServiceNotActiveException = "ServiceNotActiveException" - - // ErrCodeServiceNotFoundException for service response error code - // "ServiceNotFoundException". - // - // The specified service could not be found. You can view your available services - // with ListServices. Amazon ECS services are cluster-specific and region-specific. - ErrCodeServiceNotFoundException = "ServiceNotFoundException" - - // ErrCodeTargetNotFoundException for service response error code - // "TargetNotFoundException". - // - // The specified target could not be found. You can view your available container - // instances with ListContainerInstances. Amazon ECS container instances are - // cluster-specific and region-specific. - ErrCodeTargetNotFoundException = "TargetNotFoundException" - - // ErrCodeUnsupportedFeatureException for service response error code - // "UnsupportedFeatureException". - // - // The specified task is not supported in this region. - ErrCodeUnsupportedFeatureException = "UnsupportedFeatureException" - - // ErrCodeUpdateInProgressException for service response error code - // "UpdateInProgressException". - // - // There is already a current Amazon ECS container agent update in progress - // on the specified container instance. If the container agent becomes disconnected - // while it is in a transitional stage, such as PENDING or STAGING, the update - // process can get stuck in that state. However, when the agent reconnects, - // it resumes where it stopped previously. - ErrCodeUpdateInProgressException = "UpdateInProgressException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go deleted file mode 100644 index 6082b9282..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// ECS provides the API operation methods for making requests to -// Amazon EC2 Container Service. See this package's package overview docs -// for details on the service. -// -// ECS methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ECS struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ecs" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ECS client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// // Create a ECS client from just a session. -// svc := ecs.New(mySession) -// -// // Create a ECS client with additional configuration -// svc := ecs.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ECS { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ECS { - svc := &ECS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-11-13", - JSONVersion: "1.1", - TargetPrefix: "AmazonEC2ContainerServiceV20141113", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ECS operation and runs any -// custom request initialization. -func (c *ECS) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go deleted file mode 100644 index 542fe7f0f..000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/waiters.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilServicesInactive uses the Amazon ECS API operation -// DescribeServices to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *ECS) WaitUntilServicesInactive(input *DescribeServicesInput) error { - return c.WaitUntilServicesInactiveWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilServicesInactiveWithContext is an extended version of WaitUntilServicesInactive. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) WaitUntilServicesInactiveWithContext(ctx aws.Context, input *DescribeServicesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilServicesInactive", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "failures[].reason", - Expected: "MISSING", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "services[].status", - Expected: "INACTIVE", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeServicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeServicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilServicesStable uses the Amazon ECS API operation -// DescribeServices to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *ECS) WaitUntilServicesStable(input *DescribeServicesInput) error { - return c.WaitUntilServicesStableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilServicesStableWithContext is an extended version of WaitUntilServicesStable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) WaitUntilServicesStableWithContext(ctx aws.Context, input *DescribeServicesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilServicesStable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "failures[].reason", - Expected: "MISSING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "services[].status", - Expected: "DRAINING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "services[].status", - Expected: "INACTIVE", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(services[?!(length(deployments) == `1` && runningCount == desiredCount)]) == `0`", - Expected: true, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeServicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeServicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilTasksRunning uses the Amazon ECS API operation -// DescribeTasks to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *ECS) WaitUntilTasksRunning(input *DescribeTasksInput) error { - return c.WaitUntilTasksRunningWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilTasksRunningWithContext is an extended version of WaitUntilTasksRunning. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) WaitUntilTasksRunningWithContext(ctx aws.Context, input *DescribeTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilTasksRunning", - MaxAttempts: 100, - Delay: request.ConstantWaiterDelay(6 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "tasks[].lastStatus", - Expected: "STOPPED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "failures[].reason", - Expected: "MISSING", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "tasks[].lastStatus", - Expected: "RUNNING", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilTasksStopped uses the Amazon ECS API operation -// DescribeTasks to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *ECS) WaitUntilTasksStopped(input *DescribeTasksInput) error { - return c.WaitUntilTasksStoppedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilTasksStoppedWithContext is an extended version of WaitUntilTasksStopped. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ECS) WaitUntilTasksStoppedWithContext(ctx aws.Context, input *DescribeTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilTasksStopped", - MaxAttempts: 100, - Delay: request.ConstantWaiterDelay(6 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "tasks[].lastStatus", - Expected: "STOPPED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/coreos/bbolt/LICENSE b/vendor/github.com/coreos/bbolt/LICENSE deleted file mode 100644 index 004e77fe5..000000000 --- a/vendor/github.com/coreos/bbolt/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Ben Johnson - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/coreos/bbolt/bolt_386.go b/vendor/github.com/coreos/bbolt/bolt_386.go deleted file mode 100644 index 820d533c1..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_386.go +++ /dev/null @@ -1,10 +0,0 @@ -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x7FFFFFFF // 2GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0xFFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned = false diff --git a/vendor/github.com/coreos/bbolt/bolt_amd64.go b/vendor/github.com/coreos/bbolt/bolt_amd64.go deleted file mode 100644 index 98fafdb47..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_amd64.go +++ /dev/null @@ -1,10 +0,0 @@ -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned = false diff --git a/vendor/github.com/coreos/bbolt/bolt_arm.go b/vendor/github.com/coreos/bbolt/bolt_arm.go deleted file mode 100644 index 7e5cb4b94..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_arm.go +++ /dev/null @@ -1,28 +0,0 @@ -package bolt - -import "unsafe" - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x7FFFFFFF // 2GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0xFFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned bool - -func init() { - // Simple check to see whether this arch handles unaligned load/stores - // correctly. - - // ARM9 and older devices require load/stores to be from/to aligned - // addresses. If not, the lower 2 bits are cleared and that address is - // read in a jumbled up order. - - // See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15414.html - - raw := [6]byte{0xfe, 0xef, 0x11, 0x22, 0x22, 0x11} - val := *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&raw)) + 2)) - - brokenUnaligned = val != 0x11222211 -} diff --git a/vendor/github.com/coreos/bbolt/bolt_arm64.go b/vendor/github.com/coreos/bbolt/bolt_arm64.go deleted file mode 100644 index b26d84f91..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_arm64.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build arm64 - -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned = false diff --git a/vendor/github.com/coreos/bbolt/bolt_linux.go b/vendor/github.com/coreos/bbolt/bolt_linux.go deleted file mode 100644 index 2b6766614..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_linux.go +++ /dev/null @@ -1,10 +0,0 @@ -package bolt - -import ( - "syscall" -) - -// fdatasync flushes written data to a file descriptor. -func fdatasync(db *DB) error { - return syscall.Fdatasync(int(db.file.Fd())) -} diff --git a/vendor/github.com/coreos/bbolt/bolt_mips64x.go b/vendor/github.com/coreos/bbolt/bolt_mips64x.go deleted file mode 100644 index 134b578bd..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_mips64x.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build mips64 mips64le - -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x8000000000 // 512GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned = false diff --git a/vendor/github.com/coreos/bbolt/bolt_mipsx.go b/vendor/github.com/coreos/bbolt/bolt_mipsx.go deleted file mode 100644 index d5ecb0597..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_mipsx.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build mips mipsle - -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x40000000 // 1GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0xFFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned = false diff --git a/vendor/github.com/coreos/bbolt/bolt_openbsd.go b/vendor/github.com/coreos/bbolt/bolt_openbsd.go deleted file mode 100644 index 7058c3d73..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_openbsd.go +++ /dev/null @@ -1,27 +0,0 @@ -package bolt - -import ( - "syscall" - "unsafe" -) - -const ( - msAsync = 1 << iota // perform asynchronous writes - msSync // perform synchronous writes - msInvalidate // invalidate cached data -) - -func msync(db *DB) error { - _, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate) - if errno != 0 { - return errno - } - return nil -} - -func fdatasync(db *DB) error { - if db.data != nil { - return msync(db) - } - return db.file.Sync() -} diff --git a/vendor/github.com/coreos/bbolt/bolt_ppc.go b/vendor/github.com/coreos/bbolt/bolt_ppc.go deleted file mode 100644 index 645ddc3ed..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_ppc.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build ppc - -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x7FFFFFFF // 2GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0xFFFFFFF diff --git a/vendor/github.com/coreos/bbolt/bolt_ppc64.go b/vendor/github.com/coreos/bbolt/bolt_ppc64.go deleted file mode 100644 index 9331d9771..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_ppc64.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build ppc64 - -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned = false diff --git a/vendor/github.com/coreos/bbolt/bolt_ppc64le.go b/vendor/github.com/coreos/bbolt/bolt_ppc64le.go deleted file mode 100644 index 8c143bc5d..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_ppc64le.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build ppc64le - -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned = false diff --git a/vendor/github.com/coreos/bbolt/bolt_s390x.go b/vendor/github.com/coreos/bbolt/bolt_s390x.go deleted file mode 100644 index d7c39af92..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_s390x.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build s390x - -package bolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF - -// Are unaligned load/stores broken on this arch? -var brokenUnaligned = false diff --git a/vendor/github.com/coreos/bbolt/bolt_unix.go b/vendor/github.com/coreos/bbolt/bolt_unix.go deleted file mode 100644 index 06592a080..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_unix.go +++ /dev/null @@ -1,92 +0,0 @@ -// +build !windows,!plan9,!solaris - -package bolt - -import ( - "fmt" - "os" - "syscall" - "time" - "unsafe" -) - -// flock acquires an advisory lock on a file descriptor. -func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error { - var t time.Time - if timeout != 0 { - t = time.Now() - } - fd := db.file.Fd() - flag := syscall.LOCK_NB - if exclusive { - flag |= syscall.LOCK_EX - } else { - flag |= syscall.LOCK_SH - } - for { - // Attempt to obtain an exclusive lock. - err := syscall.Flock(int(fd), flag) - if err == nil { - return nil - } else if err != syscall.EWOULDBLOCK { - return err - } - - // If we timed out then return an error. - if timeout != 0 && time.Since(t) > timeout-flockRetryTimeout { - return ErrTimeout - } - - // Wait for a bit and try again. - time.Sleep(flockRetryTimeout) - } -} - -// funlock releases an advisory lock on a file descriptor. -func funlock(db *DB) error { - return syscall.Flock(int(db.file.Fd()), syscall.LOCK_UN) -} - -// mmap memory maps a DB's data file. -func mmap(db *DB, sz int) error { - // Map the data file to memory. - b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) - if err != nil { - return err - } - - // Advise the kernel that the mmap is accessed randomly. - if err := madvise(b, syscall.MADV_RANDOM); err != nil { - return fmt.Errorf("madvise: %s", err) - } - - // Save the original byte slice and convert to a byte array pointer. - db.dataref = b - db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) - db.datasz = sz - return nil -} - -// munmap unmaps a DB's data file from memory. -func munmap(db *DB) error { - // Ignore the unmap if we have no mapped data. - if db.dataref == nil { - return nil - } - - // Unmap using the original byte slice. - err := syscall.Munmap(db.dataref) - db.dataref = nil - db.data = nil - db.datasz = 0 - return err -} - -// NOTE: This function is copied from stdlib because it is not available on darwin. -func madvise(b []byte, advice int) (err error) { - _, _, e1 := syscall.Syscall(syscall.SYS_MADVISE, uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), uintptr(advice)) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/github.com/coreos/bbolt/bolt_unix_solaris.go b/vendor/github.com/coreos/bbolt/bolt_unix_solaris.go deleted file mode 100644 index fd8335ecc..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_unix_solaris.go +++ /dev/null @@ -1,89 +0,0 @@ -package bolt - -import ( - "fmt" - "os" - "syscall" - "time" - "unsafe" - - "golang.org/x/sys/unix" -) - -// flock acquires an advisory lock on a file descriptor. -func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error { - var t time.Time - if timeout != 0 { - t = time.Now() - } - fd := db.file.Fd() - var lockType int16 - if exclusive { - lockType = syscall.F_WRLCK - } else { - lockType = syscall.F_RDLCK - } - for { - // Attempt to obtain an exclusive lock. - lock := syscall.Flock_t{Type: lockType} - err := syscall.FcntlFlock(fd, syscall.F_SETLK, &lock) - if err == nil { - return nil - } else if err != syscall.EAGAIN { - return err - } - - // If we timed out then return an error. - if timeout != 0 && time.Since(t) > timeout-flockRetryTimeout { - return ErrTimeout - } - - // Wait for a bit and try again. - time.Sleep(flockRetryTimeout) - } -} - -// funlock releases an advisory lock on a file descriptor. -func funlock(db *DB) error { - var lock syscall.Flock_t - lock.Start = 0 - lock.Len = 0 - lock.Type = syscall.F_UNLCK - lock.Whence = 0 - return syscall.FcntlFlock(uintptr(db.file.Fd()), syscall.F_SETLK, &lock) -} - -// mmap memory maps a DB's data file. -func mmap(db *DB, sz int) error { - // Map the data file to memory. - b, err := unix.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) - if err != nil { - return err - } - - // Advise the kernel that the mmap is accessed randomly. - if err := unix.Madvise(b, syscall.MADV_RANDOM); err != nil { - return fmt.Errorf("madvise: %s", err) - } - - // Save the original byte slice and convert to a byte array pointer. - db.dataref = b - db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) - db.datasz = sz - return nil -} - -// munmap unmaps a DB's data file from memory. -func munmap(db *DB) error { - // Ignore the unmap if we have no mapped data. - if db.dataref == nil { - return nil - } - - // Unmap using the original byte slice. - err := unix.Munmap(db.dataref) - db.dataref = nil - db.data = nil - db.datasz = 0 - return err -} diff --git a/vendor/github.com/coreos/bbolt/bolt_windows.go b/vendor/github.com/coreos/bbolt/bolt_windows.go deleted file mode 100644 index ca6f9a11c..000000000 --- a/vendor/github.com/coreos/bbolt/bolt_windows.go +++ /dev/null @@ -1,145 +0,0 @@ -package bolt - -import ( - "fmt" - "os" - "syscall" - "time" - "unsafe" -) - -// LockFileEx code derived from golang build filemutex_windows.go @ v1.5.1 -var ( - modkernel32 = syscall.NewLazyDLL("kernel32.dll") - procLockFileEx = modkernel32.NewProc("LockFileEx") - procUnlockFileEx = modkernel32.NewProc("UnlockFileEx") -) - -const ( - lockExt = ".lock" - - // see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx - flagLockExclusive = 2 - flagLockFailImmediately = 1 - - // see https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx - errLockViolation syscall.Errno = 0x21 -) - -func lockFileEx(h syscall.Handle, flags, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { - r, _, err := procLockFileEx.Call(uintptr(h), uintptr(flags), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol))) - if r == 0 { - return err - } - return nil -} - -func unlockFileEx(h syscall.Handle, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { - r, _, err := procUnlockFileEx.Call(uintptr(h), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol)), 0) - if r == 0 { - return err - } - return nil -} - -// fdatasync flushes written data to a file descriptor. -func fdatasync(db *DB) error { - return db.file.Sync() -} - -// flock acquires an advisory lock on a file descriptor. -func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error { - // Create a separate lock file on windows because a process - // cannot share an exclusive lock on the same file. This is - // needed during Tx.WriteTo(). - f, err := os.OpenFile(db.path+lockExt, os.O_CREATE, mode) - if err != nil { - return err - } - db.lockfile = f - - var t time.Time - if timeout != 0 { - t = time.Now() - } - fd := f.Fd() - var flag uint32 = flagLockFailImmediately - if exclusive { - flag |= flagLockExclusive - } - for { - // Attempt to obtain an exclusive lock. - err := lockFileEx(syscall.Handle(fd), flag, 0, 1, 0, &syscall.Overlapped{}) - if err == nil { - return nil - } else if err != errLockViolation { - return err - } - - // If we timed oumercit then return an error. - if timeout != 0 && time.Since(t) > timeout-flockRetryTimeout { - return ErrTimeout - } - - // Wait for a bit and try again. - time.Sleep(flockRetryTimeout) - } -} - -// funlock releases an advisory lock on a file descriptor. -func funlock(db *DB) error { - err := unlockFileEx(syscall.Handle(db.lockfile.Fd()), 0, 1, 0, &syscall.Overlapped{}) - db.lockfile.Close() - os.Remove(db.path + lockExt) - return err -} - -// mmap memory maps a DB's data file. -// Based on: https://github.com/edsrzf/mmap-go -func mmap(db *DB, sz int) error { - if !db.readOnly { - // Truncate the database to the size of the mmap. - if err := db.file.Truncate(int64(sz)); err != nil { - return fmt.Errorf("truncate: %s", err) - } - } - - // Open a file mapping handle. - sizelo := uint32(sz >> 32) - sizehi := uint32(sz) & 0xffffffff - h, errno := syscall.CreateFileMapping(syscall.Handle(db.file.Fd()), nil, syscall.PAGE_READONLY, sizelo, sizehi, nil) - if h == 0 { - return os.NewSyscallError("CreateFileMapping", errno) - } - - // Create the memory map. - addr, errno := syscall.MapViewOfFile(h, syscall.FILE_MAP_READ, 0, 0, uintptr(sz)) - if addr == 0 { - return os.NewSyscallError("MapViewOfFile", errno) - } - - // Close mapping handle. - if err := syscall.CloseHandle(syscall.Handle(h)); err != nil { - return os.NewSyscallError("CloseHandle", err) - } - - // Convert to a byte array. - db.data = ((*[maxMapSize]byte)(unsafe.Pointer(addr))) - db.datasz = sz - - return nil -} - -// munmap unmaps a pointer from a file. -// Based on: https://github.com/edsrzf/mmap-go -func munmap(db *DB) error { - if db.data == nil { - return nil - } - - addr := (uintptr)(unsafe.Pointer(&db.data[0])) - if err := syscall.UnmapViewOfFile(addr); err != nil { - return os.NewSyscallError("UnmapViewOfFile", err) - } - return nil -} diff --git a/vendor/github.com/coreos/bbolt/boltsync_unix.go b/vendor/github.com/coreos/bbolt/boltsync_unix.go deleted file mode 100644 index f50442523..000000000 --- a/vendor/github.com/coreos/bbolt/boltsync_unix.go +++ /dev/null @@ -1,8 +0,0 @@ -// +build !windows,!plan9,!linux,!openbsd - -package bolt - -// fdatasync flushes written data to a file descriptor. -func fdatasync(db *DB) error { - return db.file.Sync() -} diff --git a/vendor/github.com/coreos/bbolt/bucket.go b/vendor/github.com/coreos/bbolt/bucket.go deleted file mode 100644 index 44db88b8a..000000000 --- a/vendor/github.com/coreos/bbolt/bucket.go +++ /dev/null @@ -1,775 +0,0 @@ -package bolt - -import ( - "bytes" - "fmt" - "unsafe" -) - -const ( - // MaxKeySize is the maximum length of a key, in bytes. - MaxKeySize = 32768 - - // MaxValueSize is the maximum length of a value, in bytes. - MaxValueSize = (1 << 31) - 2 -) - -const bucketHeaderSize = int(unsafe.Sizeof(bucket{})) - -const ( - minFillPercent = 0.1 - maxFillPercent = 1.0 -) - -// DefaultFillPercent is the percentage that split pages are filled. -// This value can be changed by setting Bucket.FillPercent. -const DefaultFillPercent = 0.5 - -// Bucket represents a collection of key/value pairs inside the database. -type Bucket struct { - *bucket - tx *Tx // the associated transaction - buckets map[string]*Bucket // subbucket cache - page *page // inline page reference - rootNode *node // materialized node for the root page. - nodes map[pgid]*node // node cache - - // Sets the threshold for filling nodes when they split. By default, - // the bucket will fill to 50% but it can be useful to increase this - // amount if you know that your write workloads are mostly append-only. - // - // This is non-persisted across transactions so it must be set in every Tx. - FillPercent float64 -} - -// bucket represents the on-file representation of a bucket. -// This is stored as the "value" of a bucket key. If the bucket is small enough, -// then its root page can be stored inline in the "value", after the bucket -// header. In the case of inline buckets, the "root" will be 0. -type bucket struct { - root pgid // page id of the bucket's root-level page - sequence uint64 // monotonically incrementing, used by NextSequence() -} - -// newBucket returns a new bucket associated with a transaction. -func newBucket(tx *Tx) Bucket { - var b = Bucket{tx: tx, FillPercent: DefaultFillPercent} - if tx.writable { - b.buckets = make(map[string]*Bucket) - b.nodes = make(map[pgid]*node) - } - return b -} - -// Tx returns the tx of the bucket. -func (b *Bucket) Tx() *Tx { - return b.tx -} - -// Root returns the root of the bucket. -func (b *Bucket) Root() pgid { - return b.root -} - -// Writable returns whether the bucket is writable. -func (b *Bucket) Writable() bool { - return b.tx.writable -} - -// Cursor creates a cursor associated with the bucket. -// The cursor is only valid as long as the transaction is open. -// Do not use a cursor after the transaction is closed. -func (b *Bucket) Cursor() *Cursor { - // Update transaction statistics. - b.tx.stats.CursorCount++ - - // Allocate and return a cursor. - return &Cursor{ - bucket: b, - stack: make([]elemRef, 0), - } -} - -// Bucket retrieves a nested bucket by name. -// Returns nil if the bucket does not exist. -// The bucket instance is only valid for the lifetime of the transaction. -func (b *Bucket) Bucket(name []byte) *Bucket { - if b.buckets != nil { - if child := b.buckets[string(name)]; child != nil { - return child - } - } - - // Move cursor to key. - c := b.Cursor() - k, v, flags := c.seek(name) - - // Return nil if the key doesn't exist or it is not a bucket. - if !bytes.Equal(name, k) || (flags&bucketLeafFlag) == 0 { - return nil - } - - // Otherwise create a bucket and cache it. - var child = b.openBucket(v) - if b.buckets != nil { - b.buckets[string(name)] = child - } - - return child -} - -// Helper method that re-interprets a sub-bucket value -// from a parent into a Bucket -func (b *Bucket) openBucket(value []byte) *Bucket { - var child = newBucket(b.tx) - - // If unaligned load/stores are broken on this arch and value is - // unaligned simply clone to an aligned byte array. - unaligned := brokenUnaligned && uintptr(unsafe.Pointer(&value[0]))&3 != 0 - - if unaligned { - value = cloneBytes(value) - } - - // If this is a writable transaction then we need to copy the bucket entry. - // Read-only transactions can point directly at the mmap entry. - if b.tx.writable && !unaligned { - child.bucket = &bucket{} - *child.bucket = *(*bucket)(unsafe.Pointer(&value[0])) - } else { - child.bucket = (*bucket)(unsafe.Pointer(&value[0])) - } - - // Save a reference to the inline page if the bucket is inline. - if child.root == 0 { - child.page = (*page)(unsafe.Pointer(&value[bucketHeaderSize])) - } - - return &child -} - -// CreateBucket creates a new bucket at the given key and returns the new bucket. -// Returns an error if the key already exists, if the bucket name is blank, or if the bucket name is too long. -// The bucket instance is only valid for the lifetime of the transaction. -func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) { - if b.tx.db == nil { - return nil, ErrTxClosed - } else if !b.tx.writable { - return nil, ErrTxNotWritable - } else if len(key) == 0 { - return nil, ErrBucketNameRequired - } - - // Move cursor to correct position. - c := b.Cursor() - k, _, flags := c.seek(key) - - // Return an error if there is an existing key. - if bytes.Equal(key, k) { - if (flags & bucketLeafFlag) != 0 { - return nil, ErrBucketExists - } - return nil, ErrIncompatibleValue - } - - // Create empty, inline bucket. - var bucket = Bucket{ - bucket: &bucket{}, - rootNode: &node{isLeaf: true}, - FillPercent: DefaultFillPercent, - } - var value = bucket.write() - - // Insert into node. - key = cloneBytes(key) - c.node().put(key, key, value, 0, bucketLeafFlag) - - // Since subbuckets are not allowed on inline buckets, we need to - // dereference the inline page, if it exists. This will cause the bucket - // to be treated as a regular, non-inline bucket for the rest of the tx. - b.page = nil - - return b.Bucket(key), nil -} - -// CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it. -// Returns an error if the bucket name is blank, or if the bucket name is too long. -// The bucket instance is only valid for the lifetime of the transaction. -func (b *Bucket) CreateBucketIfNotExists(key []byte) (*Bucket, error) { - child, err := b.CreateBucket(key) - if err == ErrBucketExists { - return b.Bucket(key), nil - } else if err != nil { - return nil, err - } - return child, nil -} - -// DeleteBucket deletes a bucket at the given key. -// Returns an error if the bucket does not exists, or if the key represents a non-bucket value. -func (b *Bucket) DeleteBucket(key []byte) error { - if b.tx.db == nil { - return ErrTxClosed - } else if !b.Writable() { - return ErrTxNotWritable - } - - // Move cursor to correct position. - c := b.Cursor() - k, _, flags := c.seek(key) - - // Return an error if bucket doesn't exist or is not a bucket. - if !bytes.Equal(key, k) { - return ErrBucketNotFound - } else if (flags & bucketLeafFlag) == 0 { - return ErrIncompatibleValue - } - - // Recursively delete all child buckets. - child := b.Bucket(key) - err := child.ForEach(func(k, v []byte) error { - if v == nil { - if err := child.DeleteBucket(k); err != nil { - return fmt.Errorf("delete bucket: %s", err) - } - } - return nil - }) - if err != nil { - return err - } - - // Remove cached copy. - delete(b.buckets, string(key)) - - // Release all bucket pages to freelist. - child.nodes = nil - child.rootNode = nil - child.free() - - // Delete the node if we have a matching key. - c.node().del(key) - - return nil -} - -// Get retrieves the value for a key in the bucket. -// Returns a nil value if the key does not exist or if the key is a nested bucket. -// The returned value is only valid for the life of the transaction. -func (b *Bucket) Get(key []byte) []byte { - k, v, flags := b.Cursor().seek(key) - - // Return nil if this is a bucket. - if (flags & bucketLeafFlag) != 0 { - return nil - } - - // If our target node isn't the same key as what's passed in then return nil. - if !bytes.Equal(key, k) { - return nil - } - return v -} - -// Put sets the value for a key in the bucket. -// If the key exist then its previous value will be overwritten. -// Supplied value must remain valid for the life of the transaction. -// Returns an error if the bucket was created from a read-only transaction, if the key is blank, if the key is too large, or if the value is too large. -func (b *Bucket) Put(key []byte, value []byte) error { - if b.tx.db == nil { - return ErrTxClosed - } else if !b.Writable() { - return ErrTxNotWritable - } else if len(key) == 0 { - return ErrKeyRequired - } else if len(key) > MaxKeySize { - return ErrKeyTooLarge - } else if int64(len(value)) > MaxValueSize { - return ErrValueTooLarge - } - - // Move cursor to correct position. - c := b.Cursor() - k, _, flags := c.seek(key) - - // Return an error if there is an existing key with a bucket value. - if bytes.Equal(key, k) && (flags&bucketLeafFlag) != 0 { - return ErrIncompatibleValue - } - - // Insert into node. - key = cloneBytes(key) - c.node().put(key, key, value, 0, 0) - - return nil -} - -// Delete removes a key from the bucket. -// If the key does not exist then nothing is done and a nil error is returned. -// Returns an error if the bucket was created from a read-only transaction. -func (b *Bucket) Delete(key []byte) error { - if b.tx.db == nil { - return ErrTxClosed - } else if !b.Writable() { - return ErrTxNotWritable - } - - // Move cursor to correct position. - c := b.Cursor() - k, _, flags := c.seek(key) - - // Return nil if the key doesn't exist. - if !bytes.Equal(key, k) { - return nil - } - - // Return an error if there is already existing bucket value. - if (flags & bucketLeafFlag) != 0 { - return ErrIncompatibleValue - } - - // Delete the node if we have a matching key. - c.node().del(key) - - return nil -} - -// Sequence returns the current integer for the bucket without incrementing it. -func (b *Bucket) Sequence() uint64 { return b.bucket.sequence } - -// SetSequence updates the sequence number for the bucket. -func (b *Bucket) SetSequence(v uint64) error { - if b.tx.db == nil { - return ErrTxClosed - } else if !b.Writable() { - return ErrTxNotWritable - } - - // Materialize the root node if it hasn't been already so that the - // bucket will be saved during commit. - if b.rootNode == nil { - _ = b.node(b.root, nil) - } - - // Increment and return the sequence. - b.bucket.sequence = v - return nil -} - -// NextSequence returns an autoincrementing integer for the bucket. -func (b *Bucket) NextSequence() (uint64, error) { - if b.tx.db == nil { - return 0, ErrTxClosed - } else if !b.Writable() { - return 0, ErrTxNotWritable - } - - // Materialize the root node if it hasn't been already so that the - // bucket will be saved during commit. - if b.rootNode == nil { - _ = b.node(b.root, nil) - } - - // Increment and return the sequence. - b.bucket.sequence++ - return b.bucket.sequence, nil -} - -// ForEach executes a function for each key/value pair in a bucket. -// If the provided function returns an error then the iteration is stopped and -// the error is returned to the caller. The provided function must not modify -// the bucket; this will result in undefined behavior. -func (b *Bucket) ForEach(fn func(k, v []byte) error) error { - if b.tx.db == nil { - return ErrTxClosed - } - c := b.Cursor() - for k, v := c.First(); k != nil; k, v = c.Next() { - if err := fn(k, v); err != nil { - return err - } - } - return nil -} - -// Stat returns stats on a bucket. -func (b *Bucket) Stats() BucketStats { - var s, subStats BucketStats - pageSize := b.tx.db.pageSize - s.BucketN += 1 - if b.root == 0 { - s.InlineBucketN += 1 - } - b.forEachPage(func(p *page, depth int) { - if (p.flags & leafPageFlag) != 0 { - s.KeyN += int(p.count) - - // used totals the used bytes for the page - used := pageHeaderSize - - if p.count != 0 { - // If page has any elements, add all element headers. - used += leafPageElementSize * int(p.count-1) - - // Add all element key, value sizes. - // The computation takes advantage of the fact that the position - // of the last element's key/value equals to the total of the sizes - // of all previous elements' keys and values. - // It also includes the last element's header. - lastElement := p.leafPageElement(p.count - 1) - used += int(lastElement.pos + lastElement.ksize + lastElement.vsize) - } - - if b.root == 0 { - // For inlined bucket just update the inline stats - s.InlineBucketInuse += used - } else { - // For non-inlined bucket update all the leaf stats - s.LeafPageN++ - s.LeafInuse += used - s.LeafOverflowN += int(p.overflow) - - // Collect stats from sub-buckets. - // Do that by iterating over all element headers - // looking for the ones with the bucketLeafFlag. - for i := uint16(0); i < p.count; i++ { - e := p.leafPageElement(i) - if (e.flags & bucketLeafFlag) != 0 { - // For any bucket element, open the element value - // and recursively call Stats on the contained bucket. - subStats.Add(b.openBucket(e.value()).Stats()) - } - } - } - } else if (p.flags & branchPageFlag) != 0 { - s.BranchPageN++ - lastElement := p.branchPageElement(p.count - 1) - - // used totals the used bytes for the page - // Add header and all element headers. - used := pageHeaderSize + (branchPageElementSize * int(p.count-1)) - - // Add size of all keys and values. - // Again, use the fact that last element's position equals to - // the total of key, value sizes of all previous elements. - used += int(lastElement.pos + lastElement.ksize) - s.BranchInuse += used - s.BranchOverflowN += int(p.overflow) - } - - // Keep track of maximum page depth. - if depth+1 > s.Depth { - s.Depth = (depth + 1) - } - }) - - // Alloc stats can be computed from page counts and pageSize. - s.BranchAlloc = (s.BranchPageN + s.BranchOverflowN) * pageSize - s.LeafAlloc = (s.LeafPageN + s.LeafOverflowN) * pageSize - - // Add the max depth of sub-buckets to get total nested depth. - s.Depth += subStats.Depth - // Add the stats for all sub-buckets - s.Add(subStats) - return s -} - -// forEachPage iterates over every page in a bucket, including inline pages. -func (b *Bucket) forEachPage(fn func(*page, int)) { - // If we have an inline page then just use that. - if b.page != nil { - fn(b.page, 0) - return - } - - // Otherwise traverse the page hierarchy. - b.tx.forEachPage(b.root, 0, fn) -} - -// forEachPageNode iterates over every page (or node) in a bucket. -// This also includes inline pages. -func (b *Bucket) forEachPageNode(fn func(*page, *node, int)) { - // If we have an inline page or root node then just use that. - if b.page != nil { - fn(b.page, nil, 0) - return - } - b._forEachPageNode(b.root, 0, fn) -} - -func (b *Bucket) _forEachPageNode(pgid pgid, depth int, fn func(*page, *node, int)) { - var p, n = b.pageNode(pgid) - - // Execute function. - fn(p, n, depth) - - // Recursively loop over children. - if p != nil { - if (p.flags & branchPageFlag) != 0 { - for i := 0; i < int(p.count); i++ { - elem := p.branchPageElement(uint16(i)) - b._forEachPageNode(elem.pgid, depth+1, fn) - } - } - } else { - if !n.isLeaf { - for _, inode := range n.inodes { - b._forEachPageNode(inode.pgid, depth+1, fn) - } - } - } -} - -// spill writes all the nodes for this bucket to dirty pages. -func (b *Bucket) spill() error { - // Spill all child buckets first. - for name, child := range b.buckets { - // If the child bucket is small enough and it has no child buckets then - // write it inline into the parent bucket's page. Otherwise spill it - // like a normal bucket and make the parent value a pointer to the page. - var value []byte - if child.inlineable() { - child.free() - value = child.write() - } else { - if err := child.spill(); err != nil { - return err - } - - // Update the child bucket header in this bucket. - value = make([]byte, unsafe.Sizeof(bucket{})) - var bucket = (*bucket)(unsafe.Pointer(&value[0])) - *bucket = *child.bucket - } - - // Skip writing the bucket if there are no materialized nodes. - if child.rootNode == nil { - continue - } - - // Update parent node. - var c = b.Cursor() - k, _, flags := c.seek([]byte(name)) - if !bytes.Equal([]byte(name), k) { - panic(fmt.Sprintf("misplaced bucket header: %x -> %x", []byte(name), k)) - } - if flags&bucketLeafFlag == 0 { - panic(fmt.Sprintf("unexpected bucket header flag: %x", flags)) - } - c.node().put([]byte(name), []byte(name), value, 0, bucketLeafFlag) - } - - // Ignore if there's not a materialized root node. - if b.rootNode == nil { - return nil - } - - // Spill nodes. - if err := b.rootNode.spill(); err != nil { - return err - } - b.rootNode = b.rootNode.root() - - // Update the root node for this bucket. - if b.rootNode.pgid >= b.tx.meta.pgid { - panic(fmt.Sprintf("pgid (%d) above high water mark (%d)", b.rootNode.pgid, b.tx.meta.pgid)) - } - b.root = b.rootNode.pgid - - return nil -} - -// inlineable returns true if a bucket is small enough to be written inline -// and if it contains no subbuckets. Otherwise returns false. -func (b *Bucket) inlineable() bool { - var n = b.rootNode - - // Bucket must only contain a single leaf node. - if n == nil || !n.isLeaf { - return false - } - - // Bucket is not inlineable if it contains subbuckets or if it goes beyond - // our threshold for inline bucket size. - var size = pageHeaderSize - for _, inode := range n.inodes { - size += leafPageElementSize + len(inode.key) + len(inode.value) - - if inode.flags&bucketLeafFlag != 0 { - return false - } else if size > b.maxInlineBucketSize() { - return false - } - } - - return true -} - -// Returns the maximum total size of a bucket to make it a candidate for inlining. -func (b *Bucket) maxInlineBucketSize() int { - return b.tx.db.pageSize / 4 -} - -// write allocates and writes a bucket to a byte slice. -func (b *Bucket) write() []byte { - // Allocate the appropriate size. - var n = b.rootNode - var value = make([]byte, bucketHeaderSize+n.size()) - - // Write a bucket header. - var bucket = (*bucket)(unsafe.Pointer(&value[0])) - *bucket = *b.bucket - - // Convert byte slice to a fake page and write the root node. - var p = (*page)(unsafe.Pointer(&value[bucketHeaderSize])) - n.write(p) - - return value -} - -// rebalance attempts to balance all nodes. -func (b *Bucket) rebalance() { - for _, n := range b.nodes { - n.rebalance() - } - for _, child := range b.buckets { - child.rebalance() - } -} - -// node creates a node from a page and associates it with a given parent. -func (b *Bucket) node(pgid pgid, parent *node) *node { - _assert(b.nodes != nil, "nodes map expected") - - // Retrieve node if it's already been created. - if n := b.nodes[pgid]; n != nil { - return n - } - - // Otherwise create a node and cache it. - n := &node{bucket: b, parent: parent} - if parent == nil { - b.rootNode = n - } else { - parent.children = append(parent.children, n) - } - - // Use the inline page if this is an inline bucket. - var p = b.page - if p == nil { - p = b.tx.page(pgid) - } - - // Read the page into the node and cache it. - n.read(p) - b.nodes[pgid] = n - - // Update statistics. - b.tx.stats.NodeCount++ - - return n -} - -// free recursively frees all pages in the bucket. -func (b *Bucket) free() { - if b.root == 0 { - return - } - - var tx = b.tx - b.forEachPageNode(func(p *page, n *node, _ int) { - if p != nil { - tx.db.freelist.free(tx.meta.txid, p) - } else { - n.free() - } - }) - b.root = 0 -} - -// dereference removes all references to the old mmap. -func (b *Bucket) dereference() { - if b.rootNode != nil { - b.rootNode.root().dereference() - } - - for _, child := range b.buckets { - child.dereference() - } -} - -// pageNode returns the in-memory node, if it exists. -// Otherwise returns the underlying page. -func (b *Bucket) pageNode(id pgid) (*page, *node) { - // Inline buckets have a fake page embedded in their value so treat them - // differently. We'll return the rootNode (if available) or the fake page. - if b.root == 0 { - if id != 0 { - panic(fmt.Sprintf("inline bucket non-zero page access(2): %d != 0", id)) - } - if b.rootNode != nil { - return nil, b.rootNode - } - return b.page, nil - } - - // Check the node cache for non-inline buckets. - if b.nodes != nil { - if n := b.nodes[id]; n != nil { - return nil, n - } - } - - // Finally lookup the page from the transaction if no node is materialized. - return b.tx.page(id), nil -} - -// BucketStats records statistics about resources used by a bucket. -type BucketStats struct { - // Page count statistics. - BranchPageN int // number of logical branch pages - BranchOverflowN int // number of physical branch overflow pages - LeafPageN int // number of logical leaf pages - LeafOverflowN int // number of physical leaf overflow pages - - // Tree statistics. - KeyN int // number of keys/value pairs - Depth int // number of levels in B+tree - - // Page size utilization. - BranchAlloc int // bytes allocated for physical branch pages - BranchInuse int // bytes actually used for branch data - LeafAlloc int // bytes allocated for physical leaf pages - LeafInuse int // bytes actually used for leaf data - - // Bucket statistics - BucketN int // total number of buckets including the top bucket - InlineBucketN int // total number on inlined buckets - InlineBucketInuse int // bytes used for inlined buckets (also accounted for in LeafInuse) -} - -func (s *BucketStats) Add(other BucketStats) { - s.BranchPageN += other.BranchPageN - s.BranchOverflowN += other.BranchOverflowN - s.LeafPageN += other.LeafPageN - s.LeafOverflowN += other.LeafOverflowN - s.KeyN += other.KeyN - if s.Depth < other.Depth { - s.Depth = other.Depth - } - s.BranchAlloc += other.BranchAlloc - s.BranchInuse += other.BranchInuse - s.LeafAlloc += other.LeafAlloc - s.LeafInuse += other.LeafInuse - - s.BucketN += other.BucketN - s.InlineBucketN += other.InlineBucketN - s.InlineBucketInuse += other.InlineBucketInuse -} - -// cloneBytes returns a copy of a given slice. -func cloneBytes(v []byte) []byte { - var clone = make([]byte, len(v)) - copy(clone, v) - return clone -} diff --git a/vendor/github.com/coreos/bbolt/cursor.go b/vendor/github.com/coreos/bbolt/cursor.go deleted file mode 100644 index 1be9f35e3..000000000 --- a/vendor/github.com/coreos/bbolt/cursor.go +++ /dev/null @@ -1,400 +0,0 @@ -package bolt - -import ( - "bytes" - "fmt" - "sort" -) - -// Cursor represents an iterator that can traverse over all key/value pairs in a bucket in sorted order. -// Cursors see nested buckets with value == nil. -// Cursors can be obtained from a transaction and are valid as long as the transaction is open. -// -// Keys and values returned from the cursor are only valid for the life of the transaction. -// -// Changing data while traversing with a cursor may cause it to be invalidated -// and return unexpected keys and/or values. You must reposition your cursor -// after mutating data. -type Cursor struct { - bucket *Bucket - stack []elemRef -} - -// Bucket returns the bucket that this cursor was created from. -func (c *Cursor) Bucket() *Bucket { - return c.bucket -} - -// First moves the cursor to the first item in the bucket and returns its key and value. -// If the bucket is empty then a nil key and value are returned. -// The returned key and value are only valid for the life of the transaction. -func (c *Cursor) First() (key []byte, value []byte) { - _assert(c.bucket.tx.db != nil, "tx closed") - c.stack = c.stack[:0] - p, n := c.bucket.pageNode(c.bucket.root) - c.stack = append(c.stack, elemRef{page: p, node: n, index: 0}) - c.first() - - // If we land on an empty page then move to the next value. - // https://github.com/boltdb/bolt/issues/450 - if c.stack[len(c.stack)-1].count() == 0 { - c.next() - } - - k, v, flags := c.keyValue() - if (flags & uint32(bucketLeafFlag)) != 0 { - return k, nil - } - return k, v - -} - -// Last moves the cursor to the last item in the bucket and returns its key and value. -// If the bucket is empty then a nil key and value are returned. -// The returned key and value are only valid for the life of the transaction. -func (c *Cursor) Last() (key []byte, value []byte) { - _assert(c.bucket.tx.db != nil, "tx closed") - c.stack = c.stack[:0] - p, n := c.bucket.pageNode(c.bucket.root) - ref := elemRef{page: p, node: n} - ref.index = ref.count() - 1 - c.stack = append(c.stack, ref) - c.last() - k, v, flags := c.keyValue() - if (flags & uint32(bucketLeafFlag)) != 0 { - return k, nil - } - return k, v -} - -// Next moves the cursor to the next item in the bucket and returns its key and value. -// If the cursor is at the end of the bucket then a nil key and value are returned. -// The returned key and value are only valid for the life of the transaction. -func (c *Cursor) Next() (key []byte, value []byte) { - _assert(c.bucket.tx.db != nil, "tx closed") - k, v, flags := c.next() - if (flags & uint32(bucketLeafFlag)) != 0 { - return k, nil - } - return k, v -} - -// Prev moves the cursor to the previous item in the bucket and returns its key and value. -// If the cursor is at the beginning of the bucket then a nil key and value are returned. -// The returned key and value are only valid for the life of the transaction. -func (c *Cursor) Prev() (key []byte, value []byte) { - _assert(c.bucket.tx.db != nil, "tx closed") - - // Attempt to move back one element until we're successful. - // Move up the stack as we hit the beginning of each page in our stack. - for i := len(c.stack) - 1; i >= 0; i-- { - elem := &c.stack[i] - if elem.index > 0 { - elem.index-- - break - } - c.stack = c.stack[:i] - } - - // If we've hit the end then return nil. - if len(c.stack) == 0 { - return nil, nil - } - - // Move down the stack to find the last element of the last leaf under this branch. - c.last() - k, v, flags := c.keyValue() - if (flags & uint32(bucketLeafFlag)) != 0 { - return k, nil - } - return k, v -} - -// Seek moves the cursor to a given key and returns it. -// If the key does not exist then the next key is used. If no keys -// follow, a nil key is returned. -// The returned key and value are only valid for the life of the transaction. -func (c *Cursor) Seek(seek []byte) (key []byte, value []byte) { - k, v, flags := c.seek(seek) - - // If we ended up after the last element of a page then move to the next one. - if ref := &c.stack[len(c.stack)-1]; ref.index >= ref.count() { - k, v, flags = c.next() - } - - if k == nil { - return nil, nil - } else if (flags & uint32(bucketLeafFlag)) != 0 { - return k, nil - } - return k, v -} - -// Delete removes the current key/value under the cursor from the bucket. -// Delete fails if current key/value is a bucket or if the transaction is not writable. -func (c *Cursor) Delete() error { - if c.bucket.tx.db == nil { - return ErrTxClosed - } else if !c.bucket.Writable() { - return ErrTxNotWritable - } - - key, _, flags := c.keyValue() - // Return an error if current value is a bucket. - if (flags & bucketLeafFlag) != 0 { - return ErrIncompatibleValue - } - c.node().del(key) - - return nil -} - -// seek moves the cursor to a given key and returns it. -// If the key does not exist then the next key is used. -func (c *Cursor) seek(seek []byte) (key []byte, value []byte, flags uint32) { - _assert(c.bucket.tx.db != nil, "tx closed") - - // Start from root page/node and traverse to correct page. - c.stack = c.stack[:0] - c.search(seek, c.bucket.root) - ref := &c.stack[len(c.stack)-1] - - // If the cursor is pointing to the end of page/node then return nil. - if ref.index >= ref.count() { - return nil, nil, 0 - } - - // If this is a bucket then return a nil value. - return c.keyValue() -} - -// first moves the cursor to the first leaf element under the last page in the stack. -func (c *Cursor) first() { - for { - // Exit when we hit a leaf page. - var ref = &c.stack[len(c.stack)-1] - if ref.isLeaf() { - break - } - - // Keep adding pages pointing to the first element to the stack. - var pgid pgid - if ref.node != nil { - pgid = ref.node.inodes[ref.index].pgid - } else { - pgid = ref.page.branchPageElement(uint16(ref.index)).pgid - } - p, n := c.bucket.pageNode(pgid) - c.stack = append(c.stack, elemRef{page: p, node: n, index: 0}) - } -} - -// last moves the cursor to the last leaf element under the last page in the stack. -func (c *Cursor) last() { - for { - // Exit when we hit a leaf page. - ref := &c.stack[len(c.stack)-1] - if ref.isLeaf() { - break - } - - // Keep adding pages pointing to the last element in the stack. - var pgid pgid - if ref.node != nil { - pgid = ref.node.inodes[ref.index].pgid - } else { - pgid = ref.page.branchPageElement(uint16(ref.index)).pgid - } - p, n := c.bucket.pageNode(pgid) - - var nextRef = elemRef{page: p, node: n} - nextRef.index = nextRef.count() - 1 - c.stack = append(c.stack, nextRef) - } -} - -// next moves to the next leaf element and returns the key and value. -// If the cursor is at the last leaf element then it stays there and returns nil. -func (c *Cursor) next() (key []byte, value []byte, flags uint32) { - for { - // Attempt to move over one element until we're successful. - // Move up the stack as we hit the end of each page in our stack. - var i int - for i = len(c.stack) - 1; i >= 0; i-- { - elem := &c.stack[i] - if elem.index < elem.count()-1 { - elem.index++ - break - } - } - - // If we've hit the root page then stop and return. This will leave the - // cursor on the last element of the last page. - if i == -1 { - return nil, nil, 0 - } - - // Otherwise start from where we left off in the stack and find the - // first element of the first leaf page. - c.stack = c.stack[:i+1] - c.first() - - // If this is an empty page then restart and move back up the stack. - // https://github.com/boltdb/bolt/issues/450 - if c.stack[len(c.stack)-1].count() == 0 { - continue - } - - return c.keyValue() - } -} - -// search recursively performs a binary search against a given page/node until it finds a given key. -func (c *Cursor) search(key []byte, pgid pgid) { - p, n := c.bucket.pageNode(pgid) - if p != nil && (p.flags&(branchPageFlag|leafPageFlag)) == 0 { - panic(fmt.Sprintf("invalid page type: %d: %x", p.id, p.flags)) - } - e := elemRef{page: p, node: n} - c.stack = append(c.stack, e) - - // If we're on a leaf page/node then find the specific node. - if e.isLeaf() { - c.nsearch(key) - return - } - - if n != nil { - c.searchNode(key, n) - return - } - c.searchPage(key, p) -} - -func (c *Cursor) searchNode(key []byte, n *node) { - var exact bool - index := sort.Search(len(n.inodes), func(i int) bool { - // TODO(benbjohnson): Optimize this range search. It's a bit hacky right now. - // sort.Search() finds the lowest index where f() != -1 but we need the highest index. - ret := bytes.Compare(n.inodes[i].key, key) - if ret == 0 { - exact = true - } - return ret != -1 - }) - if !exact && index > 0 { - index-- - } - c.stack[len(c.stack)-1].index = index - - // Recursively search to the next page. - c.search(key, n.inodes[index].pgid) -} - -func (c *Cursor) searchPage(key []byte, p *page) { - // Binary search for the correct range. - inodes := p.branchPageElements() - - var exact bool - index := sort.Search(int(p.count), func(i int) bool { - // TODO(benbjohnson): Optimize this range search. It's a bit hacky right now. - // sort.Search() finds the lowest index where f() != -1 but we need the highest index. - ret := bytes.Compare(inodes[i].key(), key) - if ret == 0 { - exact = true - } - return ret != -1 - }) - if !exact && index > 0 { - index-- - } - c.stack[len(c.stack)-1].index = index - - // Recursively search to the next page. - c.search(key, inodes[index].pgid) -} - -// nsearch searches the leaf node on the top of the stack for a key. -func (c *Cursor) nsearch(key []byte) { - e := &c.stack[len(c.stack)-1] - p, n := e.page, e.node - - // If we have a node then search its inodes. - if n != nil { - index := sort.Search(len(n.inodes), func(i int) bool { - return bytes.Compare(n.inodes[i].key, key) != -1 - }) - e.index = index - return - } - - // If we have a page then search its leaf elements. - inodes := p.leafPageElements() - index := sort.Search(int(p.count), func(i int) bool { - return bytes.Compare(inodes[i].key(), key) != -1 - }) - e.index = index -} - -// keyValue returns the key and value of the current leaf element. -func (c *Cursor) keyValue() ([]byte, []byte, uint32) { - ref := &c.stack[len(c.stack)-1] - if ref.count() == 0 || ref.index >= ref.count() { - return nil, nil, 0 - } - - // Retrieve value from node. - if ref.node != nil { - inode := &ref.node.inodes[ref.index] - return inode.key, inode.value, inode.flags - } - - // Or retrieve value from page. - elem := ref.page.leafPageElement(uint16(ref.index)) - return elem.key(), elem.value(), elem.flags -} - -// node returns the node that the cursor is currently positioned on. -func (c *Cursor) node() *node { - _assert(len(c.stack) > 0, "accessing a node with a zero-length cursor stack") - - // If the top of the stack is a leaf node then just return it. - if ref := &c.stack[len(c.stack)-1]; ref.node != nil && ref.isLeaf() { - return ref.node - } - - // Start from root and traverse down the hierarchy. - var n = c.stack[0].node - if n == nil { - n = c.bucket.node(c.stack[0].page.id, nil) - } - for _, ref := range c.stack[:len(c.stack)-1] { - _assert(!n.isLeaf, "expected branch node") - n = n.childAt(int(ref.index)) - } - _assert(n.isLeaf, "expected leaf node") - return n -} - -// elemRef represents a reference to an element on a given page/node. -type elemRef struct { - page *page - node *node - index int -} - -// isLeaf returns whether the ref is pointing at a leaf page/node. -func (r *elemRef) isLeaf() bool { - if r.node != nil { - return r.node.isLeaf - } - return (r.page.flags & leafPageFlag) != 0 -} - -// count returns the number of inodes or page elements. -func (r *elemRef) count() int { - if r.node != nil { - return len(r.node.inodes) - } - return int(r.page.count) -} diff --git a/vendor/github.com/coreos/bbolt/db.go b/vendor/github.com/coreos/bbolt/db.go deleted file mode 100644 index 08dfd0ab1..000000000 --- a/vendor/github.com/coreos/bbolt/db.go +++ /dev/null @@ -1,1137 +0,0 @@ -package bolt - -import ( - "errors" - "fmt" - "hash/fnv" - "log" - "os" - "runtime" - "sort" - "sync" - "time" - "unsafe" -) - -// The largest step that can be taken when remapping the mmap. -const maxMmapStep = 1 << 30 // 1GB - -// The data file format version. -const version = 2 - -// Represents a marker value to indicate that a file is a Bolt DB. -const magic uint32 = 0xED0CDAED - -const pgidNoFreelist pgid = 0xffffffffffffffff - -// IgnoreNoSync specifies whether the NoSync field of a DB is ignored when -// syncing changes to a file. This is required as some operating systems, -// such as OpenBSD, do not have a unified buffer cache (UBC) and writes -// must be synchronized using the msync(2) syscall. -const IgnoreNoSync = runtime.GOOS == "openbsd" - -// Default values if not set in a DB instance. -const ( - DefaultMaxBatchSize int = 1000 - DefaultMaxBatchDelay = 10 * time.Millisecond - DefaultAllocSize = 16 * 1024 * 1024 -) - -// default page size for db is set to the OS page size. -var defaultPageSize = os.Getpagesize() - -// The time elapsed between consecutive file locking attempts. -const flockRetryTimeout = 50 * time.Millisecond - -// DB represents a collection of buckets persisted to a file on disk. -// All data access is performed through transactions which can be obtained through the DB. -// All the functions on DB will return a ErrDatabaseNotOpen if accessed before Open() is called. -type DB struct { - // When enabled, the database will perform a Check() after every commit. - // A panic is issued if the database is in an inconsistent state. This - // flag has a large performance impact so it should only be used for - // debugging purposes. - StrictMode bool - - // Setting the NoSync flag will cause the database to skip fsync() - // calls after each commit. This can be useful when bulk loading data - // into a database and you can restart the bulk load in the event of - // a system failure or database corruption. Do not set this flag for - // normal use. - // - // If the package global IgnoreNoSync constant is true, this value is - // ignored. See the comment on that constant for more details. - // - // THIS IS UNSAFE. PLEASE USE WITH CAUTION. - NoSync bool - - // When true, skips syncing freelist to disk. This improves the database - // write performance under normal operation, but requires a full database - // re-sync during recovery. - NoFreelistSync bool - - // When true, skips the truncate call when growing the database. - // Setting this to true is only safe on non-ext3/ext4 systems. - // Skipping truncation avoids preallocation of hard drive space and - // bypasses a truncate() and fsync() syscall on remapping. - // - // https://github.com/boltdb/bolt/issues/284 - NoGrowSync bool - - // If you want to read the entire database fast, you can set MmapFlag to - // syscall.MAP_POPULATE on Linux 2.6.23+ for sequential read-ahead. - MmapFlags int - - // MaxBatchSize is the maximum size of a batch. Default value is - // copied from DefaultMaxBatchSize in Open. - // - // If <=0, disables batching. - // - // Do not change concurrently with calls to Batch. - MaxBatchSize int - - // MaxBatchDelay is the maximum delay before a batch starts. - // Default value is copied from DefaultMaxBatchDelay in Open. - // - // If <=0, effectively disables batching. - // - // Do not change concurrently with calls to Batch. - MaxBatchDelay time.Duration - - // AllocSize is the amount of space allocated when the database - // needs to create new pages. This is done to amortize the cost - // of truncate() and fsync() when growing the data file. - AllocSize int - - path string - file *os.File - lockfile *os.File // windows only - dataref []byte // mmap'ed readonly, write throws SEGV - data *[maxMapSize]byte - datasz int - filesz int // current on disk file size - meta0 *meta - meta1 *meta - pageSize int - opened bool - rwtx *Tx - txs []*Tx - stats Stats - - freelist *freelist - freelistLoad sync.Once - - pagePool sync.Pool - - batchMu sync.Mutex - batch *batch - - rwlock sync.Mutex // Allows only one writer at a time. - metalock sync.Mutex // Protects meta page access. - mmaplock sync.RWMutex // Protects mmap access during remapping. - statlock sync.RWMutex // Protects stats access. - - ops struct { - writeAt func(b []byte, off int64) (n int, err error) - } - - // Read only mode. - // When true, Update() and Begin(true) return ErrDatabaseReadOnly immediately. - readOnly bool -} - -// Path returns the path to currently open database file. -func (db *DB) Path() string { - return db.path -} - -// GoString returns the Go string representation of the database. -func (db *DB) GoString() string { - return fmt.Sprintf("bolt.DB{path:%q}", db.path) -} - -// String returns the string representation of the database. -func (db *DB) String() string { - return fmt.Sprintf("DB<%q>", db.path) -} - -// Open creates and opens a database at the given path. -// If the file does not exist then it will be created automatically. -// Passing in nil options will cause Bolt to open the database with the default options. -func Open(path string, mode os.FileMode, options *Options) (*DB, error) { - db := &DB{ - opened: true, - } - // Set default options if no options are provided. - if options == nil { - options = DefaultOptions - } - db.NoSync = options.NoSync - db.NoGrowSync = options.NoGrowSync - db.MmapFlags = options.MmapFlags - db.NoFreelistSync = options.NoFreelistSync - - // Set default values for later DB operations. - db.MaxBatchSize = DefaultMaxBatchSize - db.MaxBatchDelay = DefaultMaxBatchDelay - db.AllocSize = DefaultAllocSize - - flag := os.O_RDWR - if options.ReadOnly { - flag = os.O_RDONLY - db.readOnly = true - } - - // Open data file and separate sync handler for metadata writes. - db.path = path - var err error - if db.file, err = os.OpenFile(db.path, flag|os.O_CREATE, mode); err != nil { - _ = db.close() - return nil, err - } - - // Lock file so that other processes using Bolt in read-write mode cannot - // use the database at the same time. This would cause corruption since - // the two processes would write meta pages and free pages separately. - // The database file is locked exclusively (only one process can grab the lock) - // if !options.ReadOnly. - // The database file is locked using the shared lock (more than one process may - // hold a lock at the same time) otherwise (options.ReadOnly is set). - if err := flock(db, mode, !db.readOnly, options.Timeout); err != nil { - db.lockfile = nil // make 'unused' happy. TODO: rework locks - _ = db.close() - return nil, err - } - - // Default values for test hooks - db.ops.writeAt = db.file.WriteAt - - if db.pageSize = options.PageSize; db.pageSize == 0 { - // Set the default page size to the OS page size. - db.pageSize = defaultPageSize - } - - // Initialize the database if it doesn't exist. - if info, err := db.file.Stat(); err != nil { - return nil, err - } else if info.Size() == 0 { - // Initialize new files with meta pages. - if err := db.init(); err != nil { - return nil, err - } - } else { - // Read the first meta page to determine the page size. - var buf [0x1000]byte - // If we can't read the page size, but can read a page, assume - // it's the same as the OS or one given -- since that's how the - // page size was chosen in the first place. - // - // If the first page is invalid and this OS uses a different - // page size than what the database was created with then we - // are out of luck and cannot access the database. - // - // TODO: scan for next page - if bw, err := db.file.ReadAt(buf[:], 0); err == nil && bw == len(buf) { - if m := db.pageInBuffer(buf[:], 0).meta(); m.validate() == nil { - db.pageSize = int(m.pageSize) - } - } else { - return nil, ErrInvalid - } - } - - // Initialize page pool. - db.pagePool = sync.Pool{ - New: func() interface{} { - return make([]byte, db.pageSize) - }, - } - - // Memory map the data file. - if err := db.mmap(options.InitialMmapSize); err != nil { - _ = db.close() - return nil, err - } - - if db.readOnly { - return db, nil - } - - db.loadFreelist() - - // Flush freelist when transitioning from no sync to sync so - // NoFreelistSync unaware boltdb can open the db later. - if !db.NoFreelistSync && !db.hasSyncedFreelist() { - tx, err := db.Begin(true) - if tx != nil { - err = tx.Commit() - } - if err != nil { - _ = db.close() - return nil, err - } - } - - // Mark the database as opened and return. - return db, nil -} - -// loadFreelist reads the freelist if it is synced, or reconstructs it -// by scanning the DB if it is not synced. It assumes there are no -// concurrent accesses being made to the freelist. -func (db *DB) loadFreelist() { - db.freelistLoad.Do(func() { - db.freelist = newFreelist() - if !db.hasSyncedFreelist() { - // Reconstruct free list by scanning the DB. - db.freelist.readIDs(db.freepages()) - } else { - // Read free list from freelist page. - db.freelist.read(db.page(db.meta().freelist)) - } - db.stats.FreePageN = len(db.freelist.ids) - }) -} - -func (db *DB) hasSyncedFreelist() bool { - return db.meta().freelist != pgidNoFreelist -} - -// mmap opens the underlying memory-mapped file and initializes the meta references. -// minsz is the minimum size that the new mmap can be. -func (db *DB) mmap(minsz int) error { - db.mmaplock.Lock() - defer db.mmaplock.Unlock() - - info, err := db.file.Stat() - if err != nil { - return fmt.Errorf("mmap stat error: %s", err) - } else if int(info.Size()) < db.pageSize*2 { - return fmt.Errorf("file size too small") - } - - // Ensure the size is at least the minimum size. - var size = int(info.Size()) - if size < minsz { - size = minsz - } - size, err = db.mmapSize(size) - if err != nil { - return err - } - - // Dereference all mmap references before unmapping. - if db.rwtx != nil { - db.rwtx.root.dereference() - } - - // Unmap existing data before continuing. - if err := db.munmap(); err != nil { - return err - } - - // Memory-map the data file as a byte slice. - if err := mmap(db, size); err != nil { - return err - } - - // Save references to the meta pages. - db.meta0 = db.page(0).meta() - db.meta1 = db.page(1).meta() - - // Validate the meta pages. We only return an error if both meta pages fail - // validation, since meta0 failing validation means that it wasn't saved - // properly -- but we can recover using meta1. And vice-versa. - err0 := db.meta0.validate() - err1 := db.meta1.validate() - if err0 != nil && err1 != nil { - return err0 - } - - return nil -} - -// munmap unmaps the data file from memory. -func (db *DB) munmap() error { - if err := munmap(db); err != nil { - return fmt.Errorf("unmap error: " + err.Error()) - } - return nil -} - -// mmapSize determines the appropriate size for the mmap given the current size -// of the database. The minimum size is 32KB and doubles until it reaches 1GB. -// Returns an error if the new mmap size is greater than the max allowed. -func (db *DB) mmapSize(size int) (int, error) { - // Double the size from 32KB until 1GB. - for i := uint(15); i <= 30; i++ { - if size <= 1< maxMapSize { - return 0, fmt.Errorf("mmap too large") - } - - // If larger than 1GB then grow by 1GB at a time. - sz := int64(size) - if remainder := sz % int64(maxMmapStep); remainder > 0 { - sz += int64(maxMmapStep) - remainder - } - - // Ensure that the mmap size is a multiple of the page size. - // This should always be true since we're incrementing in MBs. - pageSize := int64(db.pageSize) - if (sz % pageSize) != 0 { - sz = ((sz / pageSize) + 1) * pageSize - } - - // If we've exceeded the max size then only grow up to the max size. - if sz > maxMapSize { - sz = maxMapSize - } - - return int(sz), nil -} - -// init creates a new database file and initializes its meta pages. -func (db *DB) init() error { - // Create two meta pages on a buffer. - buf := make([]byte, db.pageSize*4) - for i := 0; i < 2; i++ { - p := db.pageInBuffer(buf[:], pgid(i)) - p.id = pgid(i) - p.flags = metaPageFlag - - // Initialize the meta page. - m := p.meta() - m.magic = magic - m.version = version - m.pageSize = uint32(db.pageSize) - m.freelist = 2 - m.root = bucket{root: 3} - m.pgid = 4 - m.txid = txid(i) - m.checksum = m.sum64() - } - - // Write an empty freelist at page 3. - p := db.pageInBuffer(buf[:], pgid(2)) - p.id = pgid(2) - p.flags = freelistPageFlag - p.count = 0 - - // Write an empty leaf page at page 4. - p = db.pageInBuffer(buf[:], pgid(3)) - p.id = pgid(3) - p.flags = leafPageFlag - p.count = 0 - - // Write the buffer to our data file. - if _, err := db.ops.writeAt(buf, 0); err != nil { - return err - } - if err := fdatasync(db); err != nil { - return err - } - - return nil -} - -// Close releases all database resources. -// All transactions must be closed before closing the database. -func (db *DB) Close() error { - db.rwlock.Lock() - defer db.rwlock.Unlock() - - db.metalock.Lock() - defer db.metalock.Unlock() - - db.mmaplock.RLock() - defer db.mmaplock.RUnlock() - - return db.close() -} - -func (db *DB) close() error { - if !db.opened { - return nil - } - - db.opened = false - - db.freelist = nil - - // Clear ops. - db.ops.writeAt = nil - - // Close the mmap. - if err := db.munmap(); err != nil { - return err - } - - // Close file handles. - if db.file != nil { - // No need to unlock read-only file. - if !db.readOnly { - // Unlock the file. - if err := funlock(db); err != nil { - log.Printf("bolt.Close(): funlock error: %s", err) - } - } - - // Close the file descriptor. - if err := db.file.Close(); err != nil { - return fmt.Errorf("db file close: %s", err) - } - db.file = nil - } - - db.path = "" - return nil -} - -// Begin starts a new transaction. -// Multiple read-only transactions can be used concurrently but only one -// write transaction can be used at a time. Starting multiple write transactions -// will cause the calls to block and be serialized until the current write -// transaction finishes. -// -// Transactions should not be dependent on one another. Opening a read -// transaction and a write transaction in the same goroutine can cause the -// writer to deadlock because the database periodically needs to re-mmap itself -// as it grows and it cannot do that while a read transaction is open. -// -// If a long running read transaction (for example, a snapshot transaction) is -// needed, you might want to set DB.InitialMmapSize to a large enough value -// to avoid potential blocking of write transaction. -// -// IMPORTANT: You must close read-only transactions after you are finished or -// else the database will not reclaim old pages. -func (db *DB) Begin(writable bool) (*Tx, error) { - if writable { - return db.beginRWTx() - } - return db.beginTx() -} - -func (db *DB) beginTx() (*Tx, error) { - // Lock the meta pages while we initialize the transaction. We obtain - // the meta lock before the mmap lock because that's the order that the - // write transaction will obtain them. - db.metalock.Lock() - - // Obtain a read-only lock on the mmap. When the mmap is remapped it will - // obtain a write lock so all transactions must finish before it can be - // remapped. - db.mmaplock.RLock() - - // Exit if the database is not open yet. - if !db.opened { - db.mmaplock.RUnlock() - db.metalock.Unlock() - return nil, ErrDatabaseNotOpen - } - - // Create a transaction associated with the database. - t := &Tx{} - t.init(db) - - // Keep track of transaction until it closes. - db.txs = append(db.txs, t) - n := len(db.txs) - - // Unlock the meta pages. - db.metalock.Unlock() - - // Update the transaction stats. - db.statlock.Lock() - db.stats.TxN++ - db.stats.OpenTxN = n - db.statlock.Unlock() - - return t, nil -} - -func (db *DB) beginRWTx() (*Tx, error) { - // If the database was opened with Options.ReadOnly, return an error. - if db.readOnly { - return nil, ErrDatabaseReadOnly - } - - // Obtain writer lock. This is released by the transaction when it closes. - // This enforces only one writer transaction at a time. - db.rwlock.Lock() - - // Once we have the writer lock then we can lock the meta pages so that - // we can set up the transaction. - db.metalock.Lock() - defer db.metalock.Unlock() - - // Exit if the database is not open yet. - if !db.opened { - db.rwlock.Unlock() - return nil, ErrDatabaseNotOpen - } - - // Create a transaction associated with the database. - t := &Tx{writable: true} - t.init(db) - db.rwtx = t - db.freePages() - return t, nil -} - -// freePages releases any pages associated with closed read-only transactions. -func (db *DB) freePages() { - // Free all pending pages prior to earliest open transaction. - sort.Sort(txsById(db.txs)) - minid := txid(0xFFFFFFFFFFFFFFFF) - if len(db.txs) > 0 { - minid = db.txs[0].meta.txid - } - if minid > 0 { - db.freelist.release(minid - 1) - } - // Release unused txid extents. - for _, t := range db.txs { - db.freelist.releaseRange(minid, t.meta.txid-1) - minid = t.meta.txid + 1 - } - db.freelist.releaseRange(minid, txid(0xFFFFFFFFFFFFFFFF)) - // Any page both allocated and freed in an extent is safe to release. -} - -type txsById []*Tx - -func (t txsById) Len() int { return len(t) } -func (t txsById) Swap(i, j int) { t[i], t[j] = t[j], t[i] } -func (t txsById) Less(i, j int) bool { return t[i].meta.txid < t[j].meta.txid } - -// removeTx removes a transaction from the database. -func (db *DB) removeTx(tx *Tx) { - // Release the read lock on the mmap. - db.mmaplock.RUnlock() - - // Use the meta lock to restrict access to the DB object. - db.metalock.Lock() - - // Remove the transaction. - for i, t := range db.txs { - if t == tx { - last := len(db.txs) - 1 - db.txs[i] = db.txs[last] - db.txs[last] = nil - db.txs = db.txs[:last] - break - } - } - n := len(db.txs) - - // Unlock the meta pages. - db.metalock.Unlock() - - // Merge statistics. - db.statlock.Lock() - db.stats.OpenTxN = n - db.stats.TxStats.add(&tx.stats) - db.statlock.Unlock() -} - -// Update executes a function within the context of a read-write managed transaction. -// If no error is returned from the function then the transaction is committed. -// If an error is returned then the entire transaction is rolled back. -// Any error that is returned from the function or returned from the commit is -// returned from the Update() method. -// -// Attempting to manually commit or rollback within the function will cause a panic. -func (db *DB) Update(fn func(*Tx) error) error { - t, err := db.Begin(true) - if err != nil { - return err - } - - // Make sure the transaction rolls back in the event of a panic. - defer func() { - if t.db != nil { - t.rollback() - } - }() - - // Mark as a managed tx so that the inner function cannot manually commit. - t.managed = true - - // If an error is returned from the function then rollback and return error. - err = fn(t) - t.managed = false - if err != nil { - _ = t.Rollback() - return err - } - - return t.Commit() -} - -// View executes a function within the context of a managed read-only transaction. -// Any error that is returned from the function is returned from the View() method. -// -// Attempting to manually rollback within the function will cause a panic. -func (db *DB) View(fn func(*Tx) error) error { - t, err := db.Begin(false) - if err != nil { - return err - } - - // Make sure the transaction rolls back in the event of a panic. - defer func() { - if t.db != nil { - t.rollback() - } - }() - - // Mark as a managed tx so that the inner function cannot manually rollback. - t.managed = true - - // If an error is returned from the function then pass it through. - err = fn(t) - t.managed = false - if err != nil { - _ = t.Rollback() - return err - } - - return t.Rollback() -} - -// Batch calls fn as part of a batch. It behaves similar to Update, -// except: -// -// 1. concurrent Batch calls can be combined into a single Bolt -// transaction. -// -// 2. the function passed to Batch may be called multiple times, -// regardless of whether it returns error or not. -// -// This means that Batch function side effects must be idempotent and -// take permanent effect only after a successful return is seen in -// caller. -// -// The maximum batch size and delay can be adjusted with DB.MaxBatchSize -// and DB.MaxBatchDelay, respectively. -// -// Batch is only useful when there are multiple goroutines calling it. -func (db *DB) Batch(fn func(*Tx) error) error { - errCh := make(chan error, 1) - - db.batchMu.Lock() - if (db.batch == nil) || (db.batch != nil && len(db.batch.calls) >= db.MaxBatchSize) { - // There is no existing batch, or the existing batch is full; start a new one. - db.batch = &batch{ - db: db, - } - db.batch.timer = time.AfterFunc(db.MaxBatchDelay, db.batch.trigger) - } - db.batch.calls = append(db.batch.calls, call{fn: fn, err: errCh}) - if len(db.batch.calls) >= db.MaxBatchSize { - // wake up batch, it's ready to run - go db.batch.trigger() - } - db.batchMu.Unlock() - - err := <-errCh - if err == trySolo { - err = db.Update(fn) - } - return err -} - -type call struct { - fn func(*Tx) error - err chan<- error -} - -type batch struct { - db *DB - timer *time.Timer - start sync.Once - calls []call -} - -// trigger runs the batch if it hasn't already been run. -func (b *batch) trigger() { - b.start.Do(b.run) -} - -// run performs the transactions in the batch and communicates results -// back to DB.Batch. -func (b *batch) run() { - b.db.batchMu.Lock() - b.timer.Stop() - // Make sure no new work is added to this batch, but don't break - // other batches. - if b.db.batch == b { - b.db.batch = nil - } - b.db.batchMu.Unlock() - -retry: - for len(b.calls) > 0 { - var failIdx = -1 - err := b.db.Update(func(tx *Tx) error { - for i, c := range b.calls { - if err := safelyCall(c.fn, tx); err != nil { - failIdx = i - return err - } - } - return nil - }) - - if failIdx >= 0 { - // take the failing transaction out of the batch. it's - // safe to shorten b.calls here because db.batch no longer - // points to us, and we hold the mutex anyway. - c := b.calls[failIdx] - b.calls[failIdx], b.calls = b.calls[len(b.calls)-1], b.calls[:len(b.calls)-1] - // tell the submitter re-run it solo, continue with the rest of the batch - c.err <- trySolo - continue retry - } - - // pass success, or bolt internal errors, to all callers - for _, c := range b.calls { - if c.err != nil { - c.err <- err - } - } - break retry - } -} - -// trySolo is a special sentinel error value used for signaling that a -// transaction function should be re-run. It should never be seen by -// callers. -var trySolo = errors.New("batch function returned an error and should be re-run solo") - -type panicked struct { - reason interface{} -} - -func (p panicked) Error() string { - if err, ok := p.reason.(error); ok { - return err.Error() - } - return fmt.Sprintf("panic: %v", p.reason) -} - -func safelyCall(fn func(*Tx) error, tx *Tx) (err error) { - defer func() { - if p := recover(); p != nil { - err = panicked{p} - } - }() - return fn(tx) -} - -// Sync executes fdatasync() against the database file handle. -// -// This is not necessary under normal operation, however, if you use NoSync -// then it allows you to force the database file to sync against the disk. -func (db *DB) Sync() error { return fdatasync(db) } - -// Stats retrieves ongoing performance stats for the database. -// This is only updated when a transaction closes. -func (db *DB) Stats() Stats { - db.statlock.RLock() - defer db.statlock.RUnlock() - return db.stats -} - -// This is for internal access to the raw data bytes from the C cursor, use -// carefully, or not at all. -func (db *DB) Info() *Info { - return &Info{uintptr(unsafe.Pointer(&db.data[0])), db.pageSize} -} - -// page retrieves a page reference from the mmap based on the current page size. -func (db *DB) page(id pgid) *page { - pos := id * pgid(db.pageSize) - return (*page)(unsafe.Pointer(&db.data[pos])) -} - -// pageInBuffer retrieves a page reference from a given byte array based on the current page size. -func (db *DB) pageInBuffer(b []byte, id pgid) *page { - return (*page)(unsafe.Pointer(&b[id*pgid(db.pageSize)])) -} - -// meta retrieves the current meta page reference. -func (db *DB) meta() *meta { - // We have to return the meta with the highest txid which doesn't fail - // validation. Otherwise, we can cause errors when in fact the database is - // in a consistent state. metaA is the one with the higher txid. - metaA := db.meta0 - metaB := db.meta1 - if db.meta1.txid > db.meta0.txid { - metaA = db.meta1 - metaB = db.meta0 - } - - // Use higher meta page if valid. Otherwise fallback to previous, if valid. - if err := metaA.validate(); err == nil { - return metaA - } else if err := metaB.validate(); err == nil { - return metaB - } - - // This should never be reached, because both meta1 and meta0 were validated - // on mmap() and we do fsync() on every write. - panic("bolt.DB.meta(): invalid meta pages") -} - -// allocate returns a contiguous block of memory starting at a given page. -func (db *DB) allocate(txid txid, count int) (*page, error) { - // Allocate a temporary buffer for the page. - var buf []byte - if count == 1 { - buf = db.pagePool.Get().([]byte) - } else { - buf = make([]byte, count*db.pageSize) - } - p := (*page)(unsafe.Pointer(&buf[0])) - p.overflow = uint32(count - 1) - - // Use pages from the freelist if they are available. - if p.id = db.freelist.allocate(txid, count); p.id != 0 { - return p, nil - } - - // Resize mmap() if we're at the end. - p.id = db.rwtx.meta.pgid - var minsz = int((p.id+pgid(count))+1) * db.pageSize - if minsz >= db.datasz { - if err := db.mmap(minsz); err != nil { - return nil, fmt.Errorf("mmap allocate error: %s", err) - } - } - - // Move the page id high water mark. - db.rwtx.meta.pgid += pgid(count) - - return p, nil -} - -// grow grows the size of the database to the given sz. -func (db *DB) grow(sz int) error { - // Ignore if the new size is less than available file size. - if sz <= db.filesz { - return nil - } - - // If the data is smaller than the alloc size then only allocate what's needed. - // Once it goes over the allocation size then allocate in chunks. - if db.datasz < db.AllocSize { - sz = db.datasz - } else { - sz += db.AllocSize - } - - // Truncate and fsync to ensure file size metadata is flushed. - // https://github.com/boltdb/bolt/issues/284 - if !db.NoGrowSync && !db.readOnly { - if runtime.GOOS != "windows" { - if err := db.file.Truncate(int64(sz)); err != nil { - return fmt.Errorf("file resize error: %s", err) - } - } - if err := db.file.Sync(); err != nil { - return fmt.Errorf("file sync error: %s", err) - } - } - - db.filesz = sz - return nil -} - -func (db *DB) IsReadOnly() bool { - return db.readOnly -} - -func (db *DB) freepages() []pgid { - tx, err := db.beginTx() - defer func() { - err = tx.Rollback() - if err != nil { - panic("freepages: failed to rollback tx") - } - }() - if err != nil { - panic("freepages: failed to open read only tx") - } - - reachable := make(map[pgid]*page) - nofreed := make(map[pgid]bool) - ech := make(chan error) - go func() { - for e := range ech { - panic(fmt.Sprintf("freepages: failed to get all reachable pages (%v)", e)) - } - }() - tx.checkBucket(&tx.root, reachable, nofreed, ech) - close(ech) - - var fids []pgid - for i := pgid(2); i < db.meta().pgid; i++ { - if _, ok := reachable[i]; !ok { - fids = append(fids, i) - } - } - return fids -} - -// Options represents the options that can be set when opening a database. -type Options struct { - // Timeout is the amount of time to wait to obtain a file lock. - // When set to zero it will wait indefinitely. This option is only - // available on Darwin and Linux. - Timeout time.Duration - - // Sets the DB.NoGrowSync flag before memory mapping the file. - NoGrowSync bool - - // Do not sync freelist to disk. This improves the database write performance - // under normal operation, but requires a full database re-sync during recovery. - NoFreelistSync bool - - // Open database in read-only mode. Uses flock(..., LOCK_SH |LOCK_NB) to - // grab a shared lock (UNIX). - ReadOnly bool - - // Sets the DB.MmapFlags flag before memory mapping the file. - MmapFlags int - - // InitialMmapSize is the initial mmap size of the database - // in bytes. Read transactions won't block write transaction - // if the InitialMmapSize is large enough to hold database mmap - // size. (See DB.Begin for more information) - // - // If <=0, the initial map size is 0. - // If initialMmapSize is smaller than the previous database size, - // it takes no effect. - InitialMmapSize int - - // PageSize overrides the default OS page size. - PageSize int - - // NoSync sets the initial value of DB.NoSync. Normally this can just be - // set directly on the DB itself when returned from Open(), but this option - // is useful in APIs which expose Options but not the underlying DB. - NoSync bool -} - -// DefaultOptions represent the options used if nil options are passed into Open(). -// No timeout is used which will cause Bolt to wait indefinitely for a lock. -var DefaultOptions = &Options{ - Timeout: 0, - NoGrowSync: false, -} - -// Stats represents statistics about the database. -type Stats struct { - // Freelist stats - FreePageN int // total number of free pages on the freelist - PendingPageN int // total number of pending pages on the freelist - FreeAlloc int // total bytes allocated in free pages - FreelistInuse int // total bytes used by the freelist - - // Transaction stats - TxN int // total number of started read transactions - OpenTxN int // number of currently open read transactions - - TxStats TxStats // global, ongoing stats. -} - -// Sub calculates and returns the difference between two sets of database stats. -// This is useful when obtaining stats at two different points and time and -// you need the performance counters that occurred within that time span. -func (s *Stats) Sub(other *Stats) Stats { - if other == nil { - return *s - } - var diff Stats - diff.FreePageN = s.FreePageN - diff.PendingPageN = s.PendingPageN - diff.FreeAlloc = s.FreeAlloc - diff.FreelistInuse = s.FreelistInuse - diff.TxN = s.TxN - other.TxN - diff.TxStats = s.TxStats.Sub(&other.TxStats) - return diff -} - -type Info struct { - Data uintptr - PageSize int -} - -type meta struct { - magic uint32 - version uint32 - pageSize uint32 - flags uint32 - root bucket - freelist pgid - pgid pgid - txid txid - checksum uint64 -} - -// validate checks the marker bytes and version of the meta page to ensure it matches this binary. -func (m *meta) validate() error { - if m.magic != magic { - return ErrInvalid - } else if m.version != version { - return ErrVersionMismatch - } else if m.checksum != 0 && m.checksum != m.sum64() { - return ErrChecksum - } - return nil -} - -// copy copies one meta object to another. -func (m *meta) copy(dest *meta) { - *dest = *m -} - -// write writes the meta onto a page. -func (m *meta) write(p *page) { - if m.root.root >= m.pgid { - panic(fmt.Sprintf("root bucket pgid (%d) above high water mark (%d)", m.root.root, m.pgid)) - } else if m.freelist >= m.pgid && m.freelist != pgidNoFreelist { - // TODO: reject pgidNoFreeList if !NoFreelistSync - panic(fmt.Sprintf("freelist pgid (%d) above high water mark (%d)", m.freelist, m.pgid)) - } - - // Page id is either going to be 0 or 1 which we can determine by the transaction ID. - p.id = pgid(m.txid % 2) - p.flags |= metaPageFlag - - // Calculate the checksum. - m.checksum = m.sum64() - - m.copy(p.meta()) -} - -// generates the checksum for the meta. -func (m *meta) sum64() uint64 { - var h = fnv.New64a() - _, _ = h.Write((*[unsafe.Offsetof(meta{}.checksum)]byte)(unsafe.Pointer(m))[:]) - return h.Sum64() -} - -// _assert will panic with a given formatted message if the given condition is false. -func _assert(condition bool, msg string, v ...interface{}) { - if !condition { - panic(fmt.Sprintf("assertion failed: "+msg, v...)) - } -} diff --git a/vendor/github.com/coreos/bbolt/doc.go b/vendor/github.com/coreos/bbolt/doc.go deleted file mode 100644 index cc937845d..000000000 --- a/vendor/github.com/coreos/bbolt/doc.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Package bolt implements a low-level key/value store in pure Go. It supports -fully serializable transactions, ACID semantics, and lock-free MVCC with -multiple readers and a single writer. Bolt can be used for projects that -want a simple data store without the need to add large dependencies such as -Postgres or MySQL. - -Bolt is a single-level, zero-copy, B+tree data store. This means that Bolt is -optimized for fast read access and does not require recovery in the event of a -system crash. Transactions which have not finished committing will simply be -rolled back in the event of a crash. - -The design of Bolt is based on Howard Chu's LMDB database project. - -Bolt currently works on Windows, Mac OS X, and Linux. - - -Basics - -There are only a few types in Bolt: DB, Bucket, Tx, and Cursor. The DB is -a collection of buckets and is represented by a single file on disk. A bucket is -a collection of unique keys that are associated with values. - -Transactions provide either read-only or read-write access to the database. -Read-only transactions can retrieve key/value pairs and can use Cursors to -iterate over the dataset sequentially. Read-write transactions can create and -delete buckets and can insert and remove keys. Only one read-write transaction -is allowed at a time. - - -Caveats - -The database uses a read-only, memory-mapped data file to ensure that -applications cannot corrupt the database, however, this means that keys and -values returned from Bolt cannot be changed. Writing to a read-only byte slice -will cause Go to panic. - -Keys and values retrieved from the database are only valid for the life of -the transaction. When used outside the transaction, these byte slices can -point to different data or can point to invalid memory which will cause a panic. - - -*/ -package bolt diff --git a/vendor/github.com/coreos/bbolt/errors.go b/vendor/github.com/coreos/bbolt/errors.go deleted file mode 100644 index a3620a3eb..000000000 --- a/vendor/github.com/coreos/bbolt/errors.go +++ /dev/null @@ -1,71 +0,0 @@ -package bolt - -import "errors" - -// These errors can be returned when opening or calling methods on a DB. -var ( - // ErrDatabaseNotOpen is returned when a DB instance is accessed before it - // is opened or after it is closed. - ErrDatabaseNotOpen = errors.New("database not open") - - // ErrDatabaseOpen is returned when opening a database that is - // already open. - ErrDatabaseOpen = errors.New("database already open") - - // ErrInvalid is returned when both meta pages on a database are invalid. - // This typically occurs when a file is not a bolt database. - ErrInvalid = errors.New("invalid database") - - // ErrVersionMismatch is returned when the data file was created with a - // different version of Bolt. - ErrVersionMismatch = errors.New("version mismatch") - - // ErrChecksum is returned when either meta page checksum does not match. - ErrChecksum = errors.New("checksum error") - - // ErrTimeout is returned when a database cannot obtain an exclusive lock - // on the data file after the timeout passed to Open(). - ErrTimeout = errors.New("timeout") -) - -// These errors can occur when beginning or committing a Tx. -var ( - // ErrTxNotWritable is returned when performing a write operation on a - // read-only transaction. - ErrTxNotWritable = errors.New("tx not writable") - - // ErrTxClosed is returned when committing or rolling back a transaction - // that has already been committed or rolled back. - ErrTxClosed = errors.New("tx closed") - - // ErrDatabaseReadOnly is returned when a mutating transaction is started on a - // read-only database. - ErrDatabaseReadOnly = errors.New("database is in read-only mode") -) - -// These errors can occur when putting or deleting a value or a bucket. -var ( - // ErrBucketNotFound is returned when trying to access a bucket that has - // not been created yet. - ErrBucketNotFound = errors.New("bucket not found") - - // ErrBucketExists is returned when creating a bucket that already exists. - ErrBucketExists = errors.New("bucket already exists") - - // ErrBucketNameRequired is returned when creating a bucket with a blank name. - ErrBucketNameRequired = errors.New("bucket name required") - - // ErrKeyRequired is returned when inserting a zero-length key. - ErrKeyRequired = errors.New("key required") - - // ErrKeyTooLarge is returned when inserting a key that is larger than MaxKeySize. - ErrKeyTooLarge = errors.New("key too large") - - // ErrValueTooLarge is returned when inserting a value that is larger than MaxValueSize. - ErrValueTooLarge = errors.New("value too large") - - // ErrIncompatibleValue is returned when trying create or delete a bucket - // on an existing non-bucket key or when trying to create or delete a - // non-bucket key on an existing bucket key. - ErrIncompatibleValue = errors.New("incompatible value") -) diff --git a/vendor/github.com/coreos/bbolt/freelist.go b/vendor/github.com/coreos/bbolt/freelist.go deleted file mode 100644 index 266f15429..000000000 --- a/vendor/github.com/coreos/bbolt/freelist.go +++ /dev/null @@ -1,333 +0,0 @@ -package bolt - -import ( - "fmt" - "sort" - "unsafe" -) - -// txPending holds a list of pgids and corresponding allocation txns -// that are pending to be freed. -type txPending struct { - ids []pgid - alloctx []txid // txids allocating the ids - lastReleaseBegin txid // beginning txid of last matching releaseRange -} - -// freelist represents a list of all pages that are available for allocation. -// It also tracks pages that have been freed but are still in use by open transactions. -type freelist struct { - ids []pgid // all free and available free page ids. - allocs map[pgid]txid // mapping of txid that allocated a pgid. - pending map[txid]*txPending // mapping of soon-to-be free page ids by tx. - cache map[pgid]bool // fast lookup of all free and pending page ids. -} - -// newFreelist returns an empty, initialized freelist. -func newFreelist() *freelist { - return &freelist{ - allocs: make(map[pgid]txid), - pending: make(map[txid]*txPending), - cache: make(map[pgid]bool), - } -} - -// size returns the size of the page after serialization. -func (f *freelist) size() int { - n := f.count() - if n >= 0xFFFF { - // The first element will be used to store the count. See freelist.write. - n++ - } - return pageHeaderSize + (int(unsafe.Sizeof(pgid(0))) * n) -} - -// count returns count of pages on the freelist -func (f *freelist) count() int { - return f.free_count() + f.pending_count() -} - -// free_count returns count of free pages -func (f *freelist) free_count() int { - return len(f.ids) -} - -// pending_count returns count of pending pages -func (f *freelist) pending_count() int { - var count int - for _, txp := range f.pending { - count += len(txp.ids) - } - return count -} - -// copyall copies into dst a list of all free ids and all pending ids in one sorted list. -// f.count returns the minimum length required for dst. -func (f *freelist) copyall(dst []pgid) { - m := make(pgids, 0, f.pending_count()) - for _, txp := range f.pending { - m = append(m, txp.ids...) - } - sort.Sort(m) - mergepgids(dst, f.ids, m) -} - -// allocate returns the starting page id of a contiguous list of pages of a given size. -// If a contiguous block cannot be found then 0 is returned. -func (f *freelist) allocate(txid txid, n int) pgid { - if len(f.ids) == 0 { - return 0 - } - - var initial, previd pgid - for i, id := range f.ids { - if id <= 1 { - panic(fmt.Sprintf("invalid page allocation: %d", id)) - } - - // Reset initial page if this is not contiguous. - if previd == 0 || id-previd != 1 { - initial = id - } - - // If we found a contiguous block then remove it and return it. - if (id-initial)+1 == pgid(n) { - // If we're allocating off the beginning then take the fast path - // and just adjust the existing slice. This will use extra memory - // temporarily but the append() in free() will realloc the slice - // as is necessary. - if (i + 1) == n { - f.ids = f.ids[i+1:] - } else { - copy(f.ids[i-n+1:], f.ids[i+1:]) - f.ids = f.ids[:len(f.ids)-n] - } - - // Remove from the free cache. - for i := pgid(0); i < pgid(n); i++ { - delete(f.cache, initial+i) - } - f.allocs[initial] = txid - return initial - } - - previd = id - } - return 0 -} - -// free releases a page and its overflow for a given transaction id. -// If the page is already free then a panic will occur. -func (f *freelist) free(txid txid, p *page) { - if p.id <= 1 { - panic(fmt.Sprintf("cannot free page 0 or 1: %d", p.id)) - } - - // Free page and all its overflow pages. - txp := f.pending[txid] - if txp == nil { - txp = &txPending{} - f.pending[txid] = txp - } - allocTxid, ok := f.allocs[p.id] - if ok { - delete(f.allocs, p.id) - } else if (p.flags & freelistPageFlag) != 0 { - // Freelist is always allocated by prior tx. - allocTxid = txid - 1 - } - - for id := p.id; id <= p.id+pgid(p.overflow); id++ { - // Verify that page is not already free. - if f.cache[id] { - panic(fmt.Sprintf("page %d already freed", id)) - } - // Add to the freelist and cache. - txp.ids = append(txp.ids, id) - txp.alloctx = append(txp.alloctx, allocTxid) - f.cache[id] = true - } -} - -// release moves all page ids for a transaction id (or older) to the freelist. -func (f *freelist) release(txid txid) { - m := make(pgids, 0) - for tid, txp := range f.pending { - if tid <= txid { - // Move transaction's pending pages to the available freelist. - // Don't remove from the cache since the page is still free. - m = append(m, txp.ids...) - delete(f.pending, tid) - } - } - sort.Sort(m) - f.ids = pgids(f.ids).merge(m) -} - -// releaseRange moves pending pages allocated within an extent [begin,end] to the free list. -func (f *freelist) releaseRange(begin, end txid) { - if begin > end { - return - } - var m pgids - for tid, txp := range f.pending { - if tid < begin || tid > end { - continue - } - // Don't recompute freed pages if ranges haven't updated. - if txp.lastReleaseBegin == begin { - continue - } - for i := 0; i < len(txp.ids); i++ { - if atx := txp.alloctx[i]; atx < begin || atx > end { - continue - } - m = append(m, txp.ids[i]) - txp.ids[i] = txp.ids[len(txp.ids)-1] - txp.ids = txp.ids[:len(txp.ids)-1] - txp.alloctx[i] = txp.alloctx[len(txp.alloctx)-1] - txp.alloctx = txp.alloctx[:len(txp.alloctx)-1] - i-- - } - txp.lastReleaseBegin = begin - if len(txp.ids) == 0 { - delete(f.pending, tid) - } - } - sort.Sort(m) - f.ids = pgids(f.ids).merge(m) -} - -// rollback removes the pages from a given pending tx. -func (f *freelist) rollback(txid txid) { - // Remove page ids from cache. - txp := f.pending[txid] - if txp == nil { - return - } - var m pgids - for i, pgid := range txp.ids { - delete(f.cache, pgid) - tx := txp.alloctx[i] - if tx == 0 { - continue - } - if tx != txid { - // Pending free aborted; restore page back to alloc list. - f.allocs[pgid] = tx - } else { - // Freed page was allocated by this txn; OK to throw away. - m = append(m, pgid) - } - } - // Remove pages from pending list and mark as free if allocated by txid. - delete(f.pending, txid) - sort.Sort(m) - f.ids = pgids(f.ids).merge(m) -} - -// freed returns whether a given page is in the free list. -func (f *freelist) freed(pgid pgid) bool { - return f.cache[pgid] -} - -// read initializes the freelist from a freelist page. -func (f *freelist) read(p *page) { - if (p.flags & freelistPageFlag) == 0 { - panic(fmt.Sprintf("invalid freelist page: %d, page type is %s", p.id, p.typ())) - } - // If the page.count is at the max uint16 value (64k) then it's considered - // an overflow and the size of the freelist is stored as the first element. - idx, count := 0, int(p.count) - if count == 0xFFFF { - idx = 1 - count = int(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[0]) - } - - // Copy the list of page ids from the freelist. - if count == 0 { - f.ids = nil - } else { - ids := ((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[idx : idx+count] - f.ids = make([]pgid, len(ids)) - copy(f.ids, ids) - - // Make sure they're sorted. - sort.Sort(pgids(f.ids)) - } - - // Rebuild the page cache. - f.reindex() -} - -// read initializes the freelist from a given list of ids. -func (f *freelist) readIDs(ids []pgid) { - f.ids = ids - f.reindex() -} - -// write writes the page ids onto a freelist page. All free and pending ids are -// saved to disk since in the event of a program crash, all pending ids will -// become free. -func (f *freelist) write(p *page) error { - // Combine the old free pgids and pgids waiting on an open transaction. - - // Update the header flag. - p.flags |= freelistPageFlag - - // The page.count can only hold up to 64k elements so if we overflow that - // number then we handle it by putting the size in the first element. - lenids := f.count() - if lenids == 0 { - p.count = uint16(lenids) - } else if lenids < 0xFFFF { - p.count = uint16(lenids) - f.copyall(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[:]) - } else { - p.count = 0xFFFF - ((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[0] = pgid(lenids) - f.copyall(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[1:]) - } - - return nil -} - -// reload reads the freelist from a page and filters out pending items. -func (f *freelist) reload(p *page) { - f.read(p) - - // Build a cache of only pending pages. - pcache := make(map[pgid]bool) - for _, txp := range f.pending { - for _, pendingID := range txp.ids { - pcache[pendingID] = true - } - } - - // Check each page in the freelist and build a new available freelist - // with any pages not in the pending lists. - var a []pgid - for _, id := range f.ids { - if !pcache[id] { - a = append(a, id) - } - } - f.ids = a - - // Once the available list is rebuilt then rebuild the free cache so that - // it includes the available and pending free pages. - f.reindex() -} - -// reindex rebuilds the free cache based on available and pending free lists. -func (f *freelist) reindex() { - f.cache = make(map[pgid]bool, len(f.ids)) - for _, id := range f.ids { - f.cache[id] = true - } - for _, txp := range f.pending { - for _, pendingID := range txp.ids { - f.cache[pendingID] = true - } - } -} diff --git a/vendor/github.com/coreos/bbolt/node.go b/vendor/github.com/coreos/bbolt/node.go deleted file mode 100644 index f4ce240ed..000000000 --- a/vendor/github.com/coreos/bbolt/node.go +++ /dev/null @@ -1,604 +0,0 @@ -package bolt - -import ( - "bytes" - "fmt" - "sort" - "unsafe" -) - -// node represents an in-memory, deserialized page. -type node struct { - bucket *Bucket - isLeaf bool - unbalanced bool - spilled bool - key []byte - pgid pgid - parent *node - children nodes - inodes inodes -} - -// root returns the top-level node this node is attached to. -func (n *node) root() *node { - if n.parent == nil { - return n - } - return n.parent.root() -} - -// minKeys returns the minimum number of inodes this node should have. -func (n *node) minKeys() int { - if n.isLeaf { - return 1 - } - return 2 -} - -// size returns the size of the node after serialization. -func (n *node) size() int { - sz, elsz := pageHeaderSize, n.pageElementSize() - for i := 0; i < len(n.inodes); i++ { - item := &n.inodes[i] - sz += elsz + len(item.key) + len(item.value) - } - return sz -} - -// sizeLessThan returns true if the node is less than a given size. -// This is an optimization to avoid calculating a large node when we only need -// to know if it fits inside a certain page size. -func (n *node) sizeLessThan(v int) bool { - sz, elsz := pageHeaderSize, n.pageElementSize() - for i := 0; i < len(n.inodes); i++ { - item := &n.inodes[i] - sz += elsz + len(item.key) + len(item.value) - if sz >= v { - return false - } - } - return true -} - -// pageElementSize returns the size of each page element based on the type of node. -func (n *node) pageElementSize() int { - if n.isLeaf { - return leafPageElementSize - } - return branchPageElementSize -} - -// childAt returns the child node at a given index. -func (n *node) childAt(index int) *node { - if n.isLeaf { - panic(fmt.Sprintf("invalid childAt(%d) on a leaf node", index)) - } - return n.bucket.node(n.inodes[index].pgid, n) -} - -// childIndex returns the index of a given child node. -func (n *node) childIndex(child *node) int { - index := sort.Search(len(n.inodes), func(i int) bool { return bytes.Compare(n.inodes[i].key, child.key) != -1 }) - return index -} - -// numChildren returns the number of children. -func (n *node) numChildren() int { - return len(n.inodes) -} - -// nextSibling returns the next node with the same parent. -func (n *node) nextSibling() *node { - if n.parent == nil { - return nil - } - index := n.parent.childIndex(n) - if index >= n.parent.numChildren()-1 { - return nil - } - return n.parent.childAt(index + 1) -} - -// prevSibling returns the previous node with the same parent. -func (n *node) prevSibling() *node { - if n.parent == nil { - return nil - } - index := n.parent.childIndex(n) - if index == 0 { - return nil - } - return n.parent.childAt(index - 1) -} - -// put inserts a key/value. -func (n *node) put(oldKey, newKey, value []byte, pgid pgid, flags uint32) { - if pgid >= n.bucket.tx.meta.pgid { - panic(fmt.Sprintf("pgid (%d) above high water mark (%d)", pgid, n.bucket.tx.meta.pgid)) - } else if len(oldKey) <= 0 { - panic("put: zero-length old key") - } else if len(newKey) <= 0 { - panic("put: zero-length new key") - } - - // Find insertion index. - index := sort.Search(len(n.inodes), func(i int) bool { return bytes.Compare(n.inodes[i].key, oldKey) != -1 }) - - // Add capacity and shift nodes if we don't have an exact match and need to insert. - exact := (len(n.inodes) > 0 && index < len(n.inodes) && bytes.Equal(n.inodes[index].key, oldKey)) - if !exact { - n.inodes = append(n.inodes, inode{}) - copy(n.inodes[index+1:], n.inodes[index:]) - } - - inode := &n.inodes[index] - inode.flags = flags - inode.key = newKey - inode.value = value - inode.pgid = pgid - _assert(len(inode.key) > 0, "put: zero-length inode key") -} - -// del removes a key from the node. -func (n *node) del(key []byte) { - // Find index of key. - index := sort.Search(len(n.inodes), func(i int) bool { return bytes.Compare(n.inodes[i].key, key) != -1 }) - - // Exit if the key isn't found. - if index >= len(n.inodes) || !bytes.Equal(n.inodes[index].key, key) { - return - } - - // Delete inode from the node. - n.inodes = append(n.inodes[:index], n.inodes[index+1:]...) - - // Mark the node as needing rebalancing. - n.unbalanced = true -} - -// read initializes the node from a page. -func (n *node) read(p *page) { - n.pgid = p.id - n.isLeaf = ((p.flags & leafPageFlag) != 0) - n.inodes = make(inodes, int(p.count)) - - for i := 0; i < int(p.count); i++ { - inode := &n.inodes[i] - if n.isLeaf { - elem := p.leafPageElement(uint16(i)) - inode.flags = elem.flags - inode.key = elem.key() - inode.value = elem.value() - } else { - elem := p.branchPageElement(uint16(i)) - inode.pgid = elem.pgid - inode.key = elem.key() - } - _assert(len(inode.key) > 0, "read: zero-length inode key") - } - - // Save first key so we can find the node in the parent when we spill. - if len(n.inodes) > 0 { - n.key = n.inodes[0].key - _assert(len(n.key) > 0, "read: zero-length node key") - } else { - n.key = nil - } -} - -// write writes the items onto one or more pages. -func (n *node) write(p *page) { - // Initialize page. - if n.isLeaf { - p.flags |= leafPageFlag - } else { - p.flags |= branchPageFlag - } - - if len(n.inodes) >= 0xFFFF { - panic(fmt.Sprintf("inode overflow: %d (pgid=%d)", len(n.inodes), p.id)) - } - p.count = uint16(len(n.inodes)) - - // Stop here if there are no items to write. - if p.count == 0 { - return - } - - // Loop over each item and write it to the page. - b := (*[maxAllocSize]byte)(unsafe.Pointer(&p.ptr))[n.pageElementSize()*len(n.inodes):] - for i, item := range n.inodes { - _assert(len(item.key) > 0, "write: zero-length inode key") - - // Write the page element. - if n.isLeaf { - elem := p.leafPageElement(uint16(i)) - elem.pos = uint32(uintptr(unsafe.Pointer(&b[0])) - uintptr(unsafe.Pointer(elem))) - elem.flags = item.flags - elem.ksize = uint32(len(item.key)) - elem.vsize = uint32(len(item.value)) - } else { - elem := p.branchPageElement(uint16(i)) - elem.pos = uint32(uintptr(unsafe.Pointer(&b[0])) - uintptr(unsafe.Pointer(elem))) - elem.ksize = uint32(len(item.key)) - elem.pgid = item.pgid - _assert(elem.pgid != p.id, "write: circular dependency occurred") - } - - // If the length of key+value is larger than the max allocation size - // then we need to reallocate the byte array pointer. - // - // See: https://github.com/boltdb/bolt/pull/335 - klen, vlen := len(item.key), len(item.value) - if len(b) < klen+vlen { - b = (*[maxAllocSize]byte)(unsafe.Pointer(&b[0]))[:] - } - - // Write data for the element to the end of the page. - copy(b[0:], item.key) - b = b[klen:] - copy(b[0:], item.value) - b = b[vlen:] - } - - // DEBUG ONLY: n.dump() -} - -// split breaks up a node into multiple smaller nodes, if appropriate. -// This should only be called from the spill() function. -func (n *node) split(pageSize int) []*node { - var nodes []*node - - node := n - for { - // Split node into two. - a, b := node.splitTwo(pageSize) - nodes = append(nodes, a) - - // If we can't split then exit the loop. - if b == nil { - break - } - - // Set node to b so it gets split on the next iteration. - node = b - } - - return nodes -} - -// splitTwo breaks up a node into two smaller nodes, if appropriate. -// This should only be called from the split() function. -func (n *node) splitTwo(pageSize int) (*node, *node) { - // Ignore the split if the page doesn't have at least enough nodes for - // two pages or if the nodes can fit in a single page. - if len(n.inodes) <= (minKeysPerPage*2) || n.sizeLessThan(pageSize) { - return n, nil - } - - // Determine the threshold before starting a new node. - var fillPercent = n.bucket.FillPercent - if fillPercent < minFillPercent { - fillPercent = minFillPercent - } else if fillPercent > maxFillPercent { - fillPercent = maxFillPercent - } - threshold := int(float64(pageSize) * fillPercent) - - // Determine split position and sizes of the two pages. - splitIndex, _ := n.splitIndex(threshold) - - // Split node into two separate nodes. - // If there's no parent then we'll need to create one. - if n.parent == nil { - n.parent = &node{bucket: n.bucket, children: []*node{n}} - } - - // Create a new node and add it to the parent. - next := &node{bucket: n.bucket, isLeaf: n.isLeaf, parent: n.parent} - n.parent.children = append(n.parent.children, next) - - // Split inodes across two nodes. - next.inodes = n.inodes[splitIndex:] - n.inodes = n.inodes[:splitIndex] - - // Update the statistics. - n.bucket.tx.stats.Split++ - - return n, next -} - -// splitIndex finds the position where a page will fill a given threshold. -// It returns the index as well as the size of the first page. -// This is only be called from split(). -func (n *node) splitIndex(threshold int) (index, sz int) { - sz = pageHeaderSize - - // Loop until we only have the minimum number of keys required for the second page. - for i := 0; i < len(n.inodes)-minKeysPerPage; i++ { - index = i - inode := n.inodes[i] - elsize := n.pageElementSize() + len(inode.key) + len(inode.value) - - // If we have at least the minimum number of keys and adding another - // node would put us over the threshold then exit and return. - if i >= minKeysPerPage && sz+elsize > threshold { - break - } - - // Add the element size to the total size. - sz += elsize - } - - return -} - -// spill writes the nodes to dirty pages and splits nodes as it goes. -// Returns an error if dirty pages cannot be allocated. -func (n *node) spill() error { - var tx = n.bucket.tx - if n.spilled { - return nil - } - - // Spill child nodes first. Child nodes can materialize sibling nodes in - // the case of split-merge so we cannot use a range loop. We have to check - // the children size on every loop iteration. - sort.Sort(n.children) - for i := 0; i < len(n.children); i++ { - if err := n.children[i].spill(); err != nil { - return err - } - } - - // We no longer need the child list because it's only used for spill tracking. - n.children = nil - - // Split nodes into appropriate sizes. The first node will always be n. - var nodes = n.split(tx.db.pageSize) - for _, node := range nodes { - // Add node's page to the freelist if it's not new. - if node.pgid > 0 { - tx.db.freelist.free(tx.meta.txid, tx.page(node.pgid)) - node.pgid = 0 - } - - // Allocate contiguous space for the node. - p, err := tx.allocate((node.size() + tx.db.pageSize - 1) / tx.db.pageSize) - if err != nil { - return err - } - - // Write the node. - if p.id >= tx.meta.pgid { - panic(fmt.Sprintf("pgid (%d) above high water mark (%d)", p.id, tx.meta.pgid)) - } - node.pgid = p.id - node.write(p) - node.spilled = true - - // Insert into parent inodes. - if node.parent != nil { - var key = node.key - if key == nil { - key = node.inodes[0].key - } - - node.parent.put(key, node.inodes[0].key, nil, node.pgid, 0) - node.key = node.inodes[0].key - _assert(len(node.key) > 0, "spill: zero-length node key") - } - - // Update the statistics. - tx.stats.Spill++ - } - - // If the root node split and created a new root then we need to spill that - // as well. We'll clear out the children to make sure it doesn't try to respill. - if n.parent != nil && n.parent.pgid == 0 { - n.children = nil - return n.parent.spill() - } - - return nil -} - -// rebalance attempts to combine the node with sibling nodes if the node fill -// size is below a threshold or if there are not enough keys. -func (n *node) rebalance() { - if !n.unbalanced { - return - } - n.unbalanced = false - - // Update statistics. - n.bucket.tx.stats.Rebalance++ - - // Ignore if node is above threshold (25%) and has enough keys. - var threshold = n.bucket.tx.db.pageSize / 4 - if n.size() > threshold && len(n.inodes) > n.minKeys() { - return - } - - // Root node has special handling. - if n.parent == nil { - // If root node is a branch and only has one node then collapse it. - if !n.isLeaf && len(n.inodes) == 1 { - // Move root's child up. - child := n.bucket.node(n.inodes[0].pgid, n) - n.isLeaf = child.isLeaf - n.inodes = child.inodes[:] - n.children = child.children - - // Reparent all child nodes being moved. - for _, inode := range n.inodes { - if child, ok := n.bucket.nodes[inode.pgid]; ok { - child.parent = n - } - } - - // Remove old child. - child.parent = nil - delete(n.bucket.nodes, child.pgid) - child.free() - } - - return - } - - // If node has no keys then just remove it. - if n.numChildren() == 0 { - n.parent.del(n.key) - n.parent.removeChild(n) - delete(n.bucket.nodes, n.pgid) - n.free() - n.parent.rebalance() - return - } - - _assert(n.parent.numChildren() > 1, "parent must have at least 2 children") - - // Destination node is right sibling if idx == 0, otherwise left sibling. - var target *node - var useNextSibling = (n.parent.childIndex(n) == 0) - if useNextSibling { - target = n.nextSibling() - } else { - target = n.prevSibling() - } - - // If both this node and the target node are too small then merge them. - if useNextSibling { - // Reparent all child nodes being moved. - for _, inode := range target.inodes { - if child, ok := n.bucket.nodes[inode.pgid]; ok { - child.parent.removeChild(child) - child.parent = n - child.parent.children = append(child.parent.children, child) - } - } - - // Copy over inodes from target and remove target. - n.inodes = append(n.inodes, target.inodes...) - n.parent.del(target.key) - n.parent.removeChild(target) - delete(n.bucket.nodes, target.pgid) - target.free() - } else { - // Reparent all child nodes being moved. - for _, inode := range n.inodes { - if child, ok := n.bucket.nodes[inode.pgid]; ok { - child.parent.removeChild(child) - child.parent = target - child.parent.children = append(child.parent.children, child) - } - } - - // Copy over inodes to target and remove node. - target.inodes = append(target.inodes, n.inodes...) - n.parent.del(n.key) - n.parent.removeChild(n) - delete(n.bucket.nodes, n.pgid) - n.free() - } - - // Either this node or the target node was deleted from the parent so rebalance it. - n.parent.rebalance() -} - -// removes a node from the list of in-memory children. -// This does not affect the inodes. -func (n *node) removeChild(target *node) { - for i, child := range n.children { - if child == target { - n.children = append(n.children[:i], n.children[i+1:]...) - return - } - } -} - -// dereference causes the node to copy all its inode key/value references to heap memory. -// This is required when the mmap is reallocated so inodes are not pointing to stale data. -func (n *node) dereference() { - if n.key != nil { - key := make([]byte, len(n.key)) - copy(key, n.key) - n.key = key - _assert(n.pgid == 0 || len(n.key) > 0, "dereference: zero-length node key on existing node") - } - - for i := range n.inodes { - inode := &n.inodes[i] - - key := make([]byte, len(inode.key)) - copy(key, inode.key) - inode.key = key - _assert(len(inode.key) > 0, "dereference: zero-length inode key") - - value := make([]byte, len(inode.value)) - copy(value, inode.value) - inode.value = value - } - - // Recursively dereference children. - for _, child := range n.children { - child.dereference() - } - - // Update statistics. - n.bucket.tx.stats.NodeDeref++ -} - -// free adds the node's underlying page to the freelist. -func (n *node) free() { - if n.pgid != 0 { - n.bucket.tx.db.freelist.free(n.bucket.tx.meta.txid, n.bucket.tx.page(n.pgid)) - n.pgid = 0 - } -} - -// dump writes the contents of the node to STDERR for debugging purposes. -/* -func (n *node) dump() { - // Write node header. - var typ = "branch" - if n.isLeaf { - typ = "leaf" - } - warnf("[NODE %d {type=%s count=%d}]", n.pgid, typ, len(n.inodes)) - - // Write out abbreviated version of each item. - for _, item := range n.inodes { - if n.isLeaf { - if item.flags&bucketLeafFlag != 0 { - bucket := (*bucket)(unsafe.Pointer(&item.value[0])) - warnf("+L %08x -> (bucket root=%d)", trunc(item.key, 4), bucket.root) - } else { - warnf("+L %08x -> %08x", trunc(item.key, 4), trunc(item.value, 4)) - } - } else { - warnf("+B %08x -> pgid=%d", trunc(item.key, 4), item.pgid) - } - } - warn("") -} -*/ - -type nodes []*node - -func (s nodes) Len() int { return len(s) } -func (s nodes) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s nodes) Less(i, j int) bool { return bytes.Compare(s[i].inodes[0].key, s[j].inodes[0].key) == -1 } - -// inode represents an internal node inside of a node. -// It can be used to point to elements in a page or point -// to an element which hasn't been added to a page yet. -type inode struct { - flags uint32 - pgid pgid - key []byte - value []byte -} - -type inodes []inode diff --git a/vendor/github.com/coreos/bbolt/page.go b/vendor/github.com/coreos/bbolt/page.go deleted file mode 100644 index cde403ae8..000000000 --- a/vendor/github.com/coreos/bbolt/page.go +++ /dev/null @@ -1,197 +0,0 @@ -package bolt - -import ( - "fmt" - "os" - "sort" - "unsafe" -) - -const pageHeaderSize = int(unsafe.Offsetof(((*page)(nil)).ptr)) - -const minKeysPerPage = 2 - -const branchPageElementSize = int(unsafe.Sizeof(branchPageElement{})) -const leafPageElementSize = int(unsafe.Sizeof(leafPageElement{})) - -const ( - branchPageFlag = 0x01 - leafPageFlag = 0x02 - metaPageFlag = 0x04 - freelistPageFlag = 0x10 -) - -const ( - bucketLeafFlag = 0x01 -) - -type pgid uint64 - -type page struct { - id pgid - flags uint16 - count uint16 - overflow uint32 - ptr uintptr -} - -// typ returns a human readable page type string used for debugging. -func (p *page) typ() string { - if (p.flags & branchPageFlag) != 0 { - return "branch" - } else if (p.flags & leafPageFlag) != 0 { - return "leaf" - } else if (p.flags & metaPageFlag) != 0 { - return "meta" - } else if (p.flags & freelistPageFlag) != 0 { - return "freelist" - } - return fmt.Sprintf("unknown<%02x>", p.flags) -} - -// meta returns a pointer to the metadata section of the page. -func (p *page) meta() *meta { - return (*meta)(unsafe.Pointer(&p.ptr)) -} - -// leafPageElement retrieves the leaf node by index -func (p *page) leafPageElement(index uint16) *leafPageElement { - n := &((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[index] - return n -} - -// leafPageElements retrieves a list of leaf nodes. -func (p *page) leafPageElements() []leafPageElement { - if p.count == 0 { - return nil - } - return ((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[:] -} - -// branchPageElement retrieves the branch node by index -func (p *page) branchPageElement(index uint16) *branchPageElement { - return &((*[0x7FFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[index] -} - -// branchPageElements retrieves a list of branch nodes. -func (p *page) branchPageElements() []branchPageElement { - if p.count == 0 { - return nil - } - return ((*[0x7FFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[:] -} - -// dump writes n bytes of the page to STDERR as hex output. -func (p *page) hexdump(n int) { - buf := (*[maxAllocSize]byte)(unsafe.Pointer(p))[:n] - fmt.Fprintf(os.Stderr, "%x\n", buf) -} - -type pages []*page - -func (s pages) Len() int { return len(s) } -func (s pages) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s pages) Less(i, j int) bool { return s[i].id < s[j].id } - -// branchPageElement represents a node on a branch page. -type branchPageElement struct { - pos uint32 - ksize uint32 - pgid pgid -} - -// key returns a byte slice of the node key. -func (n *branchPageElement) key() []byte { - buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) - return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos]))[:n.ksize] -} - -// leafPageElement represents a node on a leaf page. -type leafPageElement struct { - flags uint32 - pos uint32 - ksize uint32 - vsize uint32 -} - -// key returns a byte slice of the node key. -func (n *leafPageElement) key() []byte { - buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) - return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos]))[:n.ksize:n.ksize] -} - -// value returns a byte slice of the node value. -func (n *leafPageElement) value() []byte { - buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) - return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos+n.ksize]))[:n.vsize:n.vsize] -} - -// PageInfo represents human readable information about a page. -type PageInfo struct { - ID int - Type string - Count int - OverflowCount int -} - -type pgids []pgid - -func (s pgids) Len() int { return len(s) } -func (s pgids) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s pgids) Less(i, j int) bool { return s[i] < s[j] } - -// merge returns the sorted union of a and b. -func (a pgids) merge(b pgids) pgids { - // Return the opposite slice if one is nil. - if len(a) == 0 { - return b - } - if len(b) == 0 { - return a - } - merged := make(pgids, len(a)+len(b)) - mergepgids(merged, a, b) - return merged -} - -// mergepgids copies the sorted union of a and b into dst. -// If dst is too small, it panics. -func mergepgids(dst, a, b pgids) { - if len(dst) < len(a)+len(b) { - panic(fmt.Errorf("mergepgids bad len %d < %d + %d", len(dst), len(a), len(b))) - } - // Copy in the opposite slice if one is nil. - if len(a) == 0 { - copy(dst, b) - return - } - if len(b) == 0 { - copy(dst, a) - return - } - - // Merged will hold all elements from both lists. - merged := dst[:0] - - // Assign lead to the slice with a lower starting value, follow to the higher value. - lead, follow := a, b - if b[0] < a[0] { - lead, follow = b, a - } - - // Continue while there are elements in the lead. - for len(lead) > 0 { - // Merge largest prefix of lead that is ahead of follow[0]. - n := sort.Search(len(lead), func(i int) bool { return lead[i] > follow[0] }) - merged = append(merged, lead[:n]...) - if n >= len(lead) { - break - } - - // Swap lead and follow. - lead, follow = follow, lead[n:] - } - - // Append what's left in follow. - _ = append(merged, follow...) -} diff --git a/vendor/github.com/coreos/bbolt/tx.go b/vendor/github.com/coreos/bbolt/tx.go deleted file mode 100644 index aefcec09e..000000000 --- a/vendor/github.com/coreos/bbolt/tx.go +++ /dev/null @@ -1,705 +0,0 @@ -package bolt - -import ( - "fmt" - "io" - "os" - "sort" - "strings" - "time" - "unsafe" -) - -// txid represents the internal transaction identifier. -type txid uint64 - -// Tx represents a read-only or read/write transaction on the database. -// Read-only transactions can be used for retrieving values for keys and creating cursors. -// Read/write transactions can create and remove buckets and create and remove keys. -// -// IMPORTANT: You must commit or rollback transactions when you are done with -// them. Pages can not be reclaimed by the writer until no more transactions -// are using them. A long running read transaction can cause the database to -// quickly grow. -type Tx struct { - writable bool - managed bool - db *DB - meta *meta - root Bucket - pages map[pgid]*page - stats TxStats - commitHandlers []func() - - // WriteFlag specifies the flag for write-related methods like WriteTo(). - // Tx opens the database file with the specified flag to copy the data. - // - // By default, the flag is unset, which works well for mostly in-memory - // workloads. For databases that are much larger than available RAM, - // set the flag to syscall.O_DIRECT to avoid trashing the page cache. - WriteFlag int -} - -// init initializes the transaction. -func (tx *Tx) init(db *DB) { - tx.db = db - tx.pages = nil - - // Copy the meta page since it can be changed by the writer. - tx.meta = &meta{} - db.meta().copy(tx.meta) - - // Copy over the root bucket. - tx.root = newBucket(tx) - tx.root.bucket = &bucket{} - *tx.root.bucket = tx.meta.root - - // Increment the transaction id and add a page cache for writable transactions. - if tx.writable { - tx.pages = make(map[pgid]*page) - tx.meta.txid += txid(1) - } -} - -// ID returns the transaction id. -func (tx *Tx) ID() int { - return int(tx.meta.txid) -} - -// DB returns a reference to the database that created the transaction. -func (tx *Tx) DB() *DB { - return tx.db -} - -// Size returns current database size in bytes as seen by this transaction. -func (tx *Tx) Size() int64 { - return int64(tx.meta.pgid) * int64(tx.db.pageSize) -} - -// Writable returns whether the transaction can perform write operations. -func (tx *Tx) Writable() bool { - return tx.writable -} - -// Cursor creates a cursor associated with the root bucket. -// All items in the cursor will return a nil value because all root bucket keys point to buckets. -// The cursor is only valid as long as the transaction is open. -// Do not use a cursor after the transaction is closed. -func (tx *Tx) Cursor() *Cursor { - return tx.root.Cursor() -} - -// Stats retrieves a copy of the current transaction statistics. -func (tx *Tx) Stats() TxStats { - return tx.stats -} - -// Bucket retrieves a bucket by name. -// Returns nil if the bucket does not exist. -// The bucket instance is only valid for the lifetime of the transaction. -func (tx *Tx) Bucket(name []byte) *Bucket { - return tx.root.Bucket(name) -} - -// CreateBucket creates a new bucket. -// Returns an error if the bucket already exists, if the bucket name is blank, or if the bucket name is too long. -// The bucket instance is only valid for the lifetime of the transaction. -func (tx *Tx) CreateBucket(name []byte) (*Bucket, error) { - return tx.root.CreateBucket(name) -} - -// CreateBucketIfNotExists creates a new bucket if it doesn't already exist. -// Returns an error if the bucket name is blank, or if the bucket name is too long. -// The bucket instance is only valid for the lifetime of the transaction. -func (tx *Tx) CreateBucketIfNotExists(name []byte) (*Bucket, error) { - return tx.root.CreateBucketIfNotExists(name) -} - -// DeleteBucket deletes a bucket. -// Returns an error if the bucket cannot be found or if the key represents a non-bucket value. -func (tx *Tx) DeleteBucket(name []byte) error { - return tx.root.DeleteBucket(name) -} - -// ForEach executes a function for each bucket in the root. -// If the provided function returns an error then the iteration is stopped and -// the error is returned to the caller. -func (tx *Tx) ForEach(fn func(name []byte, b *Bucket) error) error { - return tx.root.ForEach(func(k, v []byte) error { - return fn(k, tx.root.Bucket(k)) - }) -} - -// OnCommit adds a handler function to be executed after the transaction successfully commits. -func (tx *Tx) OnCommit(fn func()) { - tx.commitHandlers = append(tx.commitHandlers, fn) -} - -// Commit writes all changes to disk and updates the meta page. -// Returns an error if a disk write error occurs, or if Commit is -// called on a read-only transaction. -func (tx *Tx) Commit() error { - _assert(!tx.managed, "managed tx commit not allowed") - if tx.db == nil { - return ErrTxClosed - } else if !tx.writable { - return ErrTxNotWritable - } - - // TODO(benbjohnson): Use vectorized I/O to write out dirty pages. - - // Rebalance nodes which have had deletions. - var startTime = time.Now() - tx.root.rebalance() - if tx.stats.Rebalance > 0 { - tx.stats.RebalanceTime += time.Since(startTime) - } - - // spill data onto dirty pages. - startTime = time.Now() - if err := tx.root.spill(); err != nil { - tx.rollback() - return err - } - tx.stats.SpillTime += time.Since(startTime) - - // Free the old root bucket. - tx.meta.root.root = tx.root.root - - // Free the old freelist because commit writes out a fresh freelist. - if tx.meta.freelist != pgidNoFreelist { - tx.db.freelist.free(tx.meta.txid, tx.db.page(tx.meta.freelist)) - } - - if !tx.db.NoFreelistSync { - err := tx.commitFreelist() - if err != nil { - return err - } - } else { - tx.meta.freelist = pgidNoFreelist - } - - // Write dirty pages to disk. - startTime = time.Now() - if err := tx.write(); err != nil { - tx.rollback() - return err - } - - // If strict mode is enabled then perform a consistency check. - // Only the first consistency error is reported in the panic. - if tx.db.StrictMode { - ch := tx.Check() - var errs []string - for { - err, ok := <-ch - if !ok { - break - } - errs = append(errs, err.Error()) - } - if len(errs) > 0 { - panic("check fail: " + strings.Join(errs, "\n")) - } - } - - // Write meta to disk. - if err := tx.writeMeta(); err != nil { - tx.rollback() - return err - } - tx.stats.WriteTime += time.Since(startTime) - - // Finalize the transaction. - tx.close() - - // Execute commit handlers now that the locks have been removed. - for _, fn := range tx.commitHandlers { - fn() - } - - return nil -} - -func (tx *Tx) commitFreelist() error { - // Allocate new pages for the new free list. This will overestimate - // the size of the freelist but not underestimate the size (which would be bad). - opgid := tx.meta.pgid - p, err := tx.allocate((tx.db.freelist.size() / tx.db.pageSize) + 1) - if err != nil { - tx.rollback() - return err - } - if err := tx.db.freelist.write(p); err != nil { - tx.rollback() - return err - } - tx.meta.freelist = p.id - // If the high water mark has moved up then attempt to grow the database. - if tx.meta.pgid > opgid { - if err := tx.db.grow(int(tx.meta.pgid+1) * tx.db.pageSize); err != nil { - tx.rollback() - return err - } - } - - return nil -} - -// Rollback closes the transaction and ignores all previous updates. Read-only -// transactions must be rolled back and not committed. -func (tx *Tx) Rollback() error { - _assert(!tx.managed, "managed tx rollback not allowed") - if tx.db == nil { - return ErrTxClosed - } - tx.rollback() - return nil -} - -func (tx *Tx) rollback() { - if tx.db == nil { - return - } - if tx.writable { - tx.db.freelist.rollback(tx.meta.txid) - tx.db.freelist.reload(tx.db.page(tx.db.meta().freelist)) - } - tx.close() -} - -func (tx *Tx) close() { - if tx.db == nil { - return - } - if tx.writable { - // Grab freelist stats. - var freelistFreeN = tx.db.freelist.free_count() - var freelistPendingN = tx.db.freelist.pending_count() - var freelistAlloc = tx.db.freelist.size() - - // Remove transaction ref & writer lock. - tx.db.rwtx = nil - tx.db.rwlock.Unlock() - - // Merge statistics. - tx.db.statlock.Lock() - tx.db.stats.FreePageN = freelistFreeN - tx.db.stats.PendingPageN = freelistPendingN - tx.db.stats.FreeAlloc = (freelistFreeN + freelistPendingN) * tx.db.pageSize - tx.db.stats.FreelistInuse = freelistAlloc - tx.db.stats.TxStats.add(&tx.stats) - tx.db.statlock.Unlock() - } else { - tx.db.removeTx(tx) - } - - // Clear all references. - tx.db = nil - tx.meta = nil - tx.root = Bucket{tx: tx} - tx.pages = nil -} - -// Copy writes the entire database to a writer. -// This function exists for backwards compatibility. Use WriteTo() instead. -func (tx *Tx) Copy(w io.Writer) error { - _, err := tx.WriteTo(w) - return err -} - -// WriteTo writes the entire database to a writer. -// If err == nil then exactly tx.Size() bytes will be written into the writer. -func (tx *Tx) WriteTo(w io.Writer) (n int64, err error) { - // Attempt to open reader with WriteFlag - f, err := os.OpenFile(tx.db.path, os.O_RDONLY|tx.WriteFlag, 0) - if err != nil { - return 0, err - } - defer func() { - if cerr := f.Close(); err == nil { - err = cerr - } - }() - - // Generate a meta page. We use the same page data for both meta pages. - buf := make([]byte, tx.db.pageSize) - page := (*page)(unsafe.Pointer(&buf[0])) - page.flags = metaPageFlag - *page.meta() = *tx.meta - - // Write meta 0. - page.id = 0 - page.meta().checksum = page.meta().sum64() - nn, err := w.Write(buf) - n += int64(nn) - if err != nil { - return n, fmt.Errorf("meta 0 copy: %s", err) - } - - // Write meta 1 with a lower transaction id. - page.id = 1 - page.meta().txid -= 1 - page.meta().checksum = page.meta().sum64() - nn, err = w.Write(buf) - n += int64(nn) - if err != nil { - return n, fmt.Errorf("meta 1 copy: %s", err) - } - - // Move past the meta pages in the file. - if _, err := f.Seek(int64(tx.db.pageSize*2), io.SeekStart); err != nil { - return n, fmt.Errorf("seek: %s", err) - } - - // Copy data pages. - wn, err := io.CopyN(w, f, tx.Size()-int64(tx.db.pageSize*2)) - n += wn - if err != nil { - return n, err - } - - return n, nil -} - -// CopyFile copies the entire database to file at the given path. -// A reader transaction is maintained during the copy so it is safe to continue -// using the database while a copy is in progress. -func (tx *Tx) CopyFile(path string, mode os.FileMode) error { - f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, mode) - if err != nil { - return err - } - - err = tx.Copy(f) - if err != nil { - _ = f.Close() - return err - } - return f.Close() -} - -// Check performs several consistency checks on the database for this transaction. -// An error is returned if any inconsistency is found. -// -// It can be safely run concurrently on a writable transaction. However, this -// incurs a high cost for large databases and databases with a lot of subbuckets -// because of caching. This overhead can be removed if running on a read-only -// transaction, however, it is not safe to execute other writer transactions at -// the same time. -func (tx *Tx) Check() <-chan error { - ch := make(chan error) - go tx.check(ch) - return ch -} - -func (tx *Tx) check(ch chan error) { - // Force loading free list if opened in ReadOnly mode. - tx.db.loadFreelist() - - // Check if any pages are double freed. - freed := make(map[pgid]bool) - all := make([]pgid, tx.db.freelist.count()) - tx.db.freelist.copyall(all) - for _, id := range all { - if freed[id] { - ch <- fmt.Errorf("page %d: already freed", id) - } - freed[id] = true - } - - // Track every reachable page. - reachable := make(map[pgid]*page) - reachable[0] = tx.page(0) // meta0 - reachable[1] = tx.page(1) // meta1 - if tx.meta.freelist != pgidNoFreelist { - for i := uint32(0); i <= tx.page(tx.meta.freelist).overflow; i++ { - reachable[tx.meta.freelist+pgid(i)] = tx.page(tx.meta.freelist) - } - } - - // Recursively check buckets. - tx.checkBucket(&tx.root, reachable, freed, ch) - - // Ensure all pages below high water mark are either reachable or freed. - for i := pgid(0); i < tx.meta.pgid; i++ { - _, isReachable := reachable[i] - if !isReachable && !freed[i] { - ch <- fmt.Errorf("page %d: unreachable unfreed", int(i)) - } - } - - // Close the channel to signal completion. - close(ch) -} - -func (tx *Tx) checkBucket(b *Bucket, reachable map[pgid]*page, freed map[pgid]bool, ch chan error) { - // Ignore inline buckets. - if b.root == 0 { - return - } - - // Check every page used by this bucket. - b.tx.forEachPage(b.root, 0, func(p *page, _ int) { - if p.id > tx.meta.pgid { - ch <- fmt.Errorf("page %d: out of bounds: %d", int(p.id), int(b.tx.meta.pgid)) - } - - // Ensure each page is only referenced once. - for i := pgid(0); i <= pgid(p.overflow); i++ { - var id = p.id + i - if _, ok := reachable[id]; ok { - ch <- fmt.Errorf("page %d: multiple references", int(id)) - } - reachable[id] = p - } - - // We should only encounter un-freed leaf and branch pages. - if freed[p.id] { - ch <- fmt.Errorf("page %d: reachable freed", int(p.id)) - } else if (p.flags&branchPageFlag) == 0 && (p.flags&leafPageFlag) == 0 { - ch <- fmt.Errorf("page %d: invalid type: %s", int(p.id), p.typ()) - } - }) - - // Check each bucket within this bucket. - _ = b.ForEach(func(k, v []byte) error { - if child := b.Bucket(k); child != nil { - tx.checkBucket(child, reachable, freed, ch) - } - return nil - }) -} - -// allocate returns a contiguous block of memory starting at a given page. -func (tx *Tx) allocate(count int) (*page, error) { - p, err := tx.db.allocate(tx.meta.txid, count) - if err != nil { - return nil, err - } - - // Save to our page cache. - tx.pages[p.id] = p - - // Update statistics. - tx.stats.PageCount++ - tx.stats.PageAlloc += count * tx.db.pageSize - - return p, nil -} - -// write writes any dirty pages to disk. -func (tx *Tx) write() error { - // Sort pages by id. - pages := make(pages, 0, len(tx.pages)) - for _, p := range tx.pages { - pages = append(pages, p) - } - // Clear out page cache early. - tx.pages = make(map[pgid]*page) - sort.Sort(pages) - - // Write pages to disk in order. - for _, p := range pages { - size := (int(p.overflow) + 1) * tx.db.pageSize - offset := int64(p.id) * int64(tx.db.pageSize) - - // Write out page in "max allocation" sized chunks. - ptr := (*[maxAllocSize]byte)(unsafe.Pointer(p)) - for { - // Limit our write to our max allocation size. - sz := size - if sz > maxAllocSize-1 { - sz = maxAllocSize - 1 - } - - // Write chunk to disk. - buf := ptr[:sz] - if _, err := tx.db.ops.writeAt(buf, offset); err != nil { - return err - } - - // Update statistics. - tx.stats.Write++ - - // Exit inner for loop if we've written all the chunks. - size -= sz - if size == 0 { - break - } - - // Otherwise move offset forward and move pointer to next chunk. - offset += int64(sz) - ptr = (*[maxAllocSize]byte)(unsafe.Pointer(&ptr[sz])) - } - } - - // Ignore file sync if flag is set on DB. - if !tx.db.NoSync || IgnoreNoSync { - if err := fdatasync(tx.db); err != nil { - return err - } - } - - // Put small pages back to page pool. - for _, p := range pages { - // Ignore page sizes over 1 page. - // These are allocated using make() instead of the page pool. - if int(p.overflow) != 0 { - continue - } - - buf := (*[maxAllocSize]byte)(unsafe.Pointer(p))[:tx.db.pageSize] - - // See https://go.googlesource.com/go/+/f03c9202c43e0abb130669852082117ca50aa9b1 - for i := range buf { - buf[i] = 0 - } - tx.db.pagePool.Put(buf) - } - - return nil -} - -// writeMeta writes the meta to the disk. -func (tx *Tx) writeMeta() error { - // Create a temporary buffer for the meta page. - buf := make([]byte, tx.db.pageSize) - p := tx.db.pageInBuffer(buf, 0) - tx.meta.write(p) - - // Write the meta page to file. - if _, err := tx.db.ops.writeAt(buf, int64(p.id)*int64(tx.db.pageSize)); err != nil { - return err - } - if !tx.db.NoSync || IgnoreNoSync { - if err := fdatasync(tx.db); err != nil { - return err - } - } - - // Update statistics. - tx.stats.Write++ - - return nil -} - -// page returns a reference to the page with a given id. -// If page has been written to then a temporary buffered page is returned. -func (tx *Tx) page(id pgid) *page { - // Check the dirty pages first. - if tx.pages != nil { - if p, ok := tx.pages[id]; ok { - return p - } - } - - // Otherwise return directly from the mmap. - return tx.db.page(id) -} - -// forEachPage iterates over every page within a given page and executes a function. -func (tx *Tx) forEachPage(pgid pgid, depth int, fn func(*page, int)) { - p := tx.page(pgid) - - // Execute function. - fn(p, depth) - - // Recursively loop over children. - if (p.flags & branchPageFlag) != 0 { - for i := 0; i < int(p.count); i++ { - elem := p.branchPageElement(uint16(i)) - tx.forEachPage(elem.pgid, depth+1, fn) - } - } -} - -// Page returns page information for a given page number. -// This is only safe for concurrent use when used by a writable transaction. -func (tx *Tx) Page(id int) (*PageInfo, error) { - if tx.db == nil { - return nil, ErrTxClosed - } else if pgid(id) >= tx.meta.pgid { - return nil, nil - } - - // Build the page info. - p := tx.db.page(pgid(id)) - info := &PageInfo{ - ID: id, - Count: int(p.count), - OverflowCount: int(p.overflow), - } - - // Determine the type (or if it's free). - if tx.db.freelist.freed(pgid(id)) { - info.Type = "free" - } else { - info.Type = p.typ() - } - - return info, nil -} - -// TxStats represents statistics about the actions performed by the transaction. -type TxStats struct { - // Page statistics. - PageCount int // number of page allocations - PageAlloc int // total bytes allocated - - // Cursor statistics. - CursorCount int // number of cursors created - - // Node statistics - NodeCount int // number of node allocations - NodeDeref int // number of node dereferences - - // Rebalance statistics. - Rebalance int // number of node rebalances - RebalanceTime time.Duration // total time spent rebalancing - - // Split/Spill statistics. - Split int // number of nodes split - Spill int // number of nodes spilled - SpillTime time.Duration // total time spent spilling - - // Write statistics. - Write int // number of writes performed - WriteTime time.Duration // total time spent writing to disk -} - -func (s *TxStats) add(other *TxStats) { - s.PageCount += other.PageCount - s.PageAlloc += other.PageAlloc - s.CursorCount += other.CursorCount - s.NodeCount += other.NodeCount - s.NodeDeref += other.NodeDeref - s.Rebalance += other.Rebalance - s.RebalanceTime += other.RebalanceTime - s.Split += other.Split - s.Spill += other.Spill - s.SpillTime += other.SpillTime - s.Write += other.Write - s.WriteTime += other.WriteTime -} - -// Sub calculates and returns the difference between two sets of transaction stats. -// This is useful when obtaining stats at two different points and time and -// you need the performance counters that occurred within that time span. -func (s *TxStats) Sub(other *TxStats) TxStats { - var diff TxStats - diff.PageCount = s.PageCount - other.PageCount - diff.PageAlloc = s.PageAlloc - other.PageAlloc - diff.CursorCount = s.CursorCount - other.CursorCount - diff.NodeCount = s.NodeCount - other.NodeCount - diff.NodeDeref = s.NodeDeref - other.NodeDeref - diff.Rebalance = s.Rebalance - other.Rebalance - diff.RebalanceTime = s.RebalanceTime - other.RebalanceTime - diff.Split = s.Split - other.Split - diff.Spill = s.Spill - other.Spill - diff.SpillTime = s.SpillTime - other.SpillTime - diff.Write = s.Write - other.Write - diff.WriteTime = s.WriteTime - other.WriteTime - return diff -} diff --git a/vendor/github.com/coreos/etcd/LICENSE b/vendor/github.com/coreos/etcd/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/vendor/github.com/coreos/etcd/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/coreos/etcd/NOTICE b/vendor/github.com/coreos/etcd/NOTICE deleted file mode 100644 index b39ddfa5c..000000000 --- a/vendor/github.com/coreos/etcd/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -CoreOS Project -Copyright 2014 CoreOS, Inc - -This product includes software developed at CoreOS, Inc. -(http://www.coreos.com/). diff --git a/vendor/github.com/coreos/etcd/auth/authpb/auth.pb.go b/vendor/github.com/coreos/etcd/auth/authpb/auth.pb.go deleted file mode 100644 index 1a940c39b..000000000 --- a/vendor/github.com/coreos/etcd/auth/authpb/auth.pb.go +++ /dev/null @@ -1,807 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: auth.proto - -/* - Package authpb is a generated protocol buffer package. - - It is generated from these files: - auth.proto - - It has these top-level messages: - User - Permission - Role -*/ -package authpb - -import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - - math "math" - - _ "github.com/gogo/protobuf/gogoproto" - - io "io" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Permission_Type int32 - -const ( - READ Permission_Type = 0 - WRITE Permission_Type = 1 - READWRITE Permission_Type = 2 -) - -var Permission_Type_name = map[int32]string{ - 0: "READ", - 1: "WRITE", - 2: "READWRITE", -} -var Permission_Type_value = map[string]int32{ - "READ": 0, - "WRITE": 1, - "READWRITE": 2, -} - -func (x Permission_Type) String() string { - return proto.EnumName(Permission_Type_name, int32(x)) -} -func (Permission_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorAuth, []int{1, 0} } - -// User is a single entry in the bucket authUsers -type User struct { - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - Roles []string `protobuf:"bytes,3,rep,name=roles" json:"roles,omitempty"` -} - -func (m *User) Reset() { *m = User{} } -func (m *User) String() string { return proto.CompactTextString(m) } -func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{0} } - -// Permission is a single entity -type Permission struct { - PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` -} - -func (m *Permission) Reset() { *m = Permission{} } -func (m *Permission) String() string { return proto.CompactTextString(m) } -func (*Permission) ProtoMessage() {} -func (*Permission) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{1} } - -// Role is a single entry in the bucket authRoles -type Role struct { - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission" json:"keyPermission,omitempty"` -} - -func (m *Role) Reset() { *m = Role{} } -func (m *Role) String() string { return proto.CompactTextString(m) } -func (*Role) ProtoMessage() {} -func (*Role) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{2} } - -func init() { - proto.RegisterType((*User)(nil), "authpb.User") - proto.RegisterType((*Permission)(nil), "authpb.Permission") - proto.RegisterType((*Role)(nil), "authpb.Role") - proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value) -} -func (m *User) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *User) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *Permission) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Permission) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.PermType != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintAuth(dAtA, i, uint64(m.PermType)) - } - if len(m.Key) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) - } - return i, nil -} - -func (m *Role) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Role) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.KeyPermission) > 0 { - for _, msg := range m.KeyPermission { - dAtA[i] = 0x12 - i++ - i = encodeVarintAuth(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *User) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - l = len(s) - n += 1 + l + sovAuth(uint64(l)) - } - } - return n -} - -func (m *Permission) Size() (n int) { - var l int - _ = l - if m.PermType != 0 { - n += 1 + sovAuth(uint64(m.PermType)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - return n -} - -func (m *Role) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - if len(m.KeyPermission) > 0 { - for _, e := range m.KeyPermission { - l = e.Size() - n += 1 + l + sovAuth(uint64(l)) - } - } - return n -} - -func sovAuth(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozAuth(x uint64) (n int) { - return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *User) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: User: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) - if m.Name == nil { - m.Name = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = append(m.Password[:0], dAtA[iNdEx:postIndex]...) - if m.Password == nil { - m.Password = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Permission) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Permission: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Permission: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType) - } - m.PermType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PermType |= (Permission_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Role) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Role: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) - if m.Name == nil { - m.Name = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyPermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.KeyPermission = append(m.KeyPermission, &Permission{}) - if err := m.KeyPermission[len(m.KeyPermission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAuth(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthAuth - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAuth - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipAuth(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("auth.proto", fileDescriptorAuth) } - -var fileDescriptorAuth = []byte{ - // 288 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4a, 0xc3, 0x30, - 0x1c, 0xc6, 0x9b, 0xb6, 0x1b, 0xed, 0x5f, 0x27, 0x25, 0x0c, 0x0c, 0x13, 0x42, 0xe9, 0xa9, 0x78, - 0xa8, 0xb0, 0x5d, 0xbc, 0x2a, 0xf6, 0x20, 0x78, 0x90, 0x50, 0xf1, 0x28, 0x1d, 0x0d, 0x75, 0x6c, - 0x6d, 0x4a, 0x32, 0x91, 0xbe, 0x89, 0x07, 0x1f, 0x68, 0xc7, 0x3d, 0x82, 0xab, 0x2f, 0x22, 0x4d, - 0x64, 0x43, 0xdc, 0xed, 0xfb, 0xbe, 0xff, 0x97, 0xe4, 0x97, 0x3f, 0x40, 0xfe, 0xb6, 0x7e, 0x4d, - 0x1a, 0x29, 0xd6, 0x02, 0x0f, 0x7b, 0xdd, 0xcc, 0x27, 0xe3, 0x52, 0x94, 0x42, 0x47, 0x57, 0xbd, - 0x32, 0xd3, 0xe8, 0x01, 0xdc, 0x27, 0xc5, 0x25, 0xc6, 0xe0, 0xd6, 0x79, 0xc5, 0x09, 0x0a, 0x51, - 0x7c, 0xca, 0xb4, 0xc6, 0x13, 0xf0, 0x9a, 0x5c, 0xa9, 0x77, 0x21, 0x0b, 0x62, 0xeb, 0x7c, 0xef, - 0xf1, 0x18, 0x06, 0x52, 0xac, 0xb8, 0x22, 0x4e, 0xe8, 0xc4, 0x3e, 0x33, 0x26, 0xfa, 0x44, 0x00, - 0x8f, 0x5c, 0x56, 0x0b, 0xa5, 0x16, 0xa2, 0xc6, 0x33, 0xf0, 0x1a, 0x2e, 0xab, 0xac, 0x6d, 0xcc, - 0xc5, 0x67, 0xd3, 0xf3, 0xc4, 0xd0, 0x24, 0x87, 0x56, 0xd2, 0x8f, 0xd9, 0xbe, 0x88, 0x03, 0x70, - 0x96, 0xbc, 0xfd, 0x7d, 0xb0, 0x97, 0xf8, 0x02, 0x7c, 0x99, 0xd7, 0x25, 0x7f, 0xe1, 0x75, 0x41, - 0x1c, 0x03, 0xa2, 0x83, 0xb4, 0x2e, 0xa2, 0x4b, 0x70, 0xf5, 0x31, 0x0f, 0x5c, 0x96, 0xde, 0xdc, - 0x05, 0x16, 0xf6, 0x61, 0xf0, 0xcc, 0xee, 0xb3, 0x34, 0x40, 0x78, 0x04, 0x7e, 0x1f, 0x1a, 0x6b, - 0x47, 0x19, 0xb8, 0x4c, 0xac, 0xf8, 0xd1, 0xcf, 0x5e, 0xc3, 0x68, 0xc9, 0xdb, 0x03, 0x16, 0xb1, - 0x43, 0x27, 0x3e, 0x99, 0xe2, 0xff, 0xc0, 0xec, 0x6f, 0xf1, 0x96, 0x6c, 0x76, 0xd4, 0xda, 0xee, - 0xa8, 0xb5, 0xe9, 0x28, 0xda, 0x76, 0x14, 0x7d, 0x75, 0x14, 0x7d, 0x7c, 0x53, 0x6b, 0x3e, 0xd4, - 0x3b, 0x9e, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x76, 0x8d, 0x4f, 0x8f, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/coreos/etcd/clientv3/auth.go b/vendor/github.com/coreos/etcd/clientv3/auth.go deleted file mode 100644 index 7545bb6ca..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/auth.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "fmt" - "strings" - - "github.com/coreos/etcd/auth/authpb" - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - - "google.golang.org/grpc" -) - -type ( - AuthEnableResponse pb.AuthEnableResponse - AuthDisableResponse pb.AuthDisableResponse - AuthenticateResponse pb.AuthenticateResponse - AuthUserAddResponse pb.AuthUserAddResponse - AuthUserDeleteResponse pb.AuthUserDeleteResponse - AuthUserChangePasswordResponse pb.AuthUserChangePasswordResponse - AuthUserGrantRoleResponse pb.AuthUserGrantRoleResponse - AuthUserGetResponse pb.AuthUserGetResponse - AuthUserRevokeRoleResponse pb.AuthUserRevokeRoleResponse - AuthRoleAddResponse pb.AuthRoleAddResponse - AuthRoleGrantPermissionResponse pb.AuthRoleGrantPermissionResponse - AuthRoleGetResponse pb.AuthRoleGetResponse - AuthRoleRevokePermissionResponse pb.AuthRoleRevokePermissionResponse - AuthRoleDeleteResponse pb.AuthRoleDeleteResponse - AuthUserListResponse pb.AuthUserListResponse - AuthRoleListResponse pb.AuthRoleListResponse - - PermissionType authpb.Permission_Type - Permission authpb.Permission -) - -const ( - PermRead = authpb.READ - PermWrite = authpb.WRITE - PermReadWrite = authpb.READWRITE -) - -type Auth interface { - // AuthEnable enables auth of an etcd cluster. - AuthEnable(ctx context.Context) (*AuthEnableResponse, error) - - // AuthDisable disables auth of an etcd cluster. - AuthDisable(ctx context.Context) (*AuthDisableResponse, error) - - // UserAdd adds a new user to an etcd cluster. - UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) - - // UserDelete deletes a user from an etcd cluster. - UserDelete(ctx context.Context, name string) (*AuthUserDeleteResponse, error) - - // UserChangePassword changes a password of a user. - UserChangePassword(ctx context.Context, name string, password string) (*AuthUserChangePasswordResponse, error) - - // UserGrantRole grants a role to a user. - UserGrantRole(ctx context.Context, user string, role string) (*AuthUserGrantRoleResponse, error) - - // UserGet gets a detailed information of a user. - UserGet(ctx context.Context, name string) (*AuthUserGetResponse, error) - - // UserList gets a list of all users. - UserList(ctx context.Context) (*AuthUserListResponse, error) - - // UserRevokeRole revokes a role of a user. - UserRevokeRole(ctx context.Context, name string, role string) (*AuthUserRevokeRoleResponse, error) - - // RoleAdd adds a new role to an etcd cluster. - RoleAdd(ctx context.Context, name string) (*AuthRoleAddResponse, error) - - // RoleGrantPermission grants a permission to a role. - RoleGrantPermission(ctx context.Context, name string, key, rangeEnd string, permType PermissionType) (*AuthRoleGrantPermissionResponse, error) - - // RoleGet gets a detailed information of a role. - RoleGet(ctx context.Context, role string) (*AuthRoleGetResponse, error) - - // RoleList gets a list of all roles. - RoleList(ctx context.Context) (*AuthRoleListResponse, error) - - // RoleRevokePermission revokes a permission from a role. - RoleRevokePermission(ctx context.Context, role string, key, rangeEnd string) (*AuthRoleRevokePermissionResponse, error) - - // RoleDelete deletes a role. - RoleDelete(ctx context.Context, role string) (*AuthRoleDeleteResponse, error) -} - -type auth struct { - remote pb.AuthClient - callOpts []grpc.CallOption -} - -func NewAuth(c *Client) Auth { - api := &auth{remote: RetryAuthClient(c)} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func (auth *auth) AuthEnable(ctx context.Context) (*AuthEnableResponse, error) { - resp, err := auth.remote.AuthEnable(ctx, &pb.AuthEnableRequest{}, auth.callOpts...) - return (*AuthEnableResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) AuthDisable(ctx context.Context) (*AuthDisableResponse, error) { - resp, err := auth.remote.AuthDisable(ctx, &pb.AuthDisableRequest{}, auth.callOpts...) - return (*AuthDisableResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) { - resp, err := auth.remote.UserAdd(ctx, &pb.AuthUserAddRequest{Name: name, Password: password}, auth.callOpts...) - return (*AuthUserAddResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) UserDelete(ctx context.Context, name string) (*AuthUserDeleteResponse, error) { - resp, err := auth.remote.UserDelete(ctx, &pb.AuthUserDeleteRequest{Name: name}, auth.callOpts...) - return (*AuthUserDeleteResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) UserChangePassword(ctx context.Context, name string, password string) (*AuthUserChangePasswordResponse, error) { - resp, err := auth.remote.UserChangePassword(ctx, &pb.AuthUserChangePasswordRequest{Name: name, Password: password}, auth.callOpts...) - return (*AuthUserChangePasswordResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) UserGrantRole(ctx context.Context, user string, role string) (*AuthUserGrantRoleResponse, error) { - resp, err := auth.remote.UserGrantRole(ctx, &pb.AuthUserGrantRoleRequest{User: user, Role: role}, auth.callOpts...) - return (*AuthUserGrantRoleResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) UserGet(ctx context.Context, name string) (*AuthUserGetResponse, error) { - resp, err := auth.remote.UserGet(ctx, &pb.AuthUserGetRequest{Name: name}, auth.callOpts...) - return (*AuthUserGetResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) UserList(ctx context.Context) (*AuthUserListResponse, error) { - resp, err := auth.remote.UserList(ctx, &pb.AuthUserListRequest{}, auth.callOpts...) - return (*AuthUserListResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) UserRevokeRole(ctx context.Context, name string, role string) (*AuthUserRevokeRoleResponse, error) { - resp, err := auth.remote.UserRevokeRole(ctx, &pb.AuthUserRevokeRoleRequest{Name: name, Role: role}, auth.callOpts...) - return (*AuthUserRevokeRoleResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) RoleAdd(ctx context.Context, name string) (*AuthRoleAddResponse, error) { - resp, err := auth.remote.RoleAdd(ctx, &pb.AuthRoleAddRequest{Name: name}, auth.callOpts...) - return (*AuthRoleAddResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) RoleGrantPermission(ctx context.Context, name string, key, rangeEnd string, permType PermissionType) (*AuthRoleGrantPermissionResponse, error) { - perm := &authpb.Permission{ - Key: []byte(key), - RangeEnd: []byte(rangeEnd), - PermType: authpb.Permission_Type(permType), - } - resp, err := auth.remote.RoleGrantPermission(ctx, &pb.AuthRoleGrantPermissionRequest{Name: name, Perm: perm}, auth.callOpts...) - return (*AuthRoleGrantPermissionResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) RoleGet(ctx context.Context, role string) (*AuthRoleGetResponse, error) { - resp, err := auth.remote.RoleGet(ctx, &pb.AuthRoleGetRequest{Role: role}, auth.callOpts...) - return (*AuthRoleGetResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) RoleList(ctx context.Context) (*AuthRoleListResponse, error) { - resp, err := auth.remote.RoleList(ctx, &pb.AuthRoleListRequest{}, auth.callOpts...) - return (*AuthRoleListResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) RoleRevokePermission(ctx context.Context, role string, key, rangeEnd string) (*AuthRoleRevokePermissionResponse, error) { - resp, err := auth.remote.RoleRevokePermission(ctx, &pb.AuthRoleRevokePermissionRequest{Role: role, Key: key, RangeEnd: rangeEnd}, auth.callOpts...) - return (*AuthRoleRevokePermissionResponse)(resp), toErr(ctx, err) -} - -func (auth *auth) RoleDelete(ctx context.Context, role string) (*AuthRoleDeleteResponse, error) { - resp, err := auth.remote.RoleDelete(ctx, &pb.AuthRoleDeleteRequest{Role: role}, auth.callOpts...) - return (*AuthRoleDeleteResponse)(resp), toErr(ctx, err) -} - -func StrToPermissionType(s string) (PermissionType, error) { - val, ok := authpb.Permission_Type_value[strings.ToUpper(s)] - if ok { - return PermissionType(val), nil - } - return PermissionType(-1), fmt.Errorf("invalid permission type: %s", s) -} - -type authenticator struct { - conn *grpc.ClientConn // conn in-use - remote pb.AuthClient - callOpts []grpc.CallOption -} - -func (auth *authenticator) authenticate(ctx context.Context, name string, password string) (*AuthenticateResponse, error) { - resp, err := auth.remote.Authenticate(ctx, &pb.AuthenticateRequest{Name: name, Password: password}, auth.callOpts...) - return (*AuthenticateResponse)(resp), toErr(ctx, err) -} - -func (auth *authenticator) close() { - auth.conn.Close() -} - -func newAuthenticator(endpoint string, opts []grpc.DialOption, c *Client) (*authenticator, error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return nil, err - } - - api := &authenticator{ - conn: conn, - remote: pb.NewAuthClient(conn), - } - if c != nil { - api.callOpts = c.callOpts - } - return api, nil -} diff --git a/vendor/github.com/coreos/etcd/clientv3/client.go b/vendor/github.com/coreos/etcd/clientv3/client.go deleted file mode 100644 index a2c313d35..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/client.go +++ /dev/null @@ -1,562 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "crypto/tls" - "errors" - "fmt" - "net" - "net/url" - "strconv" - "strings" - "sync" - "time" - - "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/keepalive" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -var ( - ErrNoAvailableEndpoints = errors.New("etcdclient: no available endpoints") - ErrOldCluster = errors.New("etcdclient: old cluster version") -) - -// Client provides and manages an etcd v3 client session. -type Client struct { - Cluster - KV - Lease - Watcher - Auth - Maintenance - - conn *grpc.ClientConn - dialerrc chan error - - cfg Config - creds *credentials.TransportCredentials - balancer *healthBalancer - mu *sync.Mutex - - ctx context.Context - cancel context.CancelFunc - - // Username is a user name for authentication. - Username string - // Password is a password for authentication. - Password string - // tokenCred is an instance of WithPerRPCCredentials()'s argument - tokenCred *authTokenCredential - - callOpts []grpc.CallOption -} - -// New creates a new etcdv3 client from a given configuration. -func New(cfg Config) (*Client, error) { - if len(cfg.Endpoints) == 0 { - return nil, ErrNoAvailableEndpoints - } - - return newClient(&cfg) -} - -// NewCtxClient creates a client with a context but no underlying grpc -// connection. This is useful for embedded cases that override the -// service interface implementations and do not need connection management. -func NewCtxClient(ctx context.Context) *Client { - cctx, cancel := context.WithCancel(ctx) - return &Client{ctx: cctx, cancel: cancel} -} - -// NewFromURL creates a new etcdv3 client from a URL. -func NewFromURL(url string) (*Client, error) { - return New(Config{Endpoints: []string{url}}) -} - -// Close shuts down the client's etcd connections. -func (c *Client) Close() error { - c.cancel() - c.Watcher.Close() - c.Lease.Close() - if c.conn != nil { - return toErr(c.ctx, c.conn.Close()) - } - return c.ctx.Err() -} - -// Ctx is a context for "out of band" messages (e.g., for sending -// "clean up" message when another context is canceled). It is -// canceled on client Close(). -func (c *Client) Ctx() context.Context { return c.ctx } - -// Endpoints lists the registered endpoints for the client. -func (c *Client) Endpoints() (eps []string) { - // copy the slice; protect original endpoints from being changed - eps = make([]string, len(c.cfg.Endpoints)) - copy(eps, c.cfg.Endpoints) - return -} - -// SetEndpoints updates client's endpoints. -func (c *Client) SetEndpoints(eps ...string) { - c.mu.Lock() - c.cfg.Endpoints = eps - c.mu.Unlock() - c.balancer.updateAddrs(eps...) - - // updating notifyCh can trigger new connections, - // need update addrs if all connections are down - // or addrs does not include pinAddr. - c.balancer.mu.RLock() - update := !hasAddr(c.balancer.addrs, c.balancer.pinAddr) - c.balancer.mu.RUnlock() - if update { - select { - case c.balancer.updateAddrsC <- notifyNext: - case <-c.balancer.stopc: - } - } -} - -// Sync synchronizes client's endpoints with the known endpoints from the etcd membership. -func (c *Client) Sync(ctx context.Context) error { - mresp, err := c.MemberList(ctx) - if err != nil { - return err - } - var eps []string - for _, m := range mresp.Members { - eps = append(eps, m.ClientURLs...) - } - c.SetEndpoints(eps...) - return nil -} - -func (c *Client) autoSync() { - if c.cfg.AutoSyncInterval == time.Duration(0) { - return - } - - for { - select { - case <-c.ctx.Done(): - return - case <-time.After(c.cfg.AutoSyncInterval): - ctx, cancel := context.WithTimeout(c.ctx, 5*time.Second) - err := c.Sync(ctx) - cancel() - if err != nil && err != c.ctx.Err() { - logger.Println("Auto sync endpoints failed:", err) - } - } - } -} - -type authTokenCredential struct { - token string - tokenMu *sync.RWMutex -} - -func (cred authTokenCredential) RequireTransportSecurity() bool { - return false -} - -func (cred authTokenCredential) GetRequestMetadata(ctx context.Context, s ...string) (map[string]string, error) { - cred.tokenMu.RLock() - defer cred.tokenMu.RUnlock() - return map[string]string{ - "token": cred.token, - }, nil -} - -func parseEndpoint(endpoint string) (proto string, host string, scheme string) { - proto = "tcp" - host = endpoint - url, uerr := url.Parse(endpoint) - if uerr != nil || !strings.Contains(endpoint, "://") { - return proto, host, scheme - } - scheme = url.Scheme - - // strip scheme:// prefix since grpc dials by host - host = url.Host - switch url.Scheme { - case "http", "https": - case "unix", "unixs": - proto = "unix" - host = url.Host + url.Path - default: - proto, host = "", "" - } - return proto, host, scheme -} - -func (c *Client) processCreds(scheme string) (creds *credentials.TransportCredentials) { - creds = c.creds - switch scheme { - case "unix": - case "http": - creds = nil - case "https", "unixs": - if creds != nil { - break - } - tlsconfig := &tls.Config{} - emptyCreds := credentials.NewTLS(tlsconfig) - creds = &emptyCreds - default: - creds = nil - } - return creds -} - -// dialSetupOpts gives the dial opts prior to any authentication -func (c *Client) dialSetupOpts(endpoint string, dopts ...grpc.DialOption) (opts []grpc.DialOption) { - if c.cfg.DialTimeout > 0 { - opts = []grpc.DialOption{grpc.WithTimeout(c.cfg.DialTimeout)} - } - if c.cfg.DialKeepAliveTime > 0 { - params := keepalive.ClientParameters{ - Time: c.cfg.DialKeepAliveTime, - Timeout: c.cfg.DialKeepAliveTimeout, - } - opts = append(opts, grpc.WithKeepaliveParams(params)) - } - opts = append(opts, dopts...) - - f := func(host string, t time.Duration) (net.Conn, error) { - proto, host, _ := parseEndpoint(c.balancer.endpoint(host)) - if host == "" && endpoint != "" { - // dialing an endpoint not in the balancer; use - // endpoint passed into dial - proto, host, _ = parseEndpoint(endpoint) - } - if proto == "" { - return nil, fmt.Errorf("unknown scheme for %q", host) - } - select { - case <-c.ctx.Done(): - return nil, c.ctx.Err() - default: - } - dialer := &net.Dialer{Timeout: t} - conn, err := dialer.DialContext(c.ctx, proto, host) - if err != nil { - select { - case c.dialerrc <- err: - default: - } - } - return conn, err - } - opts = append(opts, grpc.WithDialer(f)) - - creds := c.creds - if _, _, scheme := parseEndpoint(endpoint); len(scheme) != 0 { - creds = c.processCreds(scheme) - } - if creds != nil { - opts = append(opts, grpc.WithTransportCredentials(*creds)) - } else { - opts = append(opts, grpc.WithInsecure()) - } - - return opts -} - -// Dial connects to a single endpoint using the client's config. -func (c *Client) Dial(endpoint string) (*grpc.ClientConn, error) { - return c.dial(endpoint) -} - -func (c *Client) getToken(ctx context.Context) error { - var err error // return last error in a case of fail - var auth *authenticator - - for i := 0; i < len(c.cfg.Endpoints); i++ { - endpoint := c.cfg.Endpoints[i] - host := getHost(endpoint) - // use dial options without dopts to avoid reusing the client balancer - auth, err = newAuthenticator(host, c.dialSetupOpts(endpoint), c) - if err != nil { - continue - } - defer auth.close() - - var resp *AuthenticateResponse - resp, err = auth.authenticate(ctx, c.Username, c.Password) - if err != nil { - continue - } - - c.tokenCred.tokenMu.Lock() - c.tokenCred.token = resp.Token - c.tokenCred.tokenMu.Unlock() - - return nil - } - - return err -} - -func (c *Client) dial(endpoint string, dopts ...grpc.DialOption) (*grpc.ClientConn, error) { - opts := c.dialSetupOpts(endpoint, dopts...) - host := getHost(endpoint) - if c.Username != "" && c.Password != "" { - c.tokenCred = &authTokenCredential{ - tokenMu: &sync.RWMutex{}, - } - - ctx := c.ctx - if c.cfg.DialTimeout > 0 { - cctx, cancel := context.WithTimeout(ctx, c.cfg.DialTimeout) - defer cancel() - ctx = cctx - } - - err := c.getToken(ctx) - if err != nil { - if toErr(ctx, err) != rpctypes.ErrAuthNotEnabled { - if err == ctx.Err() && ctx.Err() != c.ctx.Err() { - err = context.DeadlineExceeded - } - return nil, err - } - } else { - opts = append(opts, grpc.WithPerRPCCredentials(c.tokenCred)) - } - } - - opts = append(opts, c.cfg.DialOptions...) - - conn, err := grpc.DialContext(c.ctx, host, opts...) - if err != nil { - return nil, err - } - return conn, nil -} - -// WithRequireLeader requires client requests to only succeed -// when the cluster has a leader. -func WithRequireLeader(ctx context.Context) context.Context { - md := metadata.Pairs(rpctypes.MetadataRequireLeaderKey, rpctypes.MetadataHasLeader) - return metadata.NewOutgoingContext(ctx, md) -} - -func newClient(cfg *Config) (*Client, error) { - if cfg == nil { - cfg = &Config{} - } - var creds *credentials.TransportCredentials - if cfg.TLS != nil { - c := credentials.NewTLS(cfg.TLS) - creds = &c - } - - // use a temporary skeleton client to bootstrap first connection - baseCtx := context.TODO() - if cfg.Context != nil { - baseCtx = cfg.Context - } - - ctx, cancel := context.WithCancel(baseCtx) - client := &Client{ - conn: nil, - dialerrc: make(chan error, 1), - cfg: *cfg, - creds: creds, - ctx: ctx, - cancel: cancel, - mu: new(sync.Mutex), - callOpts: defaultCallOpts, - } - if cfg.Username != "" && cfg.Password != "" { - client.Username = cfg.Username - client.Password = cfg.Password - } - if cfg.MaxCallSendMsgSize > 0 || cfg.MaxCallRecvMsgSize > 0 { - if cfg.MaxCallRecvMsgSize > 0 && cfg.MaxCallSendMsgSize > cfg.MaxCallRecvMsgSize { - return nil, fmt.Errorf("gRPC message recv limit (%d bytes) must be greater than send limit (%d bytes)", cfg.MaxCallRecvMsgSize, cfg.MaxCallSendMsgSize) - } - callOpts := []grpc.CallOption{ - defaultFailFast, - defaultMaxCallSendMsgSize, - defaultMaxCallRecvMsgSize, - } - if cfg.MaxCallSendMsgSize > 0 { - callOpts[1] = grpc.MaxCallSendMsgSize(cfg.MaxCallSendMsgSize) - } - if cfg.MaxCallRecvMsgSize > 0 { - callOpts[2] = grpc.MaxCallRecvMsgSize(cfg.MaxCallRecvMsgSize) - } - client.callOpts = callOpts - } - - client.balancer = newHealthBalancer(cfg.Endpoints, cfg.DialTimeout, func(ep string) (bool, error) { - return grpcHealthCheck(client, ep) - }) - - // use Endpoints[0] so that for https:// without any tls config given, then - // grpc will assume the certificate server name is the endpoint host. - conn, err := client.dial(cfg.Endpoints[0], grpc.WithBalancer(client.balancer)) - if err != nil { - client.cancel() - client.balancer.Close() - return nil, err - } - client.conn = conn - - // wait for a connection - if cfg.DialTimeout > 0 { - hasConn := false - waitc := time.After(cfg.DialTimeout) - select { - case <-client.balancer.ready(): - hasConn = true - case <-ctx.Done(): - case <-waitc: - } - if !hasConn { - err := context.DeadlineExceeded - select { - case err = <-client.dialerrc: - default: - } - client.cancel() - client.balancer.Close() - conn.Close() - return nil, err - } - } - - client.Cluster = NewCluster(client) - client.KV = NewKV(client) - client.Lease = NewLease(client) - client.Watcher = NewWatcher(client) - client.Auth = NewAuth(client) - client.Maintenance = NewMaintenance(client) - - if cfg.RejectOldCluster { - if err := client.checkVersion(); err != nil { - client.Close() - return nil, err - } - } - - go client.autoSync() - return client, nil -} - -func (c *Client) checkVersion() (err error) { - var wg sync.WaitGroup - errc := make(chan error, len(c.cfg.Endpoints)) - ctx, cancel := context.WithCancel(c.ctx) - if c.cfg.DialTimeout > 0 { - ctx, cancel = context.WithTimeout(ctx, c.cfg.DialTimeout) - } - wg.Add(len(c.cfg.Endpoints)) - for _, ep := range c.cfg.Endpoints { - // if cluster is current, any endpoint gives a recent version - go func(e string) { - defer wg.Done() - resp, rerr := c.Status(ctx, e) - if rerr != nil { - errc <- rerr - return - } - vs := strings.Split(resp.Version, ".") - maj, min := 0, 0 - if len(vs) >= 2 { - maj, _ = strconv.Atoi(vs[0]) - min, rerr = strconv.Atoi(vs[1]) - } - if maj < 3 || (maj == 3 && min < 2) { - rerr = ErrOldCluster - } - errc <- rerr - }(ep) - } - // wait for success - for i := 0; i < len(c.cfg.Endpoints); i++ { - if err = <-errc; err == nil { - break - } - } - cancel() - wg.Wait() - return err -} - -// ActiveConnection returns the current in-use connection -func (c *Client) ActiveConnection() *grpc.ClientConn { return c.conn } - -// isHaltErr returns true if the given error and context indicate no forward -// progress can be made, even after reconnecting. -func isHaltErr(ctx context.Context, err error) bool { - if ctx != nil && ctx.Err() != nil { - return true - } - if err == nil { - return false - } - ev, _ := status.FromError(err) - // Unavailable codes mean the system will be right back. - // (e.g., can't connect, lost leader) - // Treat Internal codes as if something failed, leaving the - // system in an inconsistent state, but retrying could make progress. - // (e.g., failed in middle of send, corrupted frame) - // TODO: are permanent Internal errors possible from grpc? - return ev.Code() != codes.Unavailable && ev.Code() != codes.Internal -} - -func toErr(ctx context.Context, err error) error { - if err == nil { - return nil - } - err = rpctypes.Error(err) - if _, ok := err.(rpctypes.EtcdError); ok { - return err - } - ev, _ := status.FromError(err) - code := ev.Code() - switch code { - case codes.DeadlineExceeded: - fallthrough - case codes.Canceled: - if ctx.Err() != nil { - err = ctx.Err() - } - case codes.Unavailable: - case codes.FailedPrecondition: - err = grpc.ErrClientConnClosing - } - return err -} - -func canceledByCaller(stopCtx context.Context, err error) bool { - if stopCtx.Err() == nil || err == nil { - return false - } - - return err == context.Canceled || err == context.DeadlineExceeded -} diff --git a/vendor/github.com/coreos/etcd/clientv3/cluster.go b/vendor/github.com/coreos/etcd/clientv3/cluster.go deleted file mode 100644 index 785672be8..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/cluster.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/pkg/types" - - "google.golang.org/grpc" -) - -type ( - Member pb.Member - MemberListResponse pb.MemberListResponse - MemberAddResponse pb.MemberAddResponse - MemberRemoveResponse pb.MemberRemoveResponse - MemberUpdateResponse pb.MemberUpdateResponse -) - -type Cluster interface { - // MemberList lists the current cluster membership. - MemberList(ctx context.Context) (*MemberListResponse, error) - - // MemberAdd adds a new member into the cluster. - MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) - - // MemberRemove removes an existing member from the cluster. - MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error) - - // MemberUpdate updates the peer addresses of the member. - MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error) -} - -type cluster struct { - remote pb.ClusterClient - callOpts []grpc.CallOption -} - -func NewCluster(c *Client) Cluster { - api := &cluster{remote: RetryClusterClient(c)} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func NewClusterFromClusterClient(remote pb.ClusterClient, c *Client) Cluster { - api := &cluster{remote: remote} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func (c *cluster) MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) { - // fail-fast before panic in rafthttp - if _, err := types.NewURLs(peerAddrs); err != nil { - return nil, err - } - - r := &pb.MemberAddRequest{PeerURLs: peerAddrs} - resp, err := c.remote.MemberAdd(ctx, r, c.callOpts...) - if err != nil { - return nil, toErr(ctx, err) - } - return (*MemberAddResponse)(resp), nil -} - -func (c *cluster) MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error) { - r := &pb.MemberRemoveRequest{ID: id} - resp, err := c.remote.MemberRemove(ctx, r, c.callOpts...) - if err != nil { - return nil, toErr(ctx, err) - } - return (*MemberRemoveResponse)(resp), nil -} - -func (c *cluster) MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error) { - // fail-fast before panic in rafthttp - if _, err := types.NewURLs(peerAddrs); err != nil { - return nil, err - } - - // it is safe to retry on update. - r := &pb.MemberUpdateRequest{ID: id, PeerURLs: peerAddrs} - resp, err := c.remote.MemberUpdate(ctx, r, c.callOpts...) - if err == nil { - return (*MemberUpdateResponse)(resp), nil - } - return nil, toErr(ctx, err) -} - -func (c *cluster) MemberList(ctx context.Context) (*MemberListResponse, error) { - // it is safe to retry on list. - resp, err := c.remote.MemberList(ctx, &pb.MemberListRequest{}, c.callOpts...) - if err == nil { - return (*MemberListResponse)(resp), nil - } - return nil, toErr(ctx, err) -} diff --git a/vendor/github.com/coreos/etcd/clientv3/compact_op.go b/vendor/github.com/coreos/etcd/clientv3/compact_op.go deleted file mode 100644 index 41e80c1da..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/compact_op.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" -) - -// CompactOp represents a compact operation. -type CompactOp struct { - revision int64 - physical bool -} - -// CompactOption configures compact operation. -type CompactOption func(*CompactOp) - -func (op *CompactOp) applyCompactOpts(opts []CompactOption) { - for _, opt := range opts { - opt(op) - } -} - -// OpCompact wraps slice CompactOption to create a CompactOp. -func OpCompact(rev int64, opts ...CompactOption) CompactOp { - ret := CompactOp{revision: rev} - ret.applyCompactOpts(opts) - return ret -} - -func (op CompactOp) toRequest() *pb.CompactionRequest { - return &pb.CompactionRequest{Revision: op.revision, Physical: op.physical} -} - -// WithCompactPhysical makes Compact wait until all compacted entries are -// removed from the etcd server's storage. -func WithCompactPhysical() CompactOption { - return func(op *CompactOp) { op.physical = true } -} diff --git a/vendor/github.com/coreos/etcd/clientv3/compare.go b/vendor/github.com/coreos/etcd/clientv3/compare.go deleted file mode 100644 index b5f0a2552..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/compare.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" -) - -type CompareTarget int -type CompareResult int - -const ( - CompareVersion CompareTarget = iota - CompareCreated - CompareModified - CompareValue -) - -type Cmp pb.Compare - -func Compare(cmp Cmp, result string, v interface{}) Cmp { - var r pb.Compare_CompareResult - - switch result { - case "=": - r = pb.Compare_EQUAL - case "!=": - r = pb.Compare_NOT_EQUAL - case ">": - r = pb.Compare_GREATER - case "<": - r = pb.Compare_LESS - default: - panic("Unknown result op") - } - - cmp.Result = r - switch cmp.Target { - case pb.Compare_VALUE: - val, ok := v.(string) - if !ok { - panic("bad compare value") - } - cmp.TargetUnion = &pb.Compare_Value{Value: []byte(val)} - case pb.Compare_VERSION: - cmp.TargetUnion = &pb.Compare_Version{Version: mustInt64(v)} - case pb.Compare_CREATE: - cmp.TargetUnion = &pb.Compare_CreateRevision{CreateRevision: mustInt64(v)} - case pb.Compare_MOD: - cmp.TargetUnion = &pb.Compare_ModRevision{ModRevision: mustInt64(v)} - case pb.Compare_LEASE: - cmp.TargetUnion = &pb.Compare_Lease{Lease: mustInt64orLeaseID(v)} - default: - panic("Unknown compare type") - } - return cmp -} - -func Value(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_VALUE} -} - -func Version(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_VERSION} -} - -func CreateRevision(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_CREATE} -} - -func ModRevision(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_MOD} -} - -// LeaseValue compares a key's LeaseID to a value of your choosing. The empty -// LeaseID is 0, otherwise known as `NoLease`. -func LeaseValue(key string) Cmp { - return Cmp{Key: []byte(key), Target: pb.Compare_LEASE} -} - -// KeyBytes returns the byte slice holding with the comparison key. -func (cmp *Cmp) KeyBytes() []byte { return cmp.Key } - -// WithKeyBytes sets the byte slice for the comparison key. -func (cmp *Cmp) WithKeyBytes(key []byte) { cmp.Key = key } - -// ValueBytes returns the byte slice holding the comparison value, if any. -func (cmp *Cmp) ValueBytes() []byte { - if tu, ok := cmp.TargetUnion.(*pb.Compare_Value); ok { - return tu.Value - } - return nil -} - -// WithValueBytes sets the byte slice for the comparison's value. -func (cmp *Cmp) WithValueBytes(v []byte) { cmp.TargetUnion.(*pb.Compare_Value).Value = v } - -// WithRange sets the comparison to scan the range [key, end). -func (cmp Cmp) WithRange(end string) Cmp { - cmp.RangeEnd = []byte(end) - return cmp -} - -// WithPrefix sets the comparison to scan all keys prefixed by the key. -func (cmp Cmp) WithPrefix() Cmp { - cmp.RangeEnd = getPrefix(cmp.Key) - return cmp -} - -// mustInt64 panics if val isn't an int or int64. It returns an int64 otherwise. -func mustInt64(val interface{}) int64 { - if v, ok := val.(int64); ok { - return v - } - if v, ok := val.(int); ok { - return int64(v) - } - panic("bad value") -} - -// mustInt64orLeaseID panics if val isn't a LeaseID, int or int64. It returns an -// int64 otherwise. -func mustInt64orLeaseID(val interface{}) int64 { - if v, ok := val.(LeaseID); ok { - return int64(v) - } - return mustInt64(val) -} diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/doc.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/doc.go deleted file mode 100644 index dcdbf511d..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package concurrency implements concurrency operations on top of -// etcd such as distributed locks, barriers, and elections. -package concurrency diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/election.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/election.go deleted file mode 100644 index e18a0ed4a..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/election.go +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package concurrency - -import ( - "context" - "errors" - "fmt" - - v3 "github.com/coreos/etcd/clientv3" - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/mvcc/mvccpb" -) - -var ( - ErrElectionNotLeader = errors.New("election: not leader") - ErrElectionNoLeader = errors.New("election: no leader") -) - -type Election struct { - session *Session - - keyPrefix string - - leaderKey string - leaderRev int64 - leaderSession *Session - hdr *pb.ResponseHeader -} - -// NewElection returns a new election on a given key prefix. -func NewElection(s *Session, pfx string) *Election { - return &Election{session: s, keyPrefix: pfx + "/"} -} - -// ResumeElection initializes an election with a known leader. -func ResumeElection(s *Session, pfx string, leaderKey string, leaderRev int64) *Election { - return &Election{ - session: s, - leaderKey: leaderKey, - leaderRev: leaderRev, - leaderSession: s, - } -} - -// Campaign puts a value as eligible for the election. It blocks until -// it is elected, an error occurs, or the context is cancelled. -func (e *Election) Campaign(ctx context.Context, val string) error { - s := e.session - client := e.session.Client() - - k := fmt.Sprintf("%s%x", e.keyPrefix, s.Lease()) - txn := client.Txn(ctx).If(v3.Compare(v3.CreateRevision(k), "=", 0)) - txn = txn.Then(v3.OpPut(k, val, v3.WithLease(s.Lease()))) - txn = txn.Else(v3.OpGet(k)) - resp, err := txn.Commit() - if err != nil { - return err - } - e.leaderKey, e.leaderRev, e.leaderSession = k, resp.Header.Revision, s - if !resp.Succeeded { - kv := resp.Responses[0].GetResponseRange().Kvs[0] - e.leaderRev = kv.CreateRevision - if string(kv.Value) != val { - if err = e.Proclaim(ctx, val); err != nil { - e.Resign(ctx) - return err - } - } - } - - _, err = waitDeletes(ctx, client, e.keyPrefix, e.leaderRev-1) - if err != nil { - // clean up in case of context cancel - select { - case <-ctx.Done(): - e.Resign(client.Ctx()) - default: - e.leaderSession = nil - } - return err - } - e.hdr = resp.Header - - return nil -} - -// Proclaim lets the leader announce a new value without another election. -func (e *Election) Proclaim(ctx context.Context, val string) error { - if e.leaderSession == nil { - return ErrElectionNotLeader - } - client := e.session.Client() - cmp := v3.Compare(v3.CreateRevision(e.leaderKey), "=", e.leaderRev) - txn := client.Txn(ctx).If(cmp) - txn = txn.Then(v3.OpPut(e.leaderKey, val, v3.WithLease(e.leaderSession.Lease()))) - tresp, terr := txn.Commit() - if terr != nil { - return terr - } - if !tresp.Succeeded { - e.leaderKey = "" - return ErrElectionNotLeader - } - - e.hdr = tresp.Header - return nil -} - -// Resign lets a leader start a new election. -func (e *Election) Resign(ctx context.Context) (err error) { - if e.leaderSession == nil { - return nil - } - client := e.session.Client() - cmp := v3.Compare(v3.CreateRevision(e.leaderKey), "=", e.leaderRev) - resp, err := client.Txn(ctx).If(cmp).Then(v3.OpDelete(e.leaderKey)).Commit() - if err == nil { - e.hdr = resp.Header - } - e.leaderKey = "" - e.leaderSession = nil - return err -} - -// Leader returns the leader value for the current election. -func (e *Election) Leader(ctx context.Context) (*v3.GetResponse, error) { - client := e.session.Client() - resp, err := client.Get(ctx, e.keyPrefix, v3.WithFirstCreate()...) - if err != nil { - return nil, err - } else if len(resp.Kvs) == 0 { - // no leader currently elected - return nil, ErrElectionNoLeader - } - return resp, nil -} - -// Observe returns a channel that reliably observes ordered leader proposals -// as GetResponse values on every current elected leader key. It will not -// necessarily fetch all historical leader updates, but will always post the -// most recent leader value. -// -// The channel closes when the context is canceled or the underlying watcher -// is otherwise disrupted. -func (e *Election) Observe(ctx context.Context) <-chan v3.GetResponse { - retc := make(chan v3.GetResponse) - go e.observe(ctx, retc) - return retc -} - -func (e *Election) observe(ctx context.Context, ch chan<- v3.GetResponse) { - client := e.session.Client() - - defer close(ch) - for { - resp, err := client.Get(ctx, e.keyPrefix, v3.WithFirstCreate()...) - if err != nil { - return - } - - var kv *mvccpb.KeyValue - var hdr *pb.ResponseHeader - - if len(resp.Kvs) == 0 { - cctx, cancel := context.WithCancel(ctx) - // wait for first key put on prefix - opts := []v3.OpOption{v3.WithRev(resp.Header.Revision), v3.WithPrefix()} - wch := client.Watch(cctx, e.keyPrefix, opts...) - for kv == nil { - wr, ok := <-wch - if !ok || wr.Err() != nil { - cancel() - return - } - // only accept puts; a delete will make observe() spin - for _, ev := range wr.Events { - if ev.Type == mvccpb.PUT { - hdr, kv = &wr.Header, ev.Kv - // may have multiple revs; hdr.rev = the last rev - // set to kv's rev in case batch has multiple Puts - hdr.Revision = kv.ModRevision - break - } - } - } - cancel() - } else { - hdr, kv = resp.Header, resp.Kvs[0] - } - - select { - case ch <- v3.GetResponse{Header: hdr, Kvs: []*mvccpb.KeyValue{kv}}: - case <-ctx.Done(): - return - } - - cctx, cancel := context.WithCancel(ctx) - wch := client.Watch(cctx, string(kv.Key), v3.WithRev(hdr.Revision+1)) - keyDeleted := false - for !keyDeleted { - wr, ok := <-wch - if !ok { - cancel() - return - } - for _, ev := range wr.Events { - if ev.Type == mvccpb.DELETE { - keyDeleted = true - break - } - resp.Header = &wr.Header - resp.Kvs = []*mvccpb.KeyValue{ev.Kv} - select { - case ch <- *resp: - case <-cctx.Done(): - cancel() - return - } - } - } - cancel() - } -} - -// Key returns the leader key if elected, empty string otherwise. -func (e *Election) Key() string { return e.leaderKey } - -// Rev returns the leader key's creation revision, if elected. -func (e *Election) Rev() int64 { return e.leaderRev } - -// Header is the response header from the last successful election proposal. -func (e *Election) Header() *pb.ResponseHeader { return e.hdr } diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/key.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/key.go deleted file mode 100644 index 4b6e399bd..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/key.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package concurrency - -import ( - "context" - "fmt" - - v3 "github.com/coreos/etcd/clientv3" - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - "github.com/coreos/etcd/mvcc/mvccpb" -) - -func waitDelete(ctx context.Context, client *v3.Client, key string, rev int64) error { - cctx, cancel := context.WithCancel(ctx) - defer cancel() - - var wr v3.WatchResponse - wch := client.Watch(cctx, key, v3.WithRev(rev)) - for wr = range wch { - for _, ev := range wr.Events { - if ev.Type == mvccpb.DELETE { - return nil - } - } - } - if err := wr.Err(); err != nil { - return err - } - if err := ctx.Err(); err != nil { - return err - } - return fmt.Errorf("lost watcher waiting for delete") -} - -// waitDeletes efficiently waits until all keys matching the prefix and no greater -// than the create revision. -func waitDeletes(ctx context.Context, client *v3.Client, pfx string, maxCreateRev int64) (*pb.ResponseHeader, error) { - getOpts := append(v3.WithLastCreate(), v3.WithMaxCreateRev(maxCreateRev)) - for { - resp, err := client.Get(ctx, pfx, getOpts...) - if err != nil { - return nil, err - } - if len(resp.Kvs) == 0 { - return resp.Header, nil - } - lastKey := string(resp.Kvs[0].Key) - if err = waitDelete(ctx, client, lastKey, resp.Header.Revision); err != nil { - return nil, err - } - } -} diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/mutex.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/mutex.go deleted file mode 100644 index dac9ba5a2..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/mutex.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package concurrency - -import ( - "context" - "fmt" - "sync" - - v3 "github.com/coreos/etcd/clientv3" - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" -) - -// Mutex implements the sync Locker interface with etcd -type Mutex struct { - s *Session - - pfx string - myKey string - myRev int64 - hdr *pb.ResponseHeader -} - -func NewMutex(s *Session, pfx string) *Mutex { - return &Mutex{s, pfx + "/", "", -1, nil} -} - -// Lock locks the mutex with a cancelable context. If the context is canceled -// while trying to acquire the lock, the mutex tries to clean its stale lock entry. -func (m *Mutex) Lock(ctx context.Context) error { - s := m.s - client := m.s.Client() - - m.myKey = fmt.Sprintf("%s%x", m.pfx, s.Lease()) - cmp := v3.Compare(v3.CreateRevision(m.myKey), "=", 0) - // put self in lock waiters via myKey; oldest waiter holds lock - put := v3.OpPut(m.myKey, "", v3.WithLease(s.Lease())) - // reuse key in case this session already holds the lock - get := v3.OpGet(m.myKey) - // fetch current holder to complete uncontended path with only one RPC - getOwner := v3.OpGet(m.pfx, v3.WithFirstCreate()...) - resp, err := client.Txn(ctx).If(cmp).Then(put, getOwner).Else(get, getOwner).Commit() - if err != nil { - return err - } - m.myRev = resp.Header.Revision - if !resp.Succeeded { - m.myRev = resp.Responses[0].GetResponseRange().Kvs[0].CreateRevision - } - // if no key on prefix / the minimum rev is key, already hold the lock - ownerKey := resp.Responses[1].GetResponseRange().Kvs - if len(ownerKey) == 0 || ownerKey[0].CreateRevision == m.myRev { - m.hdr = resp.Header - return nil - } - - // wait for deletion revisions prior to myKey - hdr, werr := waitDeletes(ctx, client, m.pfx, m.myRev-1) - // release lock key if cancelled - select { - case <-ctx.Done(): - m.Unlock(client.Ctx()) - default: - m.hdr = hdr - } - return werr -} - -func (m *Mutex) Unlock(ctx context.Context) error { - client := m.s.Client() - if _, err := client.Delete(ctx, m.myKey); err != nil { - return err - } - m.myKey = "\x00" - m.myRev = -1 - return nil -} - -func (m *Mutex) IsOwner() v3.Cmp { - return v3.Compare(v3.CreateRevision(m.myKey), "=", m.myRev) -} - -func (m *Mutex) Key() string { return m.myKey } - -// Header is the response header received from etcd on acquiring the lock. -func (m *Mutex) Header() *pb.ResponseHeader { return m.hdr } - -type lockerMutex struct{ *Mutex } - -func (lm *lockerMutex) Lock() { - client := lm.s.Client() - if err := lm.Mutex.Lock(client.Ctx()); err != nil { - panic(err) - } -} -func (lm *lockerMutex) Unlock() { - client := lm.s.Client() - if err := lm.Mutex.Unlock(client.Ctx()); err != nil { - panic(err) - } -} - -// NewLocker creates a sync.Locker backed by an etcd mutex. -func NewLocker(s *Session, pfx string) sync.Locker { - return &lockerMutex{NewMutex(s, pfx)} -} diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/session.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/session.go deleted file mode 100644 index c399d64a6..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/session.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package concurrency - -import ( - "context" - "time" - - v3 "github.com/coreos/etcd/clientv3" -) - -const defaultSessionTTL = 60 - -// Session represents a lease kept alive for the lifetime of a client. -// Fault-tolerant applications may use sessions to reason about liveness. -type Session struct { - client *v3.Client - opts *sessionOptions - id v3.LeaseID - - cancel context.CancelFunc - donec <-chan struct{} -} - -// NewSession gets the leased session for a client. -func NewSession(client *v3.Client, opts ...SessionOption) (*Session, error) { - ops := &sessionOptions{ttl: defaultSessionTTL, ctx: client.Ctx()} - for _, opt := range opts { - opt(ops) - } - - id := ops.leaseID - if id == v3.NoLease { - resp, err := client.Grant(ops.ctx, int64(ops.ttl)) - if err != nil { - return nil, err - } - id = v3.LeaseID(resp.ID) - } - - ctx, cancel := context.WithCancel(ops.ctx) - keepAlive, err := client.KeepAlive(ctx, id) - if err != nil || keepAlive == nil { - cancel() - return nil, err - } - - donec := make(chan struct{}) - s := &Session{client: client, opts: ops, id: id, cancel: cancel, donec: donec} - - // keep the lease alive until client error or cancelled context - go func() { - defer close(donec) - for range keepAlive { - // eat messages until keep alive channel closes - } - }() - - return s, nil -} - -// Client is the etcd client that is attached to the session. -func (s *Session) Client() *v3.Client { - return s.client -} - -// Lease is the lease ID for keys bound to the session. -func (s *Session) Lease() v3.LeaseID { return s.id } - -// Done returns a channel that closes when the lease is orphaned, expires, or -// is otherwise no longer being refreshed. -func (s *Session) Done() <-chan struct{} { return s.donec } - -// Orphan ends the refresh for the session lease. This is useful -// in case the state of the client connection is indeterminate (revoke -// would fail) or when transferring lease ownership. -func (s *Session) Orphan() { - s.cancel() - <-s.donec -} - -// Close orphans the session and revokes the session lease. -func (s *Session) Close() error { - s.Orphan() - // if revoke takes longer than the ttl, lease is expired anyway - ctx, cancel := context.WithTimeout(s.opts.ctx, time.Duration(s.opts.ttl)*time.Second) - _, err := s.client.Revoke(ctx, s.id) - cancel() - return err -} - -type sessionOptions struct { - ttl int - leaseID v3.LeaseID - ctx context.Context -} - -// SessionOption configures Session. -type SessionOption func(*sessionOptions) - -// WithTTL configures the session's TTL in seconds. -// If TTL is <= 0, the default 60 seconds TTL will be used. -func WithTTL(ttl int) SessionOption { - return func(so *sessionOptions) { - if ttl > 0 { - so.ttl = ttl - } - } -} - -// WithLease specifies the existing leaseID to be used for the session. -// This is useful in process restart scenario, for example, to reclaim -// leadership from an election prior to restart. -func WithLease(leaseID v3.LeaseID) SessionOption { - return func(so *sessionOptions) { - so.leaseID = leaseID - } -} - -// WithContext assigns a context to the session instead of defaulting to -// using the client context. This is useful for canceling NewSession and -// Close operations immediately without having to close the client. If the -// context is canceled before Close() completes, the session's lease will be -// abandoned and left to expire instead of being revoked. -func WithContext(ctx context.Context) SessionOption { - return func(so *sessionOptions) { - so.ctx = ctx - } -} diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/stm.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/stm.go deleted file mode 100644 index d11023ebe..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/stm.go +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package concurrency - -import ( - "context" - "math" - - v3 "github.com/coreos/etcd/clientv3" -) - -// STM is an interface for software transactional memory. -type STM interface { - // Get returns the value for a key and inserts the key in the txn's read set. - // If Get fails, it aborts the transaction with an error, never returning. - Get(key ...string) string - // Put adds a value for a key to the write set. - Put(key, val string, opts ...v3.OpOption) - // Rev returns the revision of a key in the read set. - Rev(key string) int64 - // Del deletes a key. - Del(key string) - - // commit attempts to apply the txn's changes to the server. - commit() *v3.TxnResponse - reset() -} - -// Isolation is an enumeration of transactional isolation levels which -// describes how transactions should interfere and conflict. -type Isolation int - -const ( - // SerializableSnapshot provides serializable isolation and also checks - // for write conflicts. - SerializableSnapshot Isolation = iota - // Serializable reads within the same transaction attempt return data - // from the at the revision of the first read. - Serializable - // RepeatableReads reads within the same transaction attempt always - // return the same data. - RepeatableReads - // ReadCommitted reads keys from any committed revision. - ReadCommitted -) - -// stmError safely passes STM errors through panic to the STM error channel. -type stmError struct{ err error } - -type stmOptions struct { - iso Isolation - ctx context.Context - prefetch []string -} - -type stmOption func(*stmOptions) - -// WithIsolation specifies the transaction isolation level. -func WithIsolation(lvl Isolation) stmOption { - return func(so *stmOptions) { so.iso = lvl } -} - -// WithAbortContext specifies the context for permanently aborting the transaction. -func WithAbortContext(ctx context.Context) stmOption { - return func(so *stmOptions) { so.ctx = ctx } -} - -// WithPrefetch is a hint to prefetch a list of keys before trying to apply. -// If an STM transaction will unconditionally fetch a set of keys, prefetching -// those keys will save the round-trip cost from requesting each key one by one -// with Get(). -func WithPrefetch(keys ...string) stmOption { - return func(so *stmOptions) { so.prefetch = append(so.prefetch, keys...) } -} - -// NewSTM initiates a new STM instance, using serializable snapshot isolation by default. -func NewSTM(c *v3.Client, apply func(STM) error, so ...stmOption) (*v3.TxnResponse, error) { - opts := &stmOptions{ctx: c.Ctx()} - for _, f := range so { - f(opts) - } - if len(opts.prefetch) != 0 { - f := apply - apply = func(s STM) error { - s.Get(opts.prefetch...) - return f(s) - } - } - return runSTM(mkSTM(c, opts), apply) -} - -func mkSTM(c *v3.Client, opts *stmOptions) STM { - switch opts.iso { - case SerializableSnapshot: - s := &stmSerializable{ - stm: stm{client: c, ctx: opts.ctx}, - prefetch: make(map[string]*v3.GetResponse), - } - s.conflicts = func() []v3.Cmp { - return append(s.rset.cmps(), s.wset.cmps(s.rset.first()+1)...) - } - return s - case Serializable: - s := &stmSerializable{ - stm: stm{client: c, ctx: opts.ctx}, - prefetch: make(map[string]*v3.GetResponse), - } - s.conflicts = func() []v3.Cmp { return s.rset.cmps() } - return s - case RepeatableReads: - s := &stm{client: c, ctx: opts.ctx, getOpts: []v3.OpOption{v3.WithSerializable()}} - s.conflicts = func() []v3.Cmp { return s.rset.cmps() } - return s - case ReadCommitted: - s := &stm{client: c, ctx: opts.ctx, getOpts: []v3.OpOption{v3.WithSerializable()}} - s.conflicts = func() []v3.Cmp { return nil } - return s - default: - panic("unsupported stm") - } -} - -type stmResponse struct { - resp *v3.TxnResponse - err error -} - -func runSTM(s STM, apply func(STM) error) (*v3.TxnResponse, error) { - outc := make(chan stmResponse, 1) - go func() { - defer func() { - if r := recover(); r != nil { - e, ok := r.(stmError) - if !ok { - // client apply panicked - panic(r) - } - outc <- stmResponse{nil, e.err} - } - }() - var out stmResponse - for { - s.reset() - if out.err = apply(s); out.err != nil { - break - } - if out.resp = s.commit(); out.resp != nil { - break - } - } - outc <- out - }() - r := <-outc - return r.resp, r.err -} - -// stm implements repeatable-read software transactional memory over etcd -type stm struct { - client *v3.Client - ctx context.Context - // rset holds read key values and revisions - rset readSet - // wset holds overwritten keys and their values - wset writeSet - // getOpts are the opts used for gets - getOpts []v3.OpOption - // conflicts computes the current conflicts on the txn - conflicts func() []v3.Cmp -} - -type stmPut struct { - val string - op v3.Op -} - -type readSet map[string]*v3.GetResponse - -func (rs readSet) add(keys []string, txnresp *v3.TxnResponse) { - for i, resp := range txnresp.Responses { - rs[keys[i]] = (*v3.GetResponse)(resp.GetResponseRange()) - } -} - -// first returns the store revision from the first fetch -func (rs readSet) first() int64 { - ret := int64(math.MaxInt64 - 1) - for _, resp := range rs { - if rev := resp.Header.Revision; rev < ret { - ret = rev - } - } - return ret -} - -// cmps guards the txn from updates to read set -func (rs readSet) cmps() []v3.Cmp { - cmps := make([]v3.Cmp, 0, len(rs)) - for k, rk := range rs { - cmps = append(cmps, isKeyCurrent(k, rk)) - } - return cmps -} - -type writeSet map[string]stmPut - -func (ws writeSet) get(keys ...string) *stmPut { - for _, key := range keys { - if wv, ok := ws[key]; ok { - return &wv - } - } - return nil -} - -// cmps returns a cmp list testing no writes have happened past rev -func (ws writeSet) cmps(rev int64) []v3.Cmp { - cmps := make([]v3.Cmp, 0, len(ws)) - for key := range ws { - cmps = append(cmps, v3.Compare(v3.ModRevision(key), "<", rev)) - } - return cmps -} - -// puts is the list of ops for all pending writes -func (ws writeSet) puts() []v3.Op { - puts := make([]v3.Op, 0, len(ws)) - for _, v := range ws { - puts = append(puts, v.op) - } - return puts -} - -func (s *stm) Get(keys ...string) string { - if wv := s.wset.get(keys...); wv != nil { - return wv.val - } - return respToValue(s.fetch(keys...)) -} - -func (s *stm) Put(key, val string, opts ...v3.OpOption) { - s.wset[key] = stmPut{val, v3.OpPut(key, val, opts...)} -} - -func (s *stm) Del(key string) { s.wset[key] = stmPut{"", v3.OpDelete(key)} } - -func (s *stm) Rev(key string) int64 { - if resp := s.fetch(key); resp != nil && len(resp.Kvs) != 0 { - return resp.Kvs[0].ModRevision - } - return 0 -} - -func (s *stm) commit() *v3.TxnResponse { - txnresp, err := s.client.Txn(s.ctx).If(s.conflicts()...).Then(s.wset.puts()...).Commit() - if err != nil { - panic(stmError{err}) - } - if txnresp.Succeeded { - return txnresp - } - return nil -} - -func (s *stm) fetch(keys ...string) *v3.GetResponse { - if len(keys) == 0 { - return nil - } - ops := make([]v3.Op, len(keys)) - for i, key := range keys { - if resp, ok := s.rset[key]; ok { - return resp - } - ops[i] = v3.OpGet(key, s.getOpts...) - } - txnresp, err := s.client.Txn(s.ctx).Then(ops...).Commit() - if err != nil { - panic(stmError{err}) - } - s.rset.add(keys, txnresp) - return (*v3.GetResponse)(txnresp.Responses[0].GetResponseRange()) -} - -func (s *stm) reset() { - s.rset = make(map[string]*v3.GetResponse) - s.wset = make(map[string]stmPut) -} - -type stmSerializable struct { - stm - prefetch map[string]*v3.GetResponse -} - -func (s *stmSerializable) Get(keys ...string) string { - if wv := s.wset.get(keys...); wv != nil { - return wv.val - } - firstRead := len(s.rset) == 0 - for _, key := range keys { - if resp, ok := s.prefetch[key]; ok { - delete(s.prefetch, key) - s.rset[key] = resp - } - } - resp := s.stm.fetch(keys...) - if firstRead { - // txn's base revision is defined by the first read - s.getOpts = []v3.OpOption{ - v3.WithRev(resp.Header.Revision), - v3.WithSerializable(), - } - } - return respToValue(resp) -} - -func (s *stmSerializable) Rev(key string) int64 { - s.Get(key) - return s.stm.Rev(key) -} - -func (s *stmSerializable) gets() ([]string, []v3.Op) { - keys := make([]string, 0, len(s.rset)) - ops := make([]v3.Op, 0, len(s.rset)) - for k := range s.rset { - keys = append(keys, k) - ops = append(ops, v3.OpGet(k)) - } - return keys, ops -} - -func (s *stmSerializable) commit() *v3.TxnResponse { - keys, getops := s.gets() - txn := s.client.Txn(s.ctx).If(s.conflicts()...).Then(s.wset.puts()...) - // use Else to prefetch keys in case of conflict to save a round trip - txnresp, err := txn.Else(getops...).Commit() - if err != nil { - panic(stmError{err}) - } - if txnresp.Succeeded { - return txnresp - } - // load prefetch with Else data - s.rset.add(keys, txnresp) - s.prefetch = s.rset - s.getOpts = nil - return nil -} - -func isKeyCurrent(k string, r *v3.GetResponse) v3.Cmp { - if len(r.Kvs) != 0 { - return v3.Compare(v3.ModRevision(k), "=", r.Kvs[0].ModRevision) - } - return v3.Compare(v3.ModRevision(k), "=", 0) -} - -func respToValue(resp *v3.GetResponse) string { - if resp == nil || len(resp.Kvs) == 0 { - return "" - } - return string(resp.Kvs[0].Value) -} - -// NewSTMRepeatable is deprecated. -func NewSTMRepeatable(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) { - return NewSTM(c, apply, WithAbortContext(ctx), WithIsolation(RepeatableReads)) -} - -// NewSTMSerializable is deprecated. -func NewSTMSerializable(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) { - return NewSTM(c, apply, WithAbortContext(ctx), WithIsolation(Serializable)) -} - -// NewSTMReadCommitted is deprecated. -func NewSTMReadCommitted(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) { - return NewSTM(c, apply, WithAbortContext(ctx), WithIsolation(ReadCommitted)) -} diff --git a/vendor/github.com/coreos/etcd/clientv3/config.go b/vendor/github.com/coreos/etcd/clientv3/config.go deleted file mode 100644 index 79d6e2a98..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/config.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "crypto/tls" - "time" - - "google.golang.org/grpc" -) - -type Config struct { - // Endpoints is a list of URLs. - Endpoints []string `json:"endpoints"` - - // AutoSyncInterval is the interval to update endpoints with its latest members. - // 0 disables auto-sync. By default auto-sync is disabled. - AutoSyncInterval time.Duration `json:"auto-sync-interval"` - - // DialTimeout is the timeout for failing to establish a connection. - DialTimeout time.Duration `json:"dial-timeout"` - - // DialKeepAliveTime is the time after which client pings the server to see if - // transport is alive. - DialKeepAliveTime time.Duration `json:"dial-keep-alive-time"` - - // DialKeepAliveTimeout is the time that the client waits for a response for the - // keep-alive probe. If the response is not received in this time, the connection is closed. - DialKeepAliveTimeout time.Duration `json:"dial-keep-alive-timeout"` - - // MaxCallSendMsgSize is the client-side request send limit in bytes. - // If 0, it defaults to 2.0 MiB (2 * 1024 * 1024). - // Make sure that "MaxCallSendMsgSize" < server-side default send/recv limit. - // ("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes"). - MaxCallSendMsgSize int - - // MaxCallRecvMsgSize is the client-side response receive limit. - // If 0, it defaults to "math.MaxInt32", because range response can - // easily exceed request send limits. - // Make sure that "MaxCallRecvMsgSize" >= server-side default send/recv limit. - // ("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes"). - MaxCallRecvMsgSize int - - // TLS holds the client secure credentials, if any. - TLS *tls.Config - - // Username is a user name for authentication. - Username string `json:"username"` - - // Password is a password for authentication. - Password string `json:"password"` - - // RejectOldCluster when set will refuse to create a client against an outdated cluster. - RejectOldCluster bool `json:"reject-old-cluster"` - - // DialOptions is a list of dial options for the grpc client (e.g., for interceptors). - DialOptions []grpc.DialOption - - // Context is the default client context; it can be used to cancel grpc dial out and - // other operations that do not have an explicit context. - Context context.Context -} diff --git a/vendor/github.com/coreos/etcd/clientv3/doc.go b/vendor/github.com/coreos/etcd/clientv3/doc.go deleted file mode 100644 index 717fbe435..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/doc.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package clientv3 implements the official Go etcd client for v3. -// -// Create client using `clientv3.New`: -// -// // expect dial time-out on ipv4 blackhole -// _, err := clientv3.New(clientv3.Config{ -// Endpoints: []string{"http://254.0.0.1:12345"}, -// DialTimeout: 2 * time.Second -// }) -// -// // etcd clientv3 >= v3.2.10, grpc/grpc-go >= v1.7.3 -// if err == context.DeadlineExceeded { -// // handle errors -// } -// -// // etcd clientv3 <= v3.2.9, grpc/grpc-go <= v1.2.1 -// if err == grpc.ErrClientConnTimeout { -// // handle errors -// } -// -// cli, err := clientv3.New(clientv3.Config{ -// Endpoints: []string{"localhost:2379", "localhost:22379", "localhost:32379"}, -// DialTimeout: 5 * time.Second, -// }) -// if err != nil { -// // handle error! -// } -// defer cli.Close() -// -// Make sure to close the client after using it. If the client is not closed, the -// connection will have leaky goroutines. -// -// To specify a client request timeout, wrap the context with context.WithTimeout: -// -// ctx, cancel := context.WithTimeout(context.Background(), timeout) -// resp, err := kvc.Put(ctx, "sample_key", "sample_value") -// cancel() -// if err != nil { -// // handle error! -// } -// // use the response -// -// The Client has internal state (watchers and leases), so Clients should be reused instead of created as needed. -// Clients are safe for concurrent use by multiple goroutines. -// -// etcd client returns 3 types of errors: -// -// 1. context error: canceled or deadline exceeded. -// 2. gRPC status error: e.g. when clock drifts in server-side before client's context deadline exceeded. -// 3. gRPC error: see https://github.com/coreos/etcd/blob/master/etcdserver/api/v3rpc/rpctypes/error.go -// -// Here is the example code to handle client errors: -// -// resp, err := kvc.Put(ctx, "", "") -// if err != nil { -// if err == context.Canceled { -// // ctx is canceled by another routine -// } else if err == context.DeadlineExceeded { -// // ctx is attached with a deadline and it exceeded -// } else if ev, ok := status.FromError(err); ok { -// code := ev.Code() -// if code == codes.DeadlineExceeded { -// // server-side context might have timed-out first (due to clock skew) -// // while original client-side context is not timed-out yet -// } -// } else if verr, ok := err.(*v3rpc.ErrEmptyKey); ok { -// // process (verr.Errors) -// } else { -// // bad cluster endpoints, which are not etcd servers -// } -// } -// -// go func() { cli.Close() }() -// _, err := kvc.Get(ctx, "a") -// if err != nil { -// if err == context.Canceled { -// // grpc balancer calls 'Get' with an inflight client.Close -// } else if err == grpc.ErrClientConnClosing { -// // grpc balancer calls 'Get' after client.Close. -// } -// } -// -package clientv3 diff --git a/vendor/github.com/coreos/etcd/clientv3/health_balancer.go b/vendor/github.com/coreos/etcd/clientv3/health_balancer.go deleted file mode 100644 index 5918cba84..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/health_balancer.go +++ /dev/null @@ -1,609 +0,0 @@ -// Copyright 2017 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "errors" - "net/url" - "strings" - "sync" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - healthpb "google.golang.org/grpc/health/grpc_health_v1" - "google.golang.org/grpc/status" -) - -const ( - minHealthRetryDuration = 3 * time.Second - unknownService = "unknown service grpc.health.v1.Health" -) - -// ErrNoAddrAvilable is returned by Get() when the balancer does not have -// any active connection to endpoints at the time. -// This error is returned only when opts.BlockingWait is true. -var ErrNoAddrAvilable = status.Error(codes.Unavailable, "there is no address available") - -type healthCheckFunc func(ep string) (bool, error) - -type notifyMsg int - -const ( - notifyReset notifyMsg = iota - notifyNext -) - -// healthBalancer does the bare minimum to expose multiple eps -// to the grpc reconnection code path -type healthBalancer struct { - // addrs are the client's endpoint addresses for grpc - addrs []grpc.Address - - // eps holds the raw endpoints from the client - eps []string - - // notifyCh notifies grpc of the set of addresses for connecting - notifyCh chan []grpc.Address - - // readyc closes once the first connection is up - readyc chan struct{} - readyOnce sync.Once - - // healthCheck checks an endpoint's health. - healthCheck healthCheckFunc - healthCheckTimeout time.Duration - - unhealthyMu sync.RWMutex - unhealthyHostPorts map[string]time.Time - - // mu protects all fields below. - mu sync.RWMutex - - // upc closes when pinAddr transitions from empty to non-empty or the balancer closes. - upc chan struct{} - - // downc closes when grpc calls down() on pinAddr - downc chan struct{} - - // stopc is closed to signal updateNotifyLoop should stop. - stopc chan struct{} - stopOnce sync.Once - wg sync.WaitGroup - - // donec closes when all goroutines are exited - donec chan struct{} - - // updateAddrsC notifies updateNotifyLoop to update addrs. - updateAddrsC chan notifyMsg - - // grpc issues TLS cert checks using the string passed into dial so - // that string must be the host. To recover the full scheme://host URL, - // have a map from hosts to the original endpoint. - hostPort2ep map[string]string - - // pinAddr is the currently pinned address; set to the empty string on - // initialization and shutdown. - pinAddr string - - closed bool -} - -func newHealthBalancer(eps []string, timeout time.Duration, hc healthCheckFunc) *healthBalancer { - notifyCh := make(chan []grpc.Address) - addrs := eps2addrs(eps) - hb := &healthBalancer{ - addrs: addrs, - eps: eps, - notifyCh: notifyCh, - readyc: make(chan struct{}), - healthCheck: hc, - unhealthyHostPorts: make(map[string]time.Time), - upc: make(chan struct{}), - stopc: make(chan struct{}), - downc: make(chan struct{}), - donec: make(chan struct{}), - updateAddrsC: make(chan notifyMsg), - hostPort2ep: getHostPort2ep(eps), - } - if timeout < minHealthRetryDuration { - timeout = minHealthRetryDuration - } - hb.healthCheckTimeout = timeout - - close(hb.downc) - go hb.updateNotifyLoop() - hb.wg.Add(1) - go func() { - defer hb.wg.Done() - hb.updateUnhealthy() - }() - return hb -} - -func (b *healthBalancer) Start(target string, config grpc.BalancerConfig) error { return nil } - -func (b *healthBalancer) ConnectNotify() <-chan struct{} { - b.mu.Lock() - defer b.mu.Unlock() - return b.upc -} - -func (b *healthBalancer) ready() <-chan struct{} { return b.readyc } - -func (b *healthBalancer) endpoint(hostPort string) string { - b.mu.RLock() - defer b.mu.RUnlock() - return b.hostPort2ep[hostPort] -} - -func (b *healthBalancer) pinned() string { - b.mu.RLock() - defer b.mu.RUnlock() - return b.pinAddr -} - -func (b *healthBalancer) hostPortError(hostPort string, err error) { - if b.endpoint(hostPort) == "" { - logger.Lvl(4).Infof("clientv3/balancer: %q is stale (skip marking as unhealthy on %q)", hostPort, err.Error()) - return - } - - b.unhealthyMu.Lock() - b.unhealthyHostPorts[hostPort] = time.Now() - b.unhealthyMu.Unlock() - logger.Lvl(4).Infof("clientv3/balancer: %q is marked unhealthy (%q)", hostPort, err.Error()) -} - -func (b *healthBalancer) removeUnhealthy(hostPort, msg string) { - if b.endpoint(hostPort) == "" { - logger.Lvl(4).Infof("clientv3/balancer: %q was not in unhealthy (%q)", hostPort, msg) - return - } - - b.unhealthyMu.Lock() - delete(b.unhealthyHostPorts, hostPort) - b.unhealthyMu.Unlock() - logger.Lvl(4).Infof("clientv3/balancer: %q is removed from unhealthy (%q)", hostPort, msg) -} - -func (b *healthBalancer) countUnhealthy() (count int) { - b.unhealthyMu.RLock() - count = len(b.unhealthyHostPorts) - b.unhealthyMu.RUnlock() - return count -} - -func (b *healthBalancer) isUnhealthy(hostPort string) (unhealthy bool) { - b.unhealthyMu.RLock() - _, unhealthy = b.unhealthyHostPorts[hostPort] - b.unhealthyMu.RUnlock() - return unhealthy -} - -func (b *healthBalancer) cleanupUnhealthy() { - b.unhealthyMu.Lock() - for k, v := range b.unhealthyHostPorts { - if time.Since(v) > b.healthCheckTimeout { - delete(b.unhealthyHostPorts, k) - logger.Lvl(4).Infof("clientv3/balancer: removed %q from unhealthy after %v", k, b.healthCheckTimeout) - } - } - b.unhealthyMu.Unlock() -} - -func (b *healthBalancer) liveAddrs() ([]grpc.Address, map[string]struct{}) { - unhealthyCnt := b.countUnhealthy() - - b.mu.RLock() - defer b.mu.RUnlock() - - hbAddrs := b.addrs - if len(b.addrs) == 1 || unhealthyCnt == 0 || unhealthyCnt == len(b.addrs) { - liveHostPorts := make(map[string]struct{}, len(b.hostPort2ep)) - for k := range b.hostPort2ep { - liveHostPorts[k] = struct{}{} - } - return hbAddrs, liveHostPorts - } - - addrs := make([]grpc.Address, 0, len(b.addrs)-unhealthyCnt) - liveHostPorts := make(map[string]struct{}, len(addrs)) - for _, addr := range b.addrs { - if !b.isUnhealthy(addr.Addr) { - addrs = append(addrs, addr) - liveHostPorts[addr.Addr] = struct{}{} - } - } - return addrs, liveHostPorts -} - -func (b *healthBalancer) updateUnhealthy() { - for { - select { - case <-time.After(b.healthCheckTimeout): - b.cleanupUnhealthy() - pinned := b.pinned() - if pinned == "" || b.isUnhealthy(pinned) { - select { - case b.updateAddrsC <- notifyNext: - case <-b.stopc: - return - } - } - case <-b.stopc: - return - } - } -} - -func (b *healthBalancer) updateAddrs(eps ...string) { - np := getHostPort2ep(eps) - - b.mu.Lock() - defer b.mu.Unlock() - - match := len(np) == len(b.hostPort2ep) - if match { - for k, v := range np { - if b.hostPort2ep[k] != v { - match = false - break - } - } - } - if match { - // same endpoints, so no need to update address - return - } - - b.hostPort2ep = np - b.addrs, b.eps = eps2addrs(eps), eps - - b.unhealthyMu.Lock() - b.unhealthyHostPorts = make(map[string]time.Time) - b.unhealthyMu.Unlock() -} - -func (b *healthBalancer) next() { - b.mu.RLock() - downc := b.downc - b.mu.RUnlock() - select { - case b.updateAddrsC <- notifyNext: - case <-b.stopc: - } - // wait until disconnect so new RPCs are not issued on old connection - select { - case <-downc: - case <-b.stopc: - } -} - -func (b *healthBalancer) updateNotifyLoop() { - defer close(b.donec) - - for { - b.mu.RLock() - upc, downc, addr := b.upc, b.downc, b.pinAddr - b.mu.RUnlock() - // downc or upc should be closed - select { - case <-downc: - downc = nil - default: - } - select { - case <-upc: - upc = nil - default: - } - switch { - case downc == nil && upc == nil: - // stale - select { - case <-b.stopc: - return - default: - } - case downc == nil: - b.notifyAddrs(notifyReset) - select { - case <-upc: - case msg := <-b.updateAddrsC: - b.notifyAddrs(msg) - case <-b.stopc: - return - } - case upc == nil: - select { - // close connections that are not the pinned address - case b.notifyCh <- []grpc.Address{{Addr: addr}}: - case <-downc: - case <-b.stopc: - return - } - select { - case <-downc: - b.notifyAddrs(notifyReset) - case msg := <-b.updateAddrsC: - b.notifyAddrs(msg) - case <-b.stopc: - return - } - } - } -} - -func (b *healthBalancer) notifyAddrs(msg notifyMsg) { - if msg == notifyNext { - select { - case b.notifyCh <- []grpc.Address{}: - case <-b.stopc: - return - } - } - b.mu.RLock() - pinAddr := b.pinAddr - downc := b.downc - b.mu.RUnlock() - addrs, hostPorts := b.liveAddrs() - - var waitDown bool - if pinAddr != "" { - _, ok := hostPorts[pinAddr] - waitDown = !ok - } - - select { - case b.notifyCh <- addrs: - if waitDown { - select { - case <-downc: - case <-b.stopc: - } - } - case <-b.stopc: - } -} - -func (b *healthBalancer) Up(addr grpc.Address) func(error) { - if !b.mayPin(addr) { - return func(err error) {} - } - - b.mu.Lock() - defer b.mu.Unlock() - - // gRPC might call Up after it called Close. We add this check - // to "fix" it up at application layer. Otherwise, will panic - // if b.upc is already closed. - if b.closed { - return func(err error) {} - } - - // gRPC might call Up on a stale address. - // Prevent updating pinAddr with a stale address. - if !hasAddr(b.addrs, addr.Addr) { - return func(err error) {} - } - - if b.pinAddr != "" { - logger.Lvl(4).Infof("clientv3/balancer: %q is up but not pinned (already pinned %q)", addr.Addr, b.pinAddr) - return func(err error) {} - } - - // notify waiting Get()s and pin first connected address - close(b.upc) - b.downc = make(chan struct{}) - b.pinAddr = addr.Addr - logger.Lvl(4).Infof("clientv3/balancer: pin %q", addr.Addr) - - // notify client that a connection is up - b.readyOnce.Do(func() { close(b.readyc) }) - - return func(err error) { - // If connected to a black hole endpoint or a killed server, the gRPC ping - // timeout will induce a network I/O error, and retrying until success; - // finding healthy endpoint on retry could take several timeouts and redials. - // To avoid wasting retries, gray-list unhealthy endpoints. - b.hostPortError(addr.Addr, err) - - b.mu.Lock() - b.upc = make(chan struct{}) - close(b.downc) - b.pinAddr = "" - b.mu.Unlock() - logger.Lvl(4).Infof("clientv3/balancer: unpin %q (%q)", addr.Addr, err.Error()) - } -} - -func (b *healthBalancer) mayPin(addr grpc.Address) bool { - if b.endpoint(addr.Addr) == "" { // stale host:port - return false - } - - b.unhealthyMu.RLock() - unhealthyCnt := len(b.unhealthyHostPorts) - failedTime, bad := b.unhealthyHostPorts[addr.Addr] - b.unhealthyMu.RUnlock() - - b.mu.RLock() - skip := len(b.addrs) == 1 || unhealthyCnt == 0 || len(b.addrs) == unhealthyCnt - b.mu.RUnlock() - if skip || !bad { - return true - } - - // prevent isolated member's endpoint from being infinitely retried, as follows: - // 1. keepalive pings detects GoAway with http2.ErrCodeEnhanceYourCalm - // 2. balancer 'Up' unpins with grpc: failed with network I/O error - // 3. grpc-healthcheck still SERVING, thus retry to pin - // instead, return before grpc-healthcheck if failed within healthcheck timeout - if elapsed := time.Since(failedTime); elapsed < b.healthCheckTimeout { - logger.Lvl(4).Infof("clientv3/balancer: %q is up but not pinned (failed %v ago, require minimum %v after failure)", addr.Addr, elapsed, b.healthCheckTimeout) - return false - } - - if ok, _ := b.healthCheck(addr.Addr); ok { - b.removeUnhealthy(addr.Addr, "health check success") - return true - } - - b.hostPortError(addr.Addr, errors.New("health check failed")) - return false -} - -func (b *healthBalancer) Get(ctx context.Context, opts grpc.BalancerGetOptions) (grpc.Address, func(), error) { - var ( - addr string - closed bool - ) - - // If opts.BlockingWait is false (for fail-fast RPCs), it should return - // an address it has notified via Notify immediately instead of blocking. - if !opts.BlockingWait { - b.mu.RLock() - closed = b.closed - addr = b.pinAddr - b.mu.RUnlock() - if closed { - return grpc.Address{Addr: ""}, nil, grpc.ErrClientConnClosing - } - if addr == "" { - return grpc.Address{Addr: ""}, nil, ErrNoAddrAvilable - } - return grpc.Address{Addr: addr}, func() {}, nil - } - - for { - b.mu.RLock() - ch := b.upc - b.mu.RUnlock() - select { - case <-ch: - case <-b.donec: - return grpc.Address{Addr: ""}, nil, grpc.ErrClientConnClosing - case <-ctx.Done(): - return grpc.Address{Addr: ""}, nil, ctx.Err() - } - b.mu.RLock() - closed = b.closed - addr = b.pinAddr - b.mu.RUnlock() - // Close() which sets b.closed = true can be called before Get(), Get() must exit if balancer is closed. - if closed { - return grpc.Address{Addr: ""}, nil, grpc.ErrClientConnClosing - } - if addr != "" { - break - } - } - return grpc.Address{Addr: addr}, func() {}, nil -} - -func (b *healthBalancer) Notify() <-chan []grpc.Address { return b.notifyCh } - -func (b *healthBalancer) Close() error { - b.mu.Lock() - // In case gRPC calls close twice. TODO: remove the checking - // when we are sure that gRPC wont call close twice. - if b.closed { - b.mu.Unlock() - <-b.donec - return nil - } - b.closed = true - b.stopOnce.Do(func() { close(b.stopc) }) - b.pinAddr = "" - - // In the case of following scenario: - // 1. upc is not closed; no pinned address - // 2. client issues an RPC, calling invoke(), which calls Get(), enters for loop, blocks - // 3. client.conn.Close() calls balancer.Close(); closed = true - // 4. for loop in Get() never exits since ctx is the context passed in by the client and may not be canceled - // we must close upc so Get() exits from blocking on upc - select { - case <-b.upc: - default: - // terminate all waiting Get()s - close(b.upc) - } - - b.mu.Unlock() - b.wg.Wait() - - // wait for updateNotifyLoop to finish - <-b.donec - close(b.notifyCh) - - return nil -} - -func grpcHealthCheck(client *Client, ep string) (bool, error) { - conn, err := client.dial(ep) - if err != nil { - return false, err - } - defer conn.Close() - cli := healthpb.NewHealthClient(conn) - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - resp, err := cli.Check(ctx, &healthpb.HealthCheckRequest{}) - cancel() - if err != nil { - if s, ok := status.FromError(err); ok && s.Code() == codes.Unavailable { - if s.Message() == unknownService { // etcd < v3.3.0 - return true, nil - } - } - return false, err - } - return resp.Status == healthpb.HealthCheckResponse_SERVING, nil -} - -func hasAddr(addrs []grpc.Address, targetAddr string) bool { - for _, addr := range addrs { - if targetAddr == addr.Addr { - return true - } - } - return false -} - -func getHost(ep string) string { - url, uerr := url.Parse(ep) - if uerr != nil || !strings.Contains(ep, "://") { - return ep - } - return url.Host -} - -func eps2addrs(eps []string) []grpc.Address { - addrs := make([]grpc.Address, len(eps)) - for i := range eps { - addrs[i].Addr = getHost(eps[i]) - } - return addrs -} - -func getHostPort2ep(eps []string) map[string]string { - hm := make(map[string]string, len(eps)) - for i := range eps { - _, host, _ := parseEndpoint(eps[i]) - hm[host] = eps[i] - } - return hm -} diff --git a/vendor/github.com/coreos/etcd/clientv3/kv.go b/vendor/github.com/coreos/etcd/clientv3/kv.go deleted file mode 100644 index 5a7469bd4..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/kv.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - - "google.golang.org/grpc" -) - -type ( - CompactResponse pb.CompactionResponse - PutResponse pb.PutResponse - GetResponse pb.RangeResponse - DeleteResponse pb.DeleteRangeResponse - TxnResponse pb.TxnResponse -) - -type KV interface { - // Put puts a key-value pair into etcd. - // Note that key,value can be plain bytes array and string is - // an immutable representation of that bytes array. - // To get a string of bytes, do string([]byte{0x10, 0x20}). - Put(ctx context.Context, key, val string, opts ...OpOption) (*PutResponse, error) - - // Get retrieves keys. - // By default, Get will return the value for "key", if any. - // When passed WithRange(end), Get will return the keys in the range [key, end). - // When passed WithFromKey(), Get returns keys greater than or equal to key. - // When passed WithRev(rev) with rev > 0, Get retrieves keys at the given revision; - // if the required revision is compacted, the request will fail with ErrCompacted . - // When passed WithLimit(limit), the number of returned keys is bounded by limit. - // When passed WithSort(), the keys will be sorted. - Get(ctx context.Context, key string, opts ...OpOption) (*GetResponse, error) - - // Delete deletes a key, or optionally using WithRange(end), [key, end). - Delete(ctx context.Context, key string, opts ...OpOption) (*DeleteResponse, error) - - // Compact compacts etcd KV history before the given rev. - Compact(ctx context.Context, rev int64, opts ...CompactOption) (*CompactResponse, error) - - // Do applies a single Op on KV without a transaction. - // Do is useful when creating arbitrary operations to be issued at a - // later time; the user can range over the operations, calling Do to - // execute them. Get/Put/Delete, on the other hand, are best suited - // for when the operation should be issued at the time of declaration. - Do(ctx context.Context, op Op) (OpResponse, error) - - // Txn creates a transaction. - Txn(ctx context.Context) Txn -} - -type OpResponse struct { - put *PutResponse - get *GetResponse - del *DeleteResponse - txn *TxnResponse -} - -func (op OpResponse) Put() *PutResponse { return op.put } -func (op OpResponse) Get() *GetResponse { return op.get } -func (op OpResponse) Del() *DeleteResponse { return op.del } -func (op OpResponse) Txn() *TxnResponse { return op.txn } - -func (resp *PutResponse) OpResponse() OpResponse { - return OpResponse{put: resp} -} -func (resp *GetResponse) OpResponse() OpResponse { - return OpResponse{get: resp} -} -func (resp *DeleteResponse) OpResponse() OpResponse { - return OpResponse{del: resp} -} -func (resp *TxnResponse) OpResponse() OpResponse { - return OpResponse{txn: resp} -} - -type kv struct { - remote pb.KVClient - callOpts []grpc.CallOption -} - -func NewKV(c *Client) KV { - api := &kv{remote: RetryKVClient(c)} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func NewKVFromKVClient(remote pb.KVClient, c *Client) KV { - api := &kv{remote: remote} - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func (kv *kv) Put(ctx context.Context, key, val string, opts ...OpOption) (*PutResponse, error) { - r, err := kv.Do(ctx, OpPut(key, val, opts...)) - return r.put, toErr(ctx, err) -} - -func (kv *kv) Get(ctx context.Context, key string, opts ...OpOption) (*GetResponse, error) { - r, err := kv.Do(ctx, OpGet(key, opts...)) - return r.get, toErr(ctx, err) -} - -func (kv *kv) Delete(ctx context.Context, key string, opts ...OpOption) (*DeleteResponse, error) { - r, err := kv.Do(ctx, OpDelete(key, opts...)) - return r.del, toErr(ctx, err) -} - -func (kv *kv) Compact(ctx context.Context, rev int64, opts ...CompactOption) (*CompactResponse, error) { - resp, err := kv.remote.Compact(ctx, OpCompact(rev, opts...).toRequest(), kv.callOpts...) - if err != nil { - return nil, toErr(ctx, err) - } - return (*CompactResponse)(resp), err -} - -func (kv *kv) Txn(ctx context.Context) Txn { - return &txn{ - kv: kv, - ctx: ctx, - callOpts: kv.callOpts, - } -} - -func (kv *kv) Do(ctx context.Context, op Op) (OpResponse, error) { - var err error - switch op.t { - case tRange: - var resp *pb.RangeResponse - resp, err = kv.remote.Range(ctx, op.toRangeRequest(), kv.callOpts...) - if err == nil { - return OpResponse{get: (*GetResponse)(resp)}, nil - } - case tPut: - var resp *pb.PutResponse - r := &pb.PutRequest{Key: op.key, Value: op.val, Lease: int64(op.leaseID), PrevKv: op.prevKV, IgnoreValue: op.ignoreValue, IgnoreLease: op.ignoreLease} - resp, err = kv.remote.Put(ctx, r, kv.callOpts...) - if err == nil { - return OpResponse{put: (*PutResponse)(resp)}, nil - } - case tDeleteRange: - var resp *pb.DeleteRangeResponse - r := &pb.DeleteRangeRequest{Key: op.key, RangeEnd: op.end, PrevKv: op.prevKV} - resp, err = kv.remote.DeleteRange(ctx, r, kv.callOpts...) - if err == nil { - return OpResponse{del: (*DeleteResponse)(resp)}, nil - } - case tTxn: - var resp *pb.TxnResponse - resp, err = kv.remote.Txn(ctx, op.toTxnRequest(), kv.callOpts...) - if err == nil { - return OpResponse{txn: (*TxnResponse)(resp)}, nil - } - default: - panic("Unknown op") - } - return OpResponse{}, toErr(ctx, err) -} diff --git a/vendor/github.com/coreos/etcd/clientv3/lease.go b/vendor/github.com/coreos/etcd/clientv3/lease.go deleted file mode 100644 index 4097b3afa..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/lease.go +++ /dev/null @@ -1,584 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "sync" - "time" - - "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" -) - -type ( - LeaseRevokeResponse pb.LeaseRevokeResponse - LeaseID int64 -) - -// LeaseGrantResponse wraps the protobuf message LeaseGrantResponse. -type LeaseGrantResponse struct { - *pb.ResponseHeader - ID LeaseID - TTL int64 - Error string -} - -// LeaseKeepAliveResponse wraps the protobuf message LeaseKeepAliveResponse. -type LeaseKeepAliveResponse struct { - *pb.ResponseHeader - ID LeaseID - TTL int64 -} - -// LeaseTimeToLiveResponse wraps the protobuf message LeaseTimeToLiveResponse. -type LeaseTimeToLiveResponse struct { - *pb.ResponseHeader - ID LeaseID `json:"id"` - - // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. Expired lease will return -1. - TTL int64 `json:"ttl"` - - // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. - GrantedTTL int64 `json:"granted-ttl"` - - // Keys is the list of keys attached to this lease. - Keys [][]byte `json:"keys"` -} - -// LeaseStatus represents a lease status. -type LeaseStatus struct { - ID LeaseID `json:"id"` - // TODO: TTL int64 -} - -// LeaseLeasesResponse wraps the protobuf message LeaseLeasesResponse. -type LeaseLeasesResponse struct { - *pb.ResponseHeader - Leases []LeaseStatus `json:"leases"` -} - -const ( - // defaultTTL is the assumed lease TTL used for the first keepalive - // deadline before the actual TTL is known to the client. - defaultTTL = 5 * time.Second - // a small buffer to store unsent lease responses. - leaseResponseChSize = 16 - // NoLease is a lease ID for the absence of a lease. - NoLease LeaseID = 0 - - // retryConnWait is how long to wait before retrying request due to an error - retryConnWait = 500 * time.Millisecond -) - -// ErrKeepAliveHalted is returned if client keep alive loop halts with an unexpected error. -// -// This usually means that automatic lease renewal via KeepAlive is broken, but KeepAliveOnce will still work as expected. -type ErrKeepAliveHalted struct { - Reason error -} - -func (e ErrKeepAliveHalted) Error() string { - s := "etcdclient: leases keep alive halted" - if e.Reason != nil { - s += ": " + e.Reason.Error() - } - return s -} - -type Lease interface { - // Grant creates a new lease. - Grant(ctx context.Context, ttl int64) (*LeaseGrantResponse, error) - - // Revoke revokes the given lease. - Revoke(ctx context.Context, id LeaseID) (*LeaseRevokeResponse, error) - - // TimeToLive retrieves the lease information of the given lease ID. - TimeToLive(ctx context.Context, id LeaseID, opts ...LeaseOption) (*LeaseTimeToLiveResponse, error) - - // Leases retrieves all leases. - Leases(ctx context.Context) (*LeaseLeasesResponse, error) - - // KeepAlive keeps the given lease alive forever. If the keepalive response - // posted to the channel is not consumed immediately, the lease client will - // continue sending keep alive requests to the etcd server at least every - // second until latest response is consumed. - // - // The returned "LeaseKeepAliveResponse" channel closes if underlying keep - // alive stream is interrupted in some way the client cannot handle itself; - // given context "ctx" is canceled or timed out. "LeaseKeepAliveResponse" - // from this closed channel is nil. - // - // If client keep alive loop halts with an unexpected error (e.g. "etcdserver: - // no leader") or canceled by the caller (e.g. context.Canceled), the error - // is returned. Otherwise, it retries. - // - // TODO(v4.0): post errors to last keep alive message before closing - // (see https://github.com/coreos/etcd/pull/7866) - KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAliveResponse, error) - - // KeepAliveOnce renews the lease once. The response corresponds to the - // first message from calling KeepAlive. If the response has a recoverable - // error, KeepAliveOnce will retry the RPC with a new keep alive message. - // - // In most of the cases, Keepalive should be used instead of KeepAliveOnce. - KeepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAliveResponse, error) - - // Close releases all resources Lease keeps for efficient communication - // with the etcd server. - Close() error -} - -type lessor struct { - mu sync.Mutex // guards all fields - - // donec is closed and loopErr is set when recvKeepAliveLoop stops - donec chan struct{} - loopErr error - - remote pb.LeaseClient - - stream pb.Lease_LeaseKeepAliveClient - streamCancel context.CancelFunc - - stopCtx context.Context - stopCancel context.CancelFunc - - keepAlives map[LeaseID]*keepAlive - - // firstKeepAliveTimeout is the timeout for the first keepalive request - // before the actual TTL is known to the lease client - firstKeepAliveTimeout time.Duration - - // firstKeepAliveOnce ensures stream starts after first KeepAlive call. - firstKeepAliveOnce sync.Once - - callOpts []grpc.CallOption -} - -// keepAlive multiplexes a keepalive for a lease over multiple channels -type keepAlive struct { - chs []chan<- *LeaseKeepAliveResponse - ctxs []context.Context - // deadline is the time the keep alive channels close if no response - deadline time.Time - // nextKeepAlive is when to send the next keep alive message - nextKeepAlive time.Time - // donec is closed on lease revoke, expiration, or cancel. - donec chan struct{} -} - -func NewLease(c *Client) Lease { - return NewLeaseFromLeaseClient(RetryLeaseClient(c), c, c.cfg.DialTimeout+time.Second) -} - -func NewLeaseFromLeaseClient(remote pb.LeaseClient, c *Client, keepAliveTimeout time.Duration) Lease { - l := &lessor{ - donec: make(chan struct{}), - keepAlives: make(map[LeaseID]*keepAlive), - remote: remote, - firstKeepAliveTimeout: keepAliveTimeout, - } - if l.firstKeepAliveTimeout == time.Second { - l.firstKeepAliveTimeout = defaultTTL - } - if c != nil { - l.callOpts = c.callOpts - } - reqLeaderCtx := WithRequireLeader(context.Background()) - l.stopCtx, l.stopCancel = context.WithCancel(reqLeaderCtx) - return l -} - -func (l *lessor) Grant(ctx context.Context, ttl int64) (*LeaseGrantResponse, error) { - r := &pb.LeaseGrantRequest{TTL: ttl} - resp, err := l.remote.LeaseGrant(ctx, r, l.callOpts...) - if err == nil { - gresp := &LeaseGrantResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - Error: resp.Error, - } - return gresp, nil - } - return nil, toErr(ctx, err) -} - -func (l *lessor) Revoke(ctx context.Context, id LeaseID) (*LeaseRevokeResponse, error) { - r := &pb.LeaseRevokeRequest{ID: int64(id)} - resp, err := l.remote.LeaseRevoke(ctx, r, l.callOpts...) - if err == nil { - return (*LeaseRevokeResponse)(resp), nil - } - return nil, toErr(ctx, err) -} - -func (l *lessor) TimeToLive(ctx context.Context, id LeaseID, opts ...LeaseOption) (*LeaseTimeToLiveResponse, error) { - r := toLeaseTimeToLiveRequest(id, opts...) - resp, err := l.remote.LeaseTimeToLive(ctx, r, l.callOpts...) - if err == nil { - gresp := &LeaseTimeToLiveResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - GrantedTTL: resp.GrantedTTL, - Keys: resp.Keys, - } - return gresp, nil - } - return nil, toErr(ctx, err) -} - -func (l *lessor) Leases(ctx context.Context) (*LeaseLeasesResponse, error) { - resp, err := l.remote.LeaseLeases(ctx, &pb.LeaseLeasesRequest{}, l.callOpts...) - if err == nil { - leases := make([]LeaseStatus, len(resp.Leases)) - for i := range resp.Leases { - leases[i] = LeaseStatus{ID: LeaseID(resp.Leases[i].ID)} - } - return &LeaseLeasesResponse{ResponseHeader: resp.GetHeader(), Leases: leases}, nil - } - return nil, toErr(ctx, err) -} - -func (l *lessor) KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAliveResponse, error) { - ch := make(chan *LeaseKeepAliveResponse, leaseResponseChSize) - - l.mu.Lock() - // ensure that recvKeepAliveLoop is still running - select { - case <-l.donec: - err := l.loopErr - l.mu.Unlock() - close(ch) - return ch, ErrKeepAliveHalted{Reason: err} - default: - } - ka, ok := l.keepAlives[id] - if !ok { - // create fresh keep alive - ka = &keepAlive{ - chs: []chan<- *LeaseKeepAliveResponse{ch}, - ctxs: []context.Context{ctx}, - deadline: time.Now().Add(l.firstKeepAliveTimeout), - nextKeepAlive: time.Now(), - donec: make(chan struct{}), - } - l.keepAlives[id] = ka - } else { - // add channel and context to existing keep alive - ka.ctxs = append(ka.ctxs, ctx) - ka.chs = append(ka.chs, ch) - } - l.mu.Unlock() - - go l.keepAliveCtxCloser(id, ctx, ka.donec) - l.firstKeepAliveOnce.Do(func() { - go l.recvKeepAliveLoop() - go l.deadlineLoop() - }) - - return ch, nil -} - -func (l *lessor) KeepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAliveResponse, error) { - for { - resp, err := l.keepAliveOnce(ctx, id) - if err == nil { - if resp.TTL <= 0 { - err = rpctypes.ErrLeaseNotFound - } - return resp, err - } - if isHaltErr(ctx, err) { - return nil, toErr(ctx, err) - } - } -} - -func (l *lessor) Close() error { - l.stopCancel() - // close for synchronous teardown if stream goroutines never launched - l.firstKeepAliveOnce.Do(func() { close(l.donec) }) - <-l.donec - return nil -} - -func (l *lessor) keepAliveCtxCloser(id LeaseID, ctx context.Context, donec <-chan struct{}) { - select { - case <-donec: - return - case <-l.donec: - return - case <-ctx.Done(): - } - - l.mu.Lock() - defer l.mu.Unlock() - - ka, ok := l.keepAlives[id] - if !ok { - return - } - - // close channel and remove context if still associated with keep alive - for i, c := range ka.ctxs { - if c == ctx { - close(ka.chs[i]) - ka.ctxs = append(ka.ctxs[:i], ka.ctxs[i+1:]...) - ka.chs = append(ka.chs[:i], ka.chs[i+1:]...) - break - } - } - // remove if no one more listeners - if len(ka.chs) == 0 { - delete(l.keepAlives, id) - } -} - -// closeRequireLeader scans keepAlives for ctxs that have require leader -// and closes the associated channels. -func (l *lessor) closeRequireLeader() { - l.mu.Lock() - defer l.mu.Unlock() - for _, ka := range l.keepAlives { - reqIdxs := 0 - // find all required leader channels, close, mark as nil - for i, ctx := range ka.ctxs { - md, ok := metadata.FromOutgoingContext(ctx) - if !ok { - continue - } - ks := md[rpctypes.MetadataRequireLeaderKey] - if len(ks) < 1 || ks[0] != rpctypes.MetadataHasLeader { - continue - } - close(ka.chs[i]) - ka.chs[i] = nil - reqIdxs++ - } - if reqIdxs == 0 { - continue - } - // remove all channels that required a leader from keepalive - newChs := make([]chan<- *LeaseKeepAliveResponse, len(ka.chs)-reqIdxs) - newCtxs := make([]context.Context, len(newChs)) - newIdx := 0 - for i := range ka.chs { - if ka.chs[i] == nil { - continue - } - newChs[newIdx], newCtxs[newIdx] = ka.chs[i], ka.ctxs[newIdx] - newIdx++ - } - ka.chs, ka.ctxs = newChs, newCtxs - } -} - -func (l *lessor) keepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAliveResponse, error) { - cctx, cancel := context.WithCancel(ctx) - defer cancel() - - stream, err := l.remote.LeaseKeepAlive(cctx, l.callOpts...) - if err != nil { - return nil, toErr(ctx, err) - } - - err = stream.Send(&pb.LeaseKeepAliveRequest{ID: int64(id)}) - if err != nil { - return nil, toErr(ctx, err) - } - - resp, rerr := stream.Recv() - if rerr != nil { - return nil, toErr(ctx, rerr) - } - - karesp := &LeaseKeepAliveResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - } - return karesp, nil -} - -func (l *lessor) recvKeepAliveLoop() (gerr error) { - defer func() { - l.mu.Lock() - close(l.donec) - l.loopErr = gerr - for _, ka := range l.keepAlives { - ka.close() - } - l.keepAlives = make(map[LeaseID]*keepAlive) - l.mu.Unlock() - }() - - for { - stream, err := l.resetRecv() - if err != nil { - if canceledByCaller(l.stopCtx, err) { - return err - } - } else { - for { - resp, err := stream.Recv() - if err != nil { - if canceledByCaller(l.stopCtx, err) { - return err - } - - if toErr(l.stopCtx, err) == rpctypes.ErrNoLeader { - l.closeRequireLeader() - } - break - } - - l.recvKeepAlive(resp) - } - } - - select { - case <-time.After(retryConnWait): - continue - case <-l.stopCtx.Done(): - return l.stopCtx.Err() - } - } -} - -// resetRecv opens a new lease stream and starts sending keep alive requests. -func (l *lessor) resetRecv() (pb.Lease_LeaseKeepAliveClient, error) { - sctx, cancel := context.WithCancel(l.stopCtx) - stream, err := l.remote.LeaseKeepAlive(sctx, l.callOpts...) - if err != nil { - cancel() - return nil, err - } - - l.mu.Lock() - defer l.mu.Unlock() - if l.stream != nil && l.streamCancel != nil { - l.streamCancel() - } - - l.streamCancel = cancel - l.stream = stream - - go l.sendKeepAliveLoop(stream) - return stream, nil -} - -// recvKeepAlive updates a lease based on its LeaseKeepAliveResponse -func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) { - karesp := &LeaseKeepAliveResponse{ - ResponseHeader: resp.GetHeader(), - ID: LeaseID(resp.ID), - TTL: resp.TTL, - } - - l.mu.Lock() - defer l.mu.Unlock() - - ka, ok := l.keepAlives[karesp.ID] - if !ok { - return - } - - if karesp.TTL <= 0 { - // lease expired; close all keep alive channels - delete(l.keepAlives, karesp.ID) - ka.close() - return - } - - // send update to all channels - nextKeepAlive := time.Now().Add((time.Duration(karesp.TTL) * time.Second) / 3.0) - ka.deadline = time.Now().Add(time.Duration(karesp.TTL) * time.Second) - for _, ch := range ka.chs { - select { - case ch <- karesp: - ka.nextKeepAlive = nextKeepAlive - default: - } - } -} - -// deadlineLoop reaps any keep alive channels that have not received a response -// within the lease TTL -func (l *lessor) deadlineLoop() { - for { - select { - case <-time.After(time.Second): - case <-l.donec: - return - } - now := time.Now() - l.mu.Lock() - for id, ka := range l.keepAlives { - if ka.deadline.Before(now) { - // waited too long for response; lease may be expired - ka.close() - delete(l.keepAlives, id) - } - } - l.mu.Unlock() - } -} - -// sendKeepAliveLoop sends keep alive requests for the lifetime of the given stream. -func (l *lessor) sendKeepAliveLoop(stream pb.Lease_LeaseKeepAliveClient) { - for { - var tosend []LeaseID - - now := time.Now() - l.mu.Lock() - for id, ka := range l.keepAlives { - if ka.nextKeepAlive.Before(now) { - tosend = append(tosend, id) - } - } - l.mu.Unlock() - - for _, id := range tosend { - r := &pb.LeaseKeepAliveRequest{ID: int64(id)} - if err := stream.Send(r); err != nil { - // TODO do something with this error? - return - } - } - - select { - case <-time.After(500 * time.Millisecond): - case <-stream.Context().Done(): - return - case <-l.donec: - return - case <-l.stopCtx.Done(): - return - } - } -} - -func (ka *keepAlive) close() { - close(ka.donec) - for _, ch := range ka.chs { - close(ch) - } -} diff --git a/vendor/github.com/coreos/etcd/clientv3/logger.go b/vendor/github.com/coreos/etcd/clientv3/logger.go deleted file mode 100644 index 782e31313..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/logger.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "io/ioutil" - "sync" - - "google.golang.org/grpc/grpclog" -) - -// Logger is the logger used by client library. -// It implements grpclog.LoggerV2 interface. -type Logger interface { - grpclog.LoggerV2 - - // Lvl returns logger if logger's verbosity level >= "lvl". - // Otherwise, logger that discards all logs. - Lvl(lvl int) Logger - - // to satisfy capnslog - - Print(args ...interface{}) - Printf(format string, args ...interface{}) - Println(args ...interface{}) -} - -var ( - loggerMu sync.RWMutex - logger Logger -) - -type settableLogger struct { - l grpclog.LoggerV2 - mu sync.RWMutex -} - -func init() { - // disable client side logs by default - logger = &settableLogger{} - SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard)) -} - -// SetLogger sets client-side Logger. -func SetLogger(l grpclog.LoggerV2) { - loggerMu.Lock() - logger = NewLogger(l) - // override grpclog so that any changes happen with locking - grpclog.SetLoggerV2(logger) - loggerMu.Unlock() -} - -// GetLogger returns the current logger. -func GetLogger() Logger { - loggerMu.RLock() - l := logger - loggerMu.RUnlock() - return l -} - -// NewLogger returns a new Logger with grpclog.LoggerV2. -func NewLogger(gl grpclog.LoggerV2) Logger { - return &settableLogger{l: gl} -} - -func (s *settableLogger) get() grpclog.LoggerV2 { - s.mu.RLock() - l := s.l - s.mu.RUnlock() - return l -} - -// implement the grpclog.LoggerV2 interface - -func (s *settableLogger) Info(args ...interface{}) { s.get().Info(args...) } -func (s *settableLogger) Infof(format string, args ...interface{}) { s.get().Infof(format, args...) } -func (s *settableLogger) Infoln(args ...interface{}) { s.get().Infoln(args...) } -func (s *settableLogger) Warning(args ...interface{}) { s.get().Warning(args...) } -func (s *settableLogger) Warningf(format string, args ...interface{}) { - s.get().Warningf(format, args...) -} -func (s *settableLogger) Warningln(args ...interface{}) { s.get().Warningln(args...) } -func (s *settableLogger) Error(args ...interface{}) { s.get().Error(args...) } -func (s *settableLogger) Errorf(format string, args ...interface{}) { - s.get().Errorf(format, args...) -} -func (s *settableLogger) Errorln(args ...interface{}) { s.get().Errorln(args...) } -func (s *settableLogger) Fatal(args ...interface{}) { s.get().Fatal(args...) } -func (s *settableLogger) Fatalf(format string, args ...interface{}) { s.get().Fatalf(format, args...) } -func (s *settableLogger) Fatalln(args ...interface{}) { s.get().Fatalln(args...) } -func (s *settableLogger) Print(args ...interface{}) { s.get().Info(args...) } -func (s *settableLogger) Printf(format string, args ...interface{}) { s.get().Infof(format, args...) } -func (s *settableLogger) Println(args ...interface{}) { s.get().Infoln(args...) } -func (s *settableLogger) V(l int) bool { return s.get().V(l) } -func (s *settableLogger) Lvl(lvl int) Logger { - s.mu.RLock() - l := s.l - s.mu.RUnlock() - if l.V(lvl) { - return s - } - return &noLogger{} -} - -type noLogger struct{} - -func (*noLogger) Info(args ...interface{}) {} -func (*noLogger) Infof(format string, args ...interface{}) {} -func (*noLogger) Infoln(args ...interface{}) {} -func (*noLogger) Warning(args ...interface{}) {} -func (*noLogger) Warningf(format string, args ...interface{}) {} -func (*noLogger) Warningln(args ...interface{}) {} -func (*noLogger) Error(args ...interface{}) {} -func (*noLogger) Errorf(format string, args ...interface{}) {} -func (*noLogger) Errorln(args ...interface{}) {} -func (*noLogger) Fatal(args ...interface{}) {} -func (*noLogger) Fatalf(format string, args ...interface{}) {} -func (*noLogger) Fatalln(args ...interface{}) {} -func (*noLogger) Print(args ...interface{}) {} -func (*noLogger) Printf(format string, args ...interface{}) {} -func (*noLogger) Println(args ...interface{}) {} -func (*noLogger) V(l int) bool { return false } -func (ng *noLogger) Lvl(lvl int) Logger { return ng } diff --git a/vendor/github.com/coreos/etcd/clientv3/maintenance.go b/vendor/github.com/coreos/etcd/clientv3/maintenance.go deleted file mode 100644 index f60cfbe47..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/maintenance.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "io" - - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - - "google.golang.org/grpc" -) - -type ( - DefragmentResponse pb.DefragmentResponse - AlarmResponse pb.AlarmResponse - AlarmMember pb.AlarmMember - StatusResponse pb.StatusResponse - HashKVResponse pb.HashKVResponse - MoveLeaderResponse pb.MoveLeaderResponse -) - -type Maintenance interface { - // AlarmList gets all active alarms. - AlarmList(ctx context.Context) (*AlarmResponse, error) - - // AlarmDisarm disarms a given alarm. - AlarmDisarm(ctx context.Context, m *AlarmMember) (*AlarmResponse, error) - - // Defragment releases wasted space from internal fragmentation on a given etcd member. - // Defragment is only needed when deleting a large number of keys and want to reclaim - // the resources. - // Defragment is an expensive operation. User should avoid defragmenting multiple members - // at the same time. - // To defragment multiple members in the cluster, user need to call defragment multiple - // times with different endpoints. - Defragment(ctx context.Context, endpoint string) (*DefragmentResponse, error) - - // Status gets the status of the endpoint. - Status(ctx context.Context, endpoint string) (*StatusResponse, error) - - // HashKV returns a hash of the KV state at the time of the RPC. - // If revision is zero, the hash is computed on all keys. If the revision - // is non-zero, the hash is computed on all keys at or below the given revision. - HashKV(ctx context.Context, endpoint string, rev int64) (*HashKVResponse, error) - - // Snapshot provides a reader for a point-in-time snapshot of etcd. - Snapshot(ctx context.Context) (io.ReadCloser, error) - - // MoveLeader requests current leader to transfer its leadership to the transferee. - // Request must be made to the leader. - MoveLeader(ctx context.Context, transfereeID uint64) (*MoveLeaderResponse, error) -} - -type maintenance struct { - dial func(endpoint string) (pb.MaintenanceClient, func(), error) - remote pb.MaintenanceClient - callOpts []grpc.CallOption -} - -func NewMaintenance(c *Client) Maintenance { - api := &maintenance{ - dial: func(endpoint string) (pb.MaintenanceClient, func(), error) { - conn, err := c.dial(endpoint) - if err != nil { - return nil, nil, err - } - cancel := func() { conn.Close() } - return RetryMaintenanceClient(c, conn), cancel, nil - }, - remote: RetryMaintenanceClient(c, c.conn), - } - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func NewMaintenanceFromMaintenanceClient(remote pb.MaintenanceClient, c *Client) Maintenance { - api := &maintenance{ - dial: func(string) (pb.MaintenanceClient, func(), error) { - return remote, func() {}, nil - }, - remote: remote, - } - if c != nil { - api.callOpts = c.callOpts - } - return api -} - -func (m *maintenance) AlarmList(ctx context.Context) (*AlarmResponse, error) { - req := &pb.AlarmRequest{ - Action: pb.AlarmRequest_GET, - MemberID: 0, // all - Alarm: pb.AlarmType_NONE, // all - } - resp, err := m.remote.Alarm(ctx, req, m.callOpts...) - if err == nil { - return (*AlarmResponse)(resp), nil - } - return nil, toErr(ctx, err) -} - -func (m *maintenance) AlarmDisarm(ctx context.Context, am *AlarmMember) (*AlarmResponse, error) { - req := &pb.AlarmRequest{ - Action: pb.AlarmRequest_DEACTIVATE, - MemberID: am.MemberID, - Alarm: am.Alarm, - } - - if req.MemberID == 0 && req.Alarm == pb.AlarmType_NONE { - ar, err := m.AlarmList(ctx) - if err != nil { - return nil, toErr(ctx, err) - } - ret := AlarmResponse{} - for _, am := range ar.Alarms { - dresp, derr := m.AlarmDisarm(ctx, (*AlarmMember)(am)) - if derr != nil { - return nil, toErr(ctx, derr) - } - ret.Alarms = append(ret.Alarms, dresp.Alarms...) - } - return &ret, nil - } - - resp, err := m.remote.Alarm(ctx, req, m.callOpts...) - if err == nil { - return (*AlarmResponse)(resp), nil - } - return nil, toErr(ctx, err) -} - -func (m *maintenance) Defragment(ctx context.Context, endpoint string) (*DefragmentResponse, error) { - remote, cancel, err := m.dial(endpoint) - if err != nil { - return nil, toErr(ctx, err) - } - defer cancel() - resp, err := remote.Defragment(ctx, &pb.DefragmentRequest{}, m.callOpts...) - if err != nil { - return nil, toErr(ctx, err) - } - return (*DefragmentResponse)(resp), nil -} - -func (m *maintenance) Status(ctx context.Context, endpoint string) (*StatusResponse, error) { - remote, cancel, err := m.dial(endpoint) - if err != nil { - return nil, toErr(ctx, err) - } - defer cancel() - resp, err := remote.Status(ctx, &pb.StatusRequest{}, m.callOpts...) - if err != nil { - return nil, toErr(ctx, err) - } - return (*StatusResponse)(resp), nil -} - -func (m *maintenance) HashKV(ctx context.Context, endpoint string, rev int64) (*HashKVResponse, error) { - remote, cancel, err := m.dial(endpoint) - if err != nil { - return nil, toErr(ctx, err) - } - defer cancel() - resp, err := remote.HashKV(ctx, &pb.HashKVRequest{Revision: rev}, m.callOpts...) - if err != nil { - return nil, toErr(ctx, err) - } - return (*HashKVResponse)(resp), nil -} - -func (m *maintenance) Snapshot(ctx context.Context) (io.ReadCloser, error) { - ss, err := m.remote.Snapshot(ctx, &pb.SnapshotRequest{}, m.callOpts...) - if err != nil { - return nil, toErr(ctx, err) - } - - pr, pw := io.Pipe() - go func() { - for { - resp, err := ss.Recv() - if err != nil { - pw.CloseWithError(err) - return - } - if resp == nil && err == nil { - break - } - if _, werr := pw.Write(resp.Blob); werr != nil { - pw.CloseWithError(werr) - return - } - } - pw.Close() - }() - return &snapshotReadCloser{ctx: ctx, ReadCloser: pr}, nil -} - -type snapshotReadCloser struct { - ctx context.Context - io.ReadCloser -} - -func (rc *snapshotReadCloser) Read(p []byte) (n int, err error) { - n, err = rc.ReadCloser.Read(p) - return n, toErr(rc.ctx, err) -} - -func (m *maintenance) MoveLeader(ctx context.Context, transfereeID uint64) (*MoveLeaderResponse, error) { - resp, err := m.remote.MoveLeader(ctx, &pb.MoveLeaderRequest{TargetID: transfereeID}, m.callOpts...) - return (*MoveLeaderResponse)(resp), toErr(ctx, err) -} diff --git a/vendor/github.com/coreos/etcd/clientv3/op.go b/vendor/github.com/coreos/etcd/clientv3/op.go deleted file mode 100644 index c6ec5bf52..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/op.go +++ /dev/null @@ -1,513 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - -type opType int - -const ( - // A default Op has opType 0, which is invalid. - tRange opType = iota + 1 - tPut - tDeleteRange - tTxn -) - -var ( - noPrefixEnd = []byte{0} -) - -// Op represents an Operation that kv can execute. -type Op struct { - t opType - key []byte - end []byte - - // for range - limit int64 - sort *SortOption - serializable bool - keysOnly bool - countOnly bool - minModRev int64 - maxModRev int64 - minCreateRev int64 - maxCreateRev int64 - - // for range, watch - rev int64 - - // for watch, put, delete - prevKV bool - - // for put - ignoreValue bool - ignoreLease bool - - // progressNotify is for progress updates. - progressNotify bool - // createdNotify is for created event - createdNotify bool - // filters for watchers - filterPut bool - filterDelete bool - - // for put - val []byte - leaseID LeaseID - - // txn - cmps []Cmp - thenOps []Op - elseOps []Op -} - -// accessors / mutators - -func (op Op) IsTxn() bool { return op.t == tTxn } -func (op Op) Txn() ([]Cmp, []Op, []Op) { return op.cmps, op.thenOps, op.elseOps } - -// KeyBytes returns the byte slice holding the Op's key. -func (op Op) KeyBytes() []byte { return op.key } - -// WithKeyBytes sets the byte slice for the Op's key. -func (op *Op) WithKeyBytes(key []byte) { op.key = key } - -// RangeBytes returns the byte slice holding with the Op's range end, if any. -func (op Op) RangeBytes() []byte { return op.end } - -// Rev returns the requested revision, if any. -func (op Op) Rev() int64 { return op.rev } - -// IsPut returns true iff the operation is a Put. -func (op Op) IsPut() bool { return op.t == tPut } - -// IsGet returns true iff the operation is a Get. -func (op Op) IsGet() bool { return op.t == tRange } - -// IsDelete returns true iff the operation is a Delete. -func (op Op) IsDelete() bool { return op.t == tDeleteRange } - -// IsSerializable returns true if the serializable field is true. -func (op Op) IsSerializable() bool { return op.serializable == true } - -// IsKeysOnly returns whether keysOnly is set. -func (op Op) IsKeysOnly() bool { return op.keysOnly == true } - -// IsCountOnly returns whether countOnly is set. -func (op Op) IsCountOnly() bool { return op.countOnly == true } - -// MinModRev returns the operation's minimum modify revision. -func (op Op) MinModRev() int64 { return op.minModRev } - -// MaxModRev returns the operation's maximum modify revision. -func (op Op) MaxModRev() int64 { return op.maxModRev } - -// MinCreateRev returns the operation's minimum create revision. -func (op Op) MinCreateRev() int64 { return op.minCreateRev } - -// MaxCreateRev returns the operation's maximum create revision. -func (op Op) MaxCreateRev() int64 { return op.maxCreateRev } - -// WithRangeBytes sets the byte slice for the Op's range end. -func (op *Op) WithRangeBytes(end []byte) { op.end = end } - -// ValueBytes returns the byte slice holding the Op's value, if any. -func (op Op) ValueBytes() []byte { return op.val } - -// WithValueBytes sets the byte slice for the Op's value. -func (op *Op) WithValueBytes(v []byte) { op.val = v } - -func (op Op) toRangeRequest() *pb.RangeRequest { - if op.t != tRange { - panic("op.t != tRange") - } - r := &pb.RangeRequest{ - Key: op.key, - RangeEnd: op.end, - Limit: op.limit, - Revision: op.rev, - Serializable: op.serializable, - KeysOnly: op.keysOnly, - CountOnly: op.countOnly, - MinModRevision: op.minModRev, - MaxModRevision: op.maxModRev, - MinCreateRevision: op.minCreateRev, - MaxCreateRevision: op.maxCreateRev, - } - if op.sort != nil { - r.SortOrder = pb.RangeRequest_SortOrder(op.sort.Order) - r.SortTarget = pb.RangeRequest_SortTarget(op.sort.Target) - } - return r -} - -func (op Op) toTxnRequest() *pb.TxnRequest { - thenOps := make([]*pb.RequestOp, len(op.thenOps)) - for i, tOp := range op.thenOps { - thenOps[i] = tOp.toRequestOp() - } - elseOps := make([]*pb.RequestOp, len(op.elseOps)) - for i, eOp := range op.elseOps { - elseOps[i] = eOp.toRequestOp() - } - cmps := make([]*pb.Compare, len(op.cmps)) - for i := range op.cmps { - cmps[i] = (*pb.Compare)(&op.cmps[i]) - } - return &pb.TxnRequest{Compare: cmps, Success: thenOps, Failure: elseOps} -} - -func (op Op) toRequestOp() *pb.RequestOp { - switch op.t { - case tRange: - return &pb.RequestOp{Request: &pb.RequestOp_RequestRange{RequestRange: op.toRangeRequest()}} - case tPut: - r := &pb.PutRequest{Key: op.key, Value: op.val, Lease: int64(op.leaseID), PrevKv: op.prevKV, IgnoreValue: op.ignoreValue, IgnoreLease: op.ignoreLease} - return &pb.RequestOp{Request: &pb.RequestOp_RequestPut{RequestPut: r}} - case tDeleteRange: - r := &pb.DeleteRangeRequest{Key: op.key, RangeEnd: op.end, PrevKv: op.prevKV} - return &pb.RequestOp{Request: &pb.RequestOp_RequestDeleteRange{RequestDeleteRange: r}} - case tTxn: - return &pb.RequestOp{Request: &pb.RequestOp_RequestTxn{RequestTxn: op.toTxnRequest()}} - default: - panic("Unknown Op") - } -} - -func (op Op) isWrite() bool { - if op.t == tTxn { - for _, tOp := range op.thenOps { - if tOp.isWrite() { - return true - } - } - for _, tOp := range op.elseOps { - if tOp.isWrite() { - return true - } - } - return false - } - return op.t != tRange -} - -func OpGet(key string, opts ...OpOption) Op { - ret := Op{t: tRange, key: []byte(key)} - ret.applyOpts(opts) - return ret -} - -func OpDelete(key string, opts ...OpOption) Op { - ret := Op{t: tDeleteRange, key: []byte(key)} - ret.applyOpts(opts) - switch { - case ret.leaseID != 0: - panic("unexpected lease in delete") - case ret.limit != 0: - panic("unexpected limit in delete") - case ret.rev != 0: - panic("unexpected revision in delete") - case ret.sort != nil: - panic("unexpected sort in delete") - case ret.serializable: - panic("unexpected serializable in delete") - case ret.countOnly: - panic("unexpected countOnly in delete") - case ret.minModRev != 0, ret.maxModRev != 0: - panic("unexpected mod revision filter in delete") - case ret.minCreateRev != 0, ret.maxCreateRev != 0: - panic("unexpected create revision filter in delete") - case ret.filterDelete, ret.filterPut: - panic("unexpected filter in delete") - case ret.createdNotify: - panic("unexpected createdNotify in delete") - } - return ret -} - -func OpPut(key, val string, opts ...OpOption) Op { - ret := Op{t: tPut, key: []byte(key), val: []byte(val)} - ret.applyOpts(opts) - switch { - case ret.end != nil: - panic("unexpected range in put") - case ret.limit != 0: - panic("unexpected limit in put") - case ret.rev != 0: - panic("unexpected revision in put") - case ret.sort != nil: - panic("unexpected sort in put") - case ret.serializable: - panic("unexpected serializable in put") - case ret.countOnly: - panic("unexpected countOnly in put") - case ret.minModRev != 0, ret.maxModRev != 0: - panic("unexpected mod revision filter in put") - case ret.minCreateRev != 0, ret.maxCreateRev != 0: - panic("unexpected create revision filter in put") - case ret.filterDelete, ret.filterPut: - panic("unexpected filter in put") - case ret.createdNotify: - panic("unexpected createdNotify in put") - } - return ret -} - -func OpTxn(cmps []Cmp, thenOps []Op, elseOps []Op) Op { - return Op{t: tTxn, cmps: cmps, thenOps: thenOps, elseOps: elseOps} -} - -func opWatch(key string, opts ...OpOption) Op { - ret := Op{t: tRange, key: []byte(key)} - ret.applyOpts(opts) - switch { - case ret.leaseID != 0: - panic("unexpected lease in watch") - case ret.limit != 0: - panic("unexpected limit in watch") - case ret.sort != nil: - panic("unexpected sort in watch") - case ret.serializable: - panic("unexpected serializable in watch") - case ret.countOnly: - panic("unexpected countOnly in watch") - case ret.minModRev != 0, ret.maxModRev != 0: - panic("unexpected mod revision filter in watch") - case ret.minCreateRev != 0, ret.maxCreateRev != 0: - panic("unexpected create revision filter in watch") - } - return ret -} - -func (op *Op) applyOpts(opts []OpOption) { - for _, opt := range opts { - opt(op) - } -} - -// OpOption configures Operations like Get, Put, Delete. -type OpOption func(*Op) - -// WithLease attaches a lease ID to a key in 'Put' request. -func WithLease(leaseID LeaseID) OpOption { - return func(op *Op) { op.leaseID = leaseID } -} - -// WithLimit limits the number of results to return from 'Get' request. -// If WithLimit is given a 0 limit, it is treated as no limit. -func WithLimit(n int64) OpOption { return func(op *Op) { op.limit = n } } - -// WithRev specifies the store revision for 'Get' request. -// Or the start revision of 'Watch' request. -func WithRev(rev int64) OpOption { return func(op *Op) { op.rev = rev } } - -// WithSort specifies the ordering in 'Get' request. It requires -// 'WithRange' and/or 'WithPrefix' to be specified too. -// 'target' specifies the target to sort by: key, version, revisions, value. -// 'order' can be either 'SortNone', 'SortAscend', 'SortDescend'. -func WithSort(target SortTarget, order SortOrder) OpOption { - return func(op *Op) { - if target == SortByKey && order == SortAscend { - // If order != SortNone, server fetches the entire key-space, - // and then applies the sort and limit, if provided. - // Since by default the server returns results sorted by keys - // in lexicographically ascending order, the client should ignore - // SortOrder if the target is SortByKey. - order = SortNone - } - op.sort = &SortOption{target, order} - } -} - -// GetPrefixRangeEnd gets the range end of the prefix. -// 'Get(foo, WithPrefix())' is equal to 'Get(foo, WithRange(GetPrefixRangeEnd(foo))'. -func GetPrefixRangeEnd(prefix string) string { - return string(getPrefix([]byte(prefix))) -} - -func getPrefix(key []byte) []byte { - end := make([]byte, len(key)) - copy(end, key) - for i := len(end) - 1; i >= 0; i-- { - if end[i] < 0xff { - end[i] = end[i] + 1 - end = end[:i+1] - return end - } - } - // next prefix does not exist (e.g., 0xffff); - // default to WithFromKey policy - return noPrefixEnd -} - -// WithPrefix enables 'Get', 'Delete', or 'Watch' requests to operate -// on the keys with matching prefix. For example, 'Get(foo, WithPrefix())' -// can return 'foo1', 'foo2', and so on. -func WithPrefix() OpOption { - return func(op *Op) { - if len(op.key) == 0 { - op.key, op.end = []byte{0}, []byte{0} - return - } - op.end = getPrefix(op.key) - } -} - -// WithRange specifies the range of 'Get', 'Delete', 'Watch' requests. -// For example, 'Get' requests with 'WithRange(end)' returns -// the keys in the range [key, end). -// endKey must be lexicographically greater than start key. -func WithRange(endKey string) OpOption { - return func(op *Op) { op.end = []byte(endKey) } -} - -// WithFromKey specifies the range of 'Get', 'Delete', 'Watch' requests -// to be equal or greater than the key in the argument. -func WithFromKey() OpOption { return WithRange("\x00") } - -// WithSerializable makes 'Get' request serializable. By default, -// it's linearizable. Serializable requests are better for lower latency -// requirement. -func WithSerializable() OpOption { - return func(op *Op) { op.serializable = true } -} - -// WithKeysOnly makes the 'Get' request return only the keys and the corresponding -// values will be omitted. -func WithKeysOnly() OpOption { - return func(op *Op) { op.keysOnly = true } -} - -// WithCountOnly makes the 'Get' request return only the count of keys. -func WithCountOnly() OpOption { - return func(op *Op) { op.countOnly = true } -} - -// WithMinModRev filters out keys for Get with modification revisions less than the given revision. -func WithMinModRev(rev int64) OpOption { return func(op *Op) { op.minModRev = rev } } - -// WithMaxModRev filters out keys for Get with modification revisions greater than the given revision. -func WithMaxModRev(rev int64) OpOption { return func(op *Op) { op.maxModRev = rev } } - -// WithMinCreateRev filters out keys for Get with creation revisions less than the given revision. -func WithMinCreateRev(rev int64) OpOption { return func(op *Op) { op.minCreateRev = rev } } - -// WithMaxCreateRev filters out keys for Get with creation revisions greater than the given revision. -func WithMaxCreateRev(rev int64) OpOption { return func(op *Op) { op.maxCreateRev = rev } } - -// WithFirstCreate gets the key with the oldest creation revision in the request range. -func WithFirstCreate() []OpOption { return withTop(SortByCreateRevision, SortAscend) } - -// WithLastCreate gets the key with the latest creation revision in the request range. -func WithLastCreate() []OpOption { return withTop(SortByCreateRevision, SortDescend) } - -// WithFirstKey gets the lexically first key in the request range. -func WithFirstKey() []OpOption { return withTop(SortByKey, SortAscend) } - -// WithLastKey gets the lexically last key in the request range. -func WithLastKey() []OpOption { return withTop(SortByKey, SortDescend) } - -// WithFirstRev gets the key with the oldest modification revision in the request range. -func WithFirstRev() []OpOption { return withTop(SortByModRevision, SortAscend) } - -// WithLastRev gets the key with the latest modification revision in the request range. -func WithLastRev() []OpOption { return withTop(SortByModRevision, SortDescend) } - -// withTop gets the first key over the get's prefix given a sort order -func withTop(target SortTarget, order SortOrder) []OpOption { - return []OpOption{WithPrefix(), WithSort(target, order), WithLimit(1)} -} - -// WithProgressNotify makes watch server send periodic progress updates -// every 10 minutes when there is no incoming events. -// Progress updates have zero events in WatchResponse. -func WithProgressNotify() OpOption { - return func(op *Op) { - op.progressNotify = true - } -} - -// WithCreatedNotify makes watch server sends the created event. -func WithCreatedNotify() OpOption { - return func(op *Op) { - op.createdNotify = true - } -} - -// WithFilterPut discards PUT events from the watcher. -func WithFilterPut() OpOption { - return func(op *Op) { op.filterPut = true } -} - -// WithFilterDelete discards DELETE events from the watcher. -func WithFilterDelete() OpOption { - return func(op *Op) { op.filterDelete = true } -} - -// WithPrevKV gets the previous key-value pair before the event happens. If the previous KV is already compacted, -// nothing will be returned. -func WithPrevKV() OpOption { - return func(op *Op) { - op.prevKV = true - } -} - -// WithIgnoreValue updates the key using its current value. -// This option can not be combined with non-empty values. -// Returns an error if the key does not exist. -func WithIgnoreValue() OpOption { - return func(op *Op) { - op.ignoreValue = true - } -} - -// WithIgnoreLease updates the key using its current lease. -// This option can not be combined with WithLease. -// Returns an error if the key does not exist. -func WithIgnoreLease() OpOption { - return func(op *Op) { - op.ignoreLease = true - } -} - -// LeaseOp represents an Operation that lease can execute. -type LeaseOp struct { - id LeaseID - - // for TimeToLive - attachedKeys bool -} - -// LeaseOption configures lease operations. -type LeaseOption func(*LeaseOp) - -func (op *LeaseOp) applyOpts(opts []LeaseOption) { - for _, opt := range opts { - opt(op) - } -} - -// WithAttachedKeys makes TimeToLive list the keys attached to the given lease ID. -func WithAttachedKeys() LeaseOption { - return func(op *LeaseOp) { op.attachedKeys = true } -} - -func toLeaseTimeToLiveRequest(id LeaseID, opts ...LeaseOption) *pb.LeaseTimeToLiveRequest { - ret := &LeaseOp{id: id} - ret.applyOpts(opts) - return &pb.LeaseTimeToLiveRequest{ID: int64(id), Keys: ret.attachedKeys} -} diff --git a/vendor/github.com/coreos/etcd/clientv3/options.go b/vendor/github.com/coreos/etcd/clientv3/options.go deleted file mode 100644 index fa25811f3..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/options.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2017 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "math" - - "google.golang.org/grpc" -) - -var ( - // Disable gRPC internal retrial logic - // TODO: enable when gRPC retry is stable (FailFast=false) - // Reference: - // - https://github.com/grpc/grpc-go/issues/1532 - // - https://github.com/grpc/proposal/blob/master/A6-client-retries.md - defaultFailFast = grpc.FailFast(true) - - // client-side request send limit, gRPC default is math.MaxInt32 - // Make sure that "client-side send limit < server-side default send/recv limit" - // Same value as "embed.DefaultMaxRequestBytes" plus gRPC overhead bytes - defaultMaxCallSendMsgSize = grpc.MaxCallSendMsgSize(2 * 1024 * 1024) - - // client-side response receive limit, gRPC default is 4MB - // Make sure that "client-side receive limit >= server-side default send/recv limit" - // because range response can easily exceed request send limits - // Default to math.MaxInt32; writes exceeding server-side send limit fails anyway - defaultMaxCallRecvMsgSize = grpc.MaxCallRecvMsgSize(math.MaxInt32) -) - -// defaultCallOpts defines a list of default "gRPC.CallOption". -// Some options are exposed to "clientv3.Config". -// Defaults will be overridden by the settings in "clientv3.Config". -var defaultCallOpts = []grpc.CallOption{defaultFailFast, defaultMaxCallSendMsgSize, defaultMaxCallRecvMsgSize} - -// MaxLeaseTTL is the maximum lease TTL value -const MaxLeaseTTL = 9000000000 diff --git a/vendor/github.com/coreos/etcd/clientv3/ready_wait.go b/vendor/github.com/coreos/etcd/clientv3/ready_wait.go deleted file mode 100644 index c6ef585b5..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/ready_wait.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2017 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import "context" - -// TODO: remove this when "FailFast=false" is fixed. -// See https://github.com/grpc/grpc-go/issues/1532. -func readyWait(rpcCtx, clientCtx context.Context, ready <-chan struct{}) error { - select { - case <-ready: - return nil - case <-rpcCtx.Done(): - return rpcCtx.Err() - case <-clientCtx.Done(): - return clientCtx.Err() - } -} diff --git a/vendor/github.com/coreos/etcd/clientv3/retry.go b/vendor/github.com/coreos/etcd/clientv3/retry.go deleted file mode 100644 index 7f89ba641..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/retry.go +++ /dev/null @@ -1,496 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - - "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type retryPolicy uint8 - -const ( - repeatable retryPolicy = iota - nonRepeatable -) - -type rpcFunc func(ctx context.Context) error -type retryRPCFunc func(context.Context, rpcFunc, retryPolicy) error -type retryStopErrFunc func(error) bool - -// immutable requests (e.g. Get) should be retried unless it's -// an obvious server-side error (e.g. rpctypes.ErrRequestTooLarge). -// -// "isRepeatableStopError" returns "true" when an immutable request -// is interrupted by server-side or gRPC-side error and its status -// code is not transient (!= codes.Unavailable). -// -// Returning "true" means retry should stop, since client cannot -// handle itself even with retries. -func isRepeatableStopError(err error) bool { - eErr := rpctypes.Error(err) - // always stop retry on etcd errors - if serverErr, ok := eErr.(rpctypes.EtcdError); ok && serverErr.Code() != codes.Unavailable { - return true - } - // only retry if unavailable - ev, _ := status.FromError(err) - return ev.Code() != codes.Unavailable -} - -// mutable requests (e.g. Put, Delete, Txn) should only be retried -// when the status code is codes.Unavailable when initial connection -// has not been established (no pinned endpoint). -// -// "isNonRepeatableStopError" returns "true" when a mutable request -// is interrupted by non-transient error that client cannot handle itself, -// or transient error while the connection has already been established -// (pinned endpoint exists). -// -// Returning "true" means retry should stop, otherwise it violates -// write-at-most-once semantics. -func isNonRepeatableStopError(err error) bool { - ev, _ := status.FromError(err) - if ev.Code() != codes.Unavailable { - return true - } - desc := rpctypes.ErrorDesc(err) - return desc != "there is no address available" && desc != "there is no connection available" -} - -func (c *Client) newRetryWrapper() retryRPCFunc { - return func(rpcCtx context.Context, f rpcFunc, rp retryPolicy) error { - var isStop retryStopErrFunc - switch rp { - case repeatable: - isStop = isRepeatableStopError - case nonRepeatable: - isStop = isNonRepeatableStopError - } - for { - if err := readyWait(rpcCtx, c.ctx, c.balancer.ConnectNotify()); err != nil { - return err - } - pinned := c.balancer.pinned() - err := f(rpcCtx) - if err == nil { - return nil - } - logger.Lvl(4).Infof("clientv3/retry: error %q on pinned endpoint %q", err.Error(), pinned) - - if s, ok := status.FromError(err); ok && (s.Code() == codes.Unavailable || s.Code() == codes.DeadlineExceeded || s.Code() == codes.Internal) { - // mark this before endpoint switch is triggered - c.balancer.hostPortError(pinned, err) - c.balancer.next() - logger.Lvl(4).Infof("clientv3/retry: switching from %q due to error %q", pinned, err.Error()) - } - - if isStop(err) { - return err - } - } - } -} - -func (c *Client) newAuthRetryWrapper(retryf retryRPCFunc) retryRPCFunc { - return func(rpcCtx context.Context, f rpcFunc, rp retryPolicy) error { - for { - pinned := c.balancer.pinned() - err := retryf(rpcCtx, f, rp) - if err == nil { - return nil - } - logger.Lvl(4).Infof("clientv3/auth-retry: error %q on pinned endpoint %q", err.Error(), pinned) - // always stop retry on etcd errors other than invalid auth token - if rpctypes.Error(err) == rpctypes.ErrInvalidAuthToken { - gterr := c.getToken(rpcCtx) - if gterr != nil { - logger.Lvl(4).Infof("clientv3/auth-retry: cannot retry due to error %q(%q) on pinned endpoint %q", err.Error(), gterr.Error(), pinned) - return err // return the original error for simplicity - } - continue - } - return err - } - } -} - -type retryKVClient struct { - kc pb.KVClient - retryf retryRPCFunc -} - -// RetryKVClient implements a KVClient. -func RetryKVClient(c *Client) pb.KVClient { - return &retryKVClient{ - kc: pb.NewKVClient(c.conn), - retryf: c.newAuthRetryWrapper(c.newRetryWrapper()), - } -} -func (rkv *retryKVClient) Range(ctx context.Context, in *pb.RangeRequest, opts ...grpc.CallOption) (resp *pb.RangeResponse, err error) { - err = rkv.retryf(ctx, func(rctx context.Context) error { - resp, err = rkv.kc.Range(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rkv *retryKVClient) Put(ctx context.Context, in *pb.PutRequest, opts ...grpc.CallOption) (resp *pb.PutResponse, err error) { - err = rkv.retryf(ctx, func(rctx context.Context) error { - resp, err = rkv.kc.Put(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rkv *retryKVClient) DeleteRange(ctx context.Context, in *pb.DeleteRangeRequest, opts ...grpc.CallOption) (resp *pb.DeleteRangeResponse, err error) { - err = rkv.retryf(ctx, func(rctx context.Context) error { - resp, err = rkv.kc.DeleteRange(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rkv *retryKVClient) Txn(ctx context.Context, in *pb.TxnRequest, opts ...grpc.CallOption) (resp *pb.TxnResponse, err error) { - // TODO: "repeatable" for read-only txn - err = rkv.retryf(ctx, func(rctx context.Context) error { - resp, err = rkv.kc.Txn(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rkv *retryKVClient) Compact(ctx context.Context, in *pb.CompactionRequest, opts ...grpc.CallOption) (resp *pb.CompactionResponse, err error) { - err = rkv.retryf(ctx, func(rctx context.Context) error { - resp, err = rkv.kc.Compact(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -type retryLeaseClient struct { - lc pb.LeaseClient - retryf retryRPCFunc -} - -// RetryLeaseClient implements a LeaseClient. -func RetryLeaseClient(c *Client) pb.LeaseClient { - return &retryLeaseClient{ - lc: pb.NewLeaseClient(c.conn), - retryf: c.newAuthRetryWrapper(c.newRetryWrapper()), - } -} - -func (rlc *retryLeaseClient) LeaseTimeToLive(ctx context.Context, in *pb.LeaseTimeToLiveRequest, opts ...grpc.CallOption) (resp *pb.LeaseTimeToLiveResponse, err error) { - err = rlc.retryf(ctx, func(rctx context.Context) error { - resp, err = rlc.lc.LeaseTimeToLive(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rlc *retryLeaseClient) LeaseLeases(ctx context.Context, in *pb.LeaseLeasesRequest, opts ...grpc.CallOption) (resp *pb.LeaseLeasesResponse, err error) { - err = rlc.retryf(ctx, func(rctx context.Context) error { - resp, err = rlc.lc.LeaseLeases(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rlc *retryLeaseClient) LeaseGrant(ctx context.Context, in *pb.LeaseGrantRequest, opts ...grpc.CallOption) (resp *pb.LeaseGrantResponse, err error) { - err = rlc.retryf(ctx, func(rctx context.Context) error { - resp, err = rlc.lc.LeaseGrant(rctx, in, opts...) - return err - }, repeatable) - return resp, err - -} - -func (rlc *retryLeaseClient) LeaseRevoke(ctx context.Context, in *pb.LeaseRevokeRequest, opts ...grpc.CallOption) (resp *pb.LeaseRevokeResponse, err error) { - err = rlc.retryf(ctx, func(rctx context.Context) error { - resp, err = rlc.lc.LeaseRevoke(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rlc *retryLeaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (stream pb.Lease_LeaseKeepAliveClient, err error) { - err = rlc.retryf(ctx, func(rctx context.Context) error { - stream, err = rlc.lc.LeaseKeepAlive(rctx, opts...) - return err - }, repeatable) - return stream, err -} - -type retryClusterClient struct { - cc pb.ClusterClient - retryf retryRPCFunc -} - -// RetryClusterClient implements a ClusterClient. -func RetryClusterClient(c *Client) pb.ClusterClient { - return &retryClusterClient{ - cc: pb.NewClusterClient(c.conn), - retryf: c.newRetryWrapper(), - } -} - -func (rcc *retryClusterClient) MemberList(ctx context.Context, in *pb.MemberListRequest, opts ...grpc.CallOption) (resp *pb.MemberListResponse, err error) { - err = rcc.retryf(ctx, func(rctx context.Context) error { - resp, err = rcc.cc.MemberList(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rcc *retryClusterClient) MemberAdd(ctx context.Context, in *pb.MemberAddRequest, opts ...grpc.CallOption) (resp *pb.MemberAddResponse, err error) { - err = rcc.retryf(ctx, func(rctx context.Context) error { - resp, err = rcc.cc.MemberAdd(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rcc *retryClusterClient) MemberRemove(ctx context.Context, in *pb.MemberRemoveRequest, opts ...grpc.CallOption) (resp *pb.MemberRemoveResponse, err error) { - err = rcc.retryf(ctx, func(rctx context.Context) error { - resp, err = rcc.cc.MemberRemove(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rcc *retryClusterClient) MemberUpdate(ctx context.Context, in *pb.MemberUpdateRequest, opts ...grpc.CallOption) (resp *pb.MemberUpdateResponse, err error) { - err = rcc.retryf(ctx, func(rctx context.Context) error { - resp, err = rcc.cc.MemberUpdate(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -type retryMaintenanceClient struct { - mc pb.MaintenanceClient - retryf retryRPCFunc -} - -// RetryMaintenanceClient implements a Maintenance. -func RetryMaintenanceClient(c *Client, conn *grpc.ClientConn) pb.MaintenanceClient { - return &retryMaintenanceClient{ - mc: pb.NewMaintenanceClient(conn), - retryf: c.newRetryWrapper(), - } -} - -func (rmc *retryMaintenanceClient) Alarm(ctx context.Context, in *pb.AlarmRequest, opts ...grpc.CallOption) (resp *pb.AlarmResponse, err error) { - err = rmc.retryf(ctx, func(rctx context.Context) error { - resp, err = rmc.mc.Alarm(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rmc *retryMaintenanceClient) Status(ctx context.Context, in *pb.StatusRequest, opts ...grpc.CallOption) (resp *pb.StatusResponse, err error) { - err = rmc.retryf(ctx, func(rctx context.Context) error { - resp, err = rmc.mc.Status(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rmc *retryMaintenanceClient) Hash(ctx context.Context, in *pb.HashRequest, opts ...grpc.CallOption) (resp *pb.HashResponse, err error) { - err = rmc.retryf(ctx, func(rctx context.Context) error { - resp, err = rmc.mc.Hash(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rmc *retryMaintenanceClient) HashKV(ctx context.Context, in *pb.HashKVRequest, opts ...grpc.CallOption) (resp *pb.HashKVResponse, err error) { - err = rmc.retryf(ctx, func(rctx context.Context) error { - resp, err = rmc.mc.HashKV(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rmc *retryMaintenanceClient) Snapshot(ctx context.Context, in *pb.SnapshotRequest, opts ...grpc.CallOption) (stream pb.Maintenance_SnapshotClient, err error) { - err = rmc.retryf(ctx, func(rctx context.Context) error { - stream, err = rmc.mc.Snapshot(rctx, in, opts...) - return err - }, repeatable) - return stream, err -} - -func (rmc *retryMaintenanceClient) MoveLeader(ctx context.Context, in *pb.MoveLeaderRequest, opts ...grpc.CallOption) (resp *pb.MoveLeaderResponse, err error) { - err = rmc.retryf(ctx, func(rctx context.Context) error { - resp, err = rmc.mc.MoveLeader(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rmc *retryMaintenanceClient) Defragment(ctx context.Context, in *pb.DefragmentRequest, opts ...grpc.CallOption) (resp *pb.DefragmentResponse, err error) { - err = rmc.retryf(ctx, func(rctx context.Context) error { - resp, err = rmc.mc.Defragment(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -type retryAuthClient struct { - ac pb.AuthClient - retryf retryRPCFunc -} - -// RetryAuthClient implements a AuthClient. -func RetryAuthClient(c *Client) pb.AuthClient { - return &retryAuthClient{ - ac: pb.NewAuthClient(c.conn), - retryf: c.newRetryWrapper(), - } -} - -func (rac *retryAuthClient) UserList(ctx context.Context, in *pb.AuthUserListRequest, opts ...grpc.CallOption) (resp *pb.AuthUserListResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.UserList(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rac *retryAuthClient) UserGet(ctx context.Context, in *pb.AuthUserGetRequest, opts ...grpc.CallOption) (resp *pb.AuthUserGetResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.UserGet(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rac *retryAuthClient) RoleGet(ctx context.Context, in *pb.AuthRoleGetRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleGetResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.RoleGet(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rac *retryAuthClient) RoleList(ctx context.Context, in *pb.AuthRoleListRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleListResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.RoleList(rctx, in, opts...) - return err - }, repeatable) - return resp, err -} - -func (rac *retryAuthClient) AuthEnable(ctx context.Context, in *pb.AuthEnableRequest, opts ...grpc.CallOption) (resp *pb.AuthEnableResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.AuthEnable(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) AuthDisable(ctx context.Context, in *pb.AuthDisableRequest, opts ...grpc.CallOption) (resp *pb.AuthDisableResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.AuthDisable(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) UserAdd(ctx context.Context, in *pb.AuthUserAddRequest, opts ...grpc.CallOption) (resp *pb.AuthUserAddResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.UserAdd(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) UserDelete(ctx context.Context, in *pb.AuthUserDeleteRequest, opts ...grpc.CallOption) (resp *pb.AuthUserDeleteResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.UserDelete(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) UserChangePassword(ctx context.Context, in *pb.AuthUserChangePasswordRequest, opts ...grpc.CallOption) (resp *pb.AuthUserChangePasswordResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.UserChangePassword(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) UserGrantRole(ctx context.Context, in *pb.AuthUserGrantRoleRequest, opts ...grpc.CallOption) (resp *pb.AuthUserGrantRoleResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.UserGrantRole(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) UserRevokeRole(ctx context.Context, in *pb.AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (resp *pb.AuthUserRevokeRoleResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.UserRevokeRole(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) RoleAdd(ctx context.Context, in *pb.AuthRoleAddRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleAddResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.RoleAdd(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) RoleDelete(ctx context.Context, in *pb.AuthRoleDeleteRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleDeleteResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.RoleDelete(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) RoleGrantPermission(ctx context.Context, in *pb.AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleGrantPermissionResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.RoleGrantPermission(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) RoleRevokePermission(ctx context.Context, in *pb.AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleRevokePermissionResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.RoleRevokePermission(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} - -func (rac *retryAuthClient) Authenticate(ctx context.Context, in *pb.AuthenticateRequest, opts ...grpc.CallOption) (resp *pb.AuthenticateResponse, err error) { - err = rac.retryf(ctx, func(rctx context.Context) error { - resp, err = rac.ac.Authenticate(rctx, in, opts...) - return err - }, nonRepeatable) - return resp, err -} diff --git a/vendor/github.com/coreos/etcd/clientv3/sort.go b/vendor/github.com/coreos/etcd/clientv3/sort.go deleted file mode 100644 index 2bb9d9a13..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/sort.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -type SortTarget int -type SortOrder int - -const ( - SortNone SortOrder = iota - SortAscend - SortDescend -) - -const ( - SortByKey SortTarget = iota - SortByVersion - SortByCreateRevision - SortByModRevision - SortByValue -) - -type SortOption struct { - Target SortTarget - Order SortOrder -} diff --git a/vendor/github.com/coreos/etcd/clientv3/txn.go b/vendor/github.com/coreos/etcd/clientv3/txn.go deleted file mode 100644 index c3c2d2485..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/txn.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "sync" - - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - - "google.golang.org/grpc" -) - -// Txn is the interface that wraps mini-transactions. -// -// Txn(context.TODO()).If( -// Compare(Value(k1), ">", v1), -// Compare(Version(k1), "=", 2) -// ).Then( -// OpPut(k2,v2), OpPut(k3,v3) -// ).Else( -// OpPut(k4,v4), OpPut(k5,v5) -// ).Commit() -// -type Txn interface { - // If takes a list of comparison. If all comparisons passed in succeed, - // the operations passed into Then() will be executed. Or the operations - // passed into Else() will be executed. - If(cs ...Cmp) Txn - - // Then takes a list of operations. The Ops list will be executed, if the - // comparisons passed in If() succeed. - Then(ops ...Op) Txn - - // Else takes a list of operations. The Ops list will be executed, if the - // comparisons passed in If() fail. - Else(ops ...Op) Txn - - // Commit tries to commit the transaction. - Commit() (*TxnResponse, error) -} - -type txn struct { - kv *kv - ctx context.Context - - mu sync.Mutex - cif bool - cthen bool - celse bool - - isWrite bool - - cmps []*pb.Compare - - sus []*pb.RequestOp - fas []*pb.RequestOp - - callOpts []grpc.CallOption -} - -func (txn *txn) If(cs ...Cmp) Txn { - txn.mu.Lock() - defer txn.mu.Unlock() - - if txn.cif { - panic("cannot call If twice!") - } - - if txn.cthen { - panic("cannot call If after Then!") - } - - if txn.celse { - panic("cannot call If after Else!") - } - - txn.cif = true - - for i := range cs { - txn.cmps = append(txn.cmps, (*pb.Compare)(&cs[i])) - } - - return txn -} - -func (txn *txn) Then(ops ...Op) Txn { - txn.mu.Lock() - defer txn.mu.Unlock() - - if txn.cthen { - panic("cannot call Then twice!") - } - if txn.celse { - panic("cannot call Then after Else!") - } - - txn.cthen = true - - for _, op := range ops { - txn.isWrite = txn.isWrite || op.isWrite() - txn.sus = append(txn.sus, op.toRequestOp()) - } - - return txn -} - -func (txn *txn) Else(ops ...Op) Txn { - txn.mu.Lock() - defer txn.mu.Unlock() - - if txn.celse { - panic("cannot call Else twice!") - } - - txn.celse = true - - for _, op := range ops { - txn.isWrite = txn.isWrite || op.isWrite() - txn.fas = append(txn.fas, op.toRequestOp()) - } - - return txn -} - -func (txn *txn) Commit() (*TxnResponse, error) { - txn.mu.Lock() - defer txn.mu.Unlock() - - r := &pb.TxnRequest{Compare: txn.cmps, Success: txn.sus, Failure: txn.fas} - - var resp *pb.TxnResponse - var err error - resp, err = txn.kv.remote.Txn(txn.ctx, r, txn.callOpts...) - if err != nil { - return nil, toErr(txn.ctx, err) - } - return (*TxnResponse)(resp), nil -} diff --git a/vendor/github.com/coreos/etcd/clientv3/watch.go b/vendor/github.com/coreos/etcd/clientv3/watch.go deleted file mode 100644 index f606a1af9..000000000 --- a/vendor/github.com/coreos/etcd/clientv3/watch.go +++ /dev/null @@ -1,814 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package clientv3 - -import ( - "context" - "fmt" - "sync" - "time" - - v3rpc "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" - mvccpb "github.com/coreos/etcd/mvcc/mvccpb" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -const ( - EventTypeDelete = mvccpb.DELETE - EventTypePut = mvccpb.PUT - - closeSendErrTimeout = 250 * time.Millisecond -) - -type Event mvccpb.Event - -type WatchChan <-chan WatchResponse - -type Watcher interface { - // Watch watches on a key or prefix. The watched events will be returned - // through the returned channel. If revisions waiting to be sent over the - // watch are compacted, then the watch will be canceled by the server, the - // client will post a compacted error watch response, and the channel will close. - Watch(ctx context.Context, key string, opts ...OpOption) WatchChan - - // Close closes the watcher and cancels all watch requests. - Close() error -} - -type WatchResponse struct { - Header pb.ResponseHeader - Events []*Event - - // CompactRevision is the minimum revision the watcher may receive. - CompactRevision int64 - - // Canceled is used to indicate watch failure. - // If the watch failed and the stream was about to close, before the channel is closed, - // the channel sends a final response that has Canceled set to true with a non-nil Err(). - Canceled bool - - // Created is used to indicate the creation of the watcher. - Created bool - - closeErr error - - // cancelReason is a reason of canceling watch - cancelReason string -} - -// IsCreate returns true if the event tells that the key is newly created. -func (e *Event) IsCreate() bool { - return e.Type == EventTypePut && e.Kv.CreateRevision == e.Kv.ModRevision -} - -// IsModify returns true if the event tells that a new value is put on existing key. -func (e *Event) IsModify() bool { - return e.Type == EventTypePut && e.Kv.CreateRevision != e.Kv.ModRevision -} - -// Err is the error value if this WatchResponse holds an error. -func (wr *WatchResponse) Err() error { - switch { - case wr.closeErr != nil: - return v3rpc.Error(wr.closeErr) - case wr.CompactRevision != 0: - return v3rpc.ErrCompacted - case wr.Canceled: - if len(wr.cancelReason) != 0 { - return v3rpc.Error(status.Error(codes.FailedPrecondition, wr.cancelReason)) - } - return v3rpc.ErrFutureRev - } - return nil -} - -// IsProgressNotify returns true if the WatchResponse is progress notification. -func (wr *WatchResponse) IsProgressNotify() bool { - return len(wr.Events) == 0 && !wr.Canceled && !wr.Created && wr.CompactRevision == 0 && wr.Header.Revision != 0 -} - -// watcher implements the Watcher interface -type watcher struct { - remote pb.WatchClient - callOpts []grpc.CallOption - - // mu protects the grpc streams map - mu sync.RWMutex - - // streams holds all the active grpc streams keyed by ctx value. - streams map[string]*watchGrpcStream -} - -// watchGrpcStream tracks all watch resources attached to a single grpc stream. -type watchGrpcStream struct { - owner *watcher - remote pb.WatchClient - callOpts []grpc.CallOption - - // ctx controls internal remote.Watch requests - ctx context.Context - // ctxKey is the key used when looking up this stream's context - ctxKey string - cancel context.CancelFunc - - // substreams holds all active watchers on this grpc stream - substreams map[int64]*watcherStream - // resuming holds all resuming watchers on this grpc stream - resuming []*watcherStream - - // reqc sends a watch request from Watch() to the main goroutine - reqc chan *watchRequest - // respc receives data from the watch client - respc chan *pb.WatchResponse - // donec closes to broadcast shutdown - donec chan struct{} - // errc transmits errors from grpc Recv to the watch stream reconnect logic - errc chan error - // closingc gets the watcherStream of closing watchers - closingc chan *watcherStream - // wg is Done when all substream goroutines have exited - wg sync.WaitGroup - - // resumec closes to signal that all substreams should begin resuming - resumec chan struct{} - // closeErr is the error that closed the watch stream - closeErr error -} - -// watchRequest is issued by the subscriber to start a new watcher -type watchRequest struct { - ctx context.Context - key string - end string - rev int64 - // send created notification event if this field is true - createdNotify bool - // progressNotify is for progress updates - progressNotify bool - // filters is the list of events to filter out - filters []pb.WatchCreateRequest_FilterType - // get the previous key-value pair before the event happens - prevKV bool - // retc receives a chan WatchResponse once the watcher is established - retc chan chan WatchResponse -} - -// watcherStream represents a registered watcher -type watcherStream struct { - // initReq is the request that initiated this request - initReq watchRequest - - // outc publishes watch responses to subscriber - outc chan WatchResponse - // recvc buffers watch responses before publishing - recvc chan *WatchResponse - // donec closes when the watcherStream goroutine stops. - donec chan struct{} - // closing is set to true when stream should be scheduled to shutdown. - closing bool - // id is the registered watch id on the grpc stream - id int64 - - // buf holds all events received from etcd but not yet consumed by the client - buf []*WatchResponse -} - -func NewWatcher(c *Client) Watcher { - return NewWatchFromWatchClient(pb.NewWatchClient(c.conn), c) -} - -func NewWatchFromWatchClient(wc pb.WatchClient, c *Client) Watcher { - w := &watcher{ - remote: wc, - streams: make(map[string]*watchGrpcStream), - } - if c != nil { - w.callOpts = c.callOpts - } - return w -} - -// never closes -var valCtxCh = make(chan struct{}) -var zeroTime = time.Unix(0, 0) - -// ctx with only the values; never Done -type valCtx struct{ context.Context } - -func (vc *valCtx) Deadline() (time.Time, bool) { return zeroTime, false } -func (vc *valCtx) Done() <-chan struct{} { return valCtxCh } -func (vc *valCtx) Err() error { return nil } - -func (w *watcher) newWatcherGrpcStream(inctx context.Context) *watchGrpcStream { - ctx, cancel := context.WithCancel(&valCtx{inctx}) - wgs := &watchGrpcStream{ - owner: w, - remote: w.remote, - callOpts: w.callOpts, - ctx: ctx, - ctxKey: streamKeyFromCtx(inctx), - cancel: cancel, - substreams: make(map[int64]*watcherStream), - respc: make(chan *pb.WatchResponse), - reqc: make(chan *watchRequest), - donec: make(chan struct{}), - errc: make(chan error, 1), - closingc: make(chan *watcherStream), - resumec: make(chan struct{}), - } - go wgs.run() - return wgs -} - -// Watch posts a watch request to run() and waits for a new watcher channel -func (w *watcher) Watch(ctx context.Context, key string, opts ...OpOption) WatchChan { - ow := opWatch(key, opts...) - - var filters []pb.WatchCreateRequest_FilterType - if ow.filterPut { - filters = append(filters, pb.WatchCreateRequest_NOPUT) - } - if ow.filterDelete { - filters = append(filters, pb.WatchCreateRequest_NODELETE) - } - - wr := &watchRequest{ - ctx: ctx, - createdNotify: ow.createdNotify, - key: string(ow.key), - end: string(ow.end), - rev: ow.rev, - progressNotify: ow.progressNotify, - filters: filters, - prevKV: ow.prevKV, - retc: make(chan chan WatchResponse, 1), - } - - ok := false - ctxKey := streamKeyFromCtx(ctx) - - // find or allocate appropriate grpc watch stream - w.mu.Lock() - if w.streams == nil { - // closed - w.mu.Unlock() - ch := make(chan WatchResponse) - close(ch) - return ch - } - wgs := w.streams[ctxKey] - if wgs == nil { - wgs = w.newWatcherGrpcStream(ctx) - w.streams[ctxKey] = wgs - } - donec := wgs.donec - reqc := wgs.reqc - w.mu.Unlock() - - // couldn't create channel; return closed channel - closeCh := make(chan WatchResponse, 1) - - // submit request - select { - case reqc <- wr: - ok = true - case <-wr.ctx.Done(): - case <-donec: - if wgs.closeErr != nil { - closeCh <- WatchResponse{closeErr: wgs.closeErr} - break - } - // retry; may have dropped stream from no ctxs - return w.Watch(ctx, key, opts...) - } - - // receive channel - if ok { - select { - case ret := <-wr.retc: - return ret - case <-ctx.Done(): - case <-donec: - if wgs.closeErr != nil { - closeCh <- WatchResponse{closeErr: wgs.closeErr} - break - } - // retry; may have dropped stream from no ctxs - return w.Watch(ctx, key, opts...) - } - } - - close(closeCh) - return closeCh -} - -func (w *watcher) Close() (err error) { - w.mu.Lock() - streams := w.streams - w.streams = nil - w.mu.Unlock() - for _, wgs := range streams { - if werr := wgs.close(); werr != nil { - err = werr - } - } - return err -} - -func (w *watchGrpcStream) close() (err error) { - w.cancel() - <-w.donec - select { - case err = <-w.errc: - default: - } - return toErr(w.ctx, err) -} - -func (w *watcher) closeStream(wgs *watchGrpcStream) { - w.mu.Lock() - close(wgs.donec) - wgs.cancel() - if w.streams != nil { - delete(w.streams, wgs.ctxKey) - } - w.mu.Unlock() -} - -func (w *watchGrpcStream) addSubstream(resp *pb.WatchResponse, ws *watcherStream) { - if resp.WatchId == -1 { - // failed; no channel - close(ws.recvc) - return - } - ws.id = resp.WatchId - w.substreams[ws.id] = ws -} - -func (w *watchGrpcStream) sendCloseSubstream(ws *watcherStream, resp *WatchResponse) { - select { - case ws.outc <- *resp: - case <-ws.initReq.ctx.Done(): - case <-time.After(closeSendErrTimeout): - } - close(ws.outc) -} - -func (w *watchGrpcStream) closeSubstream(ws *watcherStream) { - // send channel response in case stream was never established - select { - case ws.initReq.retc <- ws.outc: - default: - } - // close subscriber's channel - if closeErr := w.closeErr; closeErr != nil && ws.initReq.ctx.Err() == nil { - go w.sendCloseSubstream(ws, &WatchResponse{closeErr: w.closeErr}) - } else if ws.outc != nil { - close(ws.outc) - } - if ws.id != -1 { - delete(w.substreams, ws.id) - return - } - for i := range w.resuming { - if w.resuming[i] == ws { - w.resuming[i] = nil - return - } - } -} - -// run is the root of the goroutines for managing a watcher client -func (w *watchGrpcStream) run() { - var wc pb.Watch_WatchClient - var closeErr error - - // substreams marked to close but goroutine still running; needed for - // avoiding double-closing recvc on grpc stream teardown - closing := make(map[*watcherStream]struct{}) - - defer func() { - w.closeErr = closeErr - // shutdown substreams and resuming substreams - for _, ws := range w.substreams { - if _, ok := closing[ws]; !ok { - close(ws.recvc) - closing[ws] = struct{}{} - } - } - for _, ws := range w.resuming { - if _, ok := closing[ws]; ws != nil && !ok { - close(ws.recvc) - closing[ws] = struct{}{} - } - } - w.joinSubstreams() - for range closing { - w.closeSubstream(<-w.closingc) - } - w.wg.Wait() - w.owner.closeStream(w) - }() - - // start a stream with the etcd grpc server - if wc, closeErr = w.newWatchClient(); closeErr != nil { - return - } - - cancelSet := make(map[int64]struct{}) - - for { - select { - // Watch() requested - case wreq := <-w.reqc: - outc := make(chan WatchResponse, 1) - ws := &watcherStream{ - initReq: *wreq, - id: -1, - outc: outc, - // unbuffered so resumes won't cause repeat events - recvc: make(chan *WatchResponse), - } - - ws.donec = make(chan struct{}) - w.wg.Add(1) - go w.serveSubstream(ws, w.resumec) - - // queue up for watcher creation/resume - w.resuming = append(w.resuming, ws) - if len(w.resuming) == 1 { - // head of resume queue, can register a new watcher - wc.Send(ws.initReq.toPB()) - } - // New events from the watch client - case pbresp := <-w.respc: - switch { - case pbresp.Created: - // response to head of queue creation - if ws := w.resuming[0]; ws != nil { - w.addSubstream(pbresp, ws) - w.dispatchEvent(pbresp) - w.resuming[0] = nil - } - if ws := w.nextResume(); ws != nil { - wc.Send(ws.initReq.toPB()) - } - case pbresp.Canceled && pbresp.CompactRevision == 0: - delete(cancelSet, pbresp.WatchId) - if ws, ok := w.substreams[pbresp.WatchId]; ok { - // signal to stream goroutine to update closingc - close(ws.recvc) - closing[ws] = struct{}{} - } - default: - // dispatch to appropriate watch stream - if ok := w.dispatchEvent(pbresp); ok { - break - } - // watch response on unexpected watch id; cancel id - if _, ok := cancelSet[pbresp.WatchId]; ok { - break - } - cancelSet[pbresp.WatchId] = struct{}{} - cr := &pb.WatchRequest_CancelRequest{ - CancelRequest: &pb.WatchCancelRequest{ - WatchId: pbresp.WatchId, - }, - } - req := &pb.WatchRequest{RequestUnion: cr} - wc.Send(req) - } - // watch client failed on Recv; spawn another if possible - case err := <-w.errc: - if isHaltErr(w.ctx, err) || toErr(w.ctx, err) == v3rpc.ErrNoLeader { - closeErr = err - return - } - if wc, closeErr = w.newWatchClient(); closeErr != nil { - return - } - if ws := w.nextResume(); ws != nil { - wc.Send(ws.initReq.toPB()) - } - cancelSet = make(map[int64]struct{}) - case <-w.ctx.Done(): - return - case ws := <-w.closingc: - w.closeSubstream(ws) - delete(closing, ws) - if len(w.substreams)+len(w.resuming) == 0 { - // no more watchers on this stream, shutdown - return - } - } - } -} - -// nextResume chooses the next resuming to register with the grpc stream. Abandoned -// streams are marked as nil in the queue since the head must wait for its inflight registration. -func (w *watchGrpcStream) nextResume() *watcherStream { - for len(w.resuming) != 0 { - if w.resuming[0] != nil { - return w.resuming[0] - } - w.resuming = w.resuming[1:len(w.resuming)] - } - return nil -} - -// dispatchEvent sends a WatchResponse to the appropriate watcher stream -func (w *watchGrpcStream) dispatchEvent(pbresp *pb.WatchResponse) bool { - events := make([]*Event, len(pbresp.Events)) - for i, ev := range pbresp.Events { - events[i] = (*Event)(ev) - } - wr := &WatchResponse{ - Header: *pbresp.Header, - Events: events, - CompactRevision: pbresp.CompactRevision, - Created: pbresp.Created, - Canceled: pbresp.Canceled, - cancelReason: pbresp.CancelReason, - } - ws, ok := w.substreams[pbresp.WatchId] - if !ok { - return false - } - select { - case ws.recvc <- wr: - case <-ws.donec: - return false - } - return true -} - -// serveWatchClient forwards messages from the grpc stream to run() -func (w *watchGrpcStream) serveWatchClient(wc pb.Watch_WatchClient) { - for { - resp, err := wc.Recv() - if err != nil { - select { - case w.errc <- err: - case <-w.donec: - } - return - } - select { - case w.respc <- resp: - case <-w.donec: - return - } - } -} - -// serveSubstream forwards watch responses from run() to the subscriber -func (w *watchGrpcStream) serveSubstream(ws *watcherStream, resumec chan struct{}) { - if ws.closing { - panic("created substream goroutine but substream is closing") - } - - // nextRev is the minimum expected next revision - nextRev := ws.initReq.rev - resuming := false - defer func() { - if !resuming { - ws.closing = true - } - close(ws.donec) - if !resuming { - w.closingc <- ws - } - w.wg.Done() - }() - - emptyWr := &WatchResponse{} - for { - curWr := emptyWr - outc := ws.outc - - if len(ws.buf) > 0 { - curWr = ws.buf[0] - } else { - outc = nil - } - select { - case outc <- *curWr: - if ws.buf[0].Err() != nil { - return - } - ws.buf[0] = nil - ws.buf = ws.buf[1:] - case wr, ok := <-ws.recvc: - if !ok { - // shutdown from closeSubstream - return - } - - if wr.Created { - if ws.initReq.retc != nil { - ws.initReq.retc <- ws.outc - // to prevent next write from taking the slot in buffered channel - // and posting duplicate create events - ws.initReq.retc = nil - - // send first creation event only if requested - if ws.initReq.createdNotify { - ws.outc <- *wr - } - // once the watch channel is returned, a current revision - // watch must resume at the store revision. This is necessary - // for the following case to work as expected: - // wch := m1.Watch("a") - // m2.Put("a", "b") - // <-wch - // If the revision is only bound on the first observed event, - // if wch is disconnected before the Put is issued, then reconnects - // after it is committed, it'll miss the Put. - if ws.initReq.rev == 0 { - nextRev = wr.Header.Revision - } - } - } else { - // current progress of watch; <= store revision - nextRev = wr.Header.Revision - } - - if len(wr.Events) > 0 { - nextRev = wr.Events[len(wr.Events)-1].Kv.ModRevision + 1 - } - ws.initReq.rev = nextRev - - // created event is already sent above, - // watcher should not post duplicate events - if wr.Created { - continue - } - - // TODO pause channel if buffer gets too large - ws.buf = append(ws.buf, wr) - case <-w.ctx.Done(): - return - case <-ws.initReq.ctx.Done(): - return - case <-resumec: - resuming = true - return - } - } - // lazily send cancel message if events on missing id -} - -func (w *watchGrpcStream) newWatchClient() (pb.Watch_WatchClient, error) { - // mark all substreams as resuming - close(w.resumec) - w.resumec = make(chan struct{}) - w.joinSubstreams() - for _, ws := range w.substreams { - ws.id = -1 - w.resuming = append(w.resuming, ws) - } - // strip out nils, if any - var resuming []*watcherStream - for _, ws := range w.resuming { - if ws != nil { - resuming = append(resuming, ws) - } - } - w.resuming = resuming - w.substreams = make(map[int64]*watcherStream) - - // connect to grpc stream while accepting watcher cancelation - stopc := make(chan struct{}) - donec := w.waitCancelSubstreams(stopc) - wc, err := w.openWatchClient() - close(stopc) - <-donec - - // serve all non-closing streams, even if there's a client error - // so that the teardown path can shutdown the streams as expected. - for _, ws := range w.resuming { - if ws.closing { - continue - } - ws.donec = make(chan struct{}) - w.wg.Add(1) - go w.serveSubstream(ws, w.resumec) - } - - if err != nil { - return nil, v3rpc.Error(err) - } - - // receive data from new grpc stream - go w.serveWatchClient(wc) - return wc, nil -} - -func (w *watchGrpcStream) waitCancelSubstreams(stopc <-chan struct{}) <-chan struct{} { - var wg sync.WaitGroup - wg.Add(len(w.resuming)) - donec := make(chan struct{}) - for i := range w.resuming { - go func(ws *watcherStream) { - defer wg.Done() - if ws.closing { - if ws.initReq.ctx.Err() != nil && ws.outc != nil { - close(ws.outc) - ws.outc = nil - } - return - } - select { - case <-ws.initReq.ctx.Done(): - // closed ws will be removed from resuming - ws.closing = true - close(ws.outc) - ws.outc = nil - w.wg.Add(1) - go func() { - defer w.wg.Done() - w.closingc <- ws - }() - case <-stopc: - } - }(w.resuming[i]) - } - go func() { - defer close(donec) - wg.Wait() - }() - return donec -} - -// joinSubstreams waits for all substream goroutines to complete. -func (w *watchGrpcStream) joinSubstreams() { - for _, ws := range w.substreams { - <-ws.donec - } - for _, ws := range w.resuming { - if ws != nil { - <-ws.donec - } - } -} - -// openWatchClient retries opening a watch client until success or halt. -// manually retry in case "ws==nil && err==nil" -// TODO: remove FailFast=false -func (w *watchGrpcStream) openWatchClient() (ws pb.Watch_WatchClient, err error) { - for { - select { - case <-w.ctx.Done(): - if err == nil { - return nil, w.ctx.Err() - } - return nil, err - default: - } - if ws, err = w.remote.Watch(w.ctx, w.callOpts...); ws != nil && err == nil { - break - } - if isHaltErr(w.ctx, err) { - return nil, v3rpc.Error(err) - } - } - return ws, nil -} - -// toPB converts an internal watch request structure to its protobuf WatchRequest structure. -func (wr *watchRequest) toPB() *pb.WatchRequest { - req := &pb.WatchCreateRequest{ - StartRevision: wr.rev, - Key: []byte(wr.key), - RangeEnd: []byte(wr.end), - ProgressNotify: wr.progressNotify, - Filters: wr.filters, - PrevKv: wr.prevKV, - } - cr := &pb.WatchRequest_CreateRequest{CreateRequest: req} - return &pb.WatchRequest{RequestUnion: cr} -} - -func streamKeyFromCtx(ctx context.Context) string { - if md, ok := metadata.FromOutgoingContext(ctx); ok { - return fmt.Sprintf("%+v", md) - } - return "" -} diff --git a/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/doc.go b/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/doc.go deleted file mode 100644 index f72c6a644..000000000 --- a/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package rpctypes has types and values shared by the etcd server and client for v3 RPC interaction. -package rpctypes diff --git a/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/error.go b/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/error.go deleted file mode 100644 index 55eab38ef..000000000 --- a/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/error.go +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rpctypes - -import ( - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// server-side error -var ( - ErrGRPCEmptyKey = status.New(codes.InvalidArgument, "etcdserver: key is not provided").Err() - ErrGRPCKeyNotFound = status.New(codes.InvalidArgument, "etcdserver: key not found").Err() - ErrGRPCValueProvided = status.New(codes.InvalidArgument, "etcdserver: value is provided").Err() - ErrGRPCLeaseProvided = status.New(codes.InvalidArgument, "etcdserver: lease is provided").Err() - ErrGRPCTooManyOps = status.New(codes.InvalidArgument, "etcdserver: too many operations in txn request").Err() - ErrGRPCDuplicateKey = status.New(codes.InvalidArgument, "etcdserver: duplicate key given in txn request").Err() - ErrGRPCCompacted = status.New(codes.OutOfRange, "etcdserver: mvcc: required revision has been compacted").Err() - ErrGRPCFutureRev = status.New(codes.OutOfRange, "etcdserver: mvcc: required revision is a future revision").Err() - ErrGRPCNoSpace = status.New(codes.ResourceExhausted, "etcdserver: mvcc: database space exceeded").Err() - - ErrGRPCLeaseNotFound = status.New(codes.NotFound, "etcdserver: requested lease not found").Err() - ErrGRPCLeaseExist = status.New(codes.FailedPrecondition, "etcdserver: lease already exists").Err() - ErrGRPCLeaseTTLTooLarge = status.New(codes.OutOfRange, "etcdserver: too large lease TTL").Err() - - ErrGRPCMemberExist = status.New(codes.FailedPrecondition, "etcdserver: member ID already exist").Err() - ErrGRPCPeerURLExist = status.New(codes.FailedPrecondition, "etcdserver: Peer URLs already exists").Err() - ErrGRPCMemberNotEnoughStarted = status.New(codes.FailedPrecondition, "etcdserver: re-configuration failed due to not enough started members").Err() - ErrGRPCMemberBadURLs = status.New(codes.InvalidArgument, "etcdserver: given member URLs are invalid").Err() - ErrGRPCMemberNotFound = status.New(codes.NotFound, "etcdserver: member not found").Err() - - ErrGRPCRequestTooLarge = status.New(codes.InvalidArgument, "etcdserver: request is too large").Err() - ErrGRPCRequestTooManyRequests = status.New(codes.ResourceExhausted, "etcdserver: too many requests").Err() - - ErrGRPCRootUserNotExist = status.New(codes.FailedPrecondition, "etcdserver: root user does not exist").Err() - ErrGRPCRootRoleNotExist = status.New(codes.FailedPrecondition, "etcdserver: root user does not have root role").Err() - ErrGRPCUserAlreadyExist = status.New(codes.FailedPrecondition, "etcdserver: user name already exists").Err() - ErrGRPCUserEmpty = status.New(codes.InvalidArgument, "etcdserver: user name is empty").Err() - ErrGRPCUserNotFound = status.New(codes.FailedPrecondition, "etcdserver: user name not found").Err() - ErrGRPCRoleAlreadyExist = status.New(codes.FailedPrecondition, "etcdserver: role name already exists").Err() - ErrGRPCRoleNotFound = status.New(codes.FailedPrecondition, "etcdserver: role name not found").Err() - ErrGRPCAuthFailed = status.New(codes.InvalidArgument, "etcdserver: authentication failed, invalid user ID or password").Err() - ErrGRPCPermissionDenied = status.New(codes.PermissionDenied, "etcdserver: permission denied").Err() - ErrGRPCRoleNotGranted = status.New(codes.FailedPrecondition, "etcdserver: role is not granted to the user").Err() - ErrGRPCPermissionNotGranted = status.New(codes.FailedPrecondition, "etcdserver: permission is not granted to the role").Err() - ErrGRPCAuthNotEnabled = status.New(codes.FailedPrecondition, "etcdserver: authentication is not enabled").Err() - ErrGRPCInvalidAuthToken = status.New(codes.Unauthenticated, "etcdserver: invalid auth token").Err() - ErrGRPCInvalidAuthMgmt = status.New(codes.InvalidArgument, "etcdserver: invalid auth management").Err() - - ErrGRPCNoLeader = status.New(codes.Unavailable, "etcdserver: no leader").Err() - ErrGRPCNotLeader = status.New(codes.FailedPrecondition, "etcdserver: not leader").Err() - ErrGRPCNotCapable = status.New(codes.Unavailable, "etcdserver: not capable").Err() - ErrGRPCStopped = status.New(codes.Unavailable, "etcdserver: server stopped").Err() - ErrGRPCTimeout = status.New(codes.Unavailable, "etcdserver: request timed out").Err() - ErrGRPCTimeoutDueToLeaderFail = status.New(codes.Unavailable, "etcdserver: request timed out, possibly due to previous leader failure").Err() - ErrGRPCTimeoutDueToConnectionLost = status.New(codes.Unavailable, "etcdserver: request timed out, possibly due to connection lost").Err() - ErrGRPCUnhealthy = status.New(codes.Unavailable, "etcdserver: unhealthy cluster").Err() - ErrGRPCCorrupt = status.New(codes.DataLoss, "etcdserver: corrupt cluster").Err() - - errStringToError = map[string]error{ - ErrorDesc(ErrGRPCEmptyKey): ErrGRPCEmptyKey, - ErrorDesc(ErrGRPCKeyNotFound): ErrGRPCKeyNotFound, - ErrorDesc(ErrGRPCValueProvided): ErrGRPCValueProvided, - ErrorDesc(ErrGRPCLeaseProvided): ErrGRPCLeaseProvided, - - ErrorDesc(ErrGRPCTooManyOps): ErrGRPCTooManyOps, - ErrorDesc(ErrGRPCDuplicateKey): ErrGRPCDuplicateKey, - ErrorDesc(ErrGRPCCompacted): ErrGRPCCompacted, - ErrorDesc(ErrGRPCFutureRev): ErrGRPCFutureRev, - ErrorDesc(ErrGRPCNoSpace): ErrGRPCNoSpace, - - ErrorDesc(ErrGRPCLeaseNotFound): ErrGRPCLeaseNotFound, - ErrorDesc(ErrGRPCLeaseExist): ErrGRPCLeaseExist, - ErrorDesc(ErrGRPCLeaseTTLTooLarge): ErrGRPCLeaseTTLTooLarge, - - ErrorDesc(ErrGRPCMemberExist): ErrGRPCMemberExist, - ErrorDesc(ErrGRPCPeerURLExist): ErrGRPCPeerURLExist, - ErrorDesc(ErrGRPCMemberNotEnoughStarted): ErrGRPCMemberNotEnoughStarted, - ErrorDesc(ErrGRPCMemberBadURLs): ErrGRPCMemberBadURLs, - ErrorDesc(ErrGRPCMemberNotFound): ErrGRPCMemberNotFound, - - ErrorDesc(ErrGRPCRequestTooLarge): ErrGRPCRequestTooLarge, - ErrorDesc(ErrGRPCRequestTooManyRequests): ErrGRPCRequestTooManyRequests, - - ErrorDesc(ErrGRPCRootUserNotExist): ErrGRPCRootUserNotExist, - ErrorDesc(ErrGRPCRootRoleNotExist): ErrGRPCRootRoleNotExist, - ErrorDesc(ErrGRPCUserAlreadyExist): ErrGRPCUserAlreadyExist, - ErrorDesc(ErrGRPCUserEmpty): ErrGRPCUserEmpty, - ErrorDesc(ErrGRPCUserNotFound): ErrGRPCUserNotFound, - ErrorDesc(ErrGRPCRoleAlreadyExist): ErrGRPCRoleAlreadyExist, - ErrorDesc(ErrGRPCRoleNotFound): ErrGRPCRoleNotFound, - ErrorDesc(ErrGRPCAuthFailed): ErrGRPCAuthFailed, - ErrorDesc(ErrGRPCPermissionDenied): ErrGRPCPermissionDenied, - ErrorDesc(ErrGRPCRoleNotGranted): ErrGRPCRoleNotGranted, - ErrorDesc(ErrGRPCPermissionNotGranted): ErrGRPCPermissionNotGranted, - ErrorDesc(ErrGRPCAuthNotEnabled): ErrGRPCAuthNotEnabled, - ErrorDesc(ErrGRPCInvalidAuthToken): ErrGRPCInvalidAuthToken, - ErrorDesc(ErrGRPCInvalidAuthMgmt): ErrGRPCInvalidAuthMgmt, - - ErrorDesc(ErrGRPCNoLeader): ErrGRPCNoLeader, - ErrorDesc(ErrGRPCNotLeader): ErrGRPCNotLeader, - ErrorDesc(ErrGRPCNotCapable): ErrGRPCNotCapable, - ErrorDesc(ErrGRPCStopped): ErrGRPCStopped, - ErrorDesc(ErrGRPCTimeout): ErrGRPCTimeout, - ErrorDesc(ErrGRPCTimeoutDueToLeaderFail): ErrGRPCTimeoutDueToLeaderFail, - ErrorDesc(ErrGRPCTimeoutDueToConnectionLost): ErrGRPCTimeoutDueToConnectionLost, - ErrorDesc(ErrGRPCUnhealthy): ErrGRPCUnhealthy, - ErrorDesc(ErrGRPCCorrupt): ErrGRPCCorrupt, - } -) - -// client-side error -var ( - ErrEmptyKey = Error(ErrGRPCEmptyKey) - ErrKeyNotFound = Error(ErrGRPCKeyNotFound) - ErrValueProvided = Error(ErrGRPCValueProvided) - ErrLeaseProvided = Error(ErrGRPCLeaseProvided) - ErrTooManyOps = Error(ErrGRPCTooManyOps) - ErrDuplicateKey = Error(ErrGRPCDuplicateKey) - ErrCompacted = Error(ErrGRPCCompacted) - ErrFutureRev = Error(ErrGRPCFutureRev) - ErrNoSpace = Error(ErrGRPCNoSpace) - - ErrLeaseNotFound = Error(ErrGRPCLeaseNotFound) - ErrLeaseExist = Error(ErrGRPCLeaseExist) - ErrLeaseTTLTooLarge = Error(ErrGRPCLeaseTTLTooLarge) - - ErrMemberExist = Error(ErrGRPCMemberExist) - ErrPeerURLExist = Error(ErrGRPCPeerURLExist) - ErrMemberNotEnoughStarted = Error(ErrGRPCMemberNotEnoughStarted) - ErrMemberBadURLs = Error(ErrGRPCMemberBadURLs) - ErrMemberNotFound = Error(ErrGRPCMemberNotFound) - - ErrRequestTooLarge = Error(ErrGRPCRequestTooLarge) - ErrTooManyRequests = Error(ErrGRPCRequestTooManyRequests) - - ErrRootUserNotExist = Error(ErrGRPCRootUserNotExist) - ErrRootRoleNotExist = Error(ErrGRPCRootRoleNotExist) - ErrUserAlreadyExist = Error(ErrGRPCUserAlreadyExist) - ErrUserEmpty = Error(ErrGRPCUserEmpty) - ErrUserNotFound = Error(ErrGRPCUserNotFound) - ErrRoleAlreadyExist = Error(ErrGRPCRoleAlreadyExist) - ErrRoleNotFound = Error(ErrGRPCRoleNotFound) - ErrAuthFailed = Error(ErrGRPCAuthFailed) - ErrPermissionDenied = Error(ErrGRPCPermissionDenied) - ErrRoleNotGranted = Error(ErrGRPCRoleNotGranted) - ErrPermissionNotGranted = Error(ErrGRPCPermissionNotGranted) - ErrAuthNotEnabled = Error(ErrGRPCAuthNotEnabled) - ErrInvalidAuthToken = Error(ErrGRPCInvalidAuthToken) - ErrInvalidAuthMgmt = Error(ErrGRPCInvalidAuthMgmt) - - ErrNoLeader = Error(ErrGRPCNoLeader) - ErrNotLeader = Error(ErrGRPCNotLeader) - ErrNotCapable = Error(ErrGRPCNotCapable) - ErrStopped = Error(ErrGRPCStopped) - ErrTimeout = Error(ErrGRPCTimeout) - ErrTimeoutDueToLeaderFail = Error(ErrGRPCTimeoutDueToLeaderFail) - ErrTimeoutDueToConnectionLost = Error(ErrGRPCTimeoutDueToConnectionLost) - ErrUnhealthy = Error(ErrGRPCUnhealthy) - ErrCorrupt = Error(ErrGRPCCorrupt) -) - -// EtcdError defines gRPC server errors. -// (https://github.com/grpc/grpc-go/blob/master/rpc_util.go#L319-L323) -type EtcdError struct { - code codes.Code - desc string -} - -// Code returns grpc/codes.Code. -// TODO: define clientv3/codes.Code. -func (e EtcdError) Code() codes.Code { - return e.code -} - -func (e EtcdError) Error() string { - return e.desc -} - -func Error(err error) error { - if err == nil { - return nil - } - verr, ok := errStringToError[ErrorDesc(err)] - if !ok { // not gRPC error - return err - } - ev, ok := status.FromError(verr) - var desc string - if ok { - desc = ev.Message() - } else { - desc = verr.Error() - } - return EtcdError{code: ev.Code(), desc: desc} -} - -func ErrorDesc(err error) string { - if s, ok := status.FromError(err); ok { - return s.Message() - } - return err.Error() -} diff --git a/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/md.go b/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/md.go deleted file mode 100644 index 5c590e1ae..000000000 --- a/vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/md.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rpctypes - -var ( - MetadataRequireLeaderKey = "hasleader" - MetadataHasLeader = "true" -) diff --git a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go b/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go deleted file mode 100644 index 90045a5c9..000000000 --- a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go +++ /dev/null @@ -1,1035 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: etcdserver.proto - -/* - Package etcdserverpb is a generated protocol buffer package. - - It is generated from these files: - etcdserver.proto - raft_internal.proto - rpc.proto - - It has these top-level messages: - Request - Metadata - RequestHeader - InternalRaftRequest - EmptyResponse - InternalAuthenticateRequest - ResponseHeader - RangeRequest - RangeResponse - PutRequest - PutResponse - DeleteRangeRequest - DeleteRangeResponse - RequestOp - ResponseOp - Compare - TxnRequest - TxnResponse - CompactionRequest - CompactionResponse - HashRequest - HashKVRequest - HashKVResponse - HashResponse - SnapshotRequest - SnapshotResponse - WatchRequest - WatchCreateRequest - WatchCancelRequest - WatchResponse - LeaseGrantRequest - LeaseGrantResponse - LeaseRevokeRequest - LeaseRevokeResponse - LeaseKeepAliveRequest - LeaseKeepAliveResponse - LeaseTimeToLiveRequest - LeaseTimeToLiveResponse - LeaseLeasesRequest - LeaseStatus - LeaseLeasesResponse - Member - MemberAddRequest - MemberAddResponse - MemberRemoveRequest - MemberRemoveResponse - MemberUpdateRequest - MemberUpdateResponse - MemberListRequest - MemberListResponse - DefragmentRequest - DefragmentResponse - MoveLeaderRequest - MoveLeaderResponse - AlarmRequest - AlarmMember - AlarmResponse - StatusRequest - StatusResponse - AuthEnableRequest - AuthDisableRequest - AuthenticateRequest - AuthUserAddRequest - AuthUserGetRequest - AuthUserDeleteRequest - AuthUserChangePasswordRequest - AuthUserGrantRoleRequest - AuthUserRevokeRoleRequest - AuthRoleAddRequest - AuthRoleGetRequest - AuthUserListRequest - AuthRoleListRequest - AuthRoleDeleteRequest - AuthRoleGrantPermissionRequest - AuthRoleRevokePermissionRequest - AuthEnableResponse - AuthDisableResponse - AuthenticateResponse - AuthUserAddResponse - AuthUserGetResponse - AuthUserDeleteResponse - AuthUserChangePasswordResponse - AuthUserGrantRoleResponse - AuthUserRevokeRoleResponse - AuthRoleAddResponse - AuthRoleGetResponse - AuthRoleListResponse - AuthUserListResponse - AuthRoleDeleteResponse - AuthRoleGrantPermissionResponse - AuthRoleRevokePermissionResponse -*/ -package etcdserverpb - -import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - - math "math" - - _ "github.com/gogo/protobuf/gogoproto" - - io "io" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Request struct { - ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"` - Method string `protobuf:"bytes,2,opt,name=Method" json:"Method"` - Path string `protobuf:"bytes,3,opt,name=Path" json:"Path"` - Val string `protobuf:"bytes,4,opt,name=Val" json:"Val"` - Dir bool `protobuf:"varint,5,opt,name=Dir" json:"Dir"` - PrevValue string `protobuf:"bytes,6,opt,name=PrevValue" json:"PrevValue"` - PrevIndex uint64 `protobuf:"varint,7,opt,name=PrevIndex" json:"PrevIndex"` - PrevExist *bool `protobuf:"varint,8,opt,name=PrevExist" json:"PrevExist,omitempty"` - Expiration int64 `protobuf:"varint,9,opt,name=Expiration" json:"Expiration"` - Wait bool `protobuf:"varint,10,opt,name=Wait" json:"Wait"` - Since uint64 `protobuf:"varint,11,opt,name=Since" json:"Since"` - Recursive bool `protobuf:"varint,12,opt,name=Recursive" json:"Recursive"` - Sorted bool `protobuf:"varint,13,opt,name=Sorted" json:"Sorted"` - Quorum bool `protobuf:"varint,14,opt,name=Quorum" json:"Quorum"` - Time int64 `protobuf:"varint,15,opt,name=Time" json:"Time"` - Stream bool `protobuf:"varint,16,opt,name=Stream" json:"Stream"` - Refresh *bool `protobuf:"varint,17,opt,name=Refresh" json:"Refresh,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorEtcdserver, []int{0} } - -type Metadata struct { - NodeID uint64 `protobuf:"varint,1,opt,name=NodeID" json:"NodeID"` - ClusterID uint64 `protobuf:"varint,2,opt,name=ClusterID" json:"ClusterID"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Metadata) Reset() { *m = Metadata{} } -func (m *Metadata) String() string { return proto.CompactTextString(m) } -func (*Metadata) ProtoMessage() {} -func (*Metadata) Descriptor() ([]byte, []int) { return fileDescriptorEtcdserver, []int{1} } - -func init() { - proto.RegisterType((*Request)(nil), "etcdserverpb.Request") - proto.RegisterType((*Metadata)(nil), "etcdserverpb.Metadata") -} -func (m *Request) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Request) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.ID)) - dAtA[i] = 0x12 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Method))) - i += copy(dAtA[i:], m.Method) - dAtA[i] = 0x1a - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Path))) - i += copy(dAtA[i:], m.Path) - dAtA[i] = 0x22 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Val))) - i += copy(dAtA[i:], m.Val) - dAtA[i] = 0x28 - i++ - if m.Dir { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - dAtA[i] = 0x32 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.PrevValue))) - i += copy(dAtA[i:], m.PrevValue) - dAtA[i] = 0x38 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.PrevIndex)) - if m.PrevExist != nil { - dAtA[i] = 0x40 - i++ - if *m.PrevExist { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - dAtA[i] = 0x48 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Expiration)) - dAtA[i] = 0x50 - i++ - if m.Wait { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - dAtA[i] = 0x58 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Since)) - dAtA[i] = 0x60 - i++ - if m.Recursive { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - dAtA[i] = 0x68 - i++ - if m.Sorted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - dAtA[i] = 0x70 - i++ - if m.Quorum { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - dAtA[i] = 0x78 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.Time)) - dAtA[i] = 0x80 - i++ - dAtA[i] = 0x1 - i++ - if m.Stream { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - if m.Refresh != nil { - dAtA[i] = 0x88 - i++ - dAtA[i] = 0x1 - i++ - if *m.Refresh { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Metadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0x8 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.NodeID)) - dAtA[i] = 0x10 - i++ - i = encodeVarintEtcdserver(dAtA, i, uint64(m.ClusterID)) - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeVarintEtcdserver(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *Request) Size() (n int) { - var l int - _ = l - n += 1 + sovEtcdserver(uint64(m.ID)) - l = len(m.Method) - n += 1 + l + sovEtcdserver(uint64(l)) - l = len(m.Path) - n += 1 + l + sovEtcdserver(uint64(l)) - l = len(m.Val) - n += 1 + l + sovEtcdserver(uint64(l)) - n += 2 - l = len(m.PrevValue) - n += 1 + l + sovEtcdserver(uint64(l)) - n += 1 + sovEtcdserver(uint64(m.PrevIndex)) - if m.PrevExist != nil { - n += 2 - } - n += 1 + sovEtcdserver(uint64(m.Expiration)) - n += 2 - n += 1 + sovEtcdserver(uint64(m.Since)) - n += 2 - n += 2 - n += 2 - n += 1 + sovEtcdserver(uint64(m.Time)) - n += 3 - if m.Refresh != nil { - n += 3 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Metadata) Size() (n int) { - var l int - _ = l - n += 1 + sovEtcdserver(uint64(m.NodeID)) - n += 1 + sovEtcdserver(uint64(m.ClusterID)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovEtcdserver(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozEtcdserver(x uint64) (n int) { - return sovEtcdserver(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Request) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Request: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEtcdserver - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Method = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEtcdserver - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Val", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEtcdserver - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Val = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Dir", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Dir = bool(v != 0) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevValue", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEtcdserver - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrevValue = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevIndex", wireType) - } - m.PrevIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PrevIndex |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevExist", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.PrevExist = &b - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) - } - m.Expiration = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Expiration |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Wait", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Wait = bool(v != 0) - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Since", wireType) - } - m.Since = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Since |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Recursive = bool(v != 0) - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sorted", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Sorted = bool(v != 0) - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Quorum = bool(v != 0) - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) - } - m.Time = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Time |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Stream", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Stream = bool(v != 0) - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Refresh", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Refresh = &b - default: - iNdEx = preIndex - skippy, err := skipEtcdserver(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthEtcdserver - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Metadata) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Metadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) - } - m.NodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NodeID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterID", wireType) - } - m.ClusterID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClusterID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEtcdserver(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthEtcdserver - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEtcdserver(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthEtcdserver - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEtcdserver - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipEtcdserver(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthEtcdserver = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEtcdserver = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("etcdserver.proto", fileDescriptorEtcdserver) } - -var fileDescriptorEtcdserver = []byte{ - // 380 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0xd2, 0xdd, 0x6e, 0xda, 0x30, - 0x14, 0x07, 0x70, 0x0c, 0xe1, 0xcb, 0x63, 0x1b, 0xb3, 0xd0, 0x74, 0x84, 0xa6, 0x2c, 0x42, 0xbb, - 0xc8, 0xd5, 0xf6, 0x0e, 0x2c, 0x5c, 0x44, 0x2a, 0x15, 0x0d, 0x15, 0xbd, 0x76, 0xc9, 0x29, 0x58, - 0x02, 0x4c, 0x1d, 0x07, 0xf1, 0x06, 0x7d, 0x85, 0x3e, 0x12, 0x97, 0x7d, 0x82, 0xaa, 0xa5, 0x2f, - 0x52, 0x39, 0x24, 0xc4, 0xed, 0x5d, 0xf4, 0xfb, 0x9f, 0x1c, 0x1f, 0x7f, 0xd0, 0x2e, 0xea, 0x79, - 0x9c, 0xa0, 0xda, 0xa1, 0xfa, 0xbb, 0x55, 0x52, 0x4b, 0xd6, 0x29, 0x65, 0x7b, 0xdb, 0xef, 0x2d, - 0xe4, 0x42, 0x66, 0xc1, 0x3f, 0xf3, 0x75, 0xaa, 0x19, 0x3c, 0x38, 0xb4, 0x19, 0xe1, 0x7d, 0x8a, - 0x89, 0x66, 0x3d, 0x5a, 0x0d, 0x03, 0x20, 0x1e, 0xf1, 0x9d, 0xa1, 0x73, 0x78, 0xfe, 0x5d, 0x89, - 0xaa, 0x61, 0xc0, 0x7e, 0xd1, 0xc6, 0x18, 0xf5, 0x52, 0xc6, 0x50, 0xf5, 0x88, 0xdf, 0xce, 0x93, - 0xdc, 0x18, 0x50, 0x67, 0xc2, 0xf5, 0x12, 0x6a, 0x56, 0x96, 0x09, 0xfb, 0x49, 0x6b, 0x33, 0xbe, - 0x02, 0xc7, 0x0a, 0x0c, 0x18, 0x0f, 0x84, 0x82, 0xba, 0x47, 0xfc, 0x56, 0xe1, 0x81, 0x50, 0x6c, - 0x40, 0xdb, 0x13, 0x85, 0xbb, 0x19, 0x5f, 0xa5, 0x08, 0x0d, 0xeb, 0xaf, 0x92, 0x8b, 0x9a, 0x70, - 0x13, 0xe3, 0x1e, 0x9a, 0xd6, 0xa0, 0x25, 0x17, 0x35, 0xa3, 0xbd, 0x48, 0x34, 0xb4, 0xce, 0xab, - 0x90, 0xa8, 0x64, 0xf6, 0x87, 0xd2, 0xd1, 0x7e, 0x2b, 0x14, 0xd7, 0x42, 0x6e, 0xa0, 0xed, 0x11, - 0xbf, 0x96, 0x37, 0xb2, 0xdc, 0xec, 0xed, 0x86, 0x0b, 0x0d, 0xd4, 0x1a, 0x35, 0x13, 0xd6, 0xa7, - 0xf5, 0xa9, 0xd8, 0xcc, 0x11, 0xbe, 0x58, 0x33, 0x9c, 0xc8, 0xac, 0x1f, 0xe1, 0x3c, 0x55, 0x89, - 0xd8, 0x21, 0x74, 0xac, 0x5f, 0x4b, 0x36, 0x67, 0x3a, 0x95, 0x4a, 0x63, 0x0c, 0x5f, 0xad, 0x82, - 0xdc, 0x4c, 0x7a, 0x95, 0x4a, 0x95, 0xae, 0xe1, 0x9b, 0x9d, 0x9e, 0xcc, 0x4c, 0x75, 0x2d, 0xd6, - 0x08, 0xdf, 0xad, 0xa9, 0x33, 0xc9, 0xba, 0x6a, 0x85, 0x7c, 0x0d, 0xdd, 0x0f, 0x5d, 0x33, 0x63, - 0xae, 0xb9, 0xe8, 0x3b, 0x85, 0xc9, 0x12, 0x7e, 0x58, 0xa7, 0x52, 0xe0, 0xe0, 0x82, 0xb6, 0xc6, - 0xa8, 0x79, 0xcc, 0x35, 0x37, 0x9d, 0x2e, 0x65, 0x8c, 0x9f, 0x5e, 0x43, 0x6e, 0x66, 0x87, 0xff, - 0x57, 0x69, 0xa2, 0x51, 0x85, 0x41, 0xf6, 0x28, 0xce, 0xb7, 0x70, 0xe6, 0x61, 0xef, 0xf0, 0xea, - 0x56, 0x0e, 0x47, 0x97, 0x3c, 0x1d, 0x5d, 0xf2, 0x72, 0x74, 0xc9, 0xe3, 0x9b, 0x5b, 0x79, 0x0f, - 0x00, 0x00, 0xff, 0xff, 0xee, 0x40, 0xba, 0xd6, 0xa4, 0x02, 0x00, 0x00, -} diff --git a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go b/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go deleted file mode 100644 index 3084c6cbf..000000000 --- a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go +++ /dev/null @@ -1,2077 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: raft_internal.proto - -package etcdserverpb - -import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - - math "math" - - _ "github.com/gogo/protobuf/gogoproto" - - io "io" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type RequestHeader struct { - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // username is a username that is associated with an auth token of gRPC connection - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - // auth_revision is a revision number of auth.authStore. It is not related to mvcc - AuthRevision uint64 `protobuf:"varint,3,opt,name=auth_revision,json=authRevision,proto3" json:"auth_revision,omitempty"` -} - -func (m *RequestHeader) Reset() { *m = RequestHeader{} } -func (m *RequestHeader) String() string { return proto.CompactTextString(m) } -func (*RequestHeader) ProtoMessage() {} -func (*RequestHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{0} } - -// An InternalRaftRequest is the union of all requests which can be -// sent via raft. -type InternalRaftRequest struct { - Header *RequestHeader `protobuf:"bytes,100,opt,name=header" json:"header,omitempty"` - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - V2 *Request `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"` - Range *RangeRequest `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"` - Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"` - DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange" json:"delete_range,omitempty"` - Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"` - Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"` - LeaseGrant *LeaseGrantRequest `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant" json:"lease_grant,omitempty"` - LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke" json:"lease_revoke,omitempty"` - Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm" json:"alarm,omitempty"` - AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable" json:"auth_enable,omitempty"` - AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable" json:"auth_disable,omitempty"` - Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate" json:"authenticate,omitempty"` - AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,1100,opt,name=auth_user_add,json=authUserAdd" json:"auth_user_add,omitempty"` - AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,1101,opt,name=auth_user_delete,json=authUserDelete" json:"auth_user_delete,omitempty"` - AuthUserGet *AuthUserGetRequest `protobuf:"bytes,1102,opt,name=auth_user_get,json=authUserGet" json:"auth_user_get,omitempty"` - AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,1103,opt,name=auth_user_change_password,json=authUserChangePassword" json:"auth_user_change_password,omitempty"` - AuthUserGrantRole *AuthUserGrantRoleRequest `protobuf:"bytes,1104,opt,name=auth_user_grant_role,json=authUserGrantRole" json:"auth_user_grant_role,omitempty"` - AuthUserRevokeRole *AuthUserRevokeRoleRequest `protobuf:"bytes,1105,opt,name=auth_user_revoke_role,json=authUserRevokeRole" json:"auth_user_revoke_role,omitempty"` - AuthUserList *AuthUserListRequest `protobuf:"bytes,1106,opt,name=auth_user_list,json=authUserList" json:"auth_user_list,omitempty"` - AuthRoleList *AuthRoleListRequest `protobuf:"bytes,1107,opt,name=auth_role_list,json=authRoleList" json:"auth_role_list,omitempty"` - AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,1200,opt,name=auth_role_add,json=authRoleAdd" json:"auth_role_add,omitempty"` - AuthRoleDelete *AuthRoleDeleteRequest `protobuf:"bytes,1201,opt,name=auth_role_delete,json=authRoleDelete" json:"auth_role_delete,omitempty"` - AuthRoleGet *AuthRoleGetRequest `protobuf:"bytes,1202,opt,name=auth_role_get,json=authRoleGet" json:"auth_role_get,omitempty"` - AuthRoleGrantPermission *AuthRoleGrantPermissionRequest `protobuf:"bytes,1203,opt,name=auth_role_grant_permission,json=authRoleGrantPermission" json:"auth_role_grant_permission,omitempty"` - AuthRoleRevokePermission *AuthRoleRevokePermissionRequest `protobuf:"bytes,1204,opt,name=auth_role_revoke_permission,json=authRoleRevokePermission" json:"auth_role_revoke_permission,omitempty"` -} - -func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } -func (m *InternalRaftRequest) String() string { return proto.CompactTextString(m) } -func (*InternalRaftRequest) ProtoMessage() {} -func (*InternalRaftRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{1} } - -type EmptyResponse struct { -} - -func (m *EmptyResponse) Reset() { *m = EmptyResponse{} } -func (m *EmptyResponse) String() string { return proto.CompactTextString(m) } -func (*EmptyResponse) ProtoMessage() {} -func (*EmptyResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{2} } - -// What is the difference between AuthenticateRequest (defined in rpc.proto) and InternalAuthenticateRequest? -// InternalAuthenticateRequest has a member that is filled by etcdserver and shouldn't be user-facing. -// For avoiding misusage the field, we have an internal version of AuthenticateRequest. -type InternalAuthenticateRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - // simple_token is generated in API layer (etcdserver/v3_server.go) - SimpleToken string `protobuf:"bytes,3,opt,name=simple_token,json=simpleToken,proto3" json:"simple_token,omitempty"` -} - -func (m *InternalAuthenticateRequest) Reset() { *m = InternalAuthenticateRequest{} } -func (m *InternalAuthenticateRequest) String() string { return proto.CompactTextString(m) } -func (*InternalAuthenticateRequest) ProtoMessage() {} -func (*InternalAuthenticateRequest) Descriptor() ([]byte, []int) { - return fileDescriptorRaftInternal, []int{3} -} - -func init() { - proto.RegisterType((*RequestHeader)(nil), "etcdserverpb.RequestHeader") - proto.RegisterType((*InternalRaftRequest)(nil), "etcdserverpb.InternalRaftRequest") - proto.RegisterType((*EmptyResponse)(nil), "etcdserverpb.EmptyResponse") - proto.RegisterType((*InternalAuthenticateRequest)(nil), "etcdserverpb.InternalAuthenticateRequest") -} -func (m *RequestHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RequestHeader) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) - } - if len(m.Username) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Username))) - i += copy(dAtA[i:], m.Username) - } - if m.AuthRevision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRevision)) - } - return i, nil -} - -func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) - } - if m.V2 != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.V2.Size())) - n1, err := m.V2.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.Range != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Range.Size())) - n2, err := m.Range.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.Put != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Put.Size())) - n3, err := m.Put.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.DeleteRange != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.DeleteRange.Size())) - n4, err := m.DeleteRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.Txn != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Txn.Size())) - n5, err := m.Txn.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.Compaction != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Compaction.Size())) - n6, err := m.Compaction.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.LeaseGrant != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.LeaseGrant.Size())) - n7, err := m.LeaseGrant.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.LeaseRevoke != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.LeaseRevoke.Size())) - n8, err := m.LeaseRevoke.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.Alarm != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Alarm.Size())) - n9, err := m.Alarm.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } - if m.Header != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x6 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Header.Size())) - n10, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 - } - if m.AuthEnable != nil { - dAtA[i] = 0xc2 - i++ - dAtA[i] = 0x3e - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthEnable.Size())) - n11, err := m.AuthEnable.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 - } - if m.AuthDisable != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x3f - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthDisable.Size())) - n12, err := m.AuthDisable.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 - } - if m.Authenticate != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x3f - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.Authenticate.Size())) - n13, err := m.Authenticate.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.AuthUserAdd != nil { - dAtA[i] = 0xe2 - i++ - dAtA[i] = 0x44 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserAdd.Size())) - n14, err := m.AuthUserAdd.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 - } - if m.AuthUserDelete != nil { - dAtA[i] = 0xea - i++ - dAtA[i] = 0x44 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserDelete.Size())) - n15, err := m.AuthUserDelete.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if m.AuthUserGet != nil { - dAtA[i] = 0xf2 - i++ - dAtA[i] = 0x44 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGet.Size())) - n16, err := m.AuthUserGet.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if m.AuthUserChangePassword != nil { - dAtA[i] = 0xfa - i++ - dAtA[i] = 0x44 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserChangePassword.Size())) - n17, err := m.AuthUserChangePassword.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n17 - } - if m.AuthUserGrantRole != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x45 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGrantRole.Size())) - n18, err := m.AuthUserGrantRole.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 - } - if m.AuthUserRevokeRole != nil { - dAtA[i] = 0x8a - i++ - dAtA[i] = 0x45 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserRevokeRole.Size())) - n19, err := m.AuthUserRevokeRole.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n19 - } - if m.AuthUserList != nil { - dAtA[i] = 0x92 - i++ - dAtA[i] = 0x45 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserList.Size())) - n20, err := m.AuthUserList.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 - } - if m.AuthRoleList != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x45 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleList.Size())) - n21, err := m.AuthRoleList.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n21 - } - if m.AuthRoleAdd != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleAdd.Size())) - n22, err := m.AuthRoleAdd.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if m.AuthRoleDelete != nil { - dAtA[i] = 0x8a - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleDelete.Size())) - n23, err := m.AuthRoleDelete.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - } - if m.AuthRoleGet != nil { - dAtA[i] = 0x92 - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGet.Size())) - n24, err := m.AuthRoleGet.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n24 - } - if m.AuthRoleGrantPermission != nil { - dAtA[i] = 0x9a - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGrantPermission.Size())) - n25, err := m.AuthRoleGrantPermission.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n25 - } - if m.AuthRoleRevokePermission != nil { - dAtA[i] = 0xa2 - i++ - dAtA[i] = 0x4b - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleRevokePermission.Size())) - n26, err := m.AuthRoleRevokePermission.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n26 - } - return i, nil -} - -func (m *EmptyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EmptyResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *InternalAuthenticateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InternalAuthenticateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) - } - if len(m.SimpleToken) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.SimpleToken))) - i += copy(dAtA[i:], m.SimpleToken) - } - return i, nil -} - -func encodeVarintRaftInternal(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *RequestHeader) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRaftInternal(uint64(m.ID)) - } - l = len(m.Username) - if l > 0 { - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRevision != 0 { - n += 1 + sovRaftInternal(uint64(m.AuthRevision)) - } - return n -} - -func (m *InternalRaftRequest) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRaftInternal(uint64(m.ID)) - } - if m.V2 != nil { - l = m.V2.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Range != nil { - l = m.Range.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Put != nil { - l = m.Put.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.DeleteRange != nil { - l = m.DeleteRange.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Txn != nil { - l = m.Txn.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Compaction != nil { - l = m.Compaction.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.LeaseGrant != nil { - l = m.LeaseGrant.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.LeaseRevoke != nil { - l = m.LeaseRevoke.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Alarm != nil { - l = m.Alarm.Size() - n += 1 + l + sovRaftInternal(uint64(l)) - } - if m.Header != nil { - l = m.Header.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthEnable != nil { - l = m.AuthEnable.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthDisable != nil { - l = m.AuthDisable.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.Authenticate != nil { - l = m.Authenticate.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserAdd != nil { - l = m.AuthUserAdd.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserDelete != nil { - l = m.AuthUserDelete.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserGet != nil { - l = m.AuthUserGet.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserChangePassword != nil { - l = m.AuthUserChangePassword.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserGrantRole != nil { - l = m.AuthUserGrantRole.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserRevokeRole != nil { - l = m.AuthUserRevokeRole.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthUserList != nil { - l = m.AuthUserList.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleList != nil { - l = m.AuthRoleList.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleAdd != nil { - l = m.AuthRoleAdd.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleDelete != nil { - l = m.AuthRoleDelete.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleGet != nil { - l = m.AuthRoleGet.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleGrantPermission != nil { - l = m.AuthRoleGrantPermission.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - if m.AuthRoleRevokePermission != nil { - l = m.AuthRoleRevokePermission.Size() - n += 2 + l + sovRaftInternal(uint64(l)) - } - return n -} - -func (m *EmptyResponse) Size() (n int) { - var l int - _ = l - return n -} - -func (m *InternalAuthenticateRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRaftInternal(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRaftInternal(uint64(l)) - } - l = len(m.SimpleToken) - if l > 0 { - n += 1 + l + sovRaftInternal(uint64(l)) - } - return n -} - -func sovRaftInternal(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozRaftInternal(x uint64) (n int) { - return sovRaftInternal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *RequestHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Username = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRevision", wireType) - } - m.AuthRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AuthRevision |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRaftInternal(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaftInternal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InternalRaftRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field V2", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.V2 == nil { - m.V2 = &Request{} - } - if err := m.V2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Range == nil { - m.Range = &RangeRequest{} - } - if err := m.Range.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Put == nil { - m.Put = &PutRequest{} - } - if err := m.Put.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeleteRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DeleteRange == nil { - m.DeleteRange = &DeleteRangeRequest{} - } - if err := m.DeleteRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Txn == nil { - m.Txn = &TxnRequest{} - } - if err := m.Txn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Compaction", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Compaction == nil { - m.Compaction = &CompactionRequest{} - } - if err := m.Compaction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LeaseGrant", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LeaseGrant == nil { - m.LeaseGrant = &LeaseGrantRequest{} - } - if err := m.LeaseGrant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LeaseRevoke", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LeaseRevoke == nil { - m.LeaseRevoke = &LeaseRevokeRequest{} - } - if err := m.LeaseRevoke.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Alarm == nil { - m.Alarm = &AlarmRequest{} - } - if err := m.Alarm.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 100: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &RequestHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1000: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthEnable", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthEnable == nil { - m.AuthEnable = &AuthEnableRequest{} - } - if err := m.AuthEnable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1011: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthDisable", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthDisable == nil { - m.AuthDisable = &AuthDisableRequest{} - } - if err := m.AuthDisable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1012: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authenticate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Authenticate == nil { - m.Authenticate = &InternalAuthenticateRequest{} - } - if err := m.Authenticate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1100: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserAdd", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserAdd == nil { - m.AuthUserAdd = &AuthUserAddRequest{} - } - if err := m.AuthUserAdd.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1101: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserDelete", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserDelete == nil { - m.AuthUserDelete = &AuthUserDeleteRequest{} - } - if err := m.AuthUserDelete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1102: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserGet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserGet == nil { - m.AuthUserGet = &AuthUserGetRequest{} - } - if err := m.AuthUserGet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1103: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserChangePassword", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserChangePassword == nil { - m.AuthUserChangePassword = &AuthUserChangePasswordRequest{} - } - if err := m.AuthUserChangePassword.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1104: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserGrantRole", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserGrantRole == nil { - m.AuthUserGrantRole = &AuthUserGrantRoleRequest{} - } - if err := m.AuthUserGrantRole.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1105: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserRevokeRole", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserRevokeRole == nil { - m.AuthUserRevokeRole = &AuthUserRevokeRoleRequest{} - } - if err := m.AuthUserRevokeRole.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1106: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthUserList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthUserList == nil { - m.AuthUserList = &AuthUserListRequest{} - } - if err := m.AuthUserList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1107: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleList == nil { - m.AuthRoleList = &AuthRoleListRequest{} - } - if err := m.AuthRoleList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1200: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleAdd", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleAdd == nil { - m.AuthRoleAdd = &AuthRoleAddRequest{} - } - if err := m.AuthRoleAdd.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1201: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleDelete", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleDelete == nil { - m.AuthRoleDelete = &AuthRoleDeleteRequest{} - } - if err := m.AuthRoleDelete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1202: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleGet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleGet == nil { - m.AuthRoleGet = &AuthRoleGetRequest{} - } - if err := m.AuthRoleGet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1203: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleGrantPermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleGrantPermission == nil { - m.AuthRoleGrantPermission = &AuthRoleGrantPermissionRequest{} - } - if err := m.AuthRoleGrantPermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 1204: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleRevokePermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AuthRoleRevokePermission == nil { - m.AuthRoleRevokePermission = &AuthRoleRevokePermissionRequest{} - } - if err := m.AuthRoleRevokePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaftInternal(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaftInternal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EmptyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EmptyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EmptyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRaftInternal(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaftInternal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InternalAuthenticateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InternalAuthenticateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SimpleToken", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRaftInternal - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SimpleToken = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRaftInternal(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRaftInternal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRaftInternal(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthRaftInternal - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRaftInternal - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRaftInternal(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRaftInternal = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("raft_internal.proto", fileDescriptorRaftInternal) } - -var fileDescriptorRaftInternal = []byte{ - // 837 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0xdd, 0x52, 0xd3, 0x40, - 0x14, 0xc7, 0x69, 0xf9, 0xec, 0xb6, 0x54, 0x5c, 0x40, 0xd7, 0x32, 0x53, 0xa1, 0x8c, 0x8a, 0x5f, - 0xe8, 0x94, 0x07, 0xd0, 0x4a, 0x19, 0x60, 0x86, 0x61, 0x98, 0x0c, 0xce, 0x38, 0xe3, 0x45, 0x5c, - 0x9a, 0x43, 0x1b, 0x49, 0x93, 0xb8, 0xd9, 0x56, 0x7c, 0x13, 0x1f, 0xc3, 0xaf, 0x87, 0xe0, 0xc2, - 0x0f, 0xd4, 0x17, 0x50, 0xbc, 0xf1, 0xca, 0x1b, 0x7d, 0x00, 0x67, 0x3f, 0x92, 0x34, 0x6d, 0xca, - 0x5d, 0x72, 0xce, 0xff, 0xfc, 0xce, 0xd9, 0xec, 0x7f, 0xbb, 0x45, 0xb3, 0x8c, 0x1e, 0x72, 0xd3, - 0x76, 0x39, 0x30, 0x97, 0x3a, 0xab, 0x3e, 0xf3, 0xb8, 0x87, 0x0b, 0xc0, 0x1b, 0x56, 0x00, 0xac, - 0x0b, 0xcc, 0x3f, 0x28, 0xcd, 0x35, 0xbd, 0xa6, 0x27, 0x13, 0xf7, 0xc4, 0x93, 0xd2, 0x94, 0x66, - 0x62, 0x8d, 0x8e, 0xe4, 0x98, 0xdf, 0x50, 0x8f, 0x95, 0x67, 0x68, 0xda, 0x80, 0x17, 0x1d, 0x08, - 0xf8, 0x16, 0x50, 0x0b, 0x18, 0x2e, 0xa2, 0xec, 0x76, 0x9d, 0x64, 0x16, 0x33, 0x2b, 0x63, 0x46, - 0x76, 0xbb, 0x8e, 0x4b, 0x68, 0xaa, 0x13, 0x88, 0x96, 0x6d, 0x20, 0xd9, 0xc5, 0xcc, 0x4a, 0xce, - 0x88, 0xde, 0xf1, 0x32, 0x9a, 0xa6, 0x1d, 0xde, 0x32, 0x19, 0x74, 0xed, 0xc0, 0xf6, 0x5c, 0x32, - 0x2a, 0xcb, 0x0a, 0x22, 0x68, 0xe8, 0x58, 0xe5, 0x4f, 0x11, 0xcd, 0x6e, 0xeb, 0xa9, 0x0d, 0x7a, - 0xc8, 0x75, 0xbb, 0x81, 0x46, 0xd7, 0x50, 0xb6, 0x5b, 0x95, 0x2d, 0xf2, 0xd5, 0xf9, 0xd5, 0xde, - 0x75, 0xad, 0xea, 0x12, 0x23, 0xdb, 0xad, 0xe2, 0xfb, 0x68, 0x9c, 0x51, 0xb7, 0x09, 0xb2, 0x57, - 0xbe, 0x5a, 0xea, 0x53, 0x8a, 0x54, 0x28, 0x57, 0x42, 0x7c, 0x0b, 0x8d, 0xfa, 0x1d, 0x4e, 0xc6, - 0xa4, 0x9e, 0x24, 0xf5, 0x7b, 0x9d, 0x70, 0x1e, 0x43, 0x88, 0xf0, 0x3a, 0x2a, 0x58, 0xe0, 0x00, - 0x07, 0x53, 0x35, 0x19, 0x97, 0x45, 0x8b, 0xc9, 0xa2, 0xba, 0x54, 0x24, 0x5a, 0xe5, 0xad, 0x38, - 0x26, 0x1a, 0xf2, 0x63, 0x97, 0x4c, 0xa4, 0x35, 0xdc, 0x3f, 0x76, 0xa3, 0x86, 0xfc, 0xd8, 0xc5, - 0x0f, 0x10, 0x6a, 0x78, 0x6d, 0x9f, 0x36, 0xb8, 0xf8, 0x7e, 0x93, 0xb2, 0xe4, 0x6a, 0xb2, 0x64, - 0x3d, 0xca, 0x87, 0x95, 0x3d, 0x25, 0xf8, 0x21, 0xca, 0x3b, 0x40, 0x03, 0x30, 0x9b, 0x8c, 0xba, - 0x9c, 0x4c, 0xa5, 0x11, 0x76, 0x84, 0x60, 0x53, 0xe4, 0x23, 0x82, 0x13, 0x85, 0xc4, 0x9a, 0x15, - 0x81, 0x41, 0xd7, 0x3b, 0x02, 0x92, 0x4b, 0x5b, 0xb3, 0x44, 0x18, 0x52, 0x10, 0xad, 0xd9, 0x89, - 0x63, 0x62, 0x5b, 0xa8, 0x43, 0x59, 0x9b, 0xa0, 0xb4, 0x6d, 0xa9, 0x89, 0x54, 0xb4, 0x2d, 0x52, - 0x88, 0xd7, 0xd0, 0x44, 0x4b, 0x5a, 0x8e, 0x58, 0xb2, 0x64, 0x21, 0x75, 0xcf, 0x95, 0x2b, 0x0d, - 0x2d, 0xc5, 0x35, 0x94, 0x97, 0x8e, 0x03, 0x97, 0x1e, 0x38, 0x40, 0x7e, 0xa7, 0x7e, 0xb0, 0x5a, - 0x87, 0xb7, 0x36, 0xa4, 0x20, 0x5a, 0x2e, 0x8d, 0x42, 0xb8, 0x8e, 0xa4, 0x3f, 0x4d, 0xcb, 0x0e, - 0x24, 0xe3, 0xef, 0x64, 0xda, 0x7a, 0x05, 0xa3, 0xae, 0x14, 0xd1, 0x7a, 0x69, 0x1c, 0xc3, 0xbb, - 0x8a, 0x02, 0x2e, 0xb7, 0x1b, 0x94, 0x03, 0xf9, 0xa7, 0x28, 0x37, 0x93, 0x94, 0xd0, 0xf7, 0xb5, - 0x1e, 0x69, 0x88, 0x4b, 0xd4, 0xe3, 0x0d, 0x7d, 0x94, 0xc4, 0xd9, 0x32, 0xa9, 0x65, 0x91, 0x8f, - 0x53, 0xc3, 0xc6, 0x7a, 0x1c, 0x00, 0xab, 0x59, 0x56, 0x62, 0x2c, 0x1d, 0xc3, 0xbb, 0x68, 0x26, - 0xc6, 0x28, 0x4f, 0x92, 0x4f, 0x8a, 0xb4, 0x9c, 0x4e, 0xd2, 0x66, 0xd6, 0xb0, 0x22, 0x4d, 0x84, - 0x93, 0x63, 0x35, 0x81, 0x93, 0xcf, 0xe7, 0x8e, 0xb5, 0x09, 0x7c, 0x60, 0xac, 0x4d, 0xe0, 0xb8, - 0x89, 0xae, 0xc4, 0x98, 0x46, 0x4b, 0x9c, 0x12, 0xd3, 0xa7, 0x41, 0xf0, 0xd2, 0x63, 0x16, 0xf9, - 0xa2, 0x90, 0xb7, 0xd3, 0x91, 0xeb, 0x52, 0xbd, 0xa7, 0xc5, 0x21, 0xfd, 0x12, 0x4d, 0x4d, 0xe3, - 0x27, 0x68, 0xae, 0x67, 0x5e, 0x61, 0x6f, 0x93, 0x79, 0x0e, 0x90, 0x53, 0xd5, 0xe3, 0xfa, 0x90, - 0xb1, 0xe5, 0xd1, 0xf0, 0xe2, 0xad, 0xbe, 0x48, 0xfb, 0x33, 0xf8, 0x29, 0x9a, 0x8f, 0xc9, 0xea, - 0xa4, 0x28, 0xf4, 0x57, 0x85, 0xbe, 0x91, 0x8e, 0xd6, 0x47, 0xa6, 0x87, 0x8d, 0xe9, 0x40, 0x0a, - 0x6f, 0xa1, 0x62, 0x0c, 0x77, 0xec, 0x80, 0x93, 0x6f, 0x8a, 0xba, 0x94, 0x4e, 0xdd, 0xb1, 0x03, - 0x9e, 0xf0, 0x51, 0x18, 0x8c, 0x48, 0x62, 0x34, 0x45, 0xfa, 0x3e, 0x94, 0x24, 0x5a, 0x0f, 0x90, - 0xc2, 0x60, 0xb4, 0xf5, 0x92, 0x24, 0x1c, 0xf9, 0x26, 0x37, 0x6c, 0xeb, 0x45, 0x4d, 0xbf, 0x23, - 0x75, 0x2c, 0x72, 0xa4, 0xc4, 0x68, 0x47, 0xbe, 0xcd, 0x0d, 0x73, 0xa4, 0xa8, 0x4a, 0x71, 0x64, - 0x1c, 0x4e, 0x8e, 0x25, 0x1c, 0xf9, 0xee, 0xdc, 0xb1, 0xfa, 0x1d, 0xa9, 0x63, 0xf8, 0x39, 0x2a, - 0xf5, 0x60, 0xa4, 0x51, 0x7c, 0x60, 0x6d, 0x3b, 0x90, 0xf7, 0xd8, 0x7b, 0xc5, 0xbc, 0x33, 0x84, - 0x29, 0xe4, 0x7b, 0x91, 0x3a, 0xe4, 0x5f, 0xa6, 0xe9, 0x79, 0xdc, 0x46, 0x0b, 0x71, 0x2f, 0x6d, - 0x9d, 0x9e, 0x66, 0x1f, 0x54, 0xb3, 0xbb, 0xe9, 0xcd, 0x94, 0x4b, 0x06, 0xbb, 0x11, 0x3a, 0x44, - 0x50, 0xb9, 0x80, 0xa6, 0x37, 0xda, 0x3e, 0x7f, 0x65, 0x40, 0xe0, 0x7b, 0x6e, 0x00, 0x15, 0x1f, - 0x2d, 0x9c, 0xf3, 0x43, 0x84, 0x31, 0x1a, 0x93, 0xb7, 0x7b, 0x46, 0xde, 0xee, 0xf2, 0x59, 0xdc, - 0xfa, 0xd1, 0xf9, 0xd4, 0xb7, 0x7e, 0xf8, 0x8e, 0x97, 0x50, 0x21, 0xb0, 0xdb, 0xbe, 0x03, 0x26, - 0xf7, 0x8e, 0x40, 0x5d, 0xfa, 0x39, 0x23, 0xaf, 0x62, 0xfb, 0x22, 0xf4, 0x68, 0xee, 0xe4, 0x67, - 0x79, 0xe4, 0xe4, 0xac, 0x9c, 0x39, 0x3d, 0x2b, 0x67, 0x7e, 0x9c, 0x95, 0x33, 0xaf, 0x7f, 0x95, - 0x47, 0x0e, 0x26, 0xe4, 0x5f, 0x8e, 0xb5, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xc9, 0xfc, - 0x0e, 0xca, 0x08, 0x00, 0x00, -} diff --git a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go b/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go deleted file mode 100644 index 40147f935..000000000 --- a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go +++ /dev/null @@ -1,18665 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: rpc.proto - -package etcdserverpb - -import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - - math "math" - - _ "github.com/gogo/protobuf/gogoproto" - - mvccpb "github.com/coreos/etcd/mvcc/mvccpb" - - authpb "github.com/coreos/etcd/auth/authpb" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" - - io "io" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type AlarmType int32 - -const ( - AlarmType_NONE AlarmType = 0 - AlarmType_NOSPACE AlarmType = 1 - AlarmType_CORRUPT AlarmType = 2 -) - -var AlarmType_name = map[int32]string{ - 0: "NONE", - 1: "NOSPACE", - 2: "CORRUPT", -} -var AlarmType_value = map[string]int32{ - "NONE": 0, - "NOSPACE": 1, - "CORRUPT": 2, -} - -func (x AlarmType) String() string { - return proto.EnumName(AlarmType_name, int32(x)) -} -func (AlarmType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} } - -type RangeRequest_SortOrder int32 - -const ( - RangeRequest_NONE RangeRequest_SortOrder = 0 - RangeRequest_ASCEND RangeRequest_SortOrder = 1 - RangeRequest_DESCEND RangeRequest_SortOrder = 2 -) - -var RangeRequest_SortOrder_name = map[int32]string{ - 0: "NONE", - 1: "ASCEND", - 2: "DESCEND", -} -var RangeRequest_SortOrder_value = map[string]int32{ - "NONE": 0, - "ASCEND": 1, - "DESCEND": 2, -} - -func (x RangeRequest_SortOrder) String() string { - return proto.EnumName(RangeRequest_SortOrder_name, int32(x)) -} -func (RangeRequest_SortOrder) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1, 0} } - -type RangeRequest_SortTarget int32 - -const ( - RangeRequest_KEY RangeRequest_SortTarget = 0 - RangeRequest_VERSION RangeRequest_SortTarget = 1 - RangeRequest_CREATE RangeRequest_SortTarget = 2 - RangeRequest_MOD RangeRequest_SortTarget = 3 - RangeRequest_VALUE RangeRequest_SortTarget = 4 -) - -var RangeRequest_SortTarget_name = map[int32]string{ - 0: "KEY", - 1: "VERSION", - 2: "CREATE", - 3: "MOD", - 4: "VALUE", -} -var RangeRequest_SortTarget_value = map[string]int32{ - "KEY": 0, - "VERSION": 1, - "CREATE": 2, - "MOD": 3, - "VALUE": 4, -} - -func (x RangeRequest_SortTarget) String() string { - return proto.EnumName(RangeRequest_SortTarget_name, int32(x)) -} -func (RangeRequest_SortTarget) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1, 1} } - -type Compare_CompareResult int32 - -const ( - Compare_EQUAL Compare_CompareResult = 0 - Compare_GREATER Compare_CompareResult = 1 - Compare_LESS Compare_CompareResult = 2 - Compare_NOT_EQUAL Compare_CompareResult = 3 -) - -var Compare_CompareResult_name = map[int32]string{ - 0: "EQUAL", - 1: "GREATER", - 2: "LESS", - 3: "NOT_EQUAL", -} -var Compare_CompareResult_value = map[string]int32{ - "EQUAL": 0, - "GREATER": 1, - "LESS": 2, - "NOT_EQUAL": 3, -} - -func (x Compare_CompareResult) String() string { - return proto.EnumName(Compare_CompareResult_name, int32(x)) -} -func (Compare_CompareResult) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 0} } - -type Compare_CompareTarget int32 - -const ( - Compare_VERSION Compare_CompareTarget = 0 - Compare_CREATE Compare_CompareTarget = 1 - Compare_MOD Compare_CompareTarget = 2 - Compare_VALUE Compare_CompareTarget = 3 - Compare_LEASE Compare_CompareTarget = 4 -) - -var Compare_CompareTarget_name = map[int32]string{ - 0: "VERSION", - 1: "CREATE", - 2: "MOD", - 3: "VALUE", - 4: "LEASE", -} -var Compare_CompareTarget_value = map[string]int32{ - "VERSION": 0, - "CREATE": 1, - "MOD": 2, - "VALUE": 3, - "LEASE": 4, -} - -func (x Compare_CompareTarget) String() string { - return proto.EnumName(Compare_CompareTarget_name, int32(x)) -} -func (Compare_CompareTarget) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 1} } - -type WatchCreateRequest_FilterType int32 - -const ( - // filter out put event. - WatchCreateRequest_NOPUT WatchCreateRequest_FilterType = 0 - // filter out delete event. - WatchCreateRequest_NODELETE WatchCreateRequest_FilterType = 1 -) - -var WatchCreateRequest_FilterType_name = map[int32]string{ - 0: "NOPUT", - 1: "NODELETE", -} -var WatchCreateRequest_FilterType_value = map[string]int32{ - "NOPUT": 0, - "NODELETE": 1, -} - -func (x WatchCreateRequest_FilterType) String() string { - return proto.EnumName(WatchCreateRequest_FilterType_name, int32(x)) -} -func (WatchCreateRequest_FilterType) EnumDescriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{21, 0} -} - -type AlarmRequest_AlarmAction int32 - -const ( - AlarmRequest_GET AlarmRequest_AlarmAction = 0 - AlarmRequest_ACTIVATE AlarmRequest_AlarmAction = 1 - AlarmRequest_DEACTIVATE AlarmRequest_AlarmAction = 2 -) - -var AlarmRequest_AlarmAction_name = map[int32]string{ - 0: "GET", - 1: "ACTIVATE", - 2: "DEACTIVATE", -} -var AlarmRequest_AlarmAction_value = map[string]int32{ - "GET": 0, - "ACTIVATE": 1, - "DEACTIVATE": 2, -} - -func (x AlarmRequest_AlarmAction) String() string { - return proto.EnumName(AlarmRequest_AlarmAction_name, int32(x)) -} -func (AlarmRequest_AlarmAction) EnumDescriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{48, 0} -} - -type ResponseHeader struct { - // cluster_id is the ID of the cluster which sent the response. - ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // member_id is the ID of the member which sent the response. - MemberId uint64 `protobuf:"varint,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` - // revision is the key-value store revision when the request was applied. - Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` - // raft_term is the raft term when the request was applied. - RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,json=raftTerm,proto3" json:"raft_term,omitempty"` -} - -func (m *ResponseHeader) Reset() { *m = ResponseHeader{} } -func (m *ResponseHeader) String() string { return proto.CompactTextString(m) } -func (*ResponseHeader) ProtoMessage() {} -func (*ResponseHeader) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} } - -func (m *ResponseHeader) GetClusterId() uint64 { - if m != nil { - return m.ClusterId - } - return 0 -} - -func (m *ResponseHeader) GetMemberId() uint64 { - if m != nil { - return m.MemberId - } - return 0 -} - -func (m *ResponseHeader) GetRevision() int64 { - if m != nil { - return m.Revision - } - return 0 -} - -func (m *ResponseHeader) GetRaftTerm() uint64 { - if m != nil { - return m.RaftTerm - } - return 0 -} - -type RangeRequest struct { - // key is the first key for the range. If range_end is not given, the request only looks up key. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // range_end is the upper bound on the requested range [key, range_end). - // If range_end is '\0', the range is all keys >= key. - // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), - // then the range request gets all keys prefixed with key. - // If both key and range_end are '\0', then the range request returns all keys. - RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - // limit is a limit on the number of keys returned for the request. When limit is set to 0, - // it is treated as no limit. - Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - // revision is the point-in-time of the key-value store to use for the range. - // If revision is less or equal to zero, the range is over the newest key-value store. - // If the revision has been compacted, ErrCompacted is returned as a response. - Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"` - // sort_order is the order for returned sorted results. - SortOrder RangeRequest_SortOrder `protobuf:"varint,5,opt,name=sort_order,json=sortOrder,proto3,enum=etcdserverpb.RangeRequest_SortOrder" json:"sort_order,omitempty"` - // sort_target is the key-value field to use for sorting. - SortTarget RangeRequest_SortTarget `protobuf:"varint,6,opt,name=sort_target,json=sortTarget,proto3,enum=etcdserverpb.RangeRequest_SortTarget" json:"sort_target,omitempty"` - // serializable sets the range request to use serializable member-local reads. - // Range requests are linearizable by default; linearizable requests have higher - // latency and lower throughput than serializable requests but reflect the current - // consensus of the cluster. For better performance, in exchange for possible stale reads, - // a serializable range request is served locally without needing to reach consensus - // with other nodes in the cluster. - Serializable bool `protobuf:"varint,7,opt,name=serializable,proto3" json:"serializable,omitempty"` - // keys_only when set returns only the keys and not the values. - KeysOnly bool `protobuf:"varint,8,opt,name=keys_only,json=keysOnly,proto3" json:"keys_only,omitempty"` - // count_only when set returns only the count of the keys in the range. - CountOnly bool `protobuf:"varint,9,opt,name=count_only,json=countOnly,proto3" json:"count_only,omitempty"` - // min_mod_revision is the lower bound for returned key mod revisions; all keys with - // lesser mod revisions will be filtered away. - MinModRevision int64 `protobuf:"varint,10,opt,name=min_mod_revision,json=minModRevision,proto3" json:"min_mod_revision,omitempty"` - // max_mod_revision is the upper bound for returned key mod revisions; all keys with - // greater mod revisions will be filtered away. - MaxModRevision int64 `protobuf:"varint,11,opt,name=max_mod_revision,json=maxModRevision,proto3" json:"max_mod_revision,omitempty"` - // min_create_revision is the lower bound for returned key create revisions; all keys with - // lesser create trevisions will be filtered away. - MinCreateRevision int64 `protobuf:"varint,12,opt,name=min_create_revision,json=minCreateRevision,proto3" json:"min_create_revision,omitempty"` - // max_create_revision is the upper bound for returned key create revisions; all keys with - // greater create revisions will be filtered away. - MaxCreateRevision int64 `protobuf:"varint,13,opt,name=max_create_revision,json=maxCreateRevision,proto3" json:"max_create_revision,omitempty"` -} - -func (m *RangeRequest) Reset() { *m = RangeRequest{} } -func (m *RangeRequest) String() string { return proto.CompactTextString(m) } -func (*RangeRequest) ProtoMessage() {} -func (*RangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1} } - -func (m *RangeRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *RangeRequest) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -func (m *RangeRequest) GetLimit() int64 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *RangeRequest) GetRevision() int64 { - if m != nil { - return m.Revision - } - return 0 -} - -func (m *RangeRequest) GetSortOrder() RangeRequest_SortOrder { - if m != nil { - return m.SortOrder - } - return RangeRequest_NONE -} - -func (m *RangeRequest) GetSortTarget() RangeRequest_SortTarget { - if m != nil { - return m.SortTarget - } - return RangeRequest_KEY -} - -func (m *RangeRequest) GetSerializable() bool { - if m != nil { - return m.Serializable - } - return false -} - -func (m *RangeRequest) GetKeysOnly() bool { - if m != nil { - return m.KeysOnly - } - return false -} - -func (m *RangeRequest) GetCountOnly() bool { - if m != nil { - return m.CountOnly - } - return false -} - -func (m *RangeRequest) GetMinModRevision() int64 { - if m != nil { - return m.MinModRevision - } - return 0 -} - -func (m *RangeRequest) GetMaxModRevision() int64 { - if m != nil { - return m.MaxModRevision - } - return 0 -} - -func (m *RangeRequest) GetMinCreateRevision() int64 { - if m != nil { - return m.MinCreateRevision - } - return 0 -} - -func (m *RangeRequest) GetMaxCreateRevision() int64 { - if m != nil { - return m.MaxCreateRevision - } - return 0 -} - -type RangeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // kvs is the list of key-value pairs matched by the range request. - // kvs is empty when count is requested. - Kvs []*mvccpb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"` - // more indicates if there are more keys to return in the requested range. - More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"` - // count is set to the number of keys within the range when requested. - Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` -} - -func (m *RangeResponse) Reset() { *m = RangeResponse{} } -func (m *RangeResponse) String() string { return proto.CompactTextString(m) } -func (*RangeResponse) ProtoMessage() {} -func (*RangeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{2} } - -func (m *RangeResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *RangeResponse) GetKvs() []*mvccpb.KeyValue { - if m != nil { - return m.Kvs - } - return nil -} - -func (m *RangeResponse) GetMore() bool { - if m != nil { - return m.More - } - return false -} - -func (m *RangeResponse) GetCount() int64 { - if m != nil { - return m.Count - } - return 0 -} - -type PutRequest struct { - // key is the key, in bytes, to put into the key-value store. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // value is the value, in bytes, to associate with the key in the key-value store. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // lease is the lease ID to associate with the key in the key-value store. A lease - // value of 0 indicates no lease. - Lease int64 `protobuf:"varint,3,opt,name=lease,proto3" json:"lease,omitempty"` - // If prev_kv is set, etcd gets the previous key-value pair before changing it. - // The previous key-value pair will be returned in the put response. - PrevKv bool `protobuf:"varint,4,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` - // If ignore_value is set, etcd updates the key using its current value. - // Returns an error if the key does not exist. - IgnoreValue bool `protobuf:"varint,5,opt,name=ignore_value,json=ignoreValue,proto3" json:"ignore_value,omitempty"` - // If ignore_lease is set, etcd updates the key using its current lease. - // Returns an error if the key does not exist. - IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,json=ignoreLease,proto3" json:"ignore_lease,omitempty"` -} - -func (m *PutRequest) Reset() { *m = PutRequest{} } -func (m *PutRequest) String() string { return proto.CompactTextString(m) } -func (*PutRequest) ProtoMessage() {} -func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{3} } - -func (m *PutRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *PutRequest) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *PutRequest) GetLease() int64 { - if m != nil { - return m.Lease - } - return 0 -} - -func (m *PutRequest) GetPrevKv() bool { - if m != nil { - return m.PrevKv - } - return false -} - -func (m *PutRequest) GetIgnoreValue() bool { - if m != nil { - return m.IgnoreValue - } - return false -} - -func (m *PutRequest) GetIgnoreLease() bool { - if m != nil { - return m.IgnoreLease - } - return false -} - -type PutResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // if prev_kv is set in the request, the previous key-value pair will be returned. - PrevKv *mvccpb.KeyValue `protobuf:"bytes,2,opt,name=prev_kv,json=prevKv" json:"prev_kv,omitempty"` -} - -func (m *PutResponse) Reset() { *m = PutResponse{} } -func (m *PutResponse) String() string { return proto.CompactTextString(m) } -func (*PutResponse) ProtoMessage() {} -func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{4} } - -func (m *PutResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *PutResponse) GetPrevKv() *mvccpb.KeyValue { - if m != nil { - return m.PrevKv - } - return nil -} - -type DeleteRangeRequest struct { - // key is the first key to delete in the range. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // range_end is the key following the last key to delete for the range [key, range_end). - // If range_end is not given, the range is defined to contain only the key argument. - // If range_end is one bit larger than the given key, then the range is all the keys - // with the prefix (the given key). - // If range_end is '\0', the range is all keys greater than or equal to the key argument. - RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - // If prev_kv is set, etcd gets the previous key-value pairs before deleting it. - // The previous key-value pairs will be returned in the delete response. - PrevKv bool `protobuf:"varint,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` -} - -func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} } -func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRangeRequest) ProtoMessage() {} -func (*DeleteRangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{5} } - -func (m *DeleteRangeRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *DeleteRangeRequest) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -func (m *DeleteRangeRequest) GetPrevKv() bool { - if m != nil { - return m.PrevKv - } - return false -} - -type DeleteRangeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // deleted is the number of keys deleted by the delete range request. - Deleted int64 `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` - // if prev_kv is set in the request, the previous key-value pairs will be returned. - PrevKvs []*mvccpb.KeyValue `protobuf:"bytes,3,rep,name=prev_kvs,json=prevKvs" json:"prev_kvs,omitempty"` -} - -func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} } -func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteRangeResponse) ProtoMessage() {} -func (*DeleteRangeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{6} } - -func (m *DeleteRangeResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *DeleteRangeResponse) GetDeleted() int64 { - if m != nil { - return m.Deleted - } - return 0 -} - -func (m *DeleteRangeResponse) GetPrevKvs() []*mvccpb.KeyValue { - if m != nil { - return m.PrevKvs - } - return nil -} - -type RequestOp struct { - // request is a union of request types accepted by a transaction. - // - // Types that are valid to be assigned to Request: - // *RequestOp_RequestRange - // *RequestOp_RequestPut - // *RequestOp_RequestDeleteRange - // *RequestOp_RequestTxn - Request isRequestOp_Request `protobuf_oneof:"request"` -} - -func (m *RequestOp) Reset() { *m = RequestOp{} } -func (m *RequestOp) String() string { return proto.CompactTextString(m) } -func (*RequestOp) ProtoMessage() {} -func (*RequestOp) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{7} } - -type isRequestOp_Request interface { - isRequestOp_Request() - MarshalTo([]byte) (int, error) - Size() int -} - -type RequestOp_RequestRange struct { - RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,json=requestRange,oneof"` -} -type RequestOp_RequestPut struct { - RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,json=requestPut,oneof"` -} -type RequestOp_RequestDeleteRange struct { - RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,json=requestDeleteRange,oneof"` -} -type RequestOp_RequestTxn struct { - RequestTxn *TxnRequest `protobuf:"bytes,4,opt,name=request_txn,json=requestTxn,oneof"` -} - -func (*RequestOp_RequestRange) isRequestOp_Request() {} -func (*RequestOp_RequestPut) isRequestOp_Request() {} -func (*RequestOp_RequestDeleteRange) isRequestOp_Request() {} -func (*RequestOp_RequestTxn) isRequestOp_Request() {} - -func (m *RequestOp) GetRequest() isRequestOp_Request { - if m != nil { - return m.Request - } - return nil -} - -func (m *RequestOp) GetRequestRange() *RangeRequest { - if x, ok := m.GetRequest().(*RequestOp_RequestRange); ok { - return x.RequestRange - } - return nil -} - -func (m *RequestOp) GetRequestPut() *PutRequest { - if x, ok := m.GetRequest().(*RequestOp_RequestPut); ok { - return x.RequestPut - } - return nil -} - -func (m *RequestOp) GetRequestDeleteRange() *DeleteRangeRequest { - if x, ok := m.GetRequest().(*RequestOp_RequestDeleteRange); ok { - return x.RequestDeleteRange - } - return nil -} - -func (m *RequestOp) GetRequestTxn() *TxnRequest { - if x, ok := m.GetRequest().(*RequestOp_RequestTxn); ok { - return x.RequestTxn - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*RequestOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _RequestOp_OneofMarshaler, _RequestOp_OneofUnmarshaler, _RequestOp_OneofSizer, []interface{}{ - (*RequestOp_RequestRange)(nil), - (*RequestOp_RequestPut)(nil), - (*RequestOp_RequestDeleteRange)(nil), - (*RequestOp_RequestTxn)(nil), - } -} - -func _RequestOp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*RequestOp) - // request - switch x := m.Request.(type) { - case *RequestOp_RequestRange: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.RequestRange); err != nil { - return err - } - case *RequestOp_RequestPut: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.RequestPut); err != nil { - return err - } - case *RequestOp_RequestDeleteRange: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.RequestDeleteRange); err != nil { - return err - } - case *RequestOp_RequestTxn: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.RequestTxn); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("RequestOp.Request has unexpected type %T", x) - } - return nil -} - -func _RequestOp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*RequestOp) - switch tag { - case 1: // request.request_range - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(RangeRequest) - err := b.DecodeMessage(msg) - m.Request = &RequestOp_RequestRange{msg} - return true, err - case 2: // request.request_put - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(PutRequest) - err := b.DecodeMessage(msg) - m.Request = &RequestOp_RequestPut{msg} - return true, err - case 3: // request.request_delete_range - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(DeleteRangeRequest) - err := b.DecodeMessage(msg) - m.Request = &RequestOp_RequestDeleteRange{msg} - return true, err - case 4: // request.request_txn - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(TxnRequest) - err := b.DecodeMessage(msg) - m.Request = &RequestOp_RequestTxn{msg} - return true, err - default: - return false, nil - } -} - -func _RequestOp_OneofSizer(msg proto.Message) (n int) { - m := msg.(*RequestOp) - // request - switch x := m.Request.(type) { - case *RequestOp_RequestRange: - s := proto.Size(x.RequestRange) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *RequestOp_RequestPut: - s := proto.Size(x.RequestPut) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *RequestOp_RequestDeleteRange: - s := proto.Size(x.RequestDeleteRange) - n += proto.SizeVarint(3<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *RequestOp_RequestTxn: - s := proto.Size(x.RequestTxn) - n += proto.SizeVarint(4<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type ResponseOp struct { - // response is a union of response types returned by a transaction. - // - // Types that are valid to be assigned to Response: - // *ResponseOp_ResponseRange - // *ResponseOp_ResponsePut - // *ResponseOp_ResponseDeleteRange - // *ResponseOp_ResponseTxn - Response isResponseOp_Response `protobuf_oneof:"response"` -} - -func (m *ResponseOp) Reset() { *m = ResponseOp{} } -func (m *ResponseOp) String() string { return proto.CompactTextString(m) } -func (*ResponseOp) ProtoMessage() {} -func (*ResponseOp) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{8} } - -type isResponseOp_Response interface { - isResponseOp_Response() - MarshalTo([]byte) (int, error) - Size() int -} - -type ResponseOp_ResponseRange struct { - ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,json=responseRange,oneof"` -} -type ResponseOp_ResponsePut struct { - ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,json=responsePut,oneof"` -} -type ResponseOp_ResponseDeleteRange struct { - ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,json=responseDeleteRange,oneof"` -} -type ResponseOp_ResponseTxn struct { - ResponseTxn *TxnResponse `protobuf:"bytes,4,opt,name=response_txn,json=responseTxn,oneof"` -} - -func (*ResponseOp_ResponseRange) isResponseOp_Response() {} -func (*ResponseOp_ResponsePut) isResponseOp_Response() {} -func (*ResponseOp_ResponseDeleteRange) isResponseOp_Response() {} -func (*ResponseOp_ResponseTxn) isResponseOp_Response() {} - -func (m *ResponseOp) GetResponse() isResponseOp_Response { - if m != nil { - return m.Response - } - return nil -} - -func (m *ResponseOp) GetResponseRange() *RangeResponse { - if x, ok := m.GetResponse().(*ResponseOp_ResponseRange); ok { - return x.ResponseRange - } - return nil -} - -func (m *ResponseOp) GetResponsePut() *PutResponse { - if x, ok := m.GetResponse().(*ResponseOp_ResponsePut); ok { - return x.ResponsePut - } - return nil -} - -func (m *ResponseOp) GetResponseDeleteRange() *DeleteRangeResponse { - if x, ok := m.GetResponse().(*ResponseOp_ResponseDeleteRange); ok { - return x.ResponseDeleteRange - } - return nil -} - -func (m *ResponseOp) GetResponseTxn() *TxnResponse { - if x, ok := m.GetResponse().(*ResponseOp_ResponseTxn); ok { - return x.ResponseTxn - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ResponseOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _ResponseOp_OneofMarshaler, _ResponseOp_OneofUnmarshaler, _ResponseOp_OneofSizer, []interface{}{ - (*ResponseOp_ResponseRange)(nil), - (*ResponseOp_ResponsePut)(nil), - (*ResponseOp_ResponseDeleteRange)(nil), - (*ResponseOp_ResponseTxn)(nil), - } -} - -func _ResponseOp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ResponseOp) - // response - switch x := m.Response.(type) { - case *ResponseOp_ResponseRange: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ResponseRange); err != nil { - return err - } - case *ResponseOp_ResponsePut: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ResponsePut); err != nil { - return err - } - case *ResponseOp_ResponseDeleteRange: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ResponseDeleteRange); err != nil { - return err - } - case *ResponseOp_ResponseTxn: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ResponseTxn); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ResponseOp.Response has unexpected type %T", x) - } - return nil -} - -func _ResponseOp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ResponseOp) - switch tag { - case 1: // response.response_range - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(RangeResponse) - err := b.DecodeMessage(msg) - m.Response = &ResponseOp_ResponseRange{msg} - return true, err - case 2: // response.response_put - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(PutResponse) - err := b.DecodeMessage(msg) - m.Response = &ResponseOp_ResponsePut{msg} - return true, err - case 3: // response.response_delete_range - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(DeleteRangeResponse) - err := b.DecodeMessage(msg) - m.Response = &ResponseOp_ResponseDeleteRange{msg} - return true, err - case 4: // response.response_txn - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(TxnResponse) - err := b.DecodeMessage(msg) - m.Response = &ResponseOp_ResponseTxn{msg} - return true, err - default: - return false, nil - } -} - -func _ResponseOp_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ResponseOp) - // response - switch x := m.Response.(type) { - case *ResponseOp_ResponseRange: - s := proto.Size(x.ResponseRange) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *ResponseOp_ResponsePut: - s := proto.Size(x.ResponsePut) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *ResponseOp_ResponseDeleteRange: - s := proto.Size(x.ResponseDeleteRange) - n += proto.SizeVarint(3<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *ResponseOp_ResponseTxn: - s := proto.Size(x.ResponseTxn) - n += proto.SizeVarint(4<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type Compare struct { - // result is logical comparison operation for this comparison. - Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"` - // target is the key-value field to inspect for the comparison. - Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"` - // key is the subject key for the comparison operation. - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // Types that are valid to be assigned to TargetUnion: - // *Compare_Version - // *Compare_CreateRevision - // *Compare_ModRevision - // *Compare_Value - // *Compare_Lease - TargetUnion isCompare_TargetUnion `protobuf_oneof:"target_union"` - // range_end compares the given target to all keys in the range [key, range_end). - // See RangeRequest for more details on key ranges. - RangeEnd []byte `protobuf:"bytes,64,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` -} - -func (m *Compare) Reset() { *m = Compare{} } -func (m *Compare) String() string { return proto.CompactTextString(m) } -func (*Compare) ProtoMessage() {} -func (*Compare) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9} } - -type isCompare_TargetUnion interface { - isCompare_TargetUnion() - MarshalTo([]byte) (int, error) - Size() int -} - -type Compare_Version struct { - Version int64 `protobuf:"varint,4,opt,name=version,proto3,oneof"` -} -type Compare_CreateRevision struct { - CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,json=createRevision,proto3,oneof"` -} -type Compare_ModRevision struct { - ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,json=modRevision,proto3,oneof"` -} -type Compare_Value struct { - Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof"` -} -type Compare_Lease struct { - Lease int64 `protobuf:"varint,8,opt,name=lease,proto3,oneof"` -} - -func (*Compare_Version) isCompare_TargetUnion() {} -func (*Compare_CreateRevision) isCompare_TargetUnion() {} -func (*Compare_ModRevision) isCompare_TargetUnion() {} -func (*Compare_Value) isCompare_TargetUnion() {} -func (*Compare_Lease) isCompare_TargetUnion() {} - -func (m *Compare) GetTargetUnion() isCompare_TargetUnion { - if m != nil { - return m.TargetUnion - } - return nil -} - -func (m *Compare) GetResult() Compare_CompareResult { - if m != nil { - return m.Result - } - return Compare_EQUAL -} - -func (m *Compare) GetTarget() Compare_CompareTarget { - if m != nil { - return m.Target - } - return Compare_VERSION -} - -func (m *Compare) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *Compare) GetVersion() int64 { - if x, ok := m.GetTargetUnion().(*Compare_Version); ok { - return x.Version - } - return 0 -} - -func (m *Compare) GetCreateRevision() int64 { - if x, ok := m.GetTargetUnion().(*Compare_CreateRevision); ok { - return x.CreateRevision - } - return 0 -} - -func (m *Compare) GetModRevision() int64 { - if x, ok := m.GetTargetUnion().(*Compare_ModRevision); ok { - return x.ModRevision - } - return 0 -} - -func (m *Compare) GetValue() []byte { - if x, ok := m.GetTargetUnion().(*Compare_Value); ok { - return x.Value - } - return nil -} - -func (m *Compare) GetLease() int64 { - if x, ok := m.GetTargetUnion().(*Compare_Lease); ok { - return x.Lease - } - return 0 -} - -func (m *Compare) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Compare) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Compare_OneofMarshaler, _Compare_OneofUnmarshaler, _Compare_OneofSizer, []interface{}{ - (*Compare_Version)(nil), - (*Compare_CreateRevision)(nil), - (*Compare_ModRevision)(nil), - (*Compare_Value)(nil), - (*Compare_Lease)(nil), - } -} - -func _Compare_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Compare) - // target_union - switch x := m.TargetUnion.(type) { - case *Compare_Version: - _ = b.EncodeVarint(4<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.Version)) - case *Compare_CreateRevision: - _ = b.EncodeVarint(5<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.CreateRevision)) - case *Compare_ModRevision: - _ = b.EncodeVarint(6<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.ModRevision)) - case *Compare_Value: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - _ = b.EncodeRawBytes(x.Value) - case *Compare_Lease: - _ = b.EncodeVarint(8<<3 | proto.WireVarint) - _ = b.EncodeVarint(uint64(x.Lease)) - case nil: - default: - return fmt.Errorf("Compare.TargetUnion has unexpected type %T", x) - } - return nil -} - -func _Compare_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Compare) - switch tag { - case 4: // target_union.version - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.TargetUnion = &Compare_Version{int64(x)} - return true, err - case 5: // target_union.create_revision - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.TargetUnion = &Compare_CreateRevision{int64(x)} - return true, err - case 6: // target_union.mod_revision - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.TargetUnion = &Compare_ModRevision{int64(x)} - return true, err - case 7: // target_union.value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeRawBytes(true) - m.TargetUnion = &Compare_Value{x} - return true, err - case 8: // target_union.lease - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.TargetUnion = &Compare_Lease{int64(x)} - return true, err - default: - return false, nil - } -} - -func _Compare_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Compare) - // target_union - switch x := m.TargetUnion.(type) { - case *Compare_Version: - n += proto.SizeVarint(4<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.Version)) - case *Compare_CreateRevision: - n += proto.SizeVarint(5<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.CreateRevision)) - case *Compare_ModRevision: - n += proto.SizeVarint(6<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.ModRevision)) - case *Compare_Value: - n += proto.SizeVarint(7<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(len(x.Value))) - n += len(x.Value) - case *Compare_Lease: - n += proto.SizeVarint(8<<3 | proto.WireVarint) - n += proto.SizeVarint(uint64(x.Lease)) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -// From google paxosdb paper: -// Our implementation hinges around a powerful primitive which we call MultiOp. All other database -// operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically -// and consists of three components: -// 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check -// for the absence or presence of a value, or compare with a given value. Two different tests in the guard -// may apply to the same or different entries in the database. All tests in the guard are applied and -// MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise -// it executes f op (see item 3 below). -// 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or -// lookup operation, and applies to a single database entry. Two different operations in the list may apply -// to the same or different entries in the database. These operations are executed -// if guard evaluates to -// true. -// 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false. -type TxnRequest struct { - // compare is a list of predicates representing a conjunction of terms. - // If the comparisons succeed, then the success requests will be processed in order, - // and the response will contain their respective responses in order. - // If the comparisons fail, then the failure requests will be processed in order, - // and the response will contain their respective responses in order. - Compare []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"` - // success is a list of requests which will be applied when compare evaluates to true. - Success []*RequestOp `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"` - // failure is a list of requests which will be applied when compare evaluates to false. - Failure []*RequestOp `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"` -} - -func (m *TxnRequest) Reset() { *m = TxnRequest{} } -func (m *TxnRequest) String() string { return proto.CompactTextString(m) } -func (*TxnRequest) ProtoMessage() {} -func (*TxnRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{10} } - -func (m *TxnRequest) GetCompare() []*Compare { - if m != nil { - return m.Compare - } - return nil -} - -func (m *TxnRequest) GetSuccess() []*RequestOp { - if m != nil { - return m.Success - } - return nil -} - -func (m *TxnRequest) GetFailure() []*RequestOp { - if m != nil { - return m.Failure - } - return nil -} - -type TxnResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // succeeded is set to true if the compare evaluated to true or false otherwise. - Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"` - // responses is a list of responses corresponding to the results from applying - // success if succeeded is true or failure if succeeded is false. - Responses []*ResponseOp `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"` -} - -func (m *TxnResponse) Reset() { *m = TxnResponse{} } -func (m *TxnResponse) String() string { return proto.CompactTextString(m) } -func (*TxnResponse) ProtoMessage() {} -func (*TxnResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{11} } - -func (m *TxnResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *TxnResponse) GetSucceeded() bool { - if m != nil { - return m.Succeeded - } - return false -} - -func (m *TxnResponse) GetResponses() []*ResponseOp { - if m != nil { - return m.Responses - } - return nil -} - -// CompactionRequest compacts the key-value store up to a given revision. All superseded keys -// with a revision less than the compaction revision will be removed. -type CompactionRequest struct { - // revision is the key-value store revision for the compaction operation. - Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` - // physical is set so the RPC will wait until the compaction is physically - // applied to the local database such that compacted entries are totally - // removed from the backend database. - Physical bool `protobuf:"varint,2,opt,name=physical,proto3" json:"physical,omitempty"` -} - -func (m *CompactionRequest) Reset() { *m = CompactionRequest{} } -func (m *CompactionRequest) String() string { return proto.CompactTextString(m) } -func (*CompactionRequest) ProtoMessage() {} -func (*CompactionRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{12} } - -func (m *CompactionRequest) GetRevision() int64 { - if m != nil { - return m.Revision - } - return 0 -} - -func (m *CompactionRequest) GetPhysical() bool { - if m != nil { - return m.Physical - } - return false -} - -type CompactionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *CompactionResponse) Reset() { *m = CompactionResponse{} } -func (m *CompactionResponse) String() string { return proto.CompactTextString(m) } -func (*CompactionResponse) ProtoMessage() {} -func (*CompactionResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{13} } - -func (m *CompactionResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type HashRequest struct { -} - -func (m *HashRequest) Reset() { *m = HashRequest{} } -func (m *HashRequest) String() string { return proto.CompactTextString(m) } -func (*HashRequest) ProtoMessage() {} -func (*HashRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{14} } - -type HashKVRequest struct { - // revision is the key-value store revision for the hash operation. - Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (m *HashKVRequest) Reset() { *m = HashKVRequest{} } -func (m *HashKVRequest) String() string { return proto.CompactTextString(m) } -func (*HashKVRequest) ProtoMessage() {} -func (*HashKVRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{15} } - -func (m *HashKVRequest) GetRevision() int64 { - if m != nil { - return m.Revision - } - return 0 -} - -type HashKVResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // hash is the hash value computed from the responding member's MVCC keys up to a given revision. - Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` - // compact_revision is the compacted revision of key-value store when hash begins. - CompactRevision int64 `protobuf:"varint,3,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"` -} - -func (m *HashKVResponse) Reset() { *m = HashKVResponse{} } -func (m *HashKVResponse) String() string { return proto.CompactTextString(m) } -func (*HashKVResponse) ProtoMessage() {} -func (*HashKVResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{16} } - -func (m *HashKVResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *HashKVResponse) GetHash() uint32 { - if m != nil { - return m.Hash - } - return 0 -} - -func (m *HashKVResponse) GetCompactRevision() int64 { - if m != nil { - return m.CompactRevision - } - return 0 -} - -type HashResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // hash is the hash value computed from the responding member's KV's backend. - Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *HashResponse) Reset() { *m = HashResponse{} } -func (m *HashResponse) String() string { return proto.CompactTextString(m) } -func (*HashResponse) ProtoMessage() {} -func (*HashResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{17} } - -func (m *HashResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *HashResponse) GetHash() uint32 { - if m != nil { - return m.Hash - } - return 0 -} - -type SnapshotRequest struct { -} - -func (m *SnapshotRequest) Reset() { *m = SnapshotRequest{} } -func (m *SnapshotRequest) String() string { return proto.CompactTextString(m) } -func (*SnapshotRequest) ProtoMessage() {} -func (*SnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{18} } - -type SnapshotResponse struct { - // header has the current key-value store information. The first header in the snapshot - // stream indicates the point in time of the snapshot. - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // remaining_bytes is the number of blob bytes to be sent after this message - RemainingBytes uint64 `protobuf:"varint,2,opt,name=remaining_bytes,json=remainingBytes,proto3" json:"remaining_bytes,omitempty"` - // blob contains the next chunk of the snapshot in the snapshot stream. - Blob []byte `protobuf:"bytes,3,opt,name=blob,proto3" json:"blob,omitempty"` -} - -func (m *SnapshotResponse) Reset() { *m = SnapshotResponse{} } -func (m *SnapshotResponse) String() string { return proto.CompactTextString(m) } -func (*SnapshotResponse) ProtoMessage() {} -func (*SnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{19} } - -func (m *SnapshotResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *SnapshotResponse) GetRemainingBytes() uint64 { - if m != nil { - return m.RemainingBytes - } - return 0 -} - -func (m *SnapshotResponse) GetBlob() []byte { - if m != nil { - return m.Blob - } - return nil -} - -type WatchRequest struct { - // request_union is a request to either create a new watcher or cancel an existing watcher. - // - // Types that are valid to be assigned to RequestUnion: - // *WatchRequest_CreateRequest - // *WatchRequest_CancelRequest - RequestUnion isWatchRequest_RequestUnion `protobuf_oneof:"request_union"` -} - -func (m *WatchRequest) Reset() { *m = WatchRequest{} } -func (m *WatchRequest) String() string { return proto.CompactTextString(m) } -func (*WatchRequest) ProtoMessage() {} -func (*WatchRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{20} } - -type isWatchRequest_RequestUnion interface { - isWatchRequest_RequestUnion() - MarshalTo([]byte) (int, error) - Size() int -} - -type WatchRequest_CreateRequest struct { - CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,json=createRequest,oneof"` -} -type WatchRequest_CancelRequest struct { - CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,json=cancelRequest,oneof"` -} - -func (*WatchRequest_CreateRequest) isWatchRequest_RequestUnion() {} -func (*WatchRequest_CancelRequest) isWatchRequest_RequestUnion() {} - -func (m *WatchRequest) GetRequestUnion() isWatchRequest_RequestUnion { - if m != nil { - return m.RequestUnion - } - return nil -} - -func (m *WatchRequest) GetCreateRequest() *WatchCreateRequest { - if x, ok := m.GetRequestUnion().(*WatchRequest_CreateRequest); ok { - return x.CreateRequest - } - return nil -} - -func (m *WatchRequest) GetCancelRequest() *WatchCancelRequest { - if x, ok := m.GetRequestUnion().(*WatchRequest_CancelRequest); ok { - return x.CancelRequest - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*WatchRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _WatchRequest_OneofMarshaler, _WatchRequest_OneofUnmarshaler, _WatchRequest_OneofSizer, []interface{}{ - (*WatchRequest_CreateRequest)(nil), - (*WatchRequest_CancelRequest)(nil), - } -} - -func _WatchRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*WatchRequest) - // request_union - switch x := m.RequestUnion.(type) { - case *WatchRequest_CreateRequest: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.CreateRequest); err != nil { - return err - } - case *WatchRequest_CancelRequest: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.CancelRequest); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("WatchRequest.RequestUnion has unexpected type %T", x) - } - return nil -} - -func _WatchRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*WatchRequest) - switch tag { - case 1: // request_union.create_request - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WatchCreateRequest) - err := b.DecodeMessage(msg) - m.RequestUnion = &WatchRequest_CreateRequest{msg} - return true, err - case 2: // request_union.cancel_request - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WatchCancelRequest) - err := b.DecodeMessage(msg) - m.RequestUnion = &WatchRequest_CancelRequest{msg} - return true, err - default: - return false, nil - } -} - -func _WatchRequest_OneofSizer(msg proto.Message) (n int) { - m := msg.(*WatchRequest) - // request_union - switch x := m.RequestUnion.(type) { - case *WatchRequest_CreateRequest: - s := proto.Size(x.CreateRequest) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *WatchRequest_CancelRequest: - s := proto.Size(x.CancelRequest) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type WatchCreateRequest struct { - // key is the key to register for watching. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // range_end is the end of the range [key, range_end) to watch. If range_end is not given, - // only the key argument is watched. If range_end is equal to '\0', all keys greater than - // or equal to the key argument are watched. - // If the range_end is one bit larger than the given key, - // then all keys with the prefix (the given key) will be watched. - RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - // start_revision is an optional revision to watch from (inclusive). No start_revision is "now". - StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,json=startRevision,proto3" json:"start_revision,omitempty"` - // progress_notify is set so that the etcd server will periodically send a WatchResponse with - // no events to the new watcher if there are no recent events. It is useful when clients - // wish to recover a disconnected watcher starting from a recent known revision. - // The etcd server may decide how often it will send notifications based on current load. - ProgressNotify bool `protobuf:"varint,4,opt,name=progress_notify,json=progressNotify,proto3" json:"progress_notify,omitempty"` - // filters filter the events at server side before it sends back to the watcher. - Filters []WatchCreateRequest_FilterType `protobuf:"varint,5,rep,packed,name=filters,enum=etcdserverpb.WatchCreateRequest_FilterType" json:"filters,omitempty"` - // If prev_kv is set, created watcher gets the previous KV before the event happens. - // If the previous KV is already compacted, nothing will be returned. - PrevKv bool `protobuf:"varint,6,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` -} - -func (m *WatchCreateRequest) Reset() { *m = WatchCreateRequest{} } -func (m *WatchCreateRequest) String() string { return proto.CompactTextString(m) } -func (*WatchCreateRequest) ProtoMessage() {} -func (*WatchCreateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{21} } - -func (m *WatchCreateRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *WatchCreateRequest) GetRangeEnd() []byte { - if m != nil { - return m.RangeEnd - } - return nil -} - -func (m *WatchCreateRequest) GetStartRevision() int64 { - if m != nil { - return m.StartRevision - } - return 0 -} - -func (m *WatchCreateRequest) GetProgressNotify() bool { - if m != nil { - return m.ProgressNotify - } - return false -} - -func (m *WatchCreateRequest) GetFilters() []WatchCreateRequest_FilterType { - if m != nil { - return m.Filters - } - return nil -} - -func (m *WatchCreateRequest) GetPrevKv() bool { - if m != nil { - return m.PrevKv - } - return false -} - -type WatchCancelRequest struct { - // watch_id is the watcher id to cancel so that no more events are transmitted. - WatchId int64 `protobuf:"varint,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` -} - -func (m *WatchCancelRequest) Reset() { *m = WatchCancelRequest{} } -func (m *WatchCancelRequest) String() string { return proto.CompactTextString(m) } -func (*WatchCancelRequest) ProtoMessage() {} -func (*WatchCancelRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{22} } - -func (m *WatchCancelRequest) GetWatchId() int64 { - if m != nil { - return m.WatchId - } - return 0 -} - -type WatchResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // watch_id is the ID of the watcher that corresponds to the response. - WatchId int64 `protobuf:"varint,2,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` - // created is set to true if the response is for a create watch request. - // The client should record the watch_id and expect to receive events for - // the created watcher from the same stream. - // All events sent to the created watcher will attach with the same watch_id. - Created bool `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"` - // canceled is set to true if the response is for a cancel watch request. - // No further events will be sent to the canceled watcher. - Canceled bool `protobuf:"varint,4,opt,name=canceled,proto3" json:"canceled,omitempty"` - // compact_revision is set to the minimum index if a watcher tries to watch - // at a compacted index. - // - // This happens when creating a watcher at a compacted revision or the watcher cannot - // catch up with the progress of the key-value store. - // - // The client should treat the watcher as canceled and should not try to create any - // watcher with the same start_revision again. - CompactRevision int64 `protobuf:"varint,5,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"` - // cancel_reason indicates the reason for canceling the watcher. - CancelReason string `protobuf:"bytes,6,opt,name=cancel_reason,json=cancelReason,proto3" json:"cancel_reason,omitempty"` - Events []*mvccpb.Event `protobuf:"bytes,11,rep,name=events" json:"events,omitempty"` -} - -func (m *WatchResponse) Reset() { *m = WatchResponse{} } -func (m *WatchResponse) String() string { return proto.CompactTextString(m) } -func (*WatchResponse) ProtoMessage() {} -func (*WatchResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{23} } - -func (m *WatchResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *WatchResponse) GetWatchId() int64 { - if m != nil { - return m.WatchId - } - return 0 -} - -func (m *WatchResponse) GetCreated() bool { - if m != nil { - return m.Created - } - return false -} - -func (m *WatchResponse) GetCanceled() bool { - if m != nil { - return m.Canceled - } - return false -} - -func (m *WatchResponse) GetCompactRevision() int64 { - if m != nil { - return m.CompactRevision - } - return 0 -} - -func (m *WatchResponse) GetCancelReason() string { - if m != nil { - return m.CancelReason - } - return "" -} - -func (m *WatchResponse) GetEvents() []*mvccpb.Event { - if m != nil { - return m.Events - } - return nil -} - -type LeaseGrantRequest struct { - // TTL is the advisory time-to-live in seconds. Expired lease will return -1. - TTL int64 `protobuf:"varint,1,opt,name=TTL,proto3" json:"TTL,omitempty"` - // ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` -} - -func (m *LeaseGrantRequest) Reset() { *m = LeaseGrantRequest{} } -func (m *LeaseGrantRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseGrantRequest) ProtoMessage() {} -func (*LeaseGrantRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{24} } - -func (m *LeaseGrantRequest) GetTTL() int64 { - if m != nil { - return m.TTL - } - return 0 -} - -func (m *LeaseGrantRequest) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -type LeaseGrantResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // ID is the lease ID for the granted lease. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - // TTL is the server chosen lease time-to-live in seconds. - TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *LeaseGrantResponse) Reset() { *m = LeaseGrantResponse{} } -func (m *LeaseGrantResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseGrantResponse) ProtoMessage() {} -func (*LeaseGrantResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{25} } - -func (m *LeaseGrantResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *LeaseGrantResponse) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseGrantResponse) GetTTL() int64 { - if m != nil { - return m.TTL - } - return 0 -} - -func (m *LeaseGrantResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type LeaseRevokeRequest struct { - // ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` -} - -func (m *LeaseRevokeRequest) Reset() { *m = LeaseRevokeRequest{} } -func (m *LeaseRevokeRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseRevokeRequest) ProtoMessage() {} -func (*LeaseRevokeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{26} } - -func (m *LeaseRevokeRequest) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -type LeaseRevokeResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *LeaseRevokeResponse) Reset() { *m = LeaseRevokeResponse{} } -func (m *LeaseRevokeResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseRevokeResponse) ProtoMessage() {} -func (*LeaseRevokeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{27} } - -func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type LeaseKeepAliveRequest struct { - // ID is the lease ID for the lease to keep alive. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` -} - -func (m *LeaseKeepAliveRequest) Reset() { *m = LeaseKeepAliveRequest{} } -func (m *LeaseKeepAliveRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseKeepAliveRequest) ProtoMessage() {} -func (*LeaseKeepAliveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{28} } - -func (m *LeaseKeepAliveRequest) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -type LeaseKeepAliveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // ID is the lease ID from the keep alive request. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - // TTL is the new time-to-live for the lease. - TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` -} - -func (m *LeaseKeepAliveResponse) Reset() { *m = LeaseKeepAliveResponse{} } -func (m *LeaseKeepAliveResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseKeepAliveResponse) ProtoMessage() {} -func (*LeaseKeepAliveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{29} } - -func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *LeaseKeepAliveResponse) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseKeepAliveResponse) GetTTL() int64 { - if m != nil { - return m.TTL - } - return 0 -} - -type LeaseTimeToLiveRequest struct { - // ID is the lease ID for the lease. - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // keys is true to query all the keys attached to this lease. - Keys bool `protobuf:"varint,2,opt,name=keys,proto3" json:"keys,omitempty"` -} - -func (m *LeaseTimeToLiveRequest) Reset() { *m = LeaseTimeToLiveRequest{} } -func (m *LeaseTimeToLiveRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseTimeToLiveRequest) ProtoMessage() {} -func (*LeaseTimeToLiveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{30} } - -func (m *LeaseTimeToLiveRequest) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseTimeToLiveRequest) GetKeys() bool { - if m != nil { - return m.Keys - } - return false -} - -type LeaseTimeToLiveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // ID is the lease ID from the keep alive request. - ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` - // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. - TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` - // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. - GrantedTTL int64 `protobuf:"varint,4,opt,name=grantedTTL,proto3" json:"grantedTTL,omitempty"` - // Keys is the list of keys attached to this lease. - Keys [][]byte `protobuf:"bytes,5,rep,name=keys" json:"keys,omitempty"` -} - -func (m *LeaseTimeToLiveResponse) Reset() { *m = LeaseTimeToLiveResponse{} } -func (m *LeaseTimeToLiveResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseTimeToLiveResponse) ProtoMessage() {} -func (*LeaseTimeToLiveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{31} } - -func (m *LeaseTimeToLiveResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *LeaseTimeToLiveResponse) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *LeaseTimeToLiveResponse) GetTTL() int64 { - if m != nil { - return m.TTL - } - return 0 -} - -func (m *LeaseTimeToLiveResponse) GetGrantedTTL() int64 { - if m != nil { - return m.GrantedTTL - } - return 0 -} - -func (m *LeaseTimeToLiveResponse) GetKeys() [][]byte { - if m != nil { - return m.Keys - } - return nil -} - -type LeaseLeasesRequest struct { -} - -func (m *LeaseLeasesRequest) Reset() { *m = LeaseLeasesRequest{} } -func (m *LeaseLeasesRequest) String() string { return proto.CompactTextString(m) } -func (*LeaseLeasesRequest) ProtoMessage() {} -func (*LeaseLeasesRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{32} } - -type LeaseStatus struct { - ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` -} - -func (m *LeaseStatus) Reset() { *m = LeaseStatus{} } -func (m *LeaseStatus) String() string { return proto.CompactTextString(m) } -func (*LeaseStatus) ProtoMessage() {} -func (*LeaseStatus) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{33} } - -func (m *LeaseStatus) GetID() int64 { - if m != nil { - return m.ID - } - return 0 -} - -type LeaseLeasesResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Leases []*LeaseStatus `protobuf:"bytes,2,rep,name=leases" json:"leases,omitempty"` -} - -func (m *LeaseLeasesResponse) Reset() { *m = LeaseLeasesResponse{} } -func (m *LeaseLeasesResponse) String() string { return proto.CompactTextString(m) } -func (*LeaseLeasesResponse) ProtoMessage() {} -func (*LeaseLeasesResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{34} } - -func (m *LeaseLeasesResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *LeaseLeasesResponse) GetLeases() []*LeaseStatus { - if m != nil { - return m.Leases - } - return nil -} - -type Member struct { - // ID is the member ID for this member. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // name is the human-readable name of the member. If the member is not started, the name will be an empty string. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // peerURLs is the list of URLs the member exposes to the cluster for communication. - PeerURLs []string `protobuf:"bytes,3,rep,name=peerURLs" json:"peerURLs,omitempty"` - // clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. - ClientURLs []string `protobuf:"bytes,4,rep,name=clientURLs" json:"clientURLs,omitempty"` -} - -func (m *Member) Reset() { *m = Member{} } -func (m *Member) String() string { return proto.CompactTextString(m) } -func (*Member) ProtoMessage() {} -func (*Member) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{35} } - -func (m *Member) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *Member) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Member) GetPeerURLs() []string { - if m != nil { - return m.PeerURLs - } - return nil -} - -func (m *Member) GetClientURLs() []string { - if m != nil { - return m.ClientURLs - } - return nil -} - -type MemberAddRequest struct { - // peerURLs is the list of URLs the added member will use to communicate with the cluster. - PeerURLs []string `protobuf:"bytes,1,rep,name=peerURLs" json:"peerURLs,omitempty"` -} - -func (m *MemberAddRequest) Reset() { *m = MemberAddRequest{} } -func (m *MemberAddRequest) String() string { return proto.CompactTextString(m) } -func (*MemberAddRequest) ProtoMessage() {} -func (*MemberAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{36} } - -func (m *MemberAddRequest) GetPeerURLs() []string { - if m != nil { - return m.PeerURLs - } - return nil -} - -type MemberAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // member is the member information for the added member. - Member *Member `protobuf:"bytes,2,opt,name=member" json:"member,omitempty"` - // members is a list of all members after adding the new member. - Members []*Member `protobuf:"bytes,3,rep,name=members" json:"members,omitempty"` -} - -func (m *MemberAddResponse) Reset() { *m = MemberAddResponse{} } -func (m *MemberAddResponse) String() string { return proto.CompactTextString(m) } -func (*MemberAddResponse) ProtoMessage() {} -func (*MemberAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{37} } - -func (m *MemberAddResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberAddResponse) GetMember() *Member { - if m != nil { - return m.Member - } - return nil -} - -func (m *MemberAddResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type MemberRemoveRequest struct { - // ID is the member ID of the member to remove. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` -} - -func (m *MemberRemoveRequest) Reset() { *m = MemberRemoveRequest{} } -func (m *MemberRemoveRequest) String() string { return proto.CompactTextString(m) } -func (*MemberRemoveRequest) ProtoMessage() {} -func (*MemberRemoveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{38} } - -func (m *MemberRemoveRequest) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -type MemberRemoveResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // members is a list of all members after removing the member. - Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` -} - -func (m *MemberRemoveResponse) Reset() { *m = MemberRemoveResponse{} } -func (m *MemberRemoveResponse) String() string { return proto.CompactTextString(m) } -func (*MemberRemoveResponse) ProtoMessage() {} -func (*MemberRemoveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{39} } - -func (m *MemberRemoveResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberRemoveResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type MemberUpdateRequest struct { - // ID is the member ID of the member to update. - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - // peerURLs is the new list of URLs the member will use to communicate with the cluster. - PeerURLs []string `protobuf:"bytes,2,rep,name=peerURLs" json:"peerURLs,omitempty"` -} - -func (m *MemberUpdateRequest) Reset() { *m = MemberUpdateRequest{} } -func (m *MemberUpdateRequest) String() string { return proto.CompactTextString(m) } -func (*MemberUpdateRequest) ProtoMessage() {} -func (*MemberUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{40} } - -func (m *MemberUpdateRequest) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *MemberUpdateRequest) GetPeerURLs() []string { - if m != nil { - return m.PeerURLs - } - return nil -} - -type MemberUpdateResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // members is a list of all members after updating the member. - Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` -} - -func (m *MemberUpdateResponse) Reset() { *m = MemberUpdateResponse{} } -func (m *MemberUpdateResponse) String() string { return proto.CompactTextString(m) } -func (*MemberUpdateResponse) ProtoMessage() {} -func (*MemberUpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{41} } - -func (m *MemberUpdateResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberUpdateResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type MemberListRequest struct { -} - -func (m *MemberListRequest) Reset() { *m = MemberListRequest{} } -func (m *MemberListRequest) String() string { return proto.CompactTextString(m) } -func (*MemberListRequest) ProtoMessage() {} -func (*MemberListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{42} } - -type MemberListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // members is a list of all members associated with the cluster. - Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` -} - -func (m *MemberListResponse) Reset() { *m = MemberListResponse{} } -func (m *MemberListResponse) String() string { return proto.CompactTextString(m) } -func (*MemberListResponse) ProtoMessage() {} -func (*MemberListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{43} } - -func (m *MemberListResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *MemberListResponse) GetMembers() []*Member { - if m != nil { - return m.Members - } - return nil -} - -type DefragmentRequest struct { -} - -func (m *DefragmentRequest) Reset() { *m = DefragmentRequest{} } -func (m *DefragmentRequest) String() string { return proto.CompactTextString(m) } -func (*DefragmentRequest) ProtoMessage() {} -func (*DefragmentRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{44} } - -type DefragmentResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *DefragmentResponse) Reset() { *m = DefragmentResponse{} } -func (m *DefragmentResponse) String() string { return proto.CompactTextString(m) } -func (*DefragmentResponse) ProtoMessage() {} -func (*DefragmentResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{45} } - -func (m *DefragmentResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type MoveLeaderRequest struct { - // targetID is the node ID for the new leader. - TargetID uint64 `protobuf:"varint,1,opt,name=targetID,proto3" json:"targetID,omitempty"` -} - -func (m *MoveLeaderRequest) Reset() { *m = MoveLeaderRequest{} } -func (m *MoveLeaderRequest) String() string { return proto.CompactTextString(m) } -func (*MoveLeaderRequest) ProtoMessage() {} -func (*MoveLeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{46} } - -func (m *MoveLeaderRequest) GetTargetID() uint64 { - if m != nil { - return m.TargetID - } - return 0 -} - -type MoveLeaderResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *MoveLeaderResponse) Reset() { *m = MoveLeaderResponse{} } -func (m *MoveLeaderResponse) String() string { return proto.CompactTextString(m) } -func (*MoveLeaderResponse) ProtoMessage() {} -func (*MoveLeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{47} } - -func (m *MoveLeaderResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AlarmRequest struct { - // action is the kind of alarm request to issue. The action - // may GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a - // raised alarm. - Action AlarmRequest_AlarmAction `protobuf:"varint,1,opt,name=action,proto3,enum=etcdserverpb.AlarmRequest_AlarmAction" json:"action,omitempty"` - // memberID is the ID of the member associated with the alarm. If memberID is 0, the - // alarm request covers all members. - MemberID uint64 `protobuf:"varint,2,opt,name=memberID,proto3" json:"memberID,omitempty"` - // alarm is the type of alarm to consider for this request. - Alarm AlarmType `protobuf:"varint,3,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` -} - -func (m *AlarmRequest) Reset() { *m = AlarmRequest{} } -func (m *AlarmRequest) String() string { return proto.CompactTextString(m) } -func (*AlarmRequest) ProtoMessage() {} -func (*AlarmRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{48} } - -func (m *AlarmRequest) GetAction() AlarmRequest_AlarmAction { - if m != nil { - return m.Action - } - return AlarmRequest_GET -} - -func (m *AlarmRequest) GetMemberID() uint64 { - if m != nil { - return m.MemberID - } - return 0 -} - -func (m *AlarmRequest) GetAlarm() AlarmType { - if m != nil { - return m.Alarm - } - return AlarmType_NONE -} - -type AlarmMember struct { - // memberID is the ID of the member associated with the raised alarm. - MemberID uint64 `protobuf:"varint,1,opt,name=memberID,proto3" json:"memberID,omitempty"` - // alarm is the type of alarm which has been raised. - Alarm AlarmType `protobuf:"varint,2,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` -} - -func (m *AlarmMember) Reset() { *m = AlarmMember{} } -func (m *AlarmMember) String() string { return proto.CompactTextString(m) } -func (*AlarmMember) ProtoMessage() {} -func (*AlarmMember) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{49} } - -func (m *AlarmMember) GetMemberID() uint64 { - if m != nil { - return m.MemberID - } - return 0 -} - -func (m *AlarmMember) GetAlarm() AlarmType { - if m != nil { - return m.Alarm - } - return AlarmType_NONE -} - -type AlarmResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // alarms is a list of alarms associated with the alarm request. - Alarms []*AlarmMember `protobuf:"bytes,2,rep,name=alarms" json:"alarms,omitempty"` -} - -func (m *AlarmResponse) Reset() { *m = AlarmResponse{} } -func (m *AlarmResponse) String() string { return proto.CompactTextString(m) } -func (*AlarmResponse) ProtoMessage() {} -func (*AlarmResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{50} } - -func (m *AlarmResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AlarmResponse) GetAlarms() []*AlarmMember { - if m != nil { - return m.Alarms - } - return nil -} - -type StatusRequest struct { -} - -func (m *StatusRequest) Reset() { *m = StatusRequest{} } -func (m *StatusRequest) String() string { return proto.CompactTextString(m) } -func (*StatusRequest) ProtoMessage() {} -func (*StatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{51} } - -type StatusResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // version is the cluster protocol version used by the responding member. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // dbSize is the size of the backend database, in bytes, of the responding member. - DbSize int64 `protobuf:"varint,3,opt,name=dbSize,proto3" json:"dbSize,omitempty"` - // leader is the member ID which the responding member believes is the current leader. - Leader uint64 `protobuf:"varint,4,opt,name=leader,proto3" json:"leader,omitempty"` - // raftIndex is the current raft index of the responding member. - RaftIndex uint64 `protobuf:"varint,5,opt,name=raftIndex,proto3" json:"raftIndex,omitempty"` - // raftTerm is the current raft term of the responding member. - RaftTerm uint64 `protobuf:"varint,6,opt,name=raftTerm,proto3" json:"raftTerm,omitempty"` -} - -func (m *StatusResponse) Reset() { *m = StatusResponse{} } -func (m *StatusResponse) String() string { return proto.CompactTextString(m) } -func (*StatusResponse) ProtoMessage() {} -func (*StatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{52} } - -func (m *StatusResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *StatusResponse) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *StatusResponse) GetDbSize() int64 { - if m != nil { - return m.DbSize - } - return 0 -} - -func (m *StatusResponse) GetLeader() uint64 { - if m != nil { - return m.Leader - } - return 0 -} - -func (m *StatusResponse) GetRaftIndex() uint64 { - if m != nil { - return m.RaftIndex - } - return 0 -} - -func (m *StatusResponse) GetRaftTerm() uint64 { - if m != nil { - return m.RaftTerm - } - return 0 -} - -type AuthEnableRequest struct { -} - -func (m *AuthEnableRequest) Reset() { *m = AuthEnableRequest{} } -func (m *AuthEnableRequest) String() string { return proto.CompactTextString(m) } -func (*AuthEnableRequest) ProtoMessage() {} -func (*AuthEnableRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{53} } - -type AuthDisableRequest struct { -} - -func (m *AuthDisableRequest) Reset() { *m = AuthDisableRequest{} } -func (m *AuthDisableRequest) String() string { return proto.CompactTextString(m) } -func (*AuthDisableRequest) ProtoMessage() {} -func (*AuthDisableRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{54} } - -type AuthenticateRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (m *AuthenticateRequest) Reset() { *m = AuthenticateRequest{} } -func (m *AuthenticateRequest) String() string { return proto.CompactTextString(m) } -func (*AuthenticateRequest) ProtoMessage() {} -func (*AuthenticateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{55} } - -func (m *AuthenticateRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthenticateRequest) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -type AuthUserAddRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (m *AuthUserAddRequest) Reset() { *m = AuthUserAddRequest{} } -func (m *AuthUserAddRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserAddRequest) ProtoMessage() {} -func (*AuthUserAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{56} } - -func (m *AuthUserAddRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthUserAddRequest) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -type AuthUserGetRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *AuthUserGetRequest) Reset() { *m = AuthUserGetRequest{} } -func (m *AuthUserGetRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserGetRequest) ProtoMessage() {} -func (*AuthUserGetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{57} } - -func (m *AuthUserGetRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type AuthUserDeleteRequest struct { - // name is the name of the user to delete. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *AuthUserDeleteRequest) Reset() { *m = AuthUserDeleteRequest{} } -func (m *AuthUserDeleteRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserDeleteRequest) ProtoMessage() {} -func (*AuthUserDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{58} } - -func (m *AuthUserDeleteRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type AuthUserChangePasswordRequest struct { - // name is the name of the user whose password is being changed. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // password is the new password for the user. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (m *AuthUserChangePasswordRequest) Reset() { *m = AuthUserChangePasswordRequest{} } -func (m *AuthUserChangePasswordRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserChangePasswordRequest) ProtoMessage() {} -func (*AuthUserChangePasswordRequest) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{59} -} - -func (m *AuthUserChangePasswordRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthUserChangePasswordRequest) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -type AuthUserGrantRoleRequest struct { - // user is the name of the user which should be granted a given role. - User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - // role is the name of the role to grant to the user. - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` -} - -func (m *AuthUserGrantRoleRequest) Reset() { *m = AuthUserGrantRoleRequest{} } -func (m *AuthUserGrantRoleRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserGrantRoleRequest) ProtoMessage() {} -func (*AuthUserGrantRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{60} } - -func (m *AuthUserGrantRoleRequest) GetUser() string { - if m != nil { - return m.User - } - return "" -} - -func (m *AuthUserGrantRoleRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -type AuthUserRevokeRoleRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` -} - -func (m *AuthUserRevokeRoleRequest) Reset() { *m = AuthUserRevokeRoleRequest{} } -func (m *AuthUserRevokeRoleRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserRevokeRoleRequest) ProtoMessage() {} -func (*AuthUserRevokeRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{61} } - -func (m *AuthUserRevokeRoleRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthUserRevokeRoleRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -type AuthRoleAddRequest struct { - // name is the name of the role to add to the authentication system. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *AuthRoleAddRequest) Reset() { *m = AuthRoleAddRequest{} } -func (m *AuthRoleAddRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleAddRequest) ProtoMessage() {} -func (*AuthRoleAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{62} } - -func (m *AuthRoleAddRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -type AuthRoleGetRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` -} - -func (m *AuthRoleGetRequest) Reset() { *m = AuthRoleGetRequest{} } -func (m *AuthRoleGetRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGetRequest) ProtoMessage() {} -func (*AuthRoleGetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{63} } - -func (m *AuthRoleGetRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -type AuthUserListRequest struct { -} - -func (m *AuthUserListRequest) Reset() { *m = AuthUserListRequest{} } -func (m *AuthUserListRequest) String() string { return proto.CompactTextString(m) } -func (*AuthUserListRequest) ProtoMessage() {} -func (*AuthUserListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{64} } - -type AuthRoleListRequest struct { -} - -func (m *AuthRoleListRequest) Reset() { *m = AuthRoleListRequest{} } -func (m *AuthRoleListRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleListRequest) ProtoMessage() {} -func (*AuthRoleListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{65} } - -type AuthRoleDeleteRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` -} - -func (m *AuthRoleDeleteRequest) Reset() { *m = AuthRoleDeleteRequest{} } -func (m *AuthRoleDeleteRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleDeleteRequest) ProtoMessage() {} -func (*AuthRoleDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{66} } - -func (m *AuthRoleDeleteRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -type AuthRoleGrantPermissionRequest struct { - // name is the name of the role which will be granted the permission. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // perm is the permission to grant to the role. - Perm *authpb.Permission `protobuf:"bytes,2,opt,name=perm" json:"perm,omitempty"` -} - -func (m *AuthRoleGrantPermissionRequest) Reset() { *m = AuthRoleGrantPermissionRequest{} } -func (m *AuthRoleGrantPermissionRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGrantPermissionRequest) ProtoMessage() {} -func (*AuthRoleGrantPermissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{67} -} - -func (m *AuthRoleGrantPermissionRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *AuthRoleGrantPermissionRequest) GetPerm() *authpb.Permission { - if m != nil { - return m.Perm - } - return nil -} - -type AuthRoleRevokePermissionRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - RangeEnd string `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` -} - -func (m *AuthRoleRevokePermissionRequest) Reset() { *m = AuthRoleRevokePermissionRequest{} } -func (m *AuthRoleRevokePermissionRequest) String() string { return proto.CompactTextString(m) } -func (*AuthRoleRevokePermissionRequest) ProtoMessage() {} -func (*AuthRoleRevokePermissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{68} -} - -func (m *AuthRoleRevokePermissionRequest) GetRole() string { - if m != nil { - return m.Role - } - return "" -} - -func (m *AuthRoleRevokePermissionRequest) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *AuthRoleRevokePermissionRequest) GetRangeEnd() string { - if m != nil { - return m.RangeEnd - } - return "" -} - -type AuthEnableResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthEnableResponse) Reset() { *m = AuthEnableResponse{} } -func (m *AuthEnableResponse) String() string { return proto.CompactTextString(m) } -func (*AuthEnableResponse) ProtoMessage() {} -func (*AuthEnableResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{69} } - -func (m *AuthEnableResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthDisableResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthDisableResponse) Reset() { *m = AuthDisableResponse{} } -func (m *AuthDisableResponse) String() string { return proto.CompactTextString(m) } -func (*AuthDisableResponse) ProtoMessage() {} -func (*AuthDisableResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{70} } - -func (m *AuthDisableResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthenticateResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - // token is an authorized token that can be used in succeeding RPCs - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` -} - -func (m *AuthenticateResponse) Reset() { *m = AuthenticateResponse{} } -func (m *AuthenticateResponse) String() string { return proto.CompactTextString(m) } -func (*AuthenticateResponse) ProtoMessage() {} -func (*AuthenticateResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{71} } - -func (m *AuthenticateResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthenticateResponse) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -type AuthUserAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthUserAddResponse) Reset() { *m = AuthUserAddResponse{} } -func (m *AuthUserAddResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserAddResponse) ProtoMessage() {} -func (*AuthUserAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{72} } - -func (m *AuthUserAddResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthUserGetResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Roles []string `protobuf:"bytes,2,rep,name=roles" json:"roles,omitempty"` -} - -func (m *AuthUserGetResponse) Reset() { *m = AuthUserGetResponse{} } -func (m *AuthUserGetResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserGetResponse) ProtoMessage() {} -func (*AuthUserGetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{73} } - -func (m *AuthUserGetResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthUserGetResponse) GetRoles() []string { - if m != nil { - return m.Roles - } - return nil -} - -type AuthUserDeleteResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthUserDeleteResponse) Reset() { *m = AuthUserDeleteResponse{} } -func (m *AuthUserDeleteResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserDeleteResponse) ProtoMessage() {} -func (*AuthUserDeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{74} } - -func (m *AuthUserDeleteResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthUserChangePasswordResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthUserChangePasswordResponse) Reset() { *m = AuthUserChangePasswordResponse{} } -func (m *AuthUserChangePasswordResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserChangePasswordResponse) ProtoMessage() {} -func (*AuthUserChangePasswordResponse) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{75} -} - -func (m *AuthUserChangePasswordResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthUserGrantRoleResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthUserGrantRoleResponse) Reset() { *m = AuthUserGrantRoleResponse{} } -func (m *AuthUserGrantRoleResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserGrantRoleResponse) ProtoMessage() {} -func (*AuthUserGrantRoleResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{76} } - -func (m *AuthUserGrantRoleResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthUserRevokeRoleResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthUserRevokeRoleResponse) Reset() { *m = AuthUserRevokeRoleResponse{} } -func (m *AuthUserRevokeRoleResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserRevokeRoleResponse) ProtoMessage() {} -func (*AuthUserRevokeRoleResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{77} } - -func (m *AuthUserRevokeRoleResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthRoleAddResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthRoleAddResponse) Reset() { *m = AuthRoleAddResponse{} } -func (m *AuthRoleAddResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleAddResponse) ProtoMessage() {} -func (*AuthRoleAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{78} } - -func (m *AuthRoleAddResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthRoleGetResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Perm []*authpb.Permission `protobuf:"bytes,2,rep,name=perm" json:"perm,omitempty"` -} - -func (m *AuthRoleGetResponse) Reset() { *m = AuthRoleGetResponse{} } -func (m *AuthRoleGetResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGetResponse) ProtoMessage() {} -func (*AuthRoleGetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{79} } - -func (m *AuthRoleGetResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthRoleGetResponse) GetPerm() []*authpb.Permission { - if m != nil { - return m.Perm - } - return nil -} - -type AuthRoleListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Roles []string `protobuf:"bytes,2,rep,name=roles" json:"roles,omitempty"` -} - -func (m *AuthRoleListResponse) Reset() { *m = AuthRoleListResponse{} } -func (m *AuthRoleListResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleListResponse) ProtoMessage() {} -func (*AuthRoleListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{80} } - -func (m *AuthRoleListResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthRoleListResponse) GetRoles() []string { - if m != nil { - return m.Roles - } - return nil -} - -type AuthUserListResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Users []string `protobuf:"bytes,2,rep,name=users" json:"users,omitempty"` -} - -func (m *AuthUserListResponse) Reset() { *m = AuthUserListResponse{} } -func (m *AuthUserListResponse) String() string { return proto.CompactTextString(m) } -func (*AuthUserListResponse) ProtoMessage() {} -func (*AuthUserListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{81} } - -func (m *AuthUserListResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *AuthUserListResponse) GetUsers() []string { - if m != nil { - return m.Users - } - return nil -} - -type AuthRoleDeleteResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthRoleDeleteResponse) Reset() { *m = AuthRoleDeleteResponse{} } -func (m *AuthRoleDeleteResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleDeleteResponse) ProtoMessage() {} -func (*AuthRoleDeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{82} } - -func (m *AuthRoleDeleteResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthRoleGrantPermissionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthRoleGrantPermissionResponse) Reset() { *m = AuthRoleGrantPermissionResponse{} } -func (m *AuthRoleGrantPermissionResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleGrantPermissionResponse) ProtoMessage() {} -func (*AuthRoleGrantPermissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{83} -} - -func (m *AuthRoleGrantPermissionResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -type AuthRoleRevokePermissionResponse struct { - Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` -} - -func (m *AuthRoleRevokePermissionResponse) Reset() { *m = AuthRoleRevokePermissionResponse{} } -func (m *AuthRoleRevokePermissionResponse) String() string { return proto.CompactTextString(m) } -func (*AuthRoleRevokePermissionResponse) ProtoMessage() {} -func (*AuthRoleRevokePermissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptorRpc, []int{84} -} - -func (m *AuthRoleRevokePermissionResponse) GetHeader() *ResponseHeader { - if m != nil { - return m.Header - } - return nil -} - -func init() { - proto.RegisterType((*ResponseHeader)(nil), "etcdserverpb.ResponseHeader") - proto.RegisterType((*RangeRequest)(nil), "etcdserverpb.RangeRequest") - proto.RegisterType((*RangeResponse)(nil), "etcdserverpb.RangeResponse") - proto.RegisterType((*PutRequest)(nil), "etcdserverpb.PutRequest") - proto.RegisterType((*PutResponse)(nil), "etcdserverpb.PutResponse") - proto.RegisterType((*DeleteRangeRequest)(nil), "etcdserverpb.DeleteRangeRequest") - proto.RegisterType((*DeleteRangeResponse)(nil), "etcdserverpb.DeleteRangeResponse") - proto.RegisterType((*RequestOp)(nil), "etcdserverpb.RequestOp") - proto.RegisterType((*ResponseOp)(nil), "etcdserverpb.ResponseOp") - proto.RegisterType((*Compare)(nil), "etcdserverpb.Compare") - proto.RegisterType((*TxnRequest)(nil), "etcdserverpb.TxnRequest") - proto.RegisterType((*TxnResponse)(nil), "etcdserverpb.TxnResponse") - proto.RegisterType((*CompactionRequest)(nil), "etcdserverpb.CompactionRequest") - proto.RegisterType((*CompactionResponse)(nil), "etcdserverpb.CompactionResponse") - proto.RegisterType((*HashRequest)(nil), "etcdserverpb.HashRequest") - proto.RegisterType((*HashKVRequest)(nil), "etcdserverpb.HashKVRequest") - proto.RegisterType((*HashKVResponse)(nil), "etcdserverpb.HashKVResponse") - proto.RegisterType((*HashResponse)(nil), "etcdserverpb.HashResponse") - proto.RegisterType((*SnapshotRequest)(nil), "etcdserverpb.SnapshotRequest") - proto.RegisterType((*SnapshotResponse)(nil), "etcdserverpb.SnapshotResponse") - proto.RegisterType((*WatchRequest)(nil), "etcdserverpb.WatchRequest") - proto.RegisterType((*WatchCreateRequest)(nil), "etcdserverpb.WatchCreateRequest") - proto.RegisterType((*WatchCancelRequest)(nil), "etcdserverpb.WatchCancelRequest") - proto.RegisterType((*WatchResponse)(nil), "etcdserverpb.WatchResponse") - proto.RegisterType((*LeaseGrantRequest)(nil), "etcdserverpb.LeaseGrantRequest") - proto.RegisterType((*LeaseGrantResponse)(nil), "etcdserverpb.LeaseGrantResponse") - proto.RegisterType((*LeaseRevokeRequest)(nil), "etcdserverpb.LeaseRevokeRequest") - proto.RegisterType((*LeaseRevokeResponse)(nil), "etcdserverpb.LeaseRevokeResponse") - proto.RegisterType((*LeaseKeepAliveRequest)(nil), "etcdserverpb.LeaseKeepAliveRequest") - proto.RegisterType((*LeaseKeepAliveResponse)(nil), "etcdserverpb.LeaseKeepAliveResponse") - proto.RegisterType((*LeaseTimeToLiveRequest)(nil), "etcdserverpb.LeaseTimeToLiveRequest") - proto.RegisterType((*LeaseTimeToLiveResponse)(nil), "etcdserverpb.LeaseTimeToLiveResponse") - proto.RegisterType((*LeaseLeasesRequest)(nil), "etcdserverpb.LeaseLeasesRequest") - proto.RegisterType((*LeaseStatus)(nil), "etcdserverpb.LeaseStatus") - proto.RegisterType((*LeaseLeasesResponse)(nil), "etcdserverpb.LeaseLeasesResponse") - proto.RegisterType((*Member)(nil), "etcdserverpb.Member") - proto.RegisterType((*MemberAddRequest)(nil), "etcdserverpb.MemberAddRequest") - proto.RegisterType((*MemberAddResponse)(nil), "etcdserverpb.MemberAddResponse") - proto.RegisterType((*MemberRemoveRequest)(nil), "etcdserverpb.MemberRemoveRequest") - proto.RegisterType((*MemberRemoveResponse)(nil), "etcdserverpb.MemberRemoveResponse") - proto.RegisterType((*MemberUpdateRequest)(nil), "etcdserverpb.MemberUpdateRequest") - proto.RegisterType((*MemberUpdateResponse)(nil), "etcdserverpb.MemberUpdateResponse") - proto.RegisterType((*MemberListRequest)(nil), "etcdserverpb.MemberListRequest") - proto.RegisterType((*MemberListResponse)(nil), "etcdserverpb.MemberListResponse") - proto.RegisterType((*DefragmentRequest)(nil), "etcdserverpb.DefragmentRequest") - proto.RegisterType((*DefragmentResponse)(nil), "etcdserverpb.DefragmentResponse") - proto.RegisterType((*MoveLeaderRequest)(nil), "etcdserverpb.MoveLeaderRequest") - proto.RegisterType((*MoveLeaderResponse)(nil), "etcdserverpb.MoveLeaderResponse") - proto.RegisterType((*AlarmRequest)(nil), "etcdserverpb.AlarmRequest") - proto.RegisterType((*AlarmMember)(nil), "etcdserverpb.AlarmMember") - proto.RegisterType((*AlarmResponse)(nil), "etcdserverpb.AlarmResponse") - proto.RegisterType((*StatusRequest)(nil), "etcdserverpb.StatusRequest") - proto.RegisterType((*StatusResponse)(nil), "etcdserverpb.StatusResponse") - proto.RegisterType((*AuthEnableRequest)(nil), "etcdserverpb.AuthEnableRequest") - proto.RegisterType((*AuthDisableRequest)(nil), "etcdserverpb.AuthDisableRequest") - proto.RegisterType((*AuthenticateRequest)(nil), "etcdserverpb.AuthenticateRequest") - proto.RegisterType((*AuthUserAddRequest)(nil), "etcdserverpb.AuthUserAddRequest") - proto.RegisterType((*AuthUserGetRequest)(nil), "etcdserverpb.AuthUserGetRequest") - proto.RegisterType((*AuthUserDeleteRequest)(nil), "etcdserverpb.AuthUserDeleteRequest") - proto.RegisterType((*AuthUserChangePasswordRequest)(nil), "etcdserverpb.AuthUserChangePasswordRequest") - proto.RegisterType((*AuthUserGrantRoleRequest)(nil), "etcdserverpb.AuthUserGrantRoleRequest") - proto.RegisterType((*AuthUserRevokeRoleRequest)(nil), "etcdserverpb.AuthUserRevokeRoleRequest") - proto.RegisterType((*AuthRoleAddRequest)(nil), "etcdserverpb.AuthRoleAddRequest") - proto.RegisterType((*AuthRoleGetRequest)(nil), "etcdserverpb.AuthRoleGetRequest") - proto.RegisterType((*AuthUserListRequest)(nil), "etcdserverpb.AuthUserListRequest") - proto.RegisterType((*AuthRoleListRequest)(nil), "etcdserverpb.AuthRoleListRequest") - proto.RegisterType((*AuthRoleDeleteRequest)(nil), "etcdserverpb.AuthRoleDeleteRequest") - proto.RegisterType((*AuthRoleGrantPermissionRequest)(nil), "etcdserverpb.AuthRoleGrantPermissionRequest") - proto.RegisterType((*AuthRoleRevokePermissionRequest)(nil), "etcdserverpb.AuthRoleRevokePermissionRequest") - proto.RegisterType((*AuthEnableResponse)(nil), "etcdserverpb.AuthEnableResponse") - proto.RegisterType((*AuthDisableResponse)(nil), "etcdserverpb.AuthDisableResponse") - proto.RegisterType((*AuthenticateResponse)(nil), "etcdserverpb.AuthenticateResponse") - proto.RegisterType((*AuthUserAddResponse)(nil), "etcdserverpb.AuthUserAddResponse") - proto.RegisterType((*AuthUserGetResponse)(nil), "etcdserverpb.AuthUserGetResponse") - proto.RegisterType((*AuthUserDeleteResponse)(nil), "etcdserverpb.AuthUserDeleteResponse") - proto.RegisterType((*AuthUserChangePasswordResponse)(nil), "etcdserverpb.AuthUserChangePasswordResponse") - proto.RegisterType((*AuthUserGrantRoleResponse)(nil), "etcdserverpb.AuthUserGrantRoleResponse") - proto.RegisterType((*AuthUserRevokeRoleResponse)(nil), "etcdserverpb.AuthUserRevokeRoleResponse") - proto.RegisterType((*AuthRoleAddResponse)(nil), "etcdserverpb.AuthRoleAddResponse") - proto.RegisterType((*AuthRoleGetResponse)(nil), "etcdserverpb.AuthRoleGetResponse") - proto.RegisterType((*AuthRoleListResponse)(nil), "etcdserverpb.AuthRoleListResponse") - proto.RegisterType((*AuthUserListResponse)(nil), "etcdserverpb.AuthUserListResponse") - proto.RegisterType((*AuthRoleDeleteResponse)(nil), "etcdserverpb.AuthRoleDeleteResponse") - proto.RegisterType((*AuthRoleGrantPermissionResponse)(nil), "etcdserverpb.AuthRoleGrantPermissionResponse") - proto.RegisterType((*AuthRoleRevokePermissionResponse)(nil), "etcdserverpb.AuthRoleRevokePermissionResponse") - proto.RegisterEnum("etcdserverpb.AlarmType", AlarmType_name, AlarmType_value) - proto.RegisterEnum("etcdserverpb.RangeRequest_SortOrder", RangeRequest_SortOrder_name, RangeRequest_SortOrder_value) - proto.RegisterEnum("etcdserverpb.RangeRequest_SortTarget", RangeRequest_SortTarget_name, RangeRequest_SortTarget_value) - proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value) - proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value) - proto.RegisterEnum("etcdserverpb.WatchCreateRequest_FilterType", WatchCreateRequest_FilterType_name, WatchCreateRequest_FilterType_value) - proto.RegisterEnum("etcdserverpb.AlarmRequest_AlarmAction", AlarmRequest_AlarmAction_name, AlarmRequest_AlarmAction_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for KV service - -type KVClient interface { - // Range gets the keys in the range from the key-value store. - Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) - // Put puts the given key into the key-value store. - // A put request increments the revision of the key-value store - // and generates one event in the event history. - Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) - // DeleteRange deletes the given range from the key-value store. - // A delete request increments the revision of the key-value store - // and generates a delete event in the event history for every deleted key. - DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) - // Txn processes multiple requests in a single transaction. - // A txn request increments the revision of the key-value store - // and generates events with the same revision for every completed request. - // It is not allowed to modify the same key several times within one txn. - Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) - // Compact compacts the event history in the etcd key-value store. The key-value - // store should be periodically compacted or the event history will continue to grow - // indefinitely. - Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) -} - -type kVClient struct { - cc *grpc.ClientConn -} - -func NewKVClient(cc *grpc.ClientConn) KVClient { - return &kVClient{cc} -} - -func (c *kVClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) { - out := new(RangeResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/Range", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { - out := new(PutResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/Put", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) { - out := new(DeleteRangeResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/DeleteRange", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) { - out := new(TxnResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/Txn", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) { - out := new(CompactionResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.KV/Compact", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for KV service - -type KVServer interface { - // Range gets the keys in the range from the key-value store. - Range(context.Context, *RangeRequest) (*RangeResponse, error) - // Put puts the given key into the key-value store. - // A put request increments the revision of the key-value store - // and generates one event in the event history. - Put(context.Context, *PutRequest) (*PutResponse, error) - // DeleteRange deletes the given range from the key-value store. - // A delete request increments the revision of the key-value store - // and generates a delete event in the event history for every deleted key. - DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error) - // Txn processes multiple requests in a single transaction. - // A txn request increments the revision of the key-value store - // and generates events with the same revision for every completed request. - // It is not allowed to modify the same key several times within one txn. - Txn(context.Context, *TxnRequest) (*TxnResponse, error) - // Compact compacts the event history in the etcd key-value store. The key-value - // store should be periodically compacted or the event history will continue to grow - // indefinitely. - Compact(context.Context, *CompactionRequest) (*CompactionResponse, error) -} - -func RegisterKVServer(s *grpc.Server, srv KVServer) { - s.RegisterService(&_KV_serviceDesc, srv) -} - -func _KV_Range_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RangeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).Range(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/Range", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).Range(ctx, req.(*RangeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KV_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).Put(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/Put", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).Put(ctx, req.(*PutRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KV_DeleteRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRangeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).DeleteRange(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/DeleteRange", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).DeleteRange(ctx, req.(*DeleteRangeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KV_Txn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TxnRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).Txn(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/Txn", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).Txn(ctx, req.(*TxnRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KV_Compact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CompactionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVServer).Compact(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.KV/Compact", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).Compact(ctx, req.(*CompactionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _KV_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.KV", - HandlerType: (*KVServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Range", - Handler: _KV_Range_Handler, - }, - { - MethodName: "Put", - Handler: _KV_Put_Handler, - }, - { - MethodName: "DeleteRange", - Handler: _KV_DeleteRange_Handler, - }, - { - MethodName: "Txn", - Handler: _KV_Txn_Handler, - }, - { - MethodName: "Compact", - Handler: _KV_Compact_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "rpc.proto", -} - -// Client API for Watch service - -type WatchClient interface { - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) -} - -type watchClient struct { - cc *grpc.ClientConn -} - -func NewWatchClient(cc *grpc.ClientConn) WatchClient { - return &watchClient{cc} -} - -func (c *watchClient) Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Watch_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Watch/Watch", opts...) - if err != nil { - return nil, err - } - x := &watchWatchClient{stream} - return x, nil -} - -type Watch_WatchClient interface { - Send(*WatchRequest) error - Recv() (*WatchResponse, error) - grpc.ClientStream -} - -type watchWatchClient struct { - grpc.ClientStream -} - -func (x *watchWatchClient) Send(m *WatchRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *watchWatchClient) Recv() (*WatchResponse, error) { - m := new(WatchResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for Watch service - -type WatchServer interface { - // Watch watches for events happening or that have happened. Both input and output - // are streams; the input stream is for creating and canceling watchers and the output - // stream sends events. One watch RPC can watch on multiple key ranges, streaming events - // for several watches at once. The entire event history can be watched starting from the - // last compaction revision. - Watch(Watch_WatchServer) error -} - -func RegisterWatchServer(s *grpc.Server, srv WatchServer) { - s.RegisterService(&_Watch_serviceDesc, srv) -} - -func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(WatchServer).Watch(&watchWatchServer{stream}) -} - -type Watch_WatchServer interface { - Send(*WatchResponse) error - Recv() (*WatchRequest, error) - grpc.ServerStream -} - -type watchWatchServer struct { - grpc.ServerStream -} - -func (x *watchWatchServer) Send(m *WatchResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *watchWatchServer) Recv() (*WatchRequest, error) { - m := new(WatchRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Watch_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Watch", - HandlerType: (*WatchServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Watch", - Handler: _Watch_Watch_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "rpc.proto", -} - -// Client API for Lease service - -type LeaseClient interface { - // LeaseGrant creates a lease which expires if the server does not receive a keepAlive - // within a given time to live period. All keys attached to the lease will be expired and - // deleted if the lease expires. Each expired key generates a delete event in the event history. - LeaseGrant(ctx context.Context, in *LeaseGrantRequest, opts ...grpc.CallOption) (*LeaseGrantResponse, error) - // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. - LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) - // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client - // to the server and streaming keep alive responses from the server to the client. - LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) - // LeaseTimeToLive retrieves lease information. - LeaseTimeToLive(ctx context.Context, in *LeaseTimeToLiveRequest, opts ...grpc.CallOption) (*LeaseTimeToLiveResponse, error) - // LeaseLeases lists all existing leases. - LeaseLeases(ctx context.Context, in *LeaseLeasesRequest, opts ...grpc.CallOption) (*LeaseLeasesResponse, error) -} - -type leaseClient struct { - cc *grpc.ClientConn -} - -func NewLeaseClient(cc *grpc.ClientConn) LeaseClient { - return &leaseClient{cc} -} - -func (c *leaseClient) LeaseGrant(ctx context.Context, in *LeaseGrantRequest, opts ...grpc.CallOption) (*LeaseGrantResponse, error) { - out := new(LeaseGrantResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseGrant", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leaseClient) LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) { - out := new(LeaseRevokeResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseRevoke", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Lease_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Lease/LeaseKeepAlive", opts...) - if err != nil { - return nil, err - } - x := &leaseLeaseKeepAliveClient{stream} - return x, nil -} - -type Lease_LeaseKeepAliveClient interface { - Send(*LeaseKeepAliveRequest) error - Recv() (*LeaseKeepAliveResponse, error) - grpc.ClientStream -} - -type leaseLeaseKeepAliveClient struct { - grpc.ClientStream -} - -func (x *leaseLeaseKeepAliveClient) Send(m *LeaseKeepAliveRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *leaseLeaseKeepAliveClient) Recv() (*LeaseKeepAliveResponse, error) { - m := new(LeaseKeepAliveResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *leaseClient) LeaseTimeToLive(ctx context.Context, in *LeaseTimeToLiveRequest, opts ...grpc.CallOption) (*LeaseTimeToLiveResponse, error) { - out := new(LeaseTimeToLiveResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseTimeToLive", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *leaseClient) LeaseLeases(ctx context.Context, in *LeaseLeasesRequest, opts ...grpc.CallOption) (*LeaseLeasesResponse, error) { - out := new(LeaseLeasesResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseLeases", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Lease service - -type LeaseServer interface { - // LeaseGrant creates a lease which expires if the server does not receive a keepAlive - // within a given time to live period. All keys attached to the lease will be expired and - // deleted if the lease expires. Each expired key generates a delete event in the event history. - LeaseGrant(context.Context, *LeaseGrantRequest) (*LeaseGrantResponse, error) - // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. - LeaseRevoke(context.Context, *LeaseRevokeRequest) (*LeaseRevokeResponse, error) - // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client - // to the server and streaming keep alive responses from the server to the client. - LeaseKeepAlive(Lease_LeaseKeepAliveServer) error - // LeaseTimeToLive retrieves lease information. - LeaseTimeToLive(context.Context, *LeaseTimeToLiveRequest) (*LeaseTimeToLiveResponse, error) - // LeaseLeases lists all existing leases. - LeaseLeases(context.Context, *LeaseLeasesRequest) (*LeaseLeasesResponse, error) -} - -func RegisterLeaseServer(s *grpc.Server, srv LeaseServer) { - s.RegisterService(&_Lease_serviceDesc, srv) -} - -func _Lease_LeaseGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseGrantRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeaseServer).LeaseGrant(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Lease/LeaseGrant", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeaseServer).LeaseGrant(ctx, req.(*LeaseGrantRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lease_LeaseRevoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseRevokeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeaseServer).LeaseRevoke(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Lease/LeaseRevoke", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeaseServer).LeaseRevoke(ctx, req.(*LeaseRevokeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lease_LeaseKeepAlive_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(LeaseServer).LeaseKeepAlive(&leaseLeaseKeepAliveServer{stream}) -} - -type Lease_LeaseKeepAliveServer interface { - Send(*LeaseKeepAliveResponse) error - Recv() (*LeaseKeepAliveRequest, error) - grpc.ServerStream -} - -type leaseLeaseKeepAliveServer struct { - grpc.ServerStream -} - -func (x *leaseLeaseKeepAliveServer) Send(m *LeaseKeepAliveResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *leaseLeaseKeepAliveServer) Recv() (*LeaseKeepAliveRequest, error) { - m := new(LeaseKeepAliveRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Lease_LeaseTimeToLive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseTimeToLiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeaseServer).LeaseTimeToLive(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Lease/LeaseTimeToLive", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeaseServer).LeaseTimeToLive(ctx, req.(*LeaseTimeToLiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Lease_LeaseLeases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LeaseLeasesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LeaseServer).LeaseLeases(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Lease/LeaseLeases", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LeaseServer).LeaseLeases(ctx, req.(*LeaseLeasesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Lease_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Lease", - HandlerType: (*LeaseServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "LeaseGrant", - Handler: _Lease_LeaseGrant_Handler, - }, - { - MethodName: "LeaseRevoke", - Handler: _Lease_LeaseRevoke_Handler, - }, - { - MethodName: "LeaseTimeToLive", - Handler: _Lease_LeaseTimeToLive_Handler, - }, - { - MethodName: "LeaseLeases", - Handler: _Lease_LeaseLeases_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "LeaseKeepAlive", - Handler: _Lease_LeaseKeepAlive_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "rpc.proto", -} - -// Client API for Cluster service - -type ClusterClient interface { - // MemberAdd adds a member into the cluster. - MemberAdd(ctx context.Context, in *MemberAddRequest, opts ...grpc.CallOption) (*MemberAddResponse, error) - // MemberRemove removes an existing member from the cluster. - MemberRemove(ctx context.Context, in *MemberRemoveRequest, opts ...grpc.CallOption) (*MemberRemoveResponse, error) - // MemberUpdate updates the member configuration. - MemberUpdate(ctx context.Context, in *MemberUpdateRequest, opts ...grpc.CallOption) (*MemberUpdateResponse, error) - // MemberList lists all the members in the cluster. - MemberList(ctx context.Context, in *MemberListRequest, opts ...grpc.CallOption) (*MemberListResponse, error) -} - -type clusterClient struct { - cc *grpc.ClientConn -} - -func NewClusterClient(cc *grpc.ClientConn) ClusterClient { - return &clusterClient{cc} -} - -func (c *clusterClient) MemberAdd(ctx context.Context, in *MemberAddRequest, opts ...grpc.CallOption) (*MemberAddResponse, error) { - out := new(MemberAddResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberAdd", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterClient) MemberRemove(ctx context.Context, in *MemberRemoveRequest, opts ...grpc.CallOption) (*MemberRemoveResponse, error) { - out := new(MemberRemoveResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberRemove", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterClient) MemberUpdate(ctx context.Context, in *MemberUpdateRequest, opts ...grpc.CallOption) (*MemberUpdateResponse, error) { - out := new(MemberUpdateResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberUpdate", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *clusterClient) MemberList(ctx context.Context, in *MemberListRequest, opts ...grpc.CallOption) (*MemberListResponse, error) { - out := new(MemberListResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberList", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Cluster service - -type ClusterServer interface { - // MemberAdd adds a member into the cluster. - MemberAdd(context.Context, *MemberAddRequest) (*MemberAddResponse, error) - // MemberRemove removes an existing member from the cluster. - MemberRemove(context.Context, *MemberRemoveRequest) (*MemberRemoveResponse, error) - // MemberUpdate updates the member configuration. - MemberUpdate(context.Context, *MemberUpdateRequest) (*MemberUpdateResponse, error) - // MemberList lists all the members in the cluster. - MemberList(context.Context, *MemberListRequest) (*MemberListResponse, error) -} - -func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { - s.RegisterService(&_Cluster_serviceDesc, srv) -} - -func _Cluster_MemberAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberAddRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberAdd(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberAdd", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberAdd(ctx, req.(*MemberAddRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cluster_MemberRemove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberRemoveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberRemove(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberRemove", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberRemove(ctx, req.(*MemberRemoveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cluster_MemberUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberUpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberUpdate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberUpdate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberUpdate(ctx, req.(*MemberUpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cluster_MemberList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MemberListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ClusterServer).MemberList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Cluster/MemberList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ClusterServer).MemberList(ctx, req.(*MemberListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Cluster_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Cluster", - HandlerType: (*ClusterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "MemberAdd", - Handler: _Cluster_MemberAdd_Handler, - }, - { - MethodName: "MemberRemove", - Handler: _Cluster_MemberRemove_Handler, - }, - { - MethodName: "MemberUpdate", - Handler: _Cluster_MemberUpdate_Handler, - }, - { - MethodName: "MemberList", - Handler: _Cluster_MemberList_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "rpc.proto", -} - -// Client API for Maintenance service - -type MaintenanceClient interface { - // Alarm activates, deactivates, and queries alarms regarding cluster health. - Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) - // Status gets the status of the member. - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) - // Defragment defragments a member's backend database to recover storage space. - Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error) - // Hash computes the hash of the KV's backend. - // This is designed for testing; do not use this in production when there - // are ongoing transactions. - Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error) - // HashKV computes the hash of all MVCC keys up to a given revision. - HashKV(ctx context.Context, in *HashKVRequest, opts ...grpc.CallOption) (*HashKVResponse, error) - // Snapshot sends a snapshot of the entire backend from a member over a stream to a client. - Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error) - // MoveLeader requests current leader node to transfer its leadership to transferee. - MoveLeader(ctx context.Context, in *MoveLeaderRequest, opts ...grpc.CallOption) (*MoveLeaderResponse, error) -} - -type maintenanceClient struct { - cc *grpc.ClientConn -} - -func NewMaintenanceClient(cc *grpc.ClientConn) MaintenanceClient { - return &maintenanceClient{cc} -} - -func (c *maintenanceClient) Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) { - out := new(AlarmResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Alarm", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - out := new(StatusResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Status", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error) { - out := new(DefragmentResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Defragment", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error) { - out := new(HashResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Hash", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) HashKV(ctx context.Context, in *HashKVRequest, opts ...grpc.CallOption) (*HashKVResponse, error) { - out := new(HashKVResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/HashKV", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *maintenanceClient) Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Maintenance_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Maintenance/Snapshot", opts...) - if err != nil { - return nil, err - } - x := &maintenanceSnapshotClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Maintenance_SnapshotClient interface { - Recv() (*SnapshotResponse, error) - grpc.ClientStream -} - -type maintenanceSnapshotClient struct { - grpc.ClientStream -} - -func (x *maintenanceSnapshotClient) Recv() (*SnapshotResponse, error) { - m := new(SnapshotResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *maintenanceClient) MoveLeader(ctx context.Context, in *MoveLeaderRequest, opts ...grpc.CallOption) (*MoveLeaderResponse, error) { - out := new(MoveLeaderResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/MoveLeader", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Maintenance service - -type MaintenanceServer interface { - // Alarm activates, deactivates, and queries alarms regarding cluster health. - Alarm(context.Context, *AlarmRequest) (*AlarmResponse, error) - // Status gets the status of the member. - Status(context.Context, *StatusRequest) (*StatusResponse, error) - // Defragment defragments a member's backend database to recover storage space. - Defragment(context.Context, *DefragmentRequest) (*DefragmentResponse, error) - // Hash computes the hash of the KV's backend. - // This is designed for testing; do not use this in production when there - // are ongoing transactions. - Hash(context.Context, *HashRequest) (*HashResponse, error) - // HashKV computes the hash of all MVCC keys up to a given revision. - HashKV(context.Context, *HashKVRequest) (*HashKVResponse, error) - // Snapshot sends a snapshot of the entire backend from a member over a stream to a client. - Snapshot(*SnapshotRequest, Maintenance_SnapshotServer) error - // MoveLeader requests current leader node to transfer its leadership to transferee. - MoveLeader(context.Context, *MoveLeaderRequest) (*MoveLeaderResponse, error) -} - -func RegisterMaintenanceServer(s *grpc.Server, srv MaintenanceServer) { - s.RegisterService(&_Maintenance_serviceDesc, srv) -} - -func _Maintenance_Alarm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AlarmRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Alarm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Alarm", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Alarm(ctx, req.(*AlarmRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Status", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Status(ctx, req.(*StatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Defragment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DefragmentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Defragment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Defragment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Defragment(ctx, req.(*DefragmentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Hash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).Hash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/Hash", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).Hash(ctx, req.(*HashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_HashKV_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HashKVRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).HashKV(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/HashKV", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).HashKV(ctx, req.(*HashKVRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Maintenance_Snapshot_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SnapshotRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(MaintenanceServer).Snapshot(m, &maintenanceSnapshotServer{stream}) -} - -type Maintenance_SnapshotServer interface { - Send(*SnapshotResponse) error - grpc.ServerStream -} - -type maintenanceSnapshotServer struct { - grpc.ServerStream -} - -func (x *maintenanceSnapshotServer) Send(m *SnapshotResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Maintenance_MoveLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MoveLeaderRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MaintenanceServer).MoveLeader(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Maintenance/MoveLeader", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MaintenanceServer).MoveLeader(ctx, req.(*MoveLeaderRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Maintenance_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Maintenance", - HandlerType: (*MaintenanceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Alarm", - Handler: _Maintenance_Alarm_Handler, - }, - { - MethodName: "Status", - Handler: _Maintenance_Status_Handler, - }, - { - MethodName: "Defragment", - Handler: _Maintenance_Defragment_Handler, - }, - { - MethodName: "Hash", - Handler: _Maintenance_Hash_Handler, - }, - { - MethodName: "HashKV", - Handler: _Maintenance_HashKV_Handler, - }, - { - MethodName: "MoveLeader", - Handler: _Maintenance_MoveLeader_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Snapshot", - Handler: _Maintenance_Snapshot_Handler, - ServerStreams: true, - }, - }, - Metadata: "rpc.proto", -} - -// Client API for Auth service - -type AuthClient interface { - // AuthEnable enables authentication. - AuthEnable(ctx context.Context, in *AuthEnableRequest, opts ...grpc.CallOption) (*AuthEnableResponse, error) - // AuthDisable disables authentication. - AuthDisable(ctx context.Context, in *AuthDisableRequest, opts ...grpc.CallOption) (*AuthDisableResponse, error) - // Authenticate processes an authenticate request. - Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) - // UserAdd adds a new user. - UserAdd(ctx context.Context, in *AuthUserAddRequest, opts ...grpc.CallOption) (*AuthUserAddResponse, error) - // UserGet gets detailed user information. - UserGet(ctx context.Context, in *AuthUserGetRequest, opts ...grpc.CallOption) (*AuthUserGetResponse, error) - // UserList gets a list of all users. - UserList(ctx context.Context, in *AuthUserListRequest, opts ...grpc.CallOption) (*AuthUserListResponse, error) - // UserDelete deletes a specified user. - UserDelete(ctx context.Context, in *AuthUserDeleteRequest, opts ...grpc.CallOption) (*AuthUserDeleteResponse, error) - // UserChangePassword changes the password of a specified user. - UserChangePassword(ctx context.Context, in *AuthUserChangePasswordRequest, opts ...grpc.CallOption) (*AuthUserChangePasswordResponse, error) - // UserGrant grants a role to a specified user. - UserGrantRole(ctx context.Context, in *AuthUserGrantRoleRequest, opts ...grpc.CallOption) (*AuthUserGrantRoleResponse, error) - // UserRevokeRole revokes a role of specified user. - UserRevokeRole(ctx context.Context, in *AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (*AuthUserRevokeRoleResponse, error) - // RoleAdd adds a new role. - RoleAdd(ctx context.Context, in *AuthRoleAddRequest, opts ...grpc.CallOption) (*AuthRoleAddResponse, error) - // RoleGet gets detailed role information. - RoleGet(ctx context.Context, in *AuthRoleGetRequest, opts ...grpc.CallOption) (*AuthRoleGetResponse, error) - // RoleList gets lists of all roles. - RoleList(ctx context.Context, in *AuthRoleListRequest, opts ...grpc.CallOption) (*AuthRoleListResponse, error) - // RoleDelete deletes a specified role. - RoleDelete(ctx context.Context, in *AuthRoleDeleteRequest, opts ...grpc.CallOption) (*AuthRoleDeleteResponse, error) - // RoleGrantPermission grants a permission of a specified key or range to a specified role. - RoleGrantPermission(ctx context.Context, in *AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (*AuthRoleGrantPermissionResponse, error) - // RoleRevokePermission revokes a key or range permission of a specified role. - RoleRevokePermission(ctx context.Context, in *AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (*AuthRoleRevokePermissionResponse, error) -} - -type authClient struct { - cc *grpc.ClientConn -} - -func NewAuthClient(cc *grpc.ClientConn) AuthClient { - return &authClient{cc} -} - -func (c *authClient) AuthEnable(ctx context.Context, in *AuthEnableRequest, opts ...grpc.CallOption) (*AuthEnableResponse, error) { - out := new(AuthEnableResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/AuthEnable", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) AuthDisable(ctx context.Context, in *AuthDisableRequest, opts ...grpc.CallOption) (*AuthDisableResponse, error) { - out := new(AuthDisableResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/AuthDisable", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) { - out := new(AuthenticateResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/Authenticate", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserAdd(ctx context.Context, in *AuthUserAddRequest, opts ...grpc.CallOption) (*AuthUserAddResponse, error) { - out := new(AuthUserAddResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserAdd", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserGet(ctx context.Context, in *AuthUserGetRequest, opts ...grpc.CallOption) (*AuthUserGetResponse, error) { - out := new(AuthUserGetResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserGet", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserList(ctx context.Context, in *AuthUserListRequest, opts ...grpc.CallOption) (*AuthUserListResponse, error) { - out := new(AuthUserListResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserList", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserDelete(ctx context.Context, in *AuthUserDeleteRequest, opts ...grpc.CallOption) (*AuthUserDeleteResponse, error) { - out := new(AuthUserDeleteResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserDelete", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserChangePassword(ctx context.Context, in *AuthUserChangePasswordRequest, opts ...grpc.CallOption) (*AuthUserChangePasswordResponse, error) { - out := new(AuthUserChangePasswordResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserChangePassword", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserGrantRole(ctx context.Context, in *AuthUserGrantRoleRequest, opts ...grpc.CallOption) (*AuthUserGrantRoleResponse, error) { - out := new(AuthUserGrantRoleResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserGrantRole", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) UserRevokeRole(ctx context.Context, in *AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (*AuthUserRevokeRoleResponse, error) { - out := new(AuthUserRevokeRoleResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserRevokeRole", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleAdd(ctx context.Context, in *AuthRoleAddRequest, opts ...grpc.CallOption) (*AuthRoleAddResponse, error) { - out := new(AuthRoleAddResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleAdd", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleGet(ctx context.Context, in *AuthRoleGetRequest, opts ...grpc.CallOption) (*AuthRoleGetResponse, error) { - out := new(AuthRoleGetResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleGet", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleList(ctx context.Context, in *AuthRoleListRequest, opts ...grpc.CallOption) (*AuthRoleListResponse, error) { - out := new(AuthRoleListResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleList", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleDelete(ctx context.Context, in *AuthRoleDeleteRequest, opts ...grpc.CallOption) (*AuthRoleDeleteResponse, error) { - out := new(AuthRoleDeleteResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleDelete", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleGrantPermission(ctx context.Context, in *AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (*AuthRoleGrantPermissionResponse, error) { - out := new(AuthRoleGrantPermissionResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleGrantPermission", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) RoleRevokePermission(ctx context.Context, in *AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (*AuthRoleRevokePermissionResponse, error) { - out := new(AuthRoleRevokePermissionResponse) - err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleRevokePermission", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Auth service - -type AuthServer interface { - // AuthEnable enables authentication. - AuthEnable(context.Context, *AuthEnableRequest) (*AuthEnableResponse, error) - // AuthDisable disables authentication. - AuthDisable(context.Context, *AuthDisableRequest) (*AuthDisableResponse, error) - // Authenticate processes an authenticate request. - Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error) - // UserAdd adds a new user. - UserAdd(context.Context, *AuthUserAddRequest) (*AuthUserAddResponse, error) - // UserGet gets detailed user information. - UserGet(context.Context, *AuthUserGetRequest) (*AuthUserGetResponse, error) - // UserList gets a list of all users. - UserList(context.Context, *AuthUserListRequest) (*AuthUserListResponse, error) - // UserDelete deletes a specified user. - UserDelete(context.Context, *AuthUserDeleteRequest) (*AuthUserDeleteResponse, error) - // UserChangePassword changes the password of a specified user. - UserChangePassword(context.Context, *AuthUserChangePasswordRequest) (*AuthUserChangePasswordResponse, error) - // UserGrant grants a role to a specified user. - UserGrantRole(context.Context, *AuthUserGrantRoleRequest) (*AuthUserGrantRoleResponse, error) - // UserRevokeRole revokes a role of specified user. - UserRevokeRole(context.Context, *AuthUserRevokeRoleRequest) (*AuthUserRevokeRoleResponse, error) - // RoleAdd adds a new role. - RoleAdd(context.Context, *AuthRoleAddRequest) (*AuthRoleAddResponse, error) - // RoleGet gets detailed role information. - RoleGet(context.Context, *AuthRoleGetRequest) (*AuthRoleGetResponse, error) - // RoleList gets lists of all roles. - RoleList(context.Context, *AuthRoleListRequest) (*AuthRoleListResponse, error) - // RoleDelete deletes a specified role. - RoleDelete(context.Context, *AuthRoleDeleteRequest) (*AuthRoleDeleteResponse, error) - // RoleGrantPermission grants a permission of a specified key or range to a specified role. - RoleGrantPermission(context.Context, *AuthRoleGrantPermissionRequest) (*AuthRoleGrantPermissionResponse, error) - // RoleRevokePermission revokes a key or range permission of a specified role. - RoleRevokePermission(context.Context, *AuthRoleRevokePermissionRequest) (*AuthRoleRevokePermissionResponse, error) -} - -func RegisterAuthServer(s *grpc.Server, srv AuthServer) { - s.RegisterService(&_Auth_serviceDesc, srv) -} - -func _Auth_AuthEnable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthEnableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).AuthEnable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/AuthEnable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).AuthEnable(ctx, req.(*AuthEnableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_AuthDisable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthDisableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).AuthDisable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/AuthDisable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).AuthDisable(ctx, req.(*AuthDisableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthenticateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).Authenticate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/Authenticate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).Authenticate(ctx, req.(*AuthenticateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserAddRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserAdd(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserAdd", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserAdd(ctx, req.(*AuthUserAddRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserGetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserGet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserGet", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserGet(ctx, req.(*AuthUserGetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserList(ctx, req.(*AuthUserListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserDeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserDelete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserDelete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserDelete(ctx, req.(*AuthUserDeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserChangePasswordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserChangePassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserChangePassword", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserChangePassword(ctx, req.(*AuthUserChangePasswordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserGrantRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserGrantRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserGrantRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserGrantRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserGrantRole(ctx, req.(*AuthUserGrantRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_UserRevokeRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthUserRevokeRoleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).UserRevokeRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/UserRevokeRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).UserRevokeRole(ctx, req.(*AuthUserRevokeRoleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleAddRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleAdd(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleAdd", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleAdd(ctx, req.(*AuthRoleAddRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleGetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleGet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleGet", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleGet(ctx, req.(*AuthRoleGetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleList(ctx, req.(*AuthRoleListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleDeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleDelete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleDelete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleDelete(ctx, req.(*AuthRoleDeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleGrantPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleGrantPermissionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleGrantPermission(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleGrantPermission", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleGrantPermission(ctx, req.(*AuthRoleGrantPermissionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_RoleRevokePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthRoleRevokePermissionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).RoleRevokePermission(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/etcdserverpb.Auth/RoleRevokePermission", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).RoleRevokePermission(ctx, req.(*AuthRoleRevokePermissionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Auth_serviceDesc = grpc.ServiceDesc{ - ServiceName: "etcdserverpb.Auth", - HandlerType: (*AuthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AuthEnable", - Handler: _Auth_AuthEnable_Handler, - }, - { - MethodName: "AuthDisable", - Handler: _Auth_AuthDisable_Handler, - }, - { - MethodName: "Authenticate", - Handler: _Auth_Authenticate_Handler, - }, - { - MethodName: "UserAdd", - Handler: _Auth_UserAdd_Handler, - }, - { - MethodName: "UserGet", - Handler: _Auth_UserGet_Handler, - }, - { - MethodName: "UserList", - Handler: _Auth_UserList_Handler, - }, - { - MethodName: "UserDelete", - Handler: _Auth_UserDelete_Handler, - }, - { - MethodName: "UserChangePassword", - Handler: _Auth_UserChangePassword_Handler, - }, - { - MethodName: "UserGrantRole", - Handler: _Auth_UserGrantRole_Handler, - }, - { - MethodName: "UserRevokeRole", - Handler: _Auth_UserRevokeRole_Handler, - }, - { - MethodName: "RoleAdd", - Handler: _Auth_RoleAdd_Handler, - }, - { - MethodName: "RoleGet", - Handler: _Auth_RoleGet_Handler, - }, - { - MethodName: "RoleList", - Handler: _Auth_RoleList_Handler, - }, - { - MethodName: "RoleDelete", - Handler: _Auth_RoleDelete_Handler, - }, - { - MethodName: "RoleGrantPermission", - Handler: _Auth_RoleGrantPermission_Handler, - }, - { - MethodName: "RoleRevokePermission", - Handler: _Auth_RoleRevokePermission_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "rpc.proto", -} - -func (m *ResponseHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ClusterId != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ClusterId)) - } - if m.MemberId != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MemberId)) - } - if m.Revision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) - } - if m.RaftTerm != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) - } - return i, nil -} - -func (m *RangeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RangeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) - } - if m.Limit != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) - } - if m.Revision != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) - } - if m.SortOrder != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.SortOrder)) - } - if m.SortTarget != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.SortTarget)) - } - if m.Serializable { - dAtA[i] = 0x38 - i++ - if m.Serializable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.KeysOnly { - dAtA[i] = 0x40 - i++ - if m.KeysOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.CountOnly { - dAtA[i] = 0x48 - i++ - if m.CountOnly { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.MinModRevision != 0 { - dAtA[i] = 0x50 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MinModRevision)) - } - if m.MaxModRevision != 0 { - dAtA[i] = 0x58 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MaxModRevision)) - } - if m.MinCreateRevision != 0 { - dAtA[i] = 0x60 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MinCreateRevision)) - } - if m.MaxCreateRevision != 0 { - dAtA[i] = 0x68 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MaxCreateRevision)) - } - return i, nil -} - -func (m *RangeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RangeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n1, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if len(m.Kvs) > 0 { - for _, msg := range m.Kvs { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.More { - dAtA[i] = 0x18 - i++ - if m.More { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Count != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Count)) - } - return i, nil -} - -func (m *PutRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PutRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if len(m.Value) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) - } - if m.Lease != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) - } - if m.PrevKv { - dAtA[i] = 0x20 - i++ - if m.PrevKv { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.IgnoreValue { - dAtA[i] = 0x28 - i++ - if m.IgnoreValue { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.IgnoreLease { - dAtA[i] = 0x30 - i++ - if m.IgnoreLease { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - return i, nil -} - -func (m *PutResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PutResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n2, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.PrevKv != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.PrevKv.Size())) - n3, err := m.PrevKv.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 - } - return i, nil -} - -func (m *DeleteRangeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteRangeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) - } - if m.PrevKv { - dAtA[i] = 0x18 - i++ - if m.PrevKv { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - return i, nil -} - -func (m *DeleteRangeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DeleteRangeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n4, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.Deleted != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Deleted)) - } - if len(m.PrevKvs) > 0 { - for _, msg := range m.PrevKvs { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *RequestOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RequestOp) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Request != nil { - nn5, err := m.Request.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn5 - } - return i, nil -} - -func (m *RequestOp_RequestRange) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.RequestRange != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RequestRange.Size())) - n6, err := m.RequestRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - } - return i, nil -} -func (m *RequestOp_RequestPut) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.RequestPut != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RequestPut.Size())) - n7, err := m.RequestPut.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n7 - } - return i, nil -} -func (m *RequestOp_RequestDeleteRange) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.RequestDeleteRange != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RequestDeleteRange.Size())) - n8, err := m.RequestDeleteRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n8 - } - return i, nil -} -func (m *RequestOp_RequestTxn) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.RequestTxn != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RequestTxn.Size())) - n9, err := m.RequestTxn.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 - } - return i, nil -} -func (m *ResponseOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResponseOp) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Response != nil { - nn10, err := m.Response.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn10 - } - return i, nil -} - -func (m *ResponseOp_ResponseRange) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.ResponseRange != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ResponseRange.Size())) - n11, err := m.ResponseRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n11 - } - return i, nil -} -func (m *ResponseOp_ResponsePut) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.ResponsePut != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ResponsePut.Size())) - n12, err := m.ResponsePut.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 - } - return i, nil -} -func (m *ResponseOp_ResponseDeleteRange) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.ResponseDeleteRange != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ResponseDeleteRange.Size())) - n13, err := m.ResponseDeleteRange.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 - } - return i, nil -} -func (m *ResponseOp_ResponseTxn) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.ResponseTxn != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ResponseTxn.Size())) - n14, err := m.ResponseTxn.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 - } - return i, nil -} -func (m *Compare) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Compare) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Result != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Result)) - } - if m.Target != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Target)) - } - if len(m.Key) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if m.TargetUnion != nil { - nn15, err := m.TargetUnion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn15 - } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x4 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) - } - return i, nil -} - -func (m *Compare_Version) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Version)) - return i, nil -} -func (m *Compare_CreateRevision) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x28 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CreateRevision)) - return i, nil -} -func (m *Compare_ModRevision) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x30 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ModRevision)) - return i, nil -} -func (m *Compare_Value) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.Value != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) - } - return i, nil -} -func (m *Compare_Lease) MarshalTo(dAtA []byte) (int, error) { - i := 0 - dAtA[i] = 0x40 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) - return i, nil -} -func (m *TxnRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TxnRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Compare) > 0 { - for _, msg := range m.Compare { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Success) > 0 { - for _, msg := range m.Success { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Failure) > 0 { - for _, msg := range m.Failure { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *TxnResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TxnResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n16, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if m.Succeeded { - dAtA[i] = 0x10 - i++ - if m.Succeeded { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if len(m.Responses) > 0 { - for _, msg := range m.Responses { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *CompactionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CompactionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Revision != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) - } - if m.Physical { - dAtA[i] = 0x10 - i++ - if m.Physical { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - return i, nil -} - -func (m *CompactionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CompactionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n17, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n17 - } - return i, nil -} - -func (m *HashRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *HashKVRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashKVRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Revision != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) - } - return i, nil -} - -func (m *HashKVResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashKVResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n18, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n18 - } - if m.Hash != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Hash)) - } - if m.CompactRevision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) - } - return i, nil -} - -func (m *HashResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n19, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n19 - } - if m.Hash != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Hash)) - } - return i, nil -} - -func (m *SnapshotRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *SnapshotResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n20, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n20 - } - if m.RemainingBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RemainingBytes)) - } - if len(m.Blob) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Blob))) - i += copy(dAtA[i:], m.Blob) - } - return i, nil -} - -func (m *WatchRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.RequestUnion != nil { - nn21, err := m.RequestUnion.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn21 - } - return i, nil -} - -func (m *WatchRequest_CreateRequest) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.CreateRequest != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CreateRequest.Size())) - n22, err := m.CreateRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n22 - } - return i, nil -} -func (m *WatchRequest_CancelRequest) MarshalTo(dAtA []byte) (int, error) { - i := 0 - if m.CancelRequest != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CancelRequest.Size())) - n23, err := m.CancelRequest.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n23 - } - return i, nil -} -func (m *WatchCreateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchCreateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) - } - if m.StartRevision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.StartRevision)) - } - if m.ProgressNotify { - dAtA[i] = 0x20 - i++ - if m.ProgressNotify { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if len(m.Filters) > 0 { - dAtA25 := make([]byte, len(m.Filters)*10) - var j24 int - for _, num := range m.Filters { - for num >= 1<<7 { - dAtA25[j24] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j24++ - } - dAtA25[j24] = uint8(num) - j24++ - } - dAtA[i] = 0x2a - i++ - i = encodeVarintRpc(dAtA, i, uint64(j24)) - i += copy(dAtA[i:], dAtA25[:j24]) - } - if m.PrevKv { - dAtA[i] = 0x30 - i++ - if m.PrevKv { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - return i, nil -} - -func (m *WatchCancelRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchCancelRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.WatchId != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) - } - return i, nil -} - -func (m *WatchResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WatchResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n26, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n26 - } - if m.WatchId != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) - } - if m.Created { - dAtA[i] = 0x18 - i++ - if m.Created { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.Canceled { - dAtA[i] = 0x20 - i++ - if m.Canceled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.CompactRevision != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) - } - if len(m.CancelReason) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.CancelReason))) - i += copy(dAtA[i:], m.CancelReason) - } - if len(m.Events) > 0 { - for _, msg := range m.Events { - dAtA[i] = 0x5a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *LeaseGrantRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseGrantRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.TTL != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) - } - if m.ID != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - return i, nil -} - -func (m *LeaseGrantResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseGrantResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n27, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n27 - } - if m.ID != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - if m.TTL != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) - } - if len(m.Error) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Error))) - i += copy(dAtA[i:], m.Error) - } - return i, nil -} - -func (m *LeaseRevokeRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseRevokeRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - return i, nil -} - -func (m *LeaseRevokeResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseRevokeResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n28, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n28 - } - return i, nil -} - -func (m *LeaseKeepAliveRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseKeepAliveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - return i, nil -} - -func (m *LeaseKeepAliveResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseKeepAliveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n29, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if m.ID != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - if m.TTL != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) - } - return i, nil -} - -func (m *LeaseTimeToLiveRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseTimeToLiveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - if m.Keys { - dAtA[i] = 0x10 - i++ - if m.Keys { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - return i, nil -} - -func (m *LeaseTimeToLiveResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseTimeToLiveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n30, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n30 - } - if m.ID != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - if m.TTL != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) - } - if m.GrantedTTL != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.GrantedTTL)) - } - if len(m.Keys) > 0 { - for _, b := range m.Keys { - dAtA[i] = 0x2a - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(b))) - i += copy(dAtA[i:], b) - } - } - return i, nil -} - -func (m *LeaseLeasesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseLeasesRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *LeaseStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseStatus) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - return i, nil -} - -func (m *LeaseLeasesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseLeasesResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n31, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n31 - } - if len(m.Leases) > 0 { - for _, msg := range m.Leases { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *Member) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Member) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - if len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.ClientURLs) > 0 { - for _, s := range m.ClientURLs { - dAtA[i] = 0x22 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *MemberAddRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberAddRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *MemberAddResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberAddResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n32, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n32 - } - if m.Member != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Member.Size())) - n33, err := m.Member.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n33 - } - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *MemberRemoveRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberRemoveRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - return i, nil -} - -func (m *MemberRemoveResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberRemoveResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n34, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n34 - } - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *MemberUpdateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberUpdateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.ID)) - } - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *MemberUpdateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberUpdateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n35, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n35 - } - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *MemberListRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberListRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *MemberListResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MemberListResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n36, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n36 - } - if len(m.Members) > 0 { - for _, msg := range m.Members { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *DefragmentRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DefragmentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *DefragmentResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DefragmentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n37, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n37 - } - return i, nil -} - -func (m *MoveLeaderRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MoveLeaderRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.TargetID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.TargetID)) - } - return i, nil -} - -func (m *MoveLeaderResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MoveLeaderResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n38, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n38 - } - return i, nil -} - -func (m *AlarmRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AlarmRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Action != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Action)) - } - if m.MemberID != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) - } - if m.Alarm != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) - } - return i, nil -} - -func (m *AlarmMember) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AlarmMember) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.MemberID != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) - } - if m.Alarm != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) - } - return i, nil -} - -func (m *AlarmResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AlarmResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n39, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n39 - } - if len(m.Alarms) > 0 { - for _, msg := range m.Alarms { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *StatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *StatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n40, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n40 - } - if len(m.Version) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) - i += copy(dAtA[i:], m.Version) - } - if m.DbSize != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.DbSize)) - } - if m.Leader != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Leader)) - } - if m.RaftIndex != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RaftIndex)) - } - if m.RaftTerm != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) - } - return i, nil -} - -func (m *AuthEnableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthEnableRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *AuthDisableRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthDisableRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *AuthenticateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthenticateRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) - } - return i, nil -} - -func (m *AuthUserAddRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserAddRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) - } - return i, nil -} - -func (m *AuthUserGetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserGetRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - return i, nil -} - -func (m *AuthUserDeleteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserDeleteRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - return i, nil -} - -func (m *AuthUserChangePasswordRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserChangePasswordRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Password) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) - i += copy(dAtA[i:], m.Password) - } - return i, nil -} - -func (m *AuthUserGrantRoleRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserGrantRoleRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.User) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.User))) - i += copy(dAtA[i:], m.User) - } - if len(m.Role) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) - } - return i, nil -} - -func (m *AuthUserRevokeRoleRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserRevokeRoleRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Role) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) - } - return i, nil -} - -func (m *AuthRoleAddRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleAddRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - return i, nil -} - -func (m *AuthRoleGetRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleGetRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Role) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) - } - return i, nil -} - -func (m *AuthUserListRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserListRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *AuthRoleListRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleListRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *AuthRoleDeleteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleDeleteRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Role) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) - } - return i, nil -} - -func (m *AuthRoleGrantPermissionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleGrantPermissionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.Perm != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Perm.Size())) - n41, err := m.Perm.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n41 - } - return i, nil -} - -func (m *AuthRoleRevokePermissionRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleRevokePermissionRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Role) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) - i += copy(dAtA[i:], m.Role) - } - if len(m.Key) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if len(m.RangeEnd) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) - i += copy(dAtA[i:], m.RangeEnd) - } - return i, nil -} - -func (m *AuthEnableResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthEnableResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n42, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n42 - } - return i, nil -} - -func (m *AuthDisableResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthDisableResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n43, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n43 - } - return i, nil -} - -func (m *AuthenticateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthenticateResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n44, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n44 - } - if len(m.Token) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(len(m.Token))) - i += copy(dAtA[i:], m.Token) - } - return i, nil -} - -func (m *AuthUserAddResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserAddResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n45, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n45 - } - return i, nil -} - -func (m *AuthUserGetResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserGetResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n46, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n46 - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *AuthUserDeleteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserDeleteResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n47, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n47 - } - return i, nil -} - -func (m *AuthUserChangePasswordResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserChangePasswordResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n48, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n48 - } - return i, nil -} - -func (m *AuthUserGrantRoleResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserGrantRoleResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n49, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n49 - } - return i, nil -} - -func (m *AuthUserRevokeRoleResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserRevokeRoleResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n50, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n50 - } - return i, nil -} - -func (m *AuthRoleAddResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleAddResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n51, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n51 - } - return i, nil -} - -func (m *AuthRoleGetResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleGetResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n52, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n52 - } - if len(m.Perm) > 0 { - for _, msg := range m.Perm { - dAtA[i] = 0x12 - i++ - i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - return i, nil -} - -func (m *AuthRoleListResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleListResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n53, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n53 - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *AuthUserListResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthUserListResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n54, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n54 - } - if len(m.Users) > 0 { - for _, s := range m.Users { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *AuthRoleDeleteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleDeleteResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n55, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n55 - } - return i, nil -} - -func (m *AuthRoleGrantPermissionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleGrantPermissionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n56, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n56 - } - return i, nil -} - -func (m *AuthRoleRevokePermissionResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthRoleRevokePermissionResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Header != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) - n57, err := m.Header.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n57 - } - return i, nil -} - -func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *ResponseHeader) Size() (n int) { - var l int - _ = l - if m.ClusterId != 0 { - n += 1 + sovRpc(uint64(m.ClusterId)) - } - if m.MemberId != 0 { - n += 1 + sovRpc(uint64(m.MemberId)) - } - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.RaftTerm != 0 { - n += 1 + sovRpc(uint64(m.RaftTerm)) - } - return n -} - -func (m *RangeRequest) Size() (n int) { - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Limit != 0 { - n += 1 + sovRpc(uint64(m.Limit)) - } - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.SortOrder != 0 { - n += 1 + sovRpc(uint64(m.SortOrder)) - } - if m.SortTarget != 0 { - n += 1 + sovRpc(uint64(m.SortTarget)) - } - if m.Serializable { - n += 2 - } - if m.KeysOnly { - n += 2 - } - if m.CountOnly { - n += 2 - } - if m.MinModRevision != 0 { - n += 1 + sovRpc(uint64(m.MinModRevision)) - } - if m.MaxModRevision != 0 { - n += 1 + sovRpc(uint64(m.MaxModRevision)) - } - if m.MinCreateRevision != 0 { - n += 1 + sovRpc(uint64(m.MinCreateRevision)) - } - if m.MaxCreateRevision != 0 { - n += 1 + sovRpc(uint64(m.MaxCreateRevision)) - } - return n -} - -func (m *RangeResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Kvs) > 0 { - for _, e := range m.Kvs { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if m.More { - n += 2 - } - if m.Count != 0 { - n += 1 + sovRpc(uint64(m.Count)) - } - return n -} - -func (m *PutRequest) Size() (n int) { - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Lease != 0 { - n += 1 + sovRpc(uint64(m.Lease)) - } - if m.PrevKv { - n += 2 - } - if m.IgnoreValue { - n += 2 - } - if m.IgnoreLease { - n += 2 - } - return n -} - -func (m *PutResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.PrevKv != nil { - l = m.PrevKv.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *DeleteRangeRequest) Size() (n int) { - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.PrevKv { - n += 2 - } - return n -} - -func (m *DeleteRangeResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Deleted != 0 { - n += 1 + sovRpc(uint64(m.Deleted)) - } - if len(m.PrevKvs) > 0 { - for _, e := range m.PrevKvs { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *RequestOp) Size() (n int) { - var l int - _ = l - if m.Request != nil { - n += m.Request.Size() - } - return n -} - -func (m *RequestOp_RequestRange) Size() (n int) { - var l int - _ = l - if m.RequestRange != nil { - l = m.RequestRange.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *RequestOp_RequestPut) Size() (n int) { - var l int - _ = l - if m.RequestPut != nil { - l = m.RequestPut.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *RequestOp_RequestDeleteRange) Size() (n int) { - var l int - _ = l - if m.RequestDeleteRange != nil { - l = m.RequestDeleteRange.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *RequestOp_RequestTxn) Size() (n int) { - var l int - _ = l - if m.RequestTxn != nil { - l = m.RequestTxn.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp) Size() (n int) { - var l int - _ = l - if m.Response != nil { - n += m.Response.Size() - } - return n -} - -func (m *ResponseOp_ResponseRange) Size() (n int) { - var l int - _ = l - if m.ResponseRange != nil { - l = m.ResponseRange.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp_ResponsePut) Size() (n int) { - var l int - _ = l - if m.ResponsePut != nil { - l = m.ResponsePut.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp_ResponseDeleteRange) Size() (n int) { - var l int - _ = l - if m.ResponseDeleteRange != nil { - l = m.ResponseDeleteRange.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *ResponseOp_ResponseTxn) Size() (n int) { - var l int - _ = l - if m.ResponseTxn != nil { - l = m.ResponseTxn.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *Compare) Size() (n int) { - var l int - _ = l - if m.Result != 0 { - n += 1 + sovRpc(uint64(m.Result)) - } - if m.Target != 0 { - n += 1 + sovRpc(uint64(m.Target)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.TargetUnion != nil { - n += m.TargetUnion.Size() - } - l = len(m.RangeEnd) - if l > 0 { - n += 2 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *Compare_Version) Size() (n int) { - var l int - _ = l - n += 1 + sovRpc(uint64(m.Version)) - return n -} -func (m *Compare_CreateRevision) Size() (n int) { - var l int - _ = l - n += 1 + sovRpc(uint64(m.CreateRevision)) - return n -} -func (m *Compare_ModRevision) Size() (n int) { - var l int - _ = l - n += 1 + sovRpc(uint64(m.ModRevision)) - return n -} -func (m *Compare_Value) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(m.Value) - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *Compare_Lease) Size() (n int) { - var l int - _ = l - n += 1 + sovRpc(uint64(m.Lease)) - return n -} -func (m *TxnRequest) Size() (n int) { - var l int - _ = l - if len(m.Compare) > 0 { - for _, e := range m.Compare { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.Success) > 0 { - for _, e := range m.Success { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.Failure) > 0 { - for _, e := range m.Failure { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *TxnResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Succeeded { - n += 2 - } - if len(m.Responses) > 0 { - for _, e := range m.Responses { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *CompactionRequest) Size() (n int) { - var l int - _ = l - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - if m.Physical { - n += 2 - } - return n -} - -func (m *CompactionResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *HashRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *HashKVRequest) Size() (n int) { - var l int - _ = l - if m.Revision != 0 { - n += 1 + sovRpc(uint64(m.Revision)) - } - return n -} - -func (m *HashKVResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Hash != 0 { - n += 1 + sovRpc(uint64(m.Hash)) - } - if m.CompactRevision != 0 { - n += 1 + sovRpc(uint64(m.CompactRevision)) - } - return n -} - -func (m *HashResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Hash != 0 { - n += 1 + sovRpc(uint64(m.Hash)) - } - return n -} - -func (m *SnapshotRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *SnapshotResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.RemainingBytes != 0 { - n += 1 + sovRpc(uint64(m.RemainingBytes)) - } - l = len(m.Blob) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *WatchRequest) Size() (n int) { - var l int - _ = l - if m.RequestUnion != nil { - n += m.RequestUnion.Size() - } - return n -} - -func (m *WatchRequest_CreateRequest) Size() (n int) { - var l int - _ = l - if m.CreateRequest != nil { - l = m.CreateRequest.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *WatchRequest_CancelRequest) Size() (n int) { - var l int - _ = l - if m.CancelRequest != nil { - l = m.CancelRequest.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} -func (m *WatchCreateRequest) Size() (n int) { - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.StartRevision != 0 { - n += 1 + sovRpc(uint64(m.StartRevision)) - } - if m.ProgressNotify { - n += 2 - } - if len(m.Filters) > 0 { - l = 0 - for _, e := range m.Filters { - l += sovRpc(uint64(e)) - } - n += 1 + sovRpc(uint64(l)) + l - } - if m.PrevKv { - n += 2 - } - return n -} - -func (m *WatchCancelRequest) Size() (n int) { - var l int - _ = l - if m.WatchId != 0 { - n += 1 + sovRpc(uint64(m.WatchId)) - } - return n -} - -func (m *WatchResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.WatchId != 0 { - n += 1 + sovRpc(uint64(m.WatchId)) - } - if m.Created { - n += 2 - } - if m.Canceled { - n += 2 - } - if m.CompactRevision != 0 { - n += 1 + sovRpc(uint64(m.CompactRevision)) - } - l = len(m.CancelReason) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *LeaseGrantRequest) Size() (n int) { - var l int - _ = l - if m.TTL != 0 { - n += 1 + sovRpc(uint64(m.TTL)) - } - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - return n -} - -func (m *LeaseGrantResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.TTL != 0 { - n += 1 + sovRpc(uint64(m.TTL)) - } - l = len(m.Error) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *LeaseRevokeRequest) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - return n -} - -func (m *LeaseRevokeResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *LeaseKeepAliveRequest) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - return n -} - -func (m *LeaseKeepAliveResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.TTL != 0 { - n += 1 + sovRpc(uint64(m.TTL)) - } - return n -} - -func (m *LeaseTimeToLiveRequest) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.Keys { - n += 2 - } - return n -} - -func (m *LeaseTimeToLiveResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if m.TTL != 0 { - n += 1 + sovRpc(uint64(m.TTL)) - } - if m.GrantedTTL != 0 { - n += 1 + sovRpc(uint64(m.GrantedTTL)) - } - if len(m.Keys) > 0 { - for _, b := range m.Keys { - l = len(b) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *LeaseLeasesRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *LeaseStatus) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - return n -} - -func (m *LeaseLeasesResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Leases) > 0 { - for _, e := range m.Leases { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *Member) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - if len(m.ClientURLs) > 0 { - for _, s := range m.ClientURLs { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *MemberAddRequest) Size() (n int) { - var l int - _ = l - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *MemberAddResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if m.Member != nil { - l = m.Member.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *MemberRemoveRequest) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - return n -} - -func (m *MemberRemoveResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *MemberUpdateRequest) Size() (n int) { - var l int - _ = l - if m.ID != 0 { - n += 1 + sovRpc(uint64(m.ID)) - } - if len(m.PeerURLs) > 0 { - for _, s := range m.PeerURLs { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *MemberUpdateResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *MemberListRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *MemberListResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Members) > 0 { - for _, e := range m.Members { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *DefragmentRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *DefragmentResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *MoveLeaderRequest) Size() (n int) { - var l int - _ = l - if m.TargetID != 0 { - n += 1 + sovRpc(uint64(m.TargetID)) - } - return n -} - -func (m *MoveLeaderResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AlarmRequest) Size() (n int) { - var l int - _ = l - if m.Action != 0 { - n += 1 + sovRpc(uint64(m.Action)) - } - if m.MemberID != 0 { - n += 1 + sovRpc(uint64(m.MemberID)) - } - if m.Alarm != 0 { - n += 1 + sovRpc(uint64(m.Alarm)) - } - return n -} - -func (m *AlarmMember) Size() (n int) { - var l int - _ = l - if m.MemberID != 0 { - n += 1 + sovRpc(uint64(m.MemberID)) - } - if m.Alarm != 0 { - n += 1 + sovRpc(uint64(m.Alarm)) - } - return n -} - -func (m *AlarmResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Alarms) > 0 { - for _, e := range m.Alarms { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *StatusRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *StatusResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.DbSize != 0 { - n += 1 + sovRpc(uint64(m.DbSize)) - } - if m.Leader != 0 { - n += 1 + sovRpc(uint64(m.Leader)) - } - if m.RaftIndex != 0 { - n += 1 + sovRpc(uint64(m.RaftIndex)) - } - if m.RaftTerm != 0 { - n += 1 + sovRpc(uint64(m.RaftTerm)) - } - return n -} - -func (m *AuthEnableRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *AuthDisableRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *AuthenticateRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserAddRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserGetRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserDeleteRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserChangePasswordRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Password) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserGrantRoleRequest) Size() (n int) { - var l int - _ = l - l = len(m.User) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserRevokeRoleRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthRoleAddRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthRoleGetRequest) Size() (n int) { - var l int - _ = l - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserListRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *AuthRoleListRequest) Size() (n int) { - var l int - _ = l - return n -} - -func (m *AuthRoleDeleteRequest) Size() (n int) { - var l int - _ = l - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthRoleGrantPermissionRequest) Size() (n int) { - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - if m.Perm != nil { - l = m.Perm.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthRoleRevokePermissionRequest) Size() (n int) { - var l int - _ = l - l = len(m.Role) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.RangeEnd) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthEnableResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthDisableResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthenticateResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - l = len(m.Token) - if l > 0 { - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserAddResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserGetResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *AuthUserDeleteResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserChangePasswordResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserGrantRoleResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthUserRevokeRoleResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthRoleAddResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthRoleGetResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Perm) > 0 { - for _, e := range m.Perm { - l = e.Size() - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *AuthRoleListResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Roles) > 0 { - for _, s := range m.Roles { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *AuthUserListResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - if len(m.Users) > 0 { - for _, s := range m.Users { - l = len(s) - n += 1 + l + sovRpc(uint64(l)) - } - } - return n -} - -func (m *AuthRoleDeleteResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthRoleGrantPermissionResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func (m *AuthRoleRevokePermissionResponse) Size() (n int) { - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovRpc(uint64(l)) - } - return n -} - -func sovRpc(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozRpc(x uint64) (n int) { - return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ResponseHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType) - } - m.ClusterId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ClusterId |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType) - } - m.MemberId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemberId |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - m.Revision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) - } - m.RaftTerm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftTerm |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RangeRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RangeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - m.Revision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SortOrder", wireType) - } - m.SortOrder = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SortOrder |= (RangeRequest_SortOrder(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SortTarget", wireType) - } - m.SortTarget = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SortTarget |= (RangeRequest_SortTarget(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Serializable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Serializable = bool(v != 0) - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeysOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.KeysOnly = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CountOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CountOnly = bool(v != 0) - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinModRevision", wireType) - } - m.MinModRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinModRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxModRevision", wireType) - } - m.MaxModRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxModRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinCreateRevision", wireType) - } - m.MinCreateRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinCreateRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxCreateRevision", wireType) - } - m.MaxCreateRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxCreateRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RangeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RangeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kvs = append(m.Kvs, &mvccpb.KeyValue{}) - if err := m.Kvs[len(m.Kvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.More = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PutRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PutRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PutRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) - } - m.Lease = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Lease |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.PrevKv = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IgnoreValue", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.IgnoreValue = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IgnoreLease", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.IgnoreLease = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PutResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PutResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PutResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PrevKv == nil { - m.PrevKv = &mvccpb.KeyValue{} - } - if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteRangeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteRangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.PrevKv = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DeleteRangeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteRangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType) - } - m.Deleted = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Deleted |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKvs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrevKvs = append(m.PrevKvs, &mvccpb.KeyValue{}) - if err := m.PrevKvs[len(m.PrevKvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RequestOp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RequestOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RequestOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RangeRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestRange{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PutRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestPut{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DeleteRangeRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestDeleteRange{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestTxn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TxnRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Request = &RequestOp_RequestTxn{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResponseOp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResponseOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &RangeResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponseRange{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PutResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponsePut{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DeleteRangeResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponseDeleteRange{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseTxn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TxnResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Response = &ResponseOp_ResponseTxn{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Compare) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Compare: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Compare: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - m.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Result |= (Compare_CompareResult(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) - } - m.Target = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.TargetUnion = &Compare_Version{v} - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.TargetUnion = &Compare_CreateRevision{v} - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.TargetUnion = &Compare_ModRevision{v} - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.TargetUnion = &Compare_Value{v} - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.TargetUnion = &Compare_Lease{v} - case 64: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TxnRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TxnRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxnRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Compare = append(m.Compare, &Compare{}) - if err := m.Compare[len(m.Compare)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Success = append(m.Success, &RequestOp{}) - if err := m.Success[len(m.Success)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Failure = append(m.Failure, &RequestOp{}) - if err := m.Failure[len(m.Failure)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TxnResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TxnResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxnResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Succeeded = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Responses = append(m.Responses, &ResponseOp{}) - if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CompactionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CompactionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CompactionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - m.Revision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Physical", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Physical = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CompactionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CompactionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CompactionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashKVRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashKVRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashKVRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - m.Revision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Revision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashKVResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashKVResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashKVResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - m.Hash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Hash |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) - } - m.CompactRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CompactRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - m.Hash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Hash |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RemainingBytes", wireType) - } - m.RemainingBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RemainingBytes |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Blob", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Blob = append(m.Blob[:0], dAtA[iNdEx:postIndex]...) - if m.Blob == nil { - m.Blob = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchCreateRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RequestUnion = &WatchRequest_CreateRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CancelRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &WatchCancelRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.RequestUnion = &WatchRequest_CancelRequest{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchCreateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchCreateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) - if m.RangeEnd == nil { - m.RangeEnd = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartRevision", wireType) - } - m.StartRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProgressNotify", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ProgressNotify = bool(v != 0) - case 5: - if wireType == 0 { - var v WatchCreateRequest_FilterType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Filters = append(m.Filters, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + packedLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - for iNdEx < postIndex { - var v WatchCreateRequest_FilterType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Filters = append(m.Filters, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.PrevKv = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchCancelRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchCancelRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) - } - m.WatchId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.WatchId |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WatchResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WatchResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) - } - m.WatchId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.WatchId |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Created = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Canceled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Canceled = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) - } - m.CompactRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CompactRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CancelReason", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CancelReason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, &mvccpb.Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseGrantRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseGrantRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseGrantResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseGrantResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseRevokeRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseRevokeRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseRevokeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseRevokeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseKeepAliveRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseKeepAliveRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseKeepAliveResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseKeepAliveResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseTimeToLiveRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseTimeToLiveRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Keys = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseTimeToLiveResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseTimeToLiveResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) - } - m.TTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GrantedTTL", wireType) - } - m.GrantedTTL = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GrantedTTL |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) - copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseLeasesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseLeasesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseLeasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseStatus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseLeasesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseLeasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Leases", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Leases = append(m.Leases, &LeaseStatus{}) - if err := m.Leases[len(m.Leases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Member) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Member: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientURLs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientURLs = append(m.ClientURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberAddRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberAddResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Member", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Member == nil { - m.Member = &Member{} - } - if err := m.Member.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberRemoveRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberRemoveRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberRemoveResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberRemoveResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberUpdateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberUpdateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberListRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MemberListResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MemberListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MemberListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Members = append(m.Members, &Member{}) - if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DefragmentRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DefragmentRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefragmentRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DefragmentResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefragmentResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MoveLeaderRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MoveLeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetID", wireType) - } - m.TargetID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TargetID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MoveLeaderResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MoveLeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AlarmRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AlarmRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - m.Action = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Action |= (AlarmRequest_AlarmAction(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) - } - m.MemberID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemberID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) - } - m.Alarm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Alarm |= (AlarmType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AlarmMember) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AlarmMember: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmMember: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) - } - m.MemberID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MemberID |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) - } - m.Alarm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Alarm |= (AlarmType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AlarmResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AlarmResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AlarmResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Alarms", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Alarms = append(m.Alarms, &AlarmMember{}) - if err := m.Alarms[len(m.Alarms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DbSize", wireType) - } - m.DbSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DbSize |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) - } - m.Leader = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Leader |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) - } - m.RaftIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftIndex |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) - } - m.RaftTerm = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RaftTerm |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthEnableRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthEnableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthEnableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthDisableRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthDisableRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthDisableRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthenticateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthenticateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserAddRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserGetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserDeleteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserChangePasswordRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserChangePasswordRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Password = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserGrantRoleRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGrantRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.User = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserRevokeRoleRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserRevokeRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleAddRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserListRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleListRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleListRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleDeleteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Perm == nil { - m.Perm = &authpb.Permission{} - } - if err := m.Perm.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Role = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RangeEnd = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthEnableResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthEnableResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthDisableResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthDisableResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthenticateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthenticateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Token = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserAddResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserGetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserDeleteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserChangePasswordResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserChangePasswordResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserGrantRoleResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserGrantRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserRevokeRoleResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserRevokeRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleAddResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Perm = append(m.Perm, &authpb.Permission{}) - if err := m.Perm[len(m.Perm)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthUserListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthUserListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Users = append(m.Users, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleDeleteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &ResponseHeader{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRpc(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthRpc - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRpc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRpc(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("rpc.proto", fileDescriptorRpc) } - -var fileDescriptorRpc = []byte{ - // 3669 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x5b, 0x5b, 0x6f, 0x23, 0xc7, - 0x72, 0xd6, 0x90, 0x22, 0x29, 0x16, 0x2f, 0xe2, 0xb6, 0xb4, 0xbb, 0x14, 0x77, 0x57, 0xab, 0xed, - 0xbd, 0x69, 0x2f, 0x16, 0x6d, 0xd9, 0xc9, 0xc3, 0x26, 0x30, 0xac, 0x95, 0xe8, 0x95, 0x2c, 0xad, - 0x24, 0x8f, 0xa8, 0xb5, 0x03, 0x38, 0x11, 0x46, 0x64, 0x4b, 0x62, 0x44, 0xce, 0x30, 0x33, 0x43, - 0xae, 0xb4, 0x31, 0x12, 0xc0, 0x71, 0x82, 0xbc, 0xe4, 0x25, 0x06, 0x82, 0xc4, 0xaf, 0x41, 0x60, - 0xf8, 0x07, 0x04, 0xf9, 0x0b, 0x41, 0x5e, 0x12, 0x20, 0x7f, 0xe0, 0xc0, 0xe7, 0xbc, 0x9c, 0x5f, - 0x70, 0x2e, 0x4f, 0x07, 0x7d, 0x9b, 0xe9, 0xb9, 0x51, 0xb2, 0x69, 0xfb, 0x45, 0x3b, 0x5d, 0x5d, - 0x5d, 0x55, 0x5d, 0xdd, 0x55, 0xd5, 0xfd, 0x35, 0x17, 0xf2, 0x76, 0xbf, 0xb5, 0xd4, 0xb7, 0x2d, - 0xd7, 0x42, 0x45, 0xe2, 0xb6, 0xda, 0x0e, 0xb1, 0x87, 0xc4, 0xee, 0x1f, 0xd6, 0x66, 0x8f, 0xad, - 0x63, 0x8b, 0x75, 0xd4, 0xe9, 0x17, 0xe7, 0xa9, 0xcd, 0x51, 0x9e, 0x7a, 0x6f, 0xd8, 0x6a, 0xb1, - 0x3f, 0xfd, 0xc3, 0xfa, 0xe9, 0x50, 0x74, 0xdd, 0x60, 0x5d, 0xc6, 0xc0, 0x3d, 0x61, 0x7f, 0xfa, - 0x87, 0xec, 0x1f, 0xd1, 0x79, 0xf3, 0xd8, 0xb2, 0x8e, 0xbb, 0xa4, 0x6e, 0xf4, 0x3b, 0x75, 0xc3, - 0x34, 0x2d, 0xd7, 0x70, 0x3b, 0x96, 0xe9, 0xf0, 0x5e, 0xfc, 0xf7, 0x1a, 0x94, 0x75, 0xe2, 0xf4, - 0x2d, 0xd3, 0x21, 0xeb, 0xc4, 0x68, 0x13, 0x1b, 0xdd, 0x02, 0x68, 0x75, 0x07, 0x8e, 0x4b, 0xec, - 0x83, 0x4e, 0xbb, 0xaa, 0x2d, 0x68, 0x8b, 0x93, 0x7a, 0x5e, 0x50, 0x36, 0xda, 0xe8, 0x06, 0xe4, - 0x7b, 0xa4, 0x77, 0xc8, 0x7b, 0x53, 0xac, 0x77, 0x8a, 0x13, 0x36, 0xda, 0xa8, 0x06, 0x53, 0x36, - 0x19, 0x76, 0x9c, 0x8e, 0x65, 0x56, 0xd3, 0x0b, 0xda, 0x62, 0x5a, 0xf7, 0xda, 0x74, 0xa0, 0x6d, - 0x1c, 0xb9, 0x07, 0x2e, 0xb1, 0x7b, 0xd5, 0x49, 0x3e, 0x90, 0x12, 0x9a, 0xc4, 0xee, 0xe1, 0x2f, - 0x33, 0x50, 0xd4, 0x0d, 0xf3, 0x98, 0xe8, 0xe4, 0xaf, 0x06, 0xc4, 0x71, 0x51, 0x05, 0xd2, 0xa7, - 0xe4, 0x9c, 0xa9, 0x2f, 0xea, 0xf4, 0x93, 0x8f, 0x37, 0x8f, 0xc9, 0x01, 0x31, 0xb9, 0xe2, 0x22, - 0x1d, 0x6f, 0x1e, 0x93, 0x86, 0xd9, 0x46, 0xb3, 0x90, 0xe9, 0x76, 0x7a, 0x1d, 0x57, 0x68, 0xe5, - 0x8d, 0x80, 0x39, 0x93, 0x21, 0x73, 0x56, 0x01, 0x1c, 0xcb, 0x76, 0x0f, 0x2c, 0xbb, 0x4d, 0xec, - 0x6a, 0x66, 0x41, 0x5b, 0x2c, 0x2f, 0xdf, 0x5b, 0x52, 0x17, 0x62, 0x49, 0x35, 0x68, 0x69, 0xcf, - 0xb2, 0xdd, 0x1d, 0xca, 0xab, 0xe7, 0x1d, 0xf9, 0x89, 0x3e, 0x84, 0x02, 0x13, 0xe2, 0x1a, 0xf6, - 0x31, 0x71, 0xab, 0x59, 0x26, 0xe5, 0xfe, 0x05, 0x52, 0x9a, 0x8c, 0x59, 0x67, 0xea, 0xf9, 0x37, - 0xc2, 0x50, 0x74, 0x88, 0xdd, 0x31, 0xba, 0x9d, 0x37, 0xc6, 0x61, 0x97, 0x54, 0x73, 0x0b, 0xda, - 0xe2, 0x94, 0x1e, 0xa0, 0xd1, 0xf9, 0x9f, 0x92, 0x73, 0xe7, 0xc0, 0x32, 0xbb, 0xe7, 0xd5, 0x29, - 0xc6, 0x30, 0x45, 0x09, 0x3b, 0x66, 0xf7, 0x9c, 0x2d, 0x9a, 0x35, 0x30, 0x5d, 0xde, 0x9b, 0x67, - 0xbd, 0x79, 0x46, 0x61, 0xdd, 0x8b, 0x50, 0xe9, 0x75, 0xcc, 0x83, 0x9e, 0xd5, 0x3e, 0xf0, 0x1c, - 0x02, 0xcc, 0x21, 0xe5, 0x5e, 0xc7, 0x7c, 0x69, 0xb5, 0x75, 0xe9, 0x16, 0xca, 0x69, 0x9c, 0x05, - 0x39, 0x0b, 0x82, 0xd3, 0x38, 0x53, 0x39, 0x97, 0x60, 0x86, 0xca, 0x6c, 0xd9, 0xc4, 0x70, 0x89, - 0xcf, 0x5c, 0x64, 0xcc, 0x57, 0x7a, 0x1d, 0x73, 0x95, 0xf5, 0x04, 0xf8, 0x8d, 0xb3, 0x08, 0x7f, - 0x49, 0xf0, 0x1b, 0x67, 0x41, 0x7e, 0xbc, 0x04, 0x79, 0xcf, 0xe7, 0x68, 0x0a, 0x26, 0xb7, 0x77, - 0xb6, 0x1b, 0x95, 0x09, 0x04, 0x90, 0x5d, 0xd9, 0x5b, 0x6d, 0x6c, 0xaf, 0x55, 0x34, 0x54, 0x80, - 0xdc, 0x5a, 0x83, 0x37, 0x52, 0xf8, 0x39, 0x80, 0xef, 0x5d, 0x94, 0x83, 0xf4, 0x66, 0xe3, 0xcf, - 0x2a, 0x13, 0x94, 0xe7, 0x55, 0x43, 0xdf, 0xdb, 0xd8, 0xd9, 0xae, 0x68, 0x74, 0xf0, 0xaa, 0xde, - 0x58, 0x69, 0x36, 0x2a, 0x29, 0xca, 0xf1, 0x72, 0x67, 0xad, 0x92, 0x46, 0x79, 0xc8, 0xbc, 0x5a, - 0xd9, 0xda, 0x6f, 0x54, 0x26, 0xf1, 0x57, 0x1a, 0x94, 0xc4, 0x7a, 0xf1, 0x98, 0x40, 0xef, 0x41, - 0xf6, 0x84, 0xc5, 0x05, 0xdb, 0x8a, 0x85, 0xe5, 0x9b, 0xa1, 0xc5, 0x0d, 0xc4, 0x8e, 0x2e, 0x78, - 0x11, 0x86, 0xf4, 0xe9, 0xd0, 0xa9, 0xa6, 0x16, 0xd2, 0x8b, 0x85, 0xe5, 0xca, 0x12, 0x0f, 0xd8, - 0xa5, 0x4d, 0x72, 0xfe, 0xca, 0xe8, 0x0e, 0x88, 0x4e, 0x3b, 0x11, 0x82, 0xc9, 0x9e, 0x65, 0x13, - 0xb6, 0x63, 0xa7, 0x74, 0xf6, 0x4d, 0xb7, 0x31, 0x5b, 0x34, 0xb1, 0x5b, 0x79, 0x03, 0x7f, 0xab, - 0x01, 0xec, 0x0e, 0xdc, 0xe4, 0xd0, 0x98, 0x85, 0xcc, 0x90, 0x0a, 0x16, 0x61, 0xc1, 0x1b, 0x2c, - 0x26, 0x88, 0xe1, 0x10, 0x2f, 0x26, 0x68, 0x03, 0x5d, 0x87, 0x5c, 0xdf, 0x26, 0xc3, 0x83, 0xd3, - 0x21, 0x53, 0x32, 0xa5, 0x67, 0x69, 0x73, 0x73, 0x88, 0xee, 0x40, 0xb1, 0x73, 0x6c, 0x5a, 0x36, - 0x39, 0xe0, 0xb2, 0x32, 0xac, 0xb7, 0xc0, 0x69, 0xcc, 0x6e, 0x85, 0x85, 0x0b, 0xce, 0xaa, 0x2c, - 0x5b, 0x94, 0x84, 0x4d, 0x28, 0x30, 0x53, 0xc7, 0x72, 0xdf, 0x23, 0xdf, 0xc6, 0x14, 0x1b, 0x16, - 0x75, 0xa1, 0xb0, 0x1a, 0x7f, 0x06, 0x68, 0x8d, 0x74, 0x89, 0x4b, 0xc6, 0xc9, 0x1e, 0x8a, 0x4f, - 0xd2, 0xaa, 0x4f, 0xf0, 0x3f, 0x6b, 0x30, 0x13, 0x10, 0x3f, 0xd6, 0xb4, 0xaa, 0x90, 0x6b, 0x33, - 0x61, 0xdc, 0x82, 0xb4, 0x2e, 0x9b, 0xe8, 0x09, 0x4c, 0x09, 0x03, 0x9c, 0x6a, 0x3a, 0x61, 0xd3, - 0xe4, 0xb8, 0x4d, 0x0e, 0xfe, 0x36, 0x05, 0x79, 0x31, 0xd1, 0x9d, 0x3e, 0x5a, 0x81, 0x92, 0xcd, - 0x1b, 0x07, 0x6c, 0x3e, 0xc2, 0xa2, 0x5a, 0x72, 0x12, 0x5a, 0x9f, 0xd0, 0x8b, 0x62, 0x08, 0x23, - 0xa3, 0x3f, 0x81, 0x82, 0x14, 0xd1, 0x1f, 0xb8, 0xc2, 0xe5, 0xd5, 0xa0, 0x00, 0x7f, 0xff, 0xad, - 0x4f, 0xe8, 0x20, 0xd8, 0x77, 0x07, 0x2e, 0x6a, 0xc2, 0xac, 0x1c, 0xcc, 0x67, 0x23, 0xcc, 0x48, - 0x33, 0x29, 0x0b, 0x41, 0x29, 0xd1, 0xa5, 0x5a, 0x9f, 0xd0, 0x91, 0x18, 0xaf, 0x74, 0xaa, 0x26, - 0xb9, 0x67, 0x3c, 0x79, 0x47, 0x4c, 0x6a, 0x9e, 0x99, 0x51, 0x93, 0x9a, 0x67, 0xe6, 0xf3, 0x3c, - 0xe4, 0x44, 0x0b, 0xff, 0x57, 0x0a, 0x40, 0xae, 0xc6, 0x4e, 0x1f, 0xad, 0x41, 0xd9, 0x16, 0xad, - 0x80, 0xb7, 0x6e, 0xc4, 0x7a, 0x4b, 0x2c, 0xe2, 0x84, 0x5e, 0x92, 0x83, 0xb8, 0x71, 0xef, 0x43, - 0xd1, 0x93, 0xe2, 0x3b, 0x6c, 0x2e, 0xc6, 0x61, 0x9e, 0x84, 0x82, 0x1c, 0x40, 0x5d, 0xf6, 0x09, - 0x5c, 0xf5, 0xc6, 0xc7, 0xf8, 0xec, 0xce, 0x08, 0x9f, 0x79, 0x02, 0x67, 0xa4, 0x04, 0xd5, 0x6b, - 0xaa, 0x61, 0xbe, 0xdb, 0xe6, 0x62, 0xdc, 0x16, 0x35, 0x8c, 0x3a, 0x0e, 0x68, 0xbd, 0xe4, 0x4d, - 0xfc, 0xeb, 0x34, 0xe4, 0x56, 0xad, 0x5e, 0xdf, 0xb0, 0xe9, 0x6a, 0x64, 0x6d, 0xe2, 0x0c, 0xba, - 0x2e, 0x73, 0x57, 0x79, 0xf9, 0x6e, 0x50, 0xa2, 0x60, 0x93, 0xff, 0xea, 0x8c, 0x55, 0x17, 0x43, - 0xe8, 0x60, 0x51, 0x1e, 0x53, 0x97, 0x18, 0x2c, 0x8a, 0xa3, 0x18, 0x22, 0x03, 0x39, 0xed, 0x07, - 0x72, 0x0d, 0x72, 0x43, 0x62, 0xfb, 0x25, 0x7d, 0x7d, 0x42, 0x97, 0x04, 0xf4, 0x08, 0xa6, 0xc3, - 0xe5, 0x25, 0x23, 0x78, 0xca, 0xad, 0x60, 0x35, 0xba, 0x0b, 0xc5, 0x40, 0x8d, 0xcb, 0x0a, 0xbe, - 0x42, 0x4f, 0x29, 0x71, 0xd7, 0x64, 0x5e, 0xa5, 0xf5, 0xb8, 0xb8, 0x3e, 0x21, 0x33, 0xeb, 0x35, - 0x99, 0x59, 0xa7, 0xc4, 0x28, 0x91, 0x5b, 0x03, 0x49, 0xe6, 0x83, 0x60, 0x92, 0xc1, 0x1f, 0x40, - 0x29, 0xe0, 0x20, 0x5a, 0x77, 0x1a, 0x1f, 0xef, 0xaf, 0x6c, 0xf1, 0x22, 0xf5, 0x82, 0xd5, 0x25, - 0xbd, 0xa2, 0xd1, 0x5a, 0xb7, 0xd5, 0xd8, 0xdb, 0xab, 0xa4, 0x50, 0x09, 0xf2, 0xdb, 0x3b, 0xcd, - 0x03, 0xce, 0x95, 0xc6, 0x2f, 0x3c, 0x09, 0xa2, 0xc8, 0x29, 0xb5, 0x6d, 0x42, 0xa9, 0x6d, 0x9a, - 0xac, 0x6d, 0x29, 0xbf, 0xb6, 0xb1, 0x32, 0xb7, 0xd5, 0x58, 0xd9, 0x6b, 0x54, 0x26, 0x9f, 0x97, - 0xa1, 0xc8, 0xfd, 0x7b, 0x30, 0x30, 0x69, 0xa9, 0xfd, 0x77, 0x0d, 0xc0, 0x8f, 0x26, 0x54, 0x87, - 0x5c, 0x8b, 0xeb, 0xa9, 0x6a, 0x2c, 0x19, 0x5d, 0x8d, 0x5d, 0x32, 0x5d, 0x72, 0xa1, 0x77, 0x20, - 0xe7, 0x0c, 0x5a, 0x2d, 0xe2, 0xc8, 0x92, 0x77, 0x3d, 0x9c, 0x0f, 0x45, 0xb6, 0xd2, 0x25, 0x1f, - 0x1d, 0x72, 0x64, 0x74, 0xba, 0x03, 0x56, 0x00, 0x47, 0x0f, 0x11, 0x7c, 0xf8, 0xdf, 0x34, 0x28, - 0x28, 0x9b, 0xf7, 0x07, 0x26, 0xe1, 0x9b, 0x90, 0x67, 0x36, 0x90, 0xb6, 0x48, 0xc3, 0x53, 0xba, - 0x4f, 0x40, 0x7f, 0x0c, 0x79, 0x19, 0x01, 0x32, 0x13, 0x57, 0xe3, 0xc5, 0xee, 0xf4, 0x75, 0x9f, - 0x15, 0x6f, 0xc2, 0x15, 0xe6, 0x95, 0x16, 0x3d, 0x5c, 0x4b, 0x3f, 0xaa, 0xc7, 0x4f, 0x2d, 0x74, - 0xfc, 0xac, 0xc1, 0x54, 0xff, 0xe4, 0xdc, 0xe9, 0xb4, 0x8c, 0xae, 0xb0, 0xc2, 0x6b, 0xe3, 0x8f, - 0x00, 0xa9, 0xc2, 0xc6, 0x99, 0x2e, 0x2e, 0x41, 0x61, 0xdd, 0x70, 0x4e, 0x84, 0x49, 0xf8, 0x09, - 0x94, 0x68, 0x73, 0xf3, 0xd5, 0x25, 0x6c, 0x64, 0x97, 0x03, 0xc9, 0x3d, 0x96, 0xcf, 0x11, 0x4c, - 0x9e, 0x18, 0xce, 0x09, 0x9b, 0x68, 0x49, 0x67, 0xdf, 0xe8, 0x11, 0x54, 0x5a, 0x7c, 0x92, 0x07, - 0xa1, 0x2b, 0xc3, 0xb4, 0xa0, 0x7b, 0x27, 0xc1, 0x4f, 0xa1, 0xc8, 0xe7, 0xf0, 0x63, 0x1b, 0x81, - 0xaf, 0xc0, 0xf4, 0x9e, 0x69, 0xf4, 0x9d, 0x13, 0x4b, 0x56, 0x37, 0x3a, 0xe9, 0x8a, 0x4f, 0x1b, - 0x4b, 0xe3, 0x43, 0x98, 0xb6, 0x49, 0xcf, 0xe8, 0x98, 0x1d, 0xf3, 0xf8, 0xe0, 0xf0, 0xdc, 0x25, - 0x8e, 0xb8, 0x30, 0x95, 0x3d, 0xf2, 0x73, 0x4a, 0xa5, 0xa6, 0x1d, 0x76, 0xad, 0x43, 0x91, 0xe6, - 0xd8, 0x37, 0xfe, 0x4f, 0x0d, 0x8a, 0x9f, 0x18, 0x6e, 0x4b, 0x2e, 0x1d, 0xda, 0x80, 0xb2, 0x97, - 0xdc, 0x18, 0x45, 0xd8, 0x12, 0x2a, 0xb1, 0x6c, 0x8c, 0x3c, 0x4a, 0xcb, 0xea, 0x58, 0x6a, 0xa9, - 0x04, 0x26, 0xca, 0x30, 0x5b, 0xa4, 0xeb, 0x89, 0x4a, 0x25, 0x8b, 0x62, 0x8c, 0xaa, 0x28, 0x95, - 0xf0, 0x7c, 0xda, 0x3f, 0x7e, 0xf0, 0x5c, 0xf2, 0x75, 0x0a, 0x50, 0xd4, 0x86, 0xef, 0x7b, 0x22, - 0xbb, 0x0f, 0x65, 0xc7, 0x35, 0xec, 0xc8, 0xde, 0x28, 0x31, 0xaa, 0x97, 0xa0, 0x1f, 0xc2, 0x74, - 0xdf, 0xb6, 0x8e, 0x6d, 0xe2, 0x38, 0x07, 0xa6, 0xe5, 0x76, 0x8e, 0xce, 0xc5, 0xa1, 0xb6, 0x2c, - 0xc9, 0xdb, 0x8c, 0x8a, 0x1a, 0x90, 0x3b, 0xea, 0x74, 0x5d, 0x62, 0x3b, 0xd5, 0xcc, 0x42, 0x7a, - 0xb1, 0xbc, 0xfc, 0xe4, 0x22, 0xaf, 0x2d, 0x7d, 0xc8, 0xf8, 0x9b, 0xe7, 0x7d, 0xa2, 0xcb, 0xb1, - 0xea, 0x41, 0x31, 0x1b, 0x38, 0x28, 0xde, 0x07, 0xf0, 0xf9, 0x69, 0xaa, 0xdd, 0xde, 0xd9, 0xdd, - 0x6f, 0x56, 0x26, 0x50, 0x11, 0xa6, 0xb6, 0x77, 0xd6, 0x1a, 0x5b, 0x0d, 0x9a, 0x97, 0x71, 0x5d, - 0xfa, 0x46, 0xf5, 0x21, 0x9a, 0x83, 0xa9, 0xd7, 0x94, 0x2a, 0xef, 0xdb, 0x69, 0x3d, 0xc7, 0xda, - 0x1b, 0x6d, 0xfc, 0x4f, 0x29, 0x28, 0x89, 0x5d, 0x30, 0xd6, 0x56, 0x54, 0x55, 0xa4, 0x02, 0x2a, - 0xe8, 0xa9, 0x94, 0xef, 0x8e, 0xb6, 0x38, 0xfc, 0xca, 0x26, 0xcd, 0x0d, 0x7c, 0xb1, 0x49, 0x5b, - 0xb8, 0xd5, 0x6b, 0xc7, 0x86, 0x6f, 0x26, 0x36, 0x7c, 0xd1, 0x5d, 0x28, 0x79, 0xbb, 0xcd, 0x70, - 0x44, 0xad, 0xcd, 0xeb, 0x45, 0xb9, 0x91, 0x28, 0x0d, 0xdd, 0x87, 0x2c, 0x19, 0x12, 0xd3, 0x75, - 0xaa, 0x05, 0x96, 0x75, 0x4b, 0xf2, 0xfc, 0xdb, 0xa0, 0x54, 0x5d, 0x74, 0xe2, 0x3f, 0x82, 0x2b, - 0xec, 0x9e, 0xf1, 0xc2, 0x36, 0x4c, 0xf5, 0x42, 0xd4, 0x6c, 0x6e, 0x09, 0xd7, 0xd1, 0x4f, 0x54, - 0x86, 0xd4, 0xc6, 0x9a, 0x98, 0x68, 0x6a, 0x63, 0x0d, 0x7f, 0xa1, 0x01, 0x52, 0xc7, 0x8d, 0xe5, - 0xcb, 0x90, 0x70, 0xa9, 0x3e, 0xed, 0xab, 0x9f, 0x85, 0x0c, 0xb1, 0x6d, 0xcb, 0x66, 0x5e, 0xcb, - 0xeb, 0xbc, 0x81, 0xef, 0x09, 0x1b, 0x74, 0x32, 0xb4, 0x4e, 0xbd, 0xc0, 0xe0, 0xd2, 0x34, 0xcf, - 0xd4, 0x4d, 0x98, 0x09, 0x70, 0x8d, 0x95, 0xfd, 0x1f, 0xc2, 0x55, 0x26, 0x6c, 0x93, 0x90, 0xfe, - 0x4a, 0xb7, 0x33, 0x4c, 0xd4, 0xda, 0x87, 0x6b, 0x61, 0xc6, 0x9f, 0xd6, 0x47, 0xf8, 0x4f, 0x85, - 0xc6, 0x66, 0xa7, 0x47, 0x9a, 0xd6, 0x56, 0xb2, 0x6d, 0x34, 0x3b, 0x9e, 0x92, 0x73, 0x47, 0x94, - 0x49, 0xf6, 0x8d, 0xff, 0x43, 0x83, 0xeb, 0x91, 0xe1, 0x3f, 0xf1, 0xaa, 0xce, 0x03, 0x1c, 0xd3, - 0xed, 0x43, 0xda, 0xb4, 0x83, 0xdf, 0xd0, 0x15, 0x8a, 0x67, 0x27, 0x4d, 0x30, 0x45, 0x61, 0xe7, - 0xac, 0x58, 0x73, 0xf6, 0xc7, 0x91, 0x35, 0xe6, 0x16, 0x14, 0x18, 0x61, 0xcf, 0x35, 0xdc, 0x81, - 0x13, 0x59, 0x8c, 0xbf, 0x11, 0x5b, 0x40, 0x0e, 0x1a, 0x6b, 0x5e, 0xef, 0x40, 0x96, 0x1d, 0x4e, - 0xe5, 0xd1, 0x2c, 0x74, 0x1b, 0x50, 0xec, 0xd0, 0x05, 0x23, 0x3e, 0x81, 0xec, 0x4b, 0x86, 0xe8, - 0x29, 0x96, 0x4d, 0xca, 0xa5, 0x30, 0x8d, 0x1e, 0xc7, 0x19, 0xf2, 0x3a, 0xfb, 0x66, 0x27, 0x19, - 0x42, 0xec, 0x7d, 0x7d, 0x8b, 0x9f, 0x98, 0xf2, 0xba, 0xd7, 0xa6, 0x2e, 0x6b, 0x75, 0x3b, 0xc4, - 0x74, 0x59, 0xef, 0x24, 0xeb, 0x55, 0x28, 0x78, 0x09, 0x2a, 0x5c, 0xd3, 0x4a, 0xbb, 0xad, 0x9c, - 0x48, 0x3c, 0x79, 0x5a, 0x50, 0x1e, 0xfe, 0x46, 0x83, 0x2b, 0xca, 0x80, 0xb1, 0x1c, 0xf3, 0x14, - 0xb2, 0x1c, 0xb7, 0x14, 0xc5, 0x6f, 0x36, 0x38, 0x8a, 0xab, 0xd1, 0x05, 0x0f, 0x5a, 0x82, 0x1c, - 0xff, 0x92, 0xc7, 0xc2, 0x78, 0x76, 0xc9, 0x84, 0xef, 0xc3, 0x8c, 0x20, 0x91, 0x9e, 0x15, 0xb7, - 0xb7, 0x99, 0x43, 0xf1, 0xe7, 0x30, 0x1b, 0x64, 0x1b, 0x6b, 0x4a, 0x8a, 0x91, 0xa9, 0xcb, 0x18, - 0xb9, 0x22, 0x8d, 0xdc, 0xef, 0xb7, 0x95, 0x5a, 0x1d, 0x5e, 0x75, 0x75, 0x45, 0x52, 0xa1, 0x15, - 0xf1, 0x26, 0x20, 0x45, 0xfc, 0xac, 0x13, 0x98, 0x91, 0xdb, 0x61, 0xab, 0xe3, 0x78, 0x27, 0xb8, - 0x37, 0x80, 0x54, 0xe2, 0xcf, 0x6d, 0xd0, 0x1a, 0x39, 0xb2, 0x8d, 0xe3, 0x1e, 0xf1, 0xea, 0x13, - 0x3d, 0xcf, 0xab, 0xc4, 0xb1, 0x32, 0x7a, 0x1d, 0xae, 0xbc, 0xb4, 0x86, 0x34, 0x35, 0x50, 0xaa, - 0x1f, 0x32, 0xfc, 0x3e, 0xe7, 0x2d, 0x9b, 0xd7, 0xa6, 0xca, 0xd5, 0x01, 0x63, 0x29, 0xff, 0x5f, - 0x0d, 0x8a, 0x2b, 0x5d, 0xc3, 0xee, 0x49, 0xc5, 0xef, 0x43, 0x96, 0xdf, 0x52, 0x04, 0x30, 0xf0, - 0x20, 0x28, 0x46, 0xe5, 0xe5, 0x8d, 0x15, 0x7e, 0xa7, 0x11, 0xa3, 0xa8, 0xe1, 0xe2, 0xed, 0x60, - 0x2d, 0xf4, 0x96, 0xb0, 0x86, 0xde, 0x82, 0x8c, 0x41, 0x87, 0xb0, 0x14, 0x5c, 0x0e, 0xdf, 0x0f, - 0x99, 0x34, 0x76, 0x38, 0xe3, 0x5c, 0xf8, 0x3d, 0x28, 0x28, 0x1a, 0xe8, 0x0d, 0xf8, 0x45, 0x43, - 0x1c, 0xc0, 0x56, 0x56, 0x9b, 0x1b, 0xaf, 0xf8, 0xc5, 0xb8, 0x0c, 0xb0, 0xd6, 0xf0, 0xda, 0x29, - 0xfc, 0xa9, 0x18, 0x25, 0xf2, 0x9d, 0x6a, 0x8f, 0x96, 0x64, 0x4f, 0xea, 0x52, 0xf6, 0x9c, 0x41, - 0x49, 0x4c, 0x7f, 0xdc, 0xf4, 0xcd, 0xe4, 0x25, 0xa4, 0x6f, 0xc5, 0x78, 0x5d, 0x30, 0xe2, 0x69, - 0x28, 0x89, 0x84, 0x2e, 0xf6, 0xdf, 0xff, 0x68, 0x50, 0x96, 0x94, 0x71, 0x01, 0x4c, 0x89, 0xbd, - 0xf0, 0x0a, 0xe0, 0x21, 0x2f, 0xd7, 0x20, 0xdb, 0x3e, 0xdc, 0xeb, 0xbc, 0x91, 0x60, 0xb3, 0x68, - 0x51, 0x7a, 0x97, 0xeb, 0xe1, 0x2f, 0x3e, 0xa2, 0x45, 0x6f, 0xe1, 0xb6, 0x71, 0xe4, 0x6e, 0x98, - 0x6d, 0x72, 0xc6, 0xce, 0x8d, 0x93, 0xba, 0x4f, 0x60, 0x97, 0x52, 0xf1, 0x32, 0xc4, 0x0e, 0x8b, - 0xea, 0x4b, 0xd1, 0x0c, 0x5c, 0x59, 0x19, 0xb8, 0x27, 0x0d, 0xd3, 0x38, 0xec, 0xca, 0x8c, 0x45, - 0xcb, 0x2c, 0x25, 0xae, 0x75, 0x1c, 0x95, 0xda, 0x80, 0x19, 0x4a, 0x25, 0xa6, 0xdb, 0x69, 0x29, - 0xe9, 0x4d, 0x16, 0x31, 0x2d, 0x54, 0xc4, 0x0c, 0xc7, 0x79, 0x6d, 0xd9, 0x6d, 0x31, 0x35, 0xaf, - 0x8d, 0xd7, 0xb8, 0xf0, 0x7d, 0x27, 0x50, 0xa6, 0xbe, 0xaf, 0x94, 0x45, 0x5f, 0xca, 0x0b, 0xe2, - 0x8e, 0x90, 0x82, 0x9f, 0xc0, 0x55, 0xc9, 0x29, 0xc0, 0xbd, 0x11, 0xcc, 0x3b, 0x70, 0x4b, 0x32, - 0xaf, 0x9e, 0xd0, 0xdb, 0xd3, 0xae, 0x50, 0xf8, 0x43, 0xed, 0x7c, 0x0e, 0x55, 0xcf, 0x4e, 0x76, - 0x58, 0xb6, 0xba, 0xaa, 0x01, 0x03, 0x47, 0xec, 0x99, 0xbc, 0xce, 0xbe, 0x29, 0xcd, 0xb6, 0xba, - 0xde, 0x91, 0x80, 0x7e, 0xe3, 0x55, 0x98, 0x93, 0x32, 0xc4, 0x31, 0x36, 0x28, 0x24, 0x62, 0x50, - 0x9c, 0x10, 0xe1, 0x30, 0x3a, 0x74, 0xb4, 0xdb, 0x55, 0xce, 0xa0, 0x6b, 0x99, 0x4c, 0x4d, 0x91, - 0x79, 0x95, 0xef, 0x08, 0x6a, 0x98, 0x5a, 0x31, 0x04, 0x99, 0x0a, 0x50, 0xc9, 0x62, 0x21, 0x28, - 0x39, 0xb2, 0x10, 0x11, 0xd1, 0x9f, 0xc1, 0xbc, 0x67, 0x04, 0xf5, 0xdb, 0x2e, 0xb1, 0x7b, 0x1d, - 0xc7, 0x51, 0xe0, 0xa0, 0xb8, 0x89, 0x3f, 0x80, 0xc9, 0x3e, 0x11, 0x39, 0xa5, 0xb0, 0x8c, 0x96, - 0xf8, 0xfb, 0xed, 0x92, 0x32, 0x98, 0xf5, 0xe3, 0x36, 0xdc, 0x96, 0xd2, 0xb9, 0x47, 0x63, 0xc5, - 0x87, 0x8d, 0x92, 0xb7, 0x6e, 0xee, 0xd6, 0xe8, 0xad, 0x3b, 0xcd, 0xd7, 0xde, 0x83, 0x28, 0x3f, - 0xe2, 0x8e, 0x94, 0xb1, 0x35, 0x56, 0xad, 0xd8, 0xe4, 0x3e, 0xf5, 0x42, 0x72, 0x2c, 0x61, 0x87, - 0x30, 0x1b, 0x8c, 0xe4, 0xb1, 0xd2, 0xd8, 0x2c, 0x64, 0x5c, 0xeb, 0x94, 0xc8, 0x24, 0xc6, 0x1b, - 0xd2, 0x60, 0x2f, 0xcc, 0xc7, 0x32, 0xd8, 0xf0, 0x85, 0xb1, 0x2d, 0x39, 0xae, 0xbd, 0x74, 0x35, - 0xe5, 0xe1, 0x8b, 0x37, 0xf0, 0x36, 0x5c, 0x0b, 0xa7, 0x89, 0xb1, 0x4c, 0x7e, 0xc5, 0x37, 0x70, - 0x5c, 0x26, 0x19, 0x4b, 0xee, 0xc7, 0x7e, 0x32, 0x50, 0x12, 0xca, 0x58, 0x22, 0x75, 0xa8, 0xc5, - 0xe5, 0x97, 0x1f, 0x63, 0xbf, 0x7a, 0xe9, 0x66, 0x2c, 0x61, 0x8e, 0x2f, 0x6c, 0xfc, 0xe5, 0xf7, - 0x73, 0x44, 0x7a, 0x64, 0x8e, 0x10, 0x41, 0xe2, 0x67, 0xb1, 0x9f, 0x60, 0xd3, 0x09, 0x1d, 0x7e, - 0x02, 0x1d, 0x57, 0x07, 0xad, 0x21, 0x9e, 0x0e, 0xd6, 0x90, 0x1b, 0x5b, 0x4d, 0xbb, 0x63, 0x2d, - 0xc6, 0x27, 0x7e, 0xee, 0x8c, 0x64, 0xe6, 0xb1, 0x04, 0x7f, 0x0a, 0x0b, 0xc9, 0x49, 0x79, 0x1c, - 0xc9, 0x8f, 0xeb, 0x90, 0xf7, 0x0e, 0x94, 0xca, 0x6f, 0x1f, 0x0a, 0x90, 0xdb, 0xde, 0xd9, 0xdb, - 0x5d, 0x59, 0x6d, 0xf0, 0x1f, 0x3f, 0xac, 0xee, 0xe8, 0xfa, 0xfe, 0x6e, 0xb3, 0x92, 0x5a, 0xfe, - 0x6d, 0x1a, 0x52, 0x9b, 0xaf, 0xd0, 0x9f, 0x43, 0x86, 0xbf, 0x04, 0x8e, 0x78, 0xfe, 0xad, 0x8d, - 0x7a, 0xec, 0xc4, 0x37, 0xbe, 0xf8, 0xff, 0x5f, 0x7d, 0x95, 0xba, 0x8a, 0x2b, 0xf5, 0xe1, 0xbb, - 0x87, 0xc4, 0x35, 0xea, 0xa7, 0xc3, 0x3a, 0xab, 0x0f, 0xcf, 0xb4, 0xc7, 0x68, 0x1f, 0xd2, 0xbb, - 0x03, 0x17, 0x25, 0x3e, 0x0d, 0xd7, 0x92, 0xdf, 0x40, 0xf1, 0x1c, 0x13, 0x3c, 0x83, 0xcb, 0x8a, - 0xe0, 0xfe, 0xc0, 0xa5, 0x62, 0x07, 0x50, 0x50, 0x5f, 0x31, 0x2f, 0x7c, 0x33, 0xae, 0x5d, 0xfc, - 0x42, 0x8a, 0xef, 0x30, 0x75, 0x37, 0xf0, 0x35, 0x45, 0x1d, 0x7f, 0x6b, 0x55, 0x67, 0xd3, 0x3c, - 0x33, 0x51, 0xe2, 0xab, 0x72, 0x2d, 0xf9, 0xe1, 0x34, 0x76, 0x36, 0xee, 0x99, 0x49, 0xc5, 0x9a, - 0xe2, 0xdd, 0xb4, 0xe5, 0xa2, 0xdb, 0x31, 0xef, 0x66, 0xea, 0x0b, 0x51, 0x6d, 0x21, 0x99, 0x41, - 0x28, 0x5a, 0x60, 0x8a, 0x6a, 0xf8, 0xaa, 0xa2, 0xa8, 0xe5, 0xb1, 0x3d, 0xd3, 0x1e, 0x2f, 0x1f, - 0x43, 0x86, 0x21, 0xc4, 0xe8, 0x2f, 0xe4, 0x47, 0x2d, 0x06, 0xdb, 0x4e, 0x58, 0xfc, 0x00, 0xb6, - 0x8c, 0xab, 0x4c, 0x19, 0xc2, 0x25, 0xa9, 0x8c, 0x61, 0xc4, 0xcf, 0xb4, 0xc7, 0x8b, 0xda, 0xdb, - 0xda, 0xf2, 0x6f, 0x26, 0x21, 0xc3, 0xe0, 0x22, 0x64, 0x01, 0xf8, 0x68, 0x6a, 0x78, 0x96, 0x11, - 0x7c, 0x36, 0x3c, 0xcb, 0x28, 0x10, 0x8b, 0xe7, 0x99, 0xe2, 0x2a, 0x9e, 0x91, 0x8a, 0x19, 0x12, - 0x55, 0x67, 0xe0, 0x1a, 0xf5, 0xe9, 0x50, 0x00, 0x66, 0x3c, 0xcc, 0x50, 0x9c, 0xc0, 0x00, 0xaa, - 0x1a, 0xde, 0x21, 0x31, 0x88, 0x2a, 0xc6, 0x4c, 0xe7, 0x4d, 0x7c, 0x5d, 0xf1, 0x2c, 0x57, 0x6b, - 0x33, 0x46, 0xaa, 0xf7, 0xef, 0x34, 0x28, 0x07, 0x71, 0x51, 0x74, 0x37, 0x46, 0x72, 0x18, 0x5e, - 0xad, 0xdd, 0x1b, 0xcd, 0x94, 0x64, 0x01, 0x57, 0x7f, 0x4a, 0x48, 0xdf, 0xa0, 0x8c, 0xc2, 0xf1, - 0xe8, 0x1f, 0x34, 0x98, 0x0e, 0x81, 0x9d, 0x28, 0x4e, 0x43, 0x04, 0x4a, 0xad, 0xdd, 0xbf, 0x80, - 0x4b, 0x18, 0xf2, 0x80, 0x19, 0xb2, 0x80, 0x6f, 0x44, 0x5c, 0xe1, 0x76, 0x7a, 0xc4, 0xb5, 0x84, - 0x31, 0xde, 0x32, 0x70, 0x60, 0x32, 0x76, 0x19, 0x02, 0x40, 0x67, 0xec, 0x32, 0x04, 0x51, 0xcd, - 0x11, 0xcb, 0xc0, 0xd1, 0x48, 0xba, 0xc5, 0x7f, 0x97, 0x86, 0xdc, 0x2a, 0xff, 0x05, 0x22, 0x72, - 0x20, 0xef, 0x21, 0x80, 0x68, 0x3e, 0x0e, 0x8d, 0xf1, 0x6f, 0x0b, 0xb5, 0xdb, 0x89, 0xfd, 0x42, - 0xfb, 0x7d, 0xa6, 0xfd, 0x36, 0xae, 0x49, 0xed, 0xe2, 0x87, 0x8e, 0x75, 0x7e, 0xed, 0xaf, 0x1b, - 0xed, 0x36, 0x9d, 0xf8, 0xdf, 0x42, 0x51, 0x85, 0xe9, 0xd0, 0x9d, 0x58, 0x14, 0x48, 0x45, 0xfa, - 0x6a, 0x78, 0x14, 0x8b, 0xd0, 0xbe, 0xc8, 0xb4, 0x63, 0x7c, 0x2b, 0x41, 0xbb, 0xcd, 0xd8, 0x03, - 0x06, 0x70, 0x98, 0x2d, 0xde, 0x80, 0x00, 0x8a, 0x17, 0x6f, 0x40, 0x10, 0xa5, 0xbb, 0xd0, 0x80, - 0x01, 0x63, 0xa7, 0x06, 0xbc, 0x06, 0xf0, 0x41, 0x35, 0x14, 0xeb, 0x57, 0xe5, 0xea, 0x14, 0x0e, - 0xf9, 0x28, 0x1e, 0x17, 0xdd, 0x73, 0x21, 0xd5, 0xdd, 0x8e, 0x43, 0x43, 0x7f, 0xf9, 0x9b, 0x2c, - 0x14, 0x5e, 0x1a, 0x1d, 0xd3, 0x25, 0xa6, 0x61, 0xb6, 0x08, 0x3a, 0x82, 0x0c, 0x2b, 0x8d, 0xe1, - 0x2c, 0xa7, 0x62, 0x4d, 0xe1, 0x2c, 0x17, 0x00, 0x62, 0xf0, 0x3d, 0xa6, 0x79, 0x1e, 0xcf, 0x49, - 0xcd, 0x3d, 0x5f, 0x7c, 0x9d, 0x61, 0x28, 0x74, 0xc2, 0x7f, 0x09, 0x59, 0x01, 0xcf, 0x87, 0x84, - 0x05, 0xb0, 0x95, 0xda, 0xcd, 0xf8, 0xce, 0xa4, 0xed, 0xa5, 0xaa, 0x72, 0x18, 0x2f, 0xd5, 0xf5, - 0x06, 0xc0, 0x07, 0x08, 0xc3, 0xce, 0x8d, 0xe0, 0x89, 0xb5, 0x85, 0x64, 0x06, 0xa1, 0xf7, 0x11, - 0xd3, 0x7b, 0x17, 0xcf, 0xc7, 0xe9, 0x6d, 0x7b, 0xfc, 0x54, 0xf7, 0x21, 0x4c, 0xae, 0x1b, 0xce, - 0x09, 0x0a, 0x15, 0x3b, 0xe5, 0x47, 0x03, 0xb5, 0x5a, 0x5c, 0x97, 0xd0, 0x74, 0x97, 0x69, 0xba, - 0x85, 0xab, 0x71, 0x9a, 0x4e, 0x0c, 0x87, 0x56, 0x0f, 0x74, 0x02, 0x59, 0xfe, 0x3b, 0x82, 0xb0, - 0x2f, 0x03, 0xbf, 0x45, 0x08, 0xfb, 0x32, 0xf8, 0xd3, 0x83, 0xcb, 0x69, 0x72, 0x61, 0x4a, 0x3e, - 0xde, 0xa3, 0x5b, 0xa1, 0xa5, 0x09, 0x3e, 0xf4, 0xd7, 0xe6, 0x93, 0xba, 0x85, 0xbe, 0x87, 0x4c, - 0xdf, 0x1d, 0x7c, 0x33, 0x76, 0xed, 0x04, 0xf7, 0x33, 0xed, 0xf1, 0xdb, 0x1a, 0x2d, 0x13, 0xe0, - 0x83, 0xac, 0x91, 0xe8, 0x08, 0xe3, 0xb5, 0x91, 0xe8, 0x88, 0xe0, 0xb3, 0x78, 0x99, 0x29, 0x7f, - 0x8a, 0x1f, 0xc6, 0x29, 0x77, 0x6d, 0xc3, 0x74, 0x8e, 0x88, 0xfd, 0x16, 0x07, 0xd3, 0x9c, 0x93, - 0x4e, 0x9f, 0x46, 0xca, 0xef, 0xa7, 0x61, 0x92, 0x9e, 0x47, 0x69, 0x79, 0xf6, 0xaf, 0xf1, 0x61, - 0x6b, 0x22, 0xe0, 0x59, 0xd8, 0x9a, 0x28, 0x02, 0x10, 0x2d, 0xcf, 0xec, 0xb7, 0xe6, 0x84, 0x31, - 0x51, 0xaf, 0x3b, 0x50, 0x50, 0xee, 0xfa, 0x28, 0x46, 0x60, 0x10, 0x99, 0x0b, 0xd7, 0x85, 0x18, - 0xa0, 0x00, 0xdf, 0x66, 0x3a, 0xe7, 0xf0, 0x6c, 0x40, 0x67, 0x9b, 0x73, 0x51, 0xa5, 0x7f, 0x0d, - 0x45, 0x15, 0x13, 0x40, 0x31, 0x32, 0x43, 0xc8, 0x5f, 0x38, 0x25, 0xc6, 0x41, 0x0a, 0xd1, 0xec, - 0xe0, 0xfd, 0xae, 0x5e, 0xb2, 0x52, 0xe5, 0x7d, 0xc8, 0x09, 0xa0, 0x20, 0x6e, 0xb6, 0x41, 0xa8, - 0x30, 0x6e, 0xb6, 0x21, 0x94, 0x21, 0x7a, 0xcc, 0x63, 0x5a, 0xe9, 0x7d, 0x48, 0x96, 0x20, 0xa1, - 0xf1, 0x05, 0x71, 0x93, 0x34, 0xfa, 0xd8, 0x57, 0x92, 0x46, 0xe5, 0x2e, 0x3a, 0x4a, 0xe3, 0x31, - 0x71, 0x45, 0x2c, 0xc9, 0x7b, 0x1e, 0x4a, 0x10, 0xa8, 0xa6, 0x7c, 0x3c, 0x8a, 0x25, 0xe9, 0x54, - 0xee, 0x2b, 0x15, 0xf9, 0x1e, 0x7d, 0x0e, 0xe0, 0x43, 0x1a, 0xe1, 0xd3, 0x56, 0x2c, 0x2e, 0x1a, - 0x3e, 0x6d, 0xc5, 0xa3, 0x22, 0xd1, 0xfc, 0xe1, 0xeb, 0xe6, 0x17, 0x03, 0xaa, 0xfd, 0x5f, 0x34, - 0x40, 0x51, 0x04, 0x04, 0x3d, 0x89, 0xd7, 0x10, 0x8b, 0xb8, 0xd6, 0x9e, 0x5e, 0x8e, 0x39, 0xa9, - 0x44, 0xf8, 0x66, 0xb5, 0xd8, 0x88, 0xfe, 0x6b, 0x6a, 0xd8, 0x97, 0x1a, 0x94, 0x02, 0x10, 0x0a, - 0x7a, 0x90, 0xb0, 0xc6, 0x21, 0xd0, 0xb6, 0xf6, 0xf0, 0x42, 0xbe, 0xa4, 0x93, 0x98, 0xb2, 0x23, - 0xe4, 0x41, 0xfc, 0x1f, 0x35, 0x28, 0x07, 0x61, 0x17, 0x94, 0x20, 0x3f, 0x02, 0xfc, 0xd6, 0x16, - 0x2f, 0x66, 0xbc, 0x78, 0xa9, 0xfc, 0xb3, 0x79, 0x1f, 0x72, 0x02, 0xac, 0x89, 0x0b, 0x88, 0x20, - 0x6c, 0x1c, 0x17, 0x10, 0x21, 0xa4, 0x27, 0x21, 0x20, 0x6c, 0xab, 0x4b, 0x94, 0x10, 0x14, 0x88, - 0x4e, 0x92, 0xc6, 0xd1, 0x21, 0x18, 0x82, 0x83, 0x46, 0x69, 0xf4, 0x43, 0x50, 0xc2, 0x39, 0x28, - 0x41, 0xe0, 0x05, 0x21, 0x18, 0x46, 0x83, 0x12, 0x42, 0x90, 0x29, 0x55, 0x42, 0xd0, 0x07, 0x5f, - 0xe2, 0x42, 0x30, 0x82, 0x88, 0xc7, 0x85, 0x60, 0x14, 0xbf, 0x49, 0x58, 0x57, 0xa6, 0x3b, 0x10, - 0x82, 0x33, 0x31, 0x58, 0x0d, 0x7a, 0x9a, 0xe0, 0xd0, 0x58, 0xb0, 0xbd, 0xf6, 0xd6, 0x25, 0xb9, - 0x47, 0xee, 0x7d, 0xbe, 0x14, 0x72, 0xef, 0x7f, 0xad, 0xc1, 0x6c, 0x1c, 0xd6, 0x83, 0x12, 0x74, - 0x25, 0x00, 0xf5, 0xb5, 0xa5, 0xcb, 0xb2, 0x5f, 0xec, 0x35, 0x2f, 0x1a, 0x9e, 0x57, 0xfe, 0xfb, - 0xbb, 0x79, 0xed, 0xff, 0xbe, 0x9b, 0xd7, 0x7e, 0xf1, 0xdd, 0xbc, 0xf6, 0xaf, 0xbf, 0x9c, 0x9f, - 0x38, 0xcc, 0xb2, 0xff, 0xe1, 0xf5, 0xee, 0x1f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x74, 0x55, 0x61, - 0xe6, 0x68, 0x36, 0x00, 0x00, -} diff --git a/vendor/github.com/coreos/etcd/mvcc/mvccpb/kv.pb.go b/vendor/github.com/coreos/etcd/mvcc/mvccpb/kv.pb.go deleted file mode 100644 index 23fe337a5..000000000 --- a/vendor/github.com/coreos/etcd/mvcc/mvccpb/kv.pb.go +++ /dev/null @@ -1,718 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: kv.proto - -/* - Package mvccpb is a generated protocol buffer package. - - It is generated from these files: - kv.proto - - It has these top-level messages: - KeyValue - Event -*/ -package mvccpb - -import ( - "fmt" - - proto "github.com/golang/protobuf/proto" - - math "math" - - _ "github.com/gogo/protobuf/gogoproto" - - io "io" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Event_EventType int32 - -const ( - PUT Event_EventType = 0 - DELETE Event_EventType = 1 -) - -var Event_EventType_name = map[int32]string{ - 0: "PUT", - 1: "DELETE", -} -var Event_EventType_value = map[string]int32{ - "PUT": 0, - "DELETE": 1, -} - -func (x Event_EventType) String() string { - return proto.EnumName(Event_EventType_name, int32(x)) -} -func (Event_EventType) EnumDescriptor() ([]byte, []int) { return fileDescriptorKv, []int{1, 0} } - -type KeyValue struct { - // key is the key in bytes. An empty key is not allowed. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // create_revision is the revision of last creation on this key. - CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,json=createRevision,proto3" json:"create_revision,omitempty"` - // mod_revision is the revision of last modification on this key. - ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"` - // version is the version of the key. A deletion resets - // the version to zero and any modification of the key - // increases its version. - Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` - // value is the value held by the key, in bytes. - Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` - // lease is the ID of the lease that attached to key. - // When the attached lease expires, the key will be deleted. - // If lease is 0, then no lease is attached to the key. - Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"` -} - -func (m *KeyValue) Reset() { *m = KeyValue{} } -func (m *KeyValue) String() string { return proto.CompactTextString(m) } -func (*KeyValue) ProtoMessage() {} -func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptorKv, []int{0} } - -type Event struct { - // type is the kind of event. If type is a PUT, it indicates - // new data has been stored to the key. If type is a DELETE, - // it indicates the key was deleted. - Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=mvccpb.Event_EventType" json:"type,omitempty"` - // kv holds the KeyValue for the event. - // A PUT event contains current kv pair. - // A PUT event with kv.Version=1 indicates the creation of a key. - // A DELETE/EXPIRE event contains the deleted key with - // its modification revision set to the revision of deletion. - Kv *KeyValue `protobuf:"bytes,2,opt,name=kv" json:"kv,omitempty"` - // prev_kv holds the key-value pair before the event happens. - PrevKv *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv" json:"prev_kv,omitempty"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorKv, []int{1} } - -func init() { - proto.RegisterType((*KeyValue)(nil), "mvccpb.KeyValue") - proto.RegisterType((*Event)(nil), "mvccpb.Event") - proto.RegisterEnum("mvccpb.Event_EventType", Event_EventType_name, Event_EventType_value) -} -func (m *KeyValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Key) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintKv(dAtA, i, uint64(len(m.Key))) - i += copy(dAtA[i:], m.Key) - } - if m.CreateRevision != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.CreateRevision)) - } - if m.ModRevision != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.ModRevision)) - } - if m.Version != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.Version)) - } - if len(m.Value) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintKv(dAtA, i, uint64(len(m.Value))) - i += copy(dAtA[i:], m.Value) - } - if m.Lease != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.Lease)) - } - return i, nil -} - -func (m *Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Event) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.Type)) - } - if m.Kv != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintKv(dAtA, i, uint64(m.Kv.Size())) - n1, err := m.Kv.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.PrevKv != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintKv(dAtA, i, uint64(m.PrevKv.Size())) - n2, err := m.PrevKv.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - } - return i, nil -} - -func encodeVarintKv(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *KeyValue) Size() (n int) { - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKv(uint64(l)) - } - if m.CreateRevision != 0 { - n += 1 + sovKv(uint64(m.CreateRevision)) - } - if m.ModRevision != 0 { - n += 1 + sovKv(uint64(m.ModRevision)) - } - if m.Version != 0 { - n += 1 + sovKv(uint64(m.Version)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovKv(uint64(l)) - } - if m.Lease != 0 { - n += 1 + sovKv(uint64(m.Lease)) - } - return n -} - -func (m *Event) Size() (n int) { - var l int - _ = l - if m.Type != 0 { - n += 1 + sovKv(uint64(m.Type)) - } - if m.Kv != nil { - l = m.Kv.Size() - n += 1 + l + sovKv(uint64(l)) - } - if m.PrevKv != nil { - l = m.PrevKv.Size() - n += 1 + l + sovKv(uint64(l)) - } - return n -} - -func sovKv(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozKv(x uint64) (n int) { - return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *KeyValue) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) - } - m.CreateRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreateRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) - } - m.ModRevision = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ModRevision |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - m.Version = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) - } - m.Lease = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Lease |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipKv(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthKv - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Event) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Event: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= (Event_EventType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Kv == nil { - m.Kv = &KeyValue{} - } - if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PrevKv == nil { - m.PrevKv = &KeyValue{} - } - if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKv(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthKv - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKv(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKv - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKv - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKv - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthKv - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowKv - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipKv(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") -) - -func init() { proto.RegisterFile("kv.proto", fileDescriptorKv) } - -var fileDescriptorKv = []byte{ - // 303 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4e, 0xc2, 0x40, - 0x14, 0x86, 0x3b, 0x14, 0x0a, 0x3e, 0x08, 0x36, 0x13, 0x12, 0x27, 0x2e, 0x26, 0x95, 0x8d, 0x18, - 0x13, 0x4c, 0xf0, 0x06, 0xc6, 0xae, 0x70, 0x61, 0x1a, 0x74, 0x4b, 0x4a, 0x79, 0x21, 0xa4, 0x94, - 0x69, 0x4a, 0x9d, 0xa4, 0x37, 0x71, 0xef, 0xde, 0x73, 0xb0, 0xe4, 0x08, 0x52, 0x2f, 0x62, 0xfa, - 0xc6, 0xe2, 0xc6, 0xcd, 0xe4, 0xfd, 0xff, 0xff, 0x65, 0xe6, 0x7f, 0x03, 0x9d, 0x58, 0x8f, 0xd3, - 0x4c, 0xe5, 0x8a, 0x3b, 0x89, 0x8e, 0xa2, 0x74, 0x71, 0x39, 0x58, 0xa9, 0x95, 0x22, 0xeb, 0xae, - 0x9a, 0x4c, 0x3a, 0xfc, 0x64, 0xd0, 0x99, 0x62, 0xf1, 0x1a, 0x6e, 0xde, 0x90, 0xbb, 0x60, 0xc7, - 0x58, 0x08, 0xe6, 0xb1, 0x51, 0x2f, 0xa8, 0x46, 0x7e, 0x0d, 0xe7, 0x51, 0x86, 0x61, 0x8e, 0xf3, - 0x0c, 0xf5, 0x7a, 0xb7, 0x56, 0x5b, 0xd1, 0xf0, 0xd8, 0xc8, 0x0e, 0xfa, 0xc6, 0x0e, 0x7e, 0x5d, - 0x7e, 0x05, 0xbd, 0x44, 0x2d, 0xff, 0x28, 0x9b, 0xa8, 0x6e, 0xa2, 0x96, 0x27, 0x44, 0x40, 0x5b, - 0x63, 0x46, 0x69, 0x93, 0xd2, 0x5a, 0xf2, 0x01, 0xb4, 0x74, 0x55, 0x40, 0xb4, 0xe8, 0x65, 0x23, - 0x2a, 0x77, 0x83, 0xe1, 0x0e, 0x85, 0x43, 0xb4, 0x11, 0xc3, 0x0f, 0x06, 0x2d, 0x5f, 0xe3, 0x36, - 0xe7, 0xb7, 0xd0, 0xcc, 0x8b, 0x14, 0xa9, 0x6e, 0x7f, 0x72, 0x31, 0x36, 0x7b, 0x8e, 0x29, 0x34, - 0xe7, 0xac, 0x48, 0x31, 0x20, 0x88, 0x7b, 0xd0, 0x88, 0x35, 0x75, 0xef, 0x4e, 0xdc, 0x1a, 0xad, - 0x17, 0x0f, 0x1a, 0xb1, 0xe6, 0x37, 0xd0, 0x4e, 0x33, 0xd4, 0xf3, 0x58, 0x53, 0xf9, 0xff, 0x30, - 0xa7, 0x02, 0xa6, 0x7a, 0xe8, 0xc1, 0xd9, 0xe9, 0x7e, 0xde, 0x06, 0xfb, 0xf9, 0x65, 0xe6, 0x5a, - 0x1c, 0xc0, 0x79, 0xf4, 0x9f, 0xfc, 0x99, 0xef, 0xb2, 0x07, 0xb1, 0x3f, 0x4a, 0xeb, 0x70, 0x94, - 0xd6, 0xbe, 0x94, 0xec, 0x50, 0x4a, 0xf6, 0x55, 0x4a, 0xf6, 0xfe, 0x2d, 0xad, 0x85, 0x43, 0xff, - 0x7e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x45, 0x92, 0x5d, 0xa1, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/coreos/etcd/pkg/types/doc.go b/vendor/github.com/coreos/etcd/pkg/types/doc.go deleted file mode 100644 index de8ef0bd7..000000000 --- a/vendor/github.com/coreos/etcd/pkg/types/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package types declares various data types and implements type-checking -// functions. -package types diff --git a/vendor/github.com/coreos/etcd/pkg/types/id.go b/vendor/github.com/coreos/etcd/pkg/types/id.go deleted file mode 100644 index 1b042d9ce..000000000 --- a/vendor/github.com/coreos/etcd/pkg/types/id.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "strconv" -) - -// ID represents a generic identifier which is canonically -// stored as a uint64 but is typically represented as a -// base-16 string for input/output -type ID uint64 - -func (i ID) String() string { - return strconv.FormatUint(uint64(i), 16) -} - -// IDFromString attempts to create an ID from a base-16 string. -func IDFromString(s string) (ID, error) { - i, err := strconv.ParseUint(s, 16, 64) - return ID(i), err -} - -// IDSlice implements the sort interface -type IDSlice []ID - -func (p IDSlice) Len() int { return len(p) } -func (p IDSlice) Less(i, j int) bool { return uint64(p[i]) < uint64(p[j]) } -func (p IDSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/vendor/github.com/coreos/etcd/pkg/types/set.go b/vendor/github.com/coreos/etcd/pkg/types/set.go deleted file mode 100644 index c111b0c0c..000000000 --- a/vendor/github.com/coreos/etcd/pkg/types/set.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "reflect" - "sort" - "sync" -) - -type Set interface { - Add(string) - Remove(string) - Contains(string) bool - Equals(Set) bool - Length() int - Values() []string - Copy() Set - Sub(Set) Set -} - -func NewUnsafeSet(values ...string) *unsafeSet { - set := &unsafeSet{make(map[string]struct{})} - for _, v := range values { - set.Add(v) - } - return set -} - -func NewThreadsafeSet(values ...string) *tsafeSet { - us := NewUnsafeSet(values...) - return &tsafeSet{us, sync.RWMutex{}} -} - -type unsafeSet struct { - d map[string]struct{} -} - -// Add adds a new value to the set (no-op if the value is already present) -func (us *unsafeSet) Add(value string) { - us.d[value] = struct{}{} -} - -// Remove removes the given value from the set -func (us *unsafeSet) Remove(value string) { - delete(us.d, value) -} - -// Contains returns whether the set contains the given value -func (us *unsafeSet) Contains(value string) (exists bool) { - _, exists = us.d[value] - return exists -} - -// ContainsAll returns whether the set contains all given values -func (us *unsafeSet) ContainsAll(values []string) bool { - for _, s := range values { - if !us.Contains(s) { - return false - } - } - return true -} - -// Equals returns whether the contents of two sets are identical -func (us *unsafeSet) Equals(other Set) bool { - v1 := sort.StringSlice(us.Values()) - v2 := sort.StringSlice(other.Values()) - v1.Sort() - v2.Sort() - return reflect.DeepEqual(v1, v2) -} - -// Length returns the number of elements in the set -func (us *unsafeSet) Length() int { - return len(us.d) -} - -// Values returns the values of the Set in an unspecified order. -func (us *unsafeSet) Values() (values []string) { - values = make([]string, 0) - for val := range us.d { - values = append(values, val) - } - return values -} - -// Copy creates a new Set containing the values of the first -func (us *unsafeSet) Copy() Set { - cp := NewUnsafeSet() - for val := range us.d { - cp.Add(val) - } - - return cp -} - -// Sub removes all elements in other from the set -func (us *unsafeSet) Sub(other Set) Set { - oValues := other.Values() - result := us.Copy().(*unsafeSet) - - for _, val := range oValues { - if _, ok := result.d[val]; !ok { - continue - } - delete(result.d, val) - } - - return result -} - -type tsafeSet struct { - us *unsafeSet - m sync.RWMutex -} - -func (ts *tsafeSet) Add(value string) { - ts.m.Lock() - defer ts.m.Unlock() - ts.us.Add(value) -} - -func (ts *tsafeSet) Remove(value string) { - ts.m.Lock() - defer ts.m.Unlock() - ts.us.Remove(value) -} - -func (ts *tsafeSet) Contains(value string) (exists bool) { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Contains(value) -} - -func (ts *tsafeSet) Equals(other Set) bool { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Equals(other) -} - -func (ts *tsafeSet) Length() int { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Length() -} - -func (ts *tsafeSet) Values() (values []string) { - ts.m.RLock() - defer ts.m.RUnlock() - return ts.us.Values() -} - -func (ts *tsafeSet) Copy() Set { - ts.m.RLock() - defer ts.m.RUnlock() - usResult := ts.us.Copy().(*unsafeSet) - return &tsafeSet{usResult, sync.RWMutex{}} -} - -func (ts *tsafeSet) Sub(other Set) Set { - ts.m.RLock() - defer ts.m.RUnlock() - usResult := ts.us.Sub(other).(*unsafeSet) - return &tsafeSet{usResult, sync.RWMutex{}} -} diff --git a/vendor/github.com/coreos/etcd/pkg/types/slice.go b/vendor/github.com/coreos/etcd/pkg/types/slice.go deleted file mode 100644 index 0dd9ca798..000000000 --- a/vendor/github.com/coreos/etcd/pkg/types/slice.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -// Uint64Slice implements sort interface -type Uint64Slice []uint64 - -func (p Uint64Slice) Len() int { return len(p) } -func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/vendor/github.com/coreos/etcd/pkg/types/urls.go b/vendor/github.com/coreos/etcd/pkg/types/urls.go deleted file mode 100644 index 9e5d03ff6..000000000 --- a/vendor/github.com/coreos/etcd/pkg/types/urls.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "errors" - "fmt" - "net" - "net/url" - "sort" - "strings" -) - -type URLs []url.URL - -func NewURLs(strs []string) (URLs, error) { - all := make([]url.URL, len(strs)) - if len(all) == 0 { - return nil, errors.New("no valid URLs given") - } - for i, in := range strs { - in = strings.TrimSpace(in) - u, err := url.Parse(in) - if err != nil { - return nil, err - } - if u.Scheme != "http" && u.Scheme != "https" && u.Scheme != "unix" && u.Scheme != "unixs" { - return nil, fmt.Errorf("URL scheme must be http, https, unix, or unixs: %s", in) - } - if _, _, err := net.SplitHostPort(u.Host); err != nil { - return nil, fmt.Errorf(`URL address does not have the form "host:port": %s`, in) - } - if u.Path != "" { - return nil, fmt.Errorf("URL must not contain a path: %s", in) - } - all[i] = *u - } - us := URLs(all) - us.Sort() - - return us, nil -} - -func MustNewURLs(strs []string) URLs { - urls, err := NewURLs(strs) - if err != nil { - panic(err) - } - return urls -} - -func (us URLs) String() string { - return strings.Join(us.StringSlice(), ",") -} - -func (us *URLs) Sort() { - sort.Sort(us) -} -func (us URLs) Len() int { return len(us) } -func (us URLs) Less(i, j int) bool { return us[i].String() < us[j].String() } -func (us URLs) Swap(i, j int) { us[i], us[j] = us[j], us[i] } - -func (us URLs) StringSlice() []string { - out := make([]string, len(us)) - for i := range us { - out[i] = us[i].String() - } - - return out -} diff --git a/vendor/github.com/coreos/etcd/pkg/types/urlsmap.go b/vendor/github.com/coreos/etcd/pkg/types/urlsmap.go deleted file mode 100644 index 47690cc38..000000000 --- a/vendor/github.com/coreos/etcd/pkg/types/urlsmap.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2015 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "fmt" - "sort" - "strings" -) - -// URLsMap is a map from a name to its URLs. -type URLsMap map[string]URLs - -// NewURLsMap returns a URLsMap instantiated from the given string, -// which consists of discovery-formatted names-to-URLs, like: -// mach0=http://1.1.1.1:2380,mach0=http://2.2.2.2::2380,mach1=http://3.3.3.3:2380,mach2=http://4.4.4.4:2380 -func NewURLsMap(s string) (URLsMap, error) { - m := parse(s) - - cl := URLsMap{} - for name, urls := range m { - us, err := NewURLs(urls) - if err != nil { - return nil, err - } - cl[name] = us - } - return cl, nil -} - -// NewURLsMapFromStringMap takes a map of strings and returns a URLsMap. The -// string values in the map can be multiple values separated by the sep string. -func NewURLsMapFromStringMap(m map[string]string, sep string) (URLsMap, error) { - var err error - um := URLsMap{} - for k, v := range m { - um[k], err = NewURLs(strings.Split(v, sep)) - if err != nil { - return nil, err - } - } - return um, nil -} - -// String turns URLsMap into discovery-formatted name-to-URLs sorted by name. -func (c URLsMap) String() string { - var pairs []string - for name, urls := range c { - for _, url := range urls { - pairs = append(pairs, fmt.Sprintf("%s=%s", name, url.String())) - } - } - sort.Strings(pairs) - return strings.Join(pairs, ",") -} - -// URLs returns a list of all URLs. -// The returned list is sorted in ascending lexicographical order. -func (c URLsMap) URLs() []string { - var urls []string - for _, us := range c { - for _, u := range us { - urls = append(urls, u.String()) - } - } - sort.Strings(urls) - return urls -} - -// Len returns the size of URLsMap. -func (c URLsMap) Len() int { - return len(c) -} - -// parse parses the given string and returns a map listing the values specified for each key. -func parse(s string) map[string][]string { - m := make(map[string][]string) - for s != "" { - key := s - if i := strings.IndexAny(key, ","); i >= 0 { - key, s = key[:i], key[i+1:] - } else { - s = "" - } - if key == "" { - continue - } - value := "" - if i := strings.Index(key, "="); i >= 0 { - key, value = key[:i], key[i+1:] - } - m[key] = append(m[key], value) - } - return m -} diff --git a/vendor/github.com/docker/leadership/LICENSE b/vendor/github.com/docker/leadership/LICENSE deleted file mode 100644 index b55b37bc3..000000000 --- a/vendor/github.com/docker/leadership/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Docker, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/docker/leadership/candidate.go b/vendor/github.com/docker/leadership/candidate.go deleted file mode 100644 index 3a4cd852a..000000000 --- a/vendor/github.com/docker/leadership/candidate.go +++ /dev/null @@ -1,150 +0,0 @@ -package leadership - -import ( - "sync" - "time" - - "github.com/abronan/valkeyrie/store" -) - -const ( - defaultLockTTL = 20 * time.Second -) - -// Candidate runs the leader election algorithm asynchronously -type Candidate struct { - client store.Store - key string - node string - - electedCh chan bool - lock sync.Mutex - lockTTL time.Duration - leader bool - stopCh chan struct{} - stopRenew chan struct{} - resignCh chan bool - errCh chan error -} - -// NewCandidate creates a new Candidate -func NewCandidate(client store.Store, key, node string, ttl time.Duration) *Candidate { - return &Candidate{ - client: client, - key: key, - node: node, - - leader: false, - lockTTL: ttl, - resignCh: make(chan bool), - stopCh: make(chan struct{}), - } -} - -// IsLeader returns true if the candidate is currently a leader. -func (c *Candidate) IsLeader() bool { - return c.leader -} - -// RunForElection starts the leader election algorithm. Updates in status are -// pushed through the ElectedCh channel. -// -// ElectedCh is used to get a channel which delivers signals on -// acquiring or losing leadership. It sends true if we become -// the leader, and false if we lose it. -func (c *Candidate) RunForElection() (<-chan bool, <-chan error) { - c.electedCh = make(chan bool) - c.errCh = make(chan error) - - go c.campaign() - - return c.electedCh, c.errCh -} - -// Stop running for election. -func (c *Candidate) Stop() { - close(c.stopCh) -} - -// Resign forces the candidate to step-down and try again. -// If the candidate is not a leader, it doesn't have any effect. -// Candidate will retry immediately to acquire the leadership. If no-one else -// took it, then the Candidate will end up being a leader again. -func (c *Candidate) Resign() { - c.lock.Lock() - defer c.lock.Unlock() - - if c.leader { - c.resignCh <- true - } -} - -func (c *Candidate) update(status bool) { - c.lock.Lock() - defer c.lock.Unlock() - - c.leader = status - c.electedCh <- status -} - -func (c *Candidate) initLock() (store.Locker, error) { - // Give up on the lock session if - // we recovered from a store failure - if c.stopRenew != nil { - close(c.stopRenew) - } - - lockOpts := &store.LockOptions{ - Value: []byte(c.node), - } - - if c.lockTTL != defaultLockTTL { - lockOpts.TTL = c.lockTTL - } - - lockOpts.RenewLock = make(chan struct{}) - c.stopRenew = lockOpts.RenewLock - - lock, err := c.client.NewLock(c.key, lockOpts) - return lock, err -} - -func (c *Candidate) campaign() { - defer close(c.electedCh) - defer close(c.errCh) - - for { - // Start as a follower. - c.update(false) - - lock, err := c.initLock() - if err != nil { - c.errCh <- err - return - } - - lostCh, err := lock.Lock(nil) - if err != nil { - c.errCh <- err - return - } - - // Hooray! We acquired the lock therefore we are the new leader. - c.update(true) - - select { - case <-c.resignCh: - // We were asked to resign, give up the lock and go back - // campaigning. - lock.Unlock() - case <-c.stopCh: - // Give up the leadership and quit. - if c.leader { - lock.Unlock() - } - return - case <-lostCh: - // We lost the lock. Someone else is the leader, try again. - } - } -} diff --git a/vendor/github.com/docker/leadership/follower.go b/vendor/github.com/docker/leadership/follower.go deleted file mode 100644 index a41c72063..000000000 --- a/vendor/github.com/docker/leadership/follower.go +++ /dev/null @@ -1,74 +0,0 @@ -package leadership - -import ( - "errors" - - "github.com/abronan/valkeyrie/store" -) - -// Follower can follow an election in real-time and push notifications whenever -// there is a change in leadership. -type Follower struct { - client store.Store - key string - - leader string - leaderCh chan string - stopCh chan struct{} - errCh chan error -} - -// NewFollower creates a new follower. -func NewFollower(client store.Store, key string) *Follower { - return &Follower{ - client: client, - key: key, - stopCh: make(chan struct{}), - } -} - -// Leader returns the current leader. -func (f *Follower) Leader() string { - return f.leader -} - -// FollowElection starts monitoring the election. -func (f *Follower) FollowElection() (<-chan string, <-chan error) { - f.leaderCh = make(chan string) - f.errCh = make(chan error) - - go f.follow() - - return f.leaderCh, f.errCh -} - -// Stop stops monitoring an election. -func (f *Follower) Stop() { - close(f.stopCh) -} - -func (f *Follower) follow() { - defer close(f.leaderCh) - defer close(f.errCh) - - ch, err := f.client.Watch(f.key, f.stopCh, nil) - if err != nil { - f.errCh <- err - } - - f.leader = "" - for kv := range ch { - if kv == nil { - continue - } - curr := string(kv.Value) - if curr == f.leader { - continue - } - f.leader = curr - f.leaderCh <- f.leader - } - - // Channel closed, we return an error - f.errCh <- errors.New("Leader Election: watch leader channel closed, the store may be unavailable...") -} diff --git a/vendor/github.com/fatih/color/LICENSE.md b/vendor/github.com/fatih/color/LICENSE.md deleted file mode 100644 index 25fdaf639..000000000 --- a/vendor/github.com/fatih/color/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Fatih Arslan - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/fatih/color/color.go b/vendor/github.com/fatih/color/color.go deleted file mode 100644 index 7b5f3146d..000000000 --- a/vendor/github.com/fatih/color/color.go +++ /dev/null @@ -1,600 +0,0 @@ -package color - -import ( - "fmt" - "io" - "os" - "strconv" - "strings" - "sync" - - "github.com/mattn/go-colorable" - "github.com/mattn/go-isatty" -) - -var ( - // NoColor defines if the output is colorized or not. It's dynamically set to - // false or true based on the stdout's file descriptor referring to a terminal - // or not. This is a global option and affects all colors. For more control - // over each color block use the methods DisableColor() individually. - NoColor = os.Getenv("TERM") == "dumb" || - (!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd())) - - // Output defines the standard output of the print functions. By default - // os.Stdout is used. - Output = colorable.NewColorableStdout() - - // colorsCache is used to reduce the count of created Color objects and - // allows to reuse already created objects with required Attribute. - colorsCache = make(map[Attribute]*Color) - colorsCacheMu sync.Mutex // protects colorsCache -) - -// Color defines a custom color object which is defined by SGR parameters. -type Color struct { - params []Attribute - noColor *bool -} - -// Attribute defines a single SGR Code -type Attribute int - -const escape = "\x1b" - -// Base attributes -const ( - Reset Attribute = iota - Bold - Faint - Italic - Underline - BlinkSlow - BlinkRapid - ReverseVideo - Concealed - CrossedOut -) - -// Foreground text colors -const ( - FgBlack Attribute = iota + 30 - FgRed - FgGreen - FgYellow - FgBlue - FgMagenta - FgCyan - FgWhite -) - -// Foreground Hi-Intensity text colors -const ( - FgHiBlack Attribute = iota + 90 - FgHiRed - FgHiGreen - FgHiYellow - FgHiBlue - FgHiMagenta - FgHiCyan - FgHiWhite -) - -// Background text colors -const ( - BgBlack Attribute = iota + 40 - BgRed - BgGreen - BgYellow - BgBlue - BgMagenta - BgCyan - BgWhite -) - -// Background Hi-Intensity text colors -const ( - BgHiBlack Attribute = iota + 100 - BgHiRed - BgHiGreen - BgHiYellow - BgHiBlue - BgHiMagenta - BgHiCyan - BgHiWhite -) - -// New returns a newly created color object. -func New(value ...Attribute) *Color { - c := &Color{params: make([]Attribute, 0)} - c.Add(value...) - return c -} - -// Set sets the given parameters immediately. It will change the color of -// output with the given SGR parameters until color.Unset() is called. -func Set(p ...Attribute) *Color { - c := New(p...) - c.Set() - return c -} - -// Unset resets all escape attributes and clears the output. Usually should -// be called after Set(). -func Unset() { - if NoColor { - return - } - - fmt.Fprintf(Output, "%s[%dm", escape, Reset) -} - -// Set sets the SGR sequence. -func (c *Color) Set() *Color { - if c.isNoColorSet() { - return c - } - - fmt.Fprintf(Output, c.format()) - return c -} - -func (c *Color) unset() { - if c.isNoColorSet() { - return - } - - Unset() -} - -func (c *Color) setWriter(w io.Writer) *Color { - if c.isNoColorSet() { - return c - } - - fmt.Fprintf(w, c.format()) - return c -} - -func (c *Color) unsetWriter(w io.Writer) { - if c.isNoColorSet() { - return - } - - if NoColor { - return - } - - fmt.Fprintf(w, "%s[%dm", escape, Reset) -} - -// Add is used to chain SGR parameters. Use as many as parameters to combine -// and create custom color objects. Example: Add(color.FgRed, color.Underline). -func (c *Color) Add(value ...Attribute) *Color { - c.params = append(c.params, value...) - return c -} - -func (c *Color) prepend(value Attribute) { - c.params = append(c.params, 0) - copy(c.params[1:], c.params[0:]) - c.params[0] = value -} - -// Fprint formats using the default formats for its operands and writes to w. -// Spaces are added between operands when neither is a string. -// It returns the number of bytes written and any write error encountered. -// On Windows, users should wrap w with colorable.NewColorable() if w is of -// type *os.File. -func (c *Color) Fprint(w io.Writer, a ...interface{}) (n int, err error) { - c.setWriter(w) - defer c.unsetWriter(w) - - return fmt.Fprint(w, a...) -} - -// Print formats using the default formats for its operands and writes to -// standard output. Spaces are added between operands when neither is a -// string. It returns the number of bytes written and any write error -// encountered. This is the standard fmt.Print() method wrapped with the given -// color. -func (c *Color) Print(a ...interface{}) (n int, err error) { - c.Set() - defer c.unset() - - return fmt.Fprint(Output, a...) -} - -// Fprintf formats according to a format specifier and writes to w. -// It returns the number of bytes written and any write error encountered. -// On Windows, users should wrap w with colorable.NewColorable() if w is of -// type *os.File. -func (c *Color) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - c.setWriter(w) - defer c.unsetWriter(w) - - return fmt.Fprintf(w, format, a...) -} - -// Printf formats according to a format specifier and writes to standard output. -// It returns the number of bytes written and any write error encountered. -// This is the standard fmt.Printf() method wrapped with the given color. -func (c *Color) Printf(format string, a ...interface{}) (n int, err error) { - c.Set() - defer c.unset() - - return fmt.Fprintf(Output, format, a...) -} - -// Fprintln formats using the default formats for its operands and writes to w. -// Spaces are always added between operands and a newline is appended. -// On Windows, users should wrap w with colorable.NewColorable() if w is of -// type *os.File. -func (c *Color) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { - c.setWriter(w) - defer c.unsetWriter(w) - - return fmt.Fprintln(w, a...) -} - -// Println formats using the default formats for its operands and writes to -// standard output. Spaces are always added between operands and a newline is -// appended. It returns the number of bytes written and any write error -// encountered. This is the standard fmt.Print() method wrapped with the given -// color. -func (c *Color) Println(a ...interface{}) (n int, err error) { - c.Set() - defer c.unset() - - return fmt.Fprintln(Output, a...) -} - -// Sprint is just like Print, but returns a string instead of printing it. -func (c *Color) Sprint(a ...interface{}) string { - return c.wrap(fmt.Sprint(a...)) -} - -// Sprintln is just like Println, but returns a string instead of printing it. -func (c *Color) Sprintln(a ...interface{}) string { - return c.wrap(fmt.Sprintln(a...)) -} - -// Sprintf is just like Printf, but returns a string instead of printing it. -func (c *Color) Sprintf(format string, a ...interface{}) string { - return c.wrap(fmt.Sprintf(format, a...)) -} - -// FprintFunc returns a new function that prints the passed arguments as -// colorized with color.Fprint(). -func (c *Color) FprintFunc() func(w io.Writer, a ...interface{}) { - return func(w io.Writer, a ...interface{}) { - c.Fprint(w, a...) - } -} - -// PrintFunc returns a new function that prints the passed arguments as -// colorized with color.Print(). -func (c *Color) PrintFunc() func(a ...interface{}) { - return func(a ...interface{}) { - c.Print(a...) - } -} - -// FprintfFunc returns a new function that prints the passed arguments as -// colorized with color.Fprintf(). -func (c *Color) FprintfFunc() func(w io.Writer, format string, a ...interface{}) { - return func(w io.Writer, format string, a ...interface{}) { - c.Fprintf(w, format, a...) - } -} - -// PrintfFunc returns a new function that prints the passed arguments as -// colorized with color.Printf(). -func (c *Color) PrintfFunc() func(format string, a ...interface{}) { - return func(format string, a ...interface{}) { - c.Printf(format, a...) - } -} - -// FprintlnFunc returns a new function that prints the passed arguments as -// colorized with color.Fprintln(). -func (c *Color) FprintlnFunc() func(w io.Writer, a ...interface{}) { - return func(w io.Writer, a ...interface{}) { - c.Fprintln(w, a...) - } -} - -// PrintlnFunc returns a new function that prints the passed arguments as -// colorized with color.Println(). -func (c *Color) PrintlnFunc() func(a ...interface{}) { - return func(a ...interface{}) { - c.Println(a...) - } -} - -// SprintFunc returns a new function that returns colorized strings for the -// given arguments with fmt.Sprint(). Useful to put into or mix into other -// string. Windows users should use this in conjunction with color.Output, example: -// -// put := New(FgYellow).SprintFunc() -// fmt.Fprintf(color.Output, "This is a %s", put("warning")) -func (c *Color) SprintFunc() func(a ...interface{}) string { - return func(a ...interface{}) string { - return c.wrap(fmt.Sprint(a...)) - } -} - -// SprintfFunc returns a new function that returns colorized strings for the -// given arguments with fmt.Sprintf(). Useful to put into or mix into other -// string. Windows users should use this in conjunction with color.Output. -func (c *Color) SprintfFunc() func(format string, a ...interface{}) string { - return func(format string, a ...interface{}) string { - return c.wrap(fmt.Sprintf(format, a...)) - } -} - -// SprintlnFunc returns a new function that returns colorized strings for the -// given arguments with fmt.Sprintln(). Useful to put into or mix into other -// string. Windows users should use this in conjunction with color.Output. -func (c *Color) SprintlnFunc() func(a ...interface{}) string { - return func(a ...interface{}) string { - return c.wrap(fmt.Sprintln(a...)) - } -} - -// sequence returns a formated SGR sequence to be plugged into a "\x1b[...m" -// an example output might be: "1;36" -> bold cyan -func (c *Color) sequence() string { - format := make([]string, len(c.params)) - for i, v := range c.params { - format[i] = strconv.Itoa(int(v)) - } - - return strings.Join(format, ";") -} - -// wrap wraps the s string with the colors attributes. The string is ready to -// be printed. -func (c *Color) wrap(s string) string { - if c.isNoColorSet() { - return s - } - - return c.format() + s + c.unformat() -} - -func (c *Color) format() string { - return fmt.Sprintf("%s[%sm", escape, c.sequence()) -} - -func (c *Color) unformat() string { - return fmt.Sprintf("%s[%dm", escape, Reset) -} - -// DisableColor disables the color output. Useful to not change any existing -// code and still being able to output. Can be used for flags like -// "--no-color". To enable back use EnableColor() method. -func (c *Color) DisableColor() { - c.noColor = boolPtr(true) -} - -// EnableColor enables the color output. Use it in conjunction with -// DisableColor(). Otherwise this method has no side effects. -func (c *Color) EnableColor() { - c.noColor = boolPtr(false) -} - -func (c *Color) isNoColorSet() bool { - // check first if we have user setted action - if c.noColor != nil { - return *c.noColor - } - - // if not return the global option, which is disabled by default - return NoColor -} - -// Equals returns a boolean value indicating whether two colors are equal. -func (c *Color) Equals(c2 *Color) bool { - if len(c.params) != len(c2.params) { - return false - } - - for _, attr := range c.params { - if !c2.attrExists(attr) { - return false - } - } - - return true -} - -func (c *Color) attrExists(a Attribute) bool { - for _, attr := range c.params { - if attr == a { - return true - } - } - - return false -} - -func boolPtr(v bool) *bool { - return &v -} - -func getCachedColor(p Attribute) *Color { - colorsCacheMu.Lock() - defer colorsCacheMu.Unlock() - - c, ok := colorsCache[p] - if !ok { - c = New(p) - colorsCache[p] = c - } - - return c -} - -func colorPrint(format string, p Attribute, a ...interface{}) { - c := getCachedColor(p) - - if !strings.HasSuffix(format, "\n") { - format += "\n" - } - - if len(a) == 0 { - c.Print(format) - } else { - c.Printf(format, a...) - } -} - -func colorString(format string, p Attribute, a ...interface{}) string { - c := getCachedColor(p) - - if len(a) == 0 { - return c.SprintFunc()(format) - } - - return c.SprintfFunc()(format, a...) -} - -// Black is a convenient helper function to print with black foreground. A -// newline is appended to format by default. -func Black(format string, a ...interface{}) { colorPrint(format, FgBlack, a...) } - -// Red is a convenient helper function to print with red foreground. A -// newline is appended to format by default. -func Red(format string, a ...interface{}) { colorPrint(format, FgRed, a...) } - -// Green is a convenient helper function to print with green foreground. A -// newline is appended to format by default. -func Green(format string, a ...interface{}) { colorPrint(format, FgGreen, a...) } - -// Yellow is a convenient helper function to print with yellow foreground. -// A newline is appended to format by default. -func Yellow(format string, a ...interface{}) { colorPrint(format, FgYellow, a...) } - -// Blue is a convenient helper function to print with blue foreground. A -// newline is appended to format by default. -func Blue(format string, a ...interface{}) { colorPrint(format, FgBlue, a...) } - -// Magenta is a convenient helper function to print with magenta foreground. -// A newline is appended to format by default. -func Magenta(format string, a ...interface{}) { colorPrint(format, FgMagenta, a...) } - -// Cyan is a convenient helper function to print with cyan foreground. A -// newline is appended to format by default. -func Cyan(format string, a ...interface{}) { colorPrint(format, FgCyan, a...) } - -// White is a convenient helper function to print with white foreground. A -// newline is appended to format by default. -func White(format string, a ...interface{}) { colorPrint(format, FgWhite, a...) } - -// BlackString is a convenient helper function to return a string with black -// foreground. -func BlackString(format string, a ...interface{}) string { return colorString(format, FgBlack, a...) } - -// RedString is a convenient helper function to return a string with red -// foreground. -func RedString(format string, a ...interface{}) string { return colorString(format, FgRed, a...) } - -// GreenString is a convenient helper function to return a string with green -// foreground. -func GreenString(format string, a ...interface{}) string { return colorString(format, FgGreen, a...) } - -// YellowString is a convenient helper function to return a string with yellow -// foreground. -func YellowString(format string, a ...interface{}) string { return colorString(format, FgYellow, a...) } - -// BlueString is a convenient helper function to return a string with blue -// foreground. -func BlueString(format string, a ...interface{}) string { return colorString(format, FgBlue, a...) } - -// MagentaString is a convenient helper function to return a string with magenta -// foreground. -func MagentaString(format string, a ...interface{}) string { - return colorString(format, FgMagenta, a...) -} - -// CyanString is a convenient helper function to return a string with cyan -// foreground. -func CyanString(format string, a ...interface{}) string { return colorString(format, FgCyan, a...) } - -// WhiteString is a convenient helper function to return a string with white -// foreground. -func WhiteString(format string, a ...interface{}) string { return colorString(format, FgWhite, a...) } - -// HiBlack is a convenient helper function to print with hi-intensity black foreground. A -// newline is appended to format by default. -func HiBlack(format string, a ...interface{}) { colorPrint(format, FgHiBlack, a...) } - -// HiRed is a convenient helper function to print with hi-intensity red foreground. A -// newline is appended to format by default. -func HiRed(format string, a ...interface{}) { colorPrint(format, FgHiRed, a...) } - -// HiGreen is a convenient helper function to print with hi-intensity green foreground. A -// newline is appended to format by default. -func HiGreen(format string, a ...interface{}) { colorPrint(format, FgHiGreen, a...) } - -// HiYellow is a convenient helper function to print with hi-intensity yellow foreground. -// A newline is appended to format by default. -func HiYellow(format string, a ...interface{}) { colorPrint(format, FgHiYellow, a...) } - -// HiBlue is a convenient helper function to print with hi-intensity blue foreground. A -// newline is appended to format by default. -func HiBlue(format string, a ...interface{}) { colorPrint(format, FgHiBlue, a...) } - -// HiMagenta is a convenient helper function to print with hi-intensity magenta foreground. -// A newline is appended to format by default. -func HiMagenta(format string, a ...interface{}) { colorPrint(format, FgHiMagenta, a...) } - -// HiCyan is a convenient helper function to print with hi-intensity cyan foreground. A -// newline is appended to format by default. -func HiCyan(format string, a ...interface{}) { colorPrint(format, FgHiCyan, a...) } - -// HiWhite is a convenient helper function to print with hi-intensity white foreground. A -// newline is appended to format by default. -func HiWhite(format string, a ...interface{}) { colorPrint(format, FgHiWhite, a...) } - -// HiBlackString is a convenient helper function to return a string with hi-intensity black -// foreground. -func HiBlackString(format string, a ...interface{}) string { - return colorString(format, FgHiBlack, a...) -} - -// HiRedString is a convenient helper function to return a string with hi-intensity red -// foreground. -func HiRedString(format string, a ...interface{}) string { return colorString(format, FgHiRed, a...) } - -// HiGreenString is a convenient helper function to return a string with hi-intensity green -// foreground. -func HiGreenString(format string, a ...interface{}) string { - return colorString(format, FgHiGreen, a...) -} - -// HiYellowString is a convenient helper function to return a string with hi-intensity yellow -// foreground. -func HiYellowString(format string, a ...interface{}) string { - return colorString(format, FgHiYellow, a...) -} - -// HiBlueString is a convenient helper function to return a string with hi-intensity blue -// foreground. -func HiBlueString(format string, a ...interface{}) string { return colorString(format, FgHiBlue, a...) } - -// HiMagentaString is a convenient helper function to return a string with hi-intensity magenta -// foreground. -func HiMagentaString(format string, a ...interface{}) string { - return colorString(format, FgHiMagenta, a...) -} - -// HiCyanString is a convenient helper function to return a string with hi-intensity cyan -// foreground. -func HiCyanString(format string, a ...interface{}) string { return colorString(format, FgHiCyan, a...) } - -// HiWhiteString is a convenient helper function to return a string with hi-intensity white -// foreground. -func HiWhiteString(format string, a ...interface{}) string { - return colorString(format, FgHiWhite, a...) -} diff --git a/vendor/github.com/fatih/color/doc.go b/vendor/github.com/fatih/color/doc.go deleted file mode 100644 index cf1e96500..000000000 --- a/vendor/github.com/fatih/color/doc.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -Package color is an ANSI color package to output colorized or SGR defined -output to the standard output. The API can be used in several way, pick one -that suits you. - -Use simple and default helper functions with predefined foreground colors: - - color.Cyan("Prints text in cyan.") - - // a newline will be appended automatically - color.Blue("Prints %s in blue.", "text") - - // More default foreground colors.. - color.Red("We have red") - color.Yellow("Yellow color too!") - color.Magenta("And many others ..") - - // Hi-intensity colors - color.HiGreen("Bright green color.") - color.HiBlack("Bright black means gray..") - color.HiWhite("Shiny white color!") - -However there are times where custom color mixes are required. Below are some -examples to create custom color objects and use the print functions of each -separate color object. - - // Create a new color object - c := color.New(color.FgCyan).Add(color.Underline) - c.Println("Prints cyan text with an underline.") - - // Or just add them to New() - d := color.New(color.FgCyan, color.Bold) - d.Printf("This prints bold cyan %s\n", "too!.") - - - // Mix up foreground and background colors, create new mixes! - red := color.New(color.FgRed) - - boldRed := red.Add(color.Bold) - boldRed.Println("This will print text in bold red.") - - whiteBackground := red.Add(color.BgWhite) - whiteBackground.Println("Red text with White background.") - - // Use your own io.Writer output - color.New(color.FgBlue).Fprintln(myWriter, "blue color!") - - blue := color.New(color.FgBlue) - blue.Fprint(myWriter, "This will print text in blue.") - -You can create PrintXxx functions to simplify even more: - - // Create a custom print function for convenient - red := color.New(color.FgRed).PrintfFunc() - red("warning") - red("error: %s", err) - - // Mix up multiple attributes - notice := color.New(color.Bold, color.FgGreen).PrintlnFunc() - notice("don't forget this...") - -You can also FprintXxx functions to pass your own io.Writer: - - blue := color.New(FgBlue).FprintfFunc() - blue(myWriter, "important notice: %s", stars) - - // Mix up with multiple attributes - success := color.New(color.Bold, color.FgGreen).FprintlnFunc() - success(myWriter, don't forget this...") - - -Or create SprintXxx functions to mix strings with other non-colorized strings: - - yellow := New(FgYellow).SprintFunc() - red := New(FgRed).SprintFunc() - - fmt.Printf("this is a %s and this is %s.\n", yellow("warning"), red("error")) - - info := New(FgWhite, BgGreen).SprintFunc() - fmt.Printf("this %s rocks!\n", info("package")) - -Windows support is enabled by default. All Print functions work as intended. -However only for color.SprintXXX functions, user should use fmt.FprintXXX and -set the output to color.Output: - - fmt.Fprintf(color.Output, "Windows support: %s", color.GreenString("PASS")) - - info := New(FgWhite, BgGreen).SprintFunc() - fmt.Fprintf(color.Output, "this %s rocks!\n", info("package")) - -Using with existing code is possible. Just use the Set() method to set the -standard output to the given parameters. That way a rewrite of an existing -code is not required. - - // Use handy standard colors. - color.Set(color.FgYellow) - - fmt.Println("Existing text will be now in Yellow") - fmt.Printf("This one %s\n", "too") - - color.Unset() // don't forget to unset - - // You can mix up parameters - color.Set(color.FgMagenta, color.Bold) - defer color.Unset() // use it in your function - - fmt.Println("All text will be now bold magenta.") - -There might be a case where you want to disable color output (for example to -pipe the standard output of your app to somewhere else). `Color` has support to -disable colors both globally and for single color definition. For example -suppose you have a CLI app and a `--no-color` bool flag. You can easily disable -the color output with: - - var flagNoColor = flag.Bool("no-color", false, "Disable color output") - - if *flagNoColor { - color.NoColor = true // disables colorized output - } - -It also has support for single color definitions (local). You can -disable/enable color output on the fly: - - c := color.New(color.FgCyan) - c.Println("Prints cyan text") - - c.DisableColor() - c.Println("This is printed without any color") - - c.EnableColor() - c.Println("This prints again cyan...") -*/ -package color diff --git a/vendor/github.com/go-acme/lego/acme/api/internal/sender/useragent.go b/vendor/github.com/go-acme/lego/acme/api/internal/sender/useragent.go index b8d84a0f4..822ea5b11 100644 --- a/vendor/github.com/go-acme/lego/acme/api/internal/sender/useragent.go +++ b/vendor/github.com/go-acme/lego/acme/api/internal/sender/useragent.go @@ -5,10 +5,10 @@ package sender const ( // ourUserAgent is the User-Agent of this underlying library package. - ourUserAgent = "xenolf-acme/2.3.0" + ourUserAgent = "xenolf-acme/2.4.0" // ourUserAgentComment is part of the UA comment linked to the version status of this underlying library package. // values: detach|release // NOTE: Update this with each tagged release. - ourUserAgentComment = "detach" + ourUserAgentComment = "release" ) diff --git a/vendor/github.com/go-acme/lego/providers/dns/dns_providers.go b/vendor/github.com/go-acme/lego/providers/dns/dns_providers.go index 62bc40dec..a8def0919 100644 --- a/vendor/github.com/go-acme/lego/providers/dns/dns_providers.go +++ b/vendor/github.com/go-acme/lego/providers/dns/dns_providers.go @@ -19,6 +19,7 @@ import ( "github.com/go-acme/lego/providers/dns/dnsimple" "github.com/go-acme/lego/providers/dns/dnsmadeeasy" "github.com/go-acme/lego/providers/dns/dnspod" + "github.com/go-acme/lego/providers/dns/dode" "github.com/go-acme/lego/providers/dns/dreamhost" "github.com/go-acme/lego/providers/dns/duckdns" "github.com/go-acme/lego/providers/dns/dyn" @@ -91,6 +92,8 @@ func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) { return dnsmadeeasy.NewDNSProvider() case "dnspod": return dnspod.NewDNSProvider() + case "dode": + return dode.NewDNSProvider() case "dreamhost": return dreamhost.NewDNSProvider() case "duckdns": diff --git a/vendor/github.com/go-acme/lego/providers/dns/dode/client.go b/vendor/github.com/go-acme/lego/providers/dns/dode/client.go new file mode 100644 index 000000000..193b5160d --- /dev/null +++ b/vendor/github.com/go-acme/lego/providers/dns/dode/client.go @@ -0,0 +1,57 @@ +package dode + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/url" + + "github.com/go-acme/lego/challenge/dns01" +) + +type apiResponse struct { + Domain string + Success bool +} + +// updateTxtRecord Update the domains TXT record +// To update the TXT record we just need to make one simple get request. +func (d *DNSProvider) updateTxtRecord(fqdn, token, txt string, clear bool) error { + u, _ := url.Parse("https://www.do.de/api/letsencrypt") + + query := u.Query() + query.Set("token", token) + query.Set("domain", dns01.UnFqdn(fqdn)) + + // api call differs per set/delete + if clear { + query.Set("action", "delete") + } else { + query.Set("value", txt) + } + + u.RawQuery = query.Encode() + + response, err := d.config.HTTPClient.Get(u.String()) + if err != nil { + return err + } + defer response.Body.Close() + + bodyBytes, err := ioutil.ReadAll(response.Body) + if err != nil { + return err + } + + var r apiResponse + err = json.Unmarshal(bodyBytes, &r) + if err != nil { + return fmt.Errorf("request to change TXT record for do.de returned the following invalid json (%s); used url [%s]", string(bodyBytes), u) + } + + body := string(bodyBytes) + if !r.Success { + return fmt.Errorf("request to change TXT record for do.de returned the following error result (%s); used url [%s]", body, u) + } + return nil +} diff --git a/vendor/github.com/go-acme/lego/providers/dns/dode/dode.go b/vendor/github.com/go-acme/lego/providers/dns/dode/dode.go new file mode 100644 index 000000000..693543a77 --- /dev/null +++ b/vendor/github.com/go-acme/lego/providers/dns/dode/dode.go @@ -0,0 +1,89 @@ +// Package dode implements a DNS provider for solving the DNS-01 challenge using do.de. +package dode + +import ( + "errors" + "fmt" + "net/http" + "time" + + "github.com/go-acme/lego/challenge/dns01" + "github.com/go-acme/lego/platform/config/env" +) + +// Config is used to configure the creation of the DNSProvider +type Config struct { + Token string + PropagationTimeout time.Duration + PollingInterval time.Duration + SequenceInterval time.Duration + HTTPClient *http.Client +} + +// NewDefaultConfig returns a default configuration for the DNSProvider +func NewDefaultConfig() *Config { + return &Config{ + PropagationTimeout: env.GetOrDefaultSecond("DODE_PROPAGATION_TIMEOUT", dns01.DefaultPropagationTimeout), + PollingInterval: env.GetOrDefaultSecond("DODE_POLLING_INTERVAL", dns01.DefaultPollingInterval), + SequenceInterval: env.GetOrDefaultSecond("DODE_SEQUENCE_INTERVAL", dns01.DefaultPropagationTimeout), + HTTPClient: &http.Client{ + Timeout: env.GetOrDefaultSecond("DODE_HTTP_TIMEOUT", 30*time.Second), + }, + } +} + +// DNSProvider adds and removes the record for the DNS challenge +type DNSProvider struct { + config *Config +} + +// NewDNSProvider returns a new DNS provider using +// environment variable DODE_TOKEN for adding and removing the DNS record. +func NewDNSProvider() (*DNSProvider, error) { + values, err := env.Get("DODE_TOKEN") + if err != nil { + return nil, fmt.Errorf("do.de: %v", err) + } + + config := NewDefaultConfig() + config.Token = values["DODE_TOKEN"] + + return NewDNSProviderConfig(config) +} + +// NewDNSProviderConfig return a DNSProvider instance configured for do.de. +func NewDNSProviderConfig(config *Config) (*DNSProvider, error) { + if config == nil { + return nil, errors.New("do.de: the configuration of the DNS provider is nil") + } + + if config.Token == "" { + return nil, errors.New("do.de: credentials missing") + } + + return &DNSProvider{config: config}, nil +} + +// Present creates a TXT record to fulfill the dns-01 challenge. +func (d *DNSProvider) Present(domain, token, keyAuth string) error { + fqdn, txtRecord := dns01.GetRecord(domain, keyAuth) + return d.updateTxtRecord(fqdn, d.config.Token, txtRecord, false) +} + +// CleanUp clears TXT record +func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { + fqdn, _ := dns01.GetRecord(domain, keyAuth) + return d.updateTxtRecord(fqdn, d.config.Token, "", true) +} + +// Timeout returns the timeout and interval to use when checking for DNS propagation. +// Adjusting here to cope with spikes in propagation times. +func (d *DNSProvider) Timeout() (timeout, interval time.Duration) { + return d.config.PropagationTimeout, d.config.PollingInterval +} + +// Sequential All DNS challenges for this provider will be resolved sequentially. +// Returns the interval between each iteration. +func (d *DNSProvider) Sequential() time.Duration { + return d.config.SequenceInterval +} diff --git a/vendor/github.com/go-acme/lego/providers/dns/hostingde/hostingde.go b/vendor/github.com/go-acme/lego/providers/dns/hostingde/hostingde.go index 817622c3e..4a00f0451 100644 --- a/vendor/github.com/go-acme/lego/providers/dns/hostingde/hostingde.go +++ b/vendor/github.com/go-acme/lego/providers/dns/hostingde/hostingde.go @@ -91,7 +91,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { zonesFind := ZoneConfigsFindRequest{ Filter: Filter{ Field: "zoneName", - Value: domain, + Value: d.config.ZoneName, }, Limit: 1, Page: 1, @@ -151,7 +151,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { zonesFind := ZoneConfigsFindRequest{ Filter: Filter{ Field: "zoneName", - Value: domain, + Value: d.config.ZoneName, }, Limit: 1, Page: 1, diff --git a/vendor/github.com/go-acme/lego/providers/dns/pdns/client.go b/vendor/github.com/go-acme/lego/providers/dns/pdns/client.go index 4b58159ca..c66181eff 100644 --- a/vendor/github.com/go-acme/lego/providers/dns/pdns/client.go +++ b/vendor/github.com/go-acme/lego/providers/dns/pdns/client.go @@ -127,7 +127,7 @@ func (d *DNSProvider) findTxtRecord(fqdn string) (*rrSet, error) { } } - return nil, fmt.Errorf("no existing record found for %s", fqdn) + return nil, nil } func (d *DNSProvider) getAPIVersion() (int, error) { diff --git a/vendor/github.com/go-acme/lego/providers/dns/pdns/pdns.go b/vendor/github.com/go-acme/lego/providers/dns/pdns/pdns.go index 997d9998a..87adedb2a 100644 --- a/vendor/github.com/go-acme/lego/providers/dns/pdns/pdns.go +++ b/vendor/github.com/go-acme/lego/providers/dns/pdns/pdns.go @@ -121,6 +121,19 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { TTL: d.config.TTL, } + // Look for existing records. + existingRrSet, err := d.findTxtRecord(fqdn) + if err != nil { + return fmt.Errorf("pdns: %v", err) + } + + // merge the existing and new records + var records []Record + if existingRrSet != nil { + records = existingRrSet.Records + } + records = append(records, rec) + rrsets := rrSets{ RRSets: []rrSet{ { @@ -129,7 +142,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { Type: "TXT", Kind: "Master", TTL: d.config.TTL, - Records: []Record{rec}, + Records: records, }, }, } @@ -159,6 +172,9 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { if err != nil { return fmt.Errorf("pdns: %v", err) } + if set == nil { + return fmt.Errorf("pdns: no existing record found for %s", fqdn) + } rrsets := rrSets{ RRSets: []rrSet{ diff --git a/vendor/github.com/gogo/protobuf/gogoproto/doc.go b/vendor/github.com/gogo/protobuf/gogoproto/doc.go deleted file mode 100644 index 5ecfae113..000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/doc.go +++ /dev/null @@ -1,168 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package gogoproto provides extensions for protocol buffers to achieve: - - - fast marshalling and unmarshalling. - - peace of mind by optionally generating test and benchmark code. - - more canonical Go structures. - - less typing by optionally generating extra helper code. - - goprotobuf compatibility - -More Canonical Go Structures - -A lot of time working with a goprotobuf struct will lead you to a place where you create another struct that is easier to work with and then have a function to copy the values between the two structs. -You might also find that basic structs that started their life as part of an API need to be sent over the wire. With gob, you could just send it. With goprotobuf, you need to make a parallel struct. -Gogoprotobuf tries to fix these problems with the nullable, embed, customtype and customname field extensions. - - - nullable, if false, a field is generated without a pointer (see warning below). - - embed, if true, the field is generated as an embedded field. - - customtype, It works with the Marshal and Unmarshal methods, to allow you to have your own types in your struct, but marshal to bytes. For example, custom.Uuid or custom.Fixed128 - - customname (beta), Changes the generated fieldname. This is especially useful when generated methods conflict with fieldnames. - - casttype (beta), Changes the generated fieldtype. All generated code assumes that this type is castable to the protocol buffer field type. It does not work for structs or enums. - - castkey (beta), Changes the generated fieldtype for a map key. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps. - - castvalue (beta), Changes the generated fieldtype for a map value. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps. - -Warning about nullable: According to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of Protocol Buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset. - -Let us look at: - - github.com/gogo/protobuf/test/example/example.proto - -for a quicker overview. - -The following message: - - package test; - - import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - - message A { - optional string Description = 1 [(gogoproto.nullable) = false]; - optional int64 Number = 2 [(gogoproto.nullable) = false]; - optional bytes Id = 3 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uuid", (gogoproto.nullable) = false]; - } - -Will generate a go struct which looks a lot like this: - - type A struct { - Description string - Number int64 - Id github_com_gogo_protobuf_test_custom.Uuid - } - -You will see there are no pointers, since all fields are non-nullable. -You will also see a custom type which marshals to a string. -Be warned it is your responsibility to test your custom types thoroughly. -You should think of every possible empty and nil case for your marshaling, unmarshaling and size methods. - -Next we will embed the message A in message B. - - message B { - optional A A = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; - repeated bytes G = 2 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uint128", (gogoproto.nullable) = false]; - } - -See below that A is embedded in B. - - type B struct { - A - G []github_com_gogo_protobuf_test_custom.Uint128 - } - -Also see the repeated custom type. - - type Uint128 [2]uint64 - -Next we will create a custom name for one of our fields. - - message C { - optional int64 size = 1 [(gogoproto.customname) = "MySize"]; - } - -See below that the field's name is MySize and not Size. - - type C struct { - MySize *int64 - } - -The is useful when having a protocol buffer message with a field name which conflicts with a generated method. -As an example, having a field name size and using the sizer plugin to generate a Size method will cause a go compiler error. -Using customname you can fix this error without changing the field name. -This is typically useful when working with a protocol buffer that was designed before these methods and/or the go language were avialable. - -Gogoprotobuf also has some more subtle changes, these could be changed back: - - - the generated package name for imports do not have the extra /filename.pb, - but are actually the imports specified in the .proto file. - -Gogoprotobuf also has lost some features which should be brought back with time: - - - Marshalling and unmarshalling with reflect and without the unsafe package, - this requires work in pointer_reflect.go - -Why does nullable break protocol buffer specifications: - -The protocol buffer specification states, somewhere, that you should be able to tell whether a -field is set or unset. With the option nullable=false this feature is lost, -since your non-nullable fields will always be set. It can be seen as a layer on top of -protocol buffers, where before and after marshalling all non-nullable fields are set -and they cannot be unset. - -Goprotobuf Compatibility: - -Gogoprotobuf is compatible with Goprotobuf, because it is compatible with protocol buffers. -Gogoprotobuf generates the same code as goprotobuf if no extensions are used. -The enumprefix, getters and stringer extensions can be used to remove some of the unnecessary code generated by goprotobuf: - - - gogoproto_import, if false, the generated code imports github.com/golang/protobuf/proto instead of github.com/gogo/protobuf/proto. - - goproto_enum_prefix, if false, generates the enum constant names without the messagetype prefix - - goproto_enum_stringer (experimental), if false, the enum is generated without the default string method, this is useful for rather using enum_stringer, or allowing you to write your own string method. - - goproto_getters, if false, the message is generated without get methods, this is useful when you would rather want to use face - - goproto_stringer, if false, the message is generated without the default string method, this is useful for rather using stringer, or allowing you to write your own string method. - - goproto_extensions_map (beta), if false, the extensions field is generated as type []byte instead of type map[int32]proto.Extension - - goproto_unrecognized (beta), if false, XXX_unrecognized field is not generated. This is useful in conjunction with gogoproto.nullable=false, to generate structures completely devoid of pointers and reduce GC pressure at the cost of losing information about unrecognized fields. - -Less Typing and Peace of Mind is explained in their specific plugin folders godoc: - - - github.com/gogo/protobuf/plugin/ - -If you do not use any of these extension the code that is generated -will be the same as if goprotobuf has generated it. - -The most complete way to see examples is to look at - - github.com/gogo/protobuf/test/thetest.proto - -Gogoprototest is a seperate project, -because we want to keep gogoprotobuf independant of goprotobuf, -but we still want to test it thoroughly. - -*/ -package gogoproto diff --git a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go b/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go deleted file mode 100644 index 6da0e3e7f..000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go +++ /dev/null @@ -1,665 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: gogo.proto -// DO NOT EDIT! - -/* -Package gogoproto is a generated protocol buffer package. - -It is generated from these files: - gogo.proto - -It has these top-level messages: -*/ -package gogoproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - -var E_GoprotoEnumPrefix = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62001, - Name: "gogoproto.goproto_enum_prefix", - Tag: "varint,62001,opt,name=goproto_enum_prefix,json=goprotoEnumPrefix", -} - -var E_GoprotoEnumStringer = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62021, - Name: "gogoproto.goproto_enum_stringer", - Tag: "varint,62021,opt,name=goproto_enum_stringer,json=goprotoEnumStringer", -} - -var E_EnumStringer = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62022, - Name: "gogoproto.enum_stringer", - Tag: "varint,62022,opt,name=enum_stringer,json=enumStringer", -} - -var E_EnumCustomname = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.EnumOptions)(nil), - ExtensionType: (*string)(nil), - Field: 62023, - Name: "gogoproto.enum_customname", - Tag: "bytes,62023,opt,name=enum_customname,json=enumCustomname", -} - -var E_EnumvalueCustomname = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.EnumValueOptions)(nil), - ExtensionType: (*string)(nil), - Field: 66001, - Name: "gogoproto.enumvalue_customname", - Tag: "bytes,66001,opt,name=enumvalue_customname,json=enumvalueCustomname", -} - -var E_GoprotoGettersAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63001, - Name: "gogoproto.goproto_getters_all", - Tag: "varint,63001,opt,name=goproto_getters_all,json=goprotoGettersAll", -} - -var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63002, - Name: "gogoproto.goproto_enum_prefix_all", - Tag: "varint,63002,opt,name=goproto_enum_prefix_all,json=goprotoEnumPrefixAll", -} - -var E_GoprotoStringerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63003, - Name: "gogoproto.goproto_stringer_all", - Tag: "varint,63003,opt,name=goproto_stringer_all,json=goprotoStringerAll", -} - -var E_VerboseEqualAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63004, - Name: "gogoproto.verbose_equal_all", - Tag: "varint,63004,opt,name=verbose_equal_all,json=verboseEqualAll", -} - -var E_FaceAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63005, - Name: "gogoproto.face_all", - Tag: "varint,63005,opt,name=face_all,json=faceAll", -} - -var E_GostringAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63006, - Name: "gogoproto.gostring_all", - Tag: "varint,63006,opt,name=gostring_all,json=gostringAll", -} - -var E_PopulateAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63007, - Name: "gogoproto.populate_all", - Tag: "varint,63007,opt,name=populate_all,json=populateAll", -} - -var E_StringerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63008, - Name: "gogoproto.stringer_all", - Tag: "varint,63008,opt,name=stringer_all,json=stringerAll", -} - -var E_OnlyoneAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63009, - Name: "gogoproto.onlyone_all", - Tag: "varint,63009,opt,name=onlyone_all,json=onlyoneAll", -} - -var E_EqualAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63013, - Name: "gogoproto.equal_all", - Tag: "varint,63013,opt,name=equal_all,json=equalAll", -} - -var E_DescriptionAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63014, - Name: "gogoproto.description_all", - Tag: "varint,63014,opt,name=description_all,json=descriptionAll", -} - -var E_TestgenAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63015, - Name: "gogoproto.testgen_all", - Tag: "varint,63015,opt,name=testgen_all,json=testgenAll", -} - -var E_BenchgenAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63016, - Name: "gogoproto.benchgen_all", - Tag: "varint,63016,opt,name=benchgen_all,json=benchgenAll", -} - -var E_MarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63017, - Name: "gogoproto.marshaler_all", - Tag: "varint,63017,opt,name=marshaler_all,json=marshalerAll", -} - -var E_UnmarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63018, - Name: "gogoproto.unmarshaler_all", - Tag: "varint,63018,opt,name=unmarshaler_all,json=unmarshalerAll", -} - -var E_StableMarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63019, - Name: "gogoproto.stable_marshaler_all", - Tag: "varint,63019,opt,name=stable_marshaler_all,json=stableMarshalerAll", -} - -var E_SizerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63020, - Name: "gogoproto.sizer_all", - Tag: "varint,63020,opt,name=sizer_all,json=sizerAll", -} - -var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63021, - Name: "gogoproto.goproto_enum_stringer_all", - Tag: "varint,63021,opt,name=goproto_enum_stringer_all,json=goprotoEnumStringerAll", -} - -var E_EnumStringerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63022, - Name: "gogoproto.enum_stringer_all", - Tag: "varint,63022,opt,name=enum_stringer_all,json=enumStringerAll", -} - -var E_UnsafeMarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63023, - Name: "gogoproto.unsafe_marshaler_all", - Tag: "varint,63023,opt,name=unsafe_marshaler_all,json=unsafeMarshalerAll", -} - -var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63024, - Name: "gogoproto.unsafe_unmarshaler_all", - Tag: "varint,63024,opt,name=unsafe_unmarshaler_all,json=unsafeUnmarshalerAll", -} - -var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63025, - Name: "gogoproto.goproto_extensions_map_all", - Tag: "varint,63025,opt,name=goproto_extensions_map_all,json=goprotoExtensionsMapAll", -} - -var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63026, - Name: "gogoproto.goproto_unrecognized_all", - Tag: "varint,63026,opt,name=goproto_unrecognized_all,json=goprotoUnrecognizedAll", -} - -var E_GogoprotoImport = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63027, - Name: "gogoproto.gogoproto_import", - Tag: "varint,63027,opt,name=gogoproto_import,json=gogoprotoImport", -} - -var E_ProtosizerAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63028, - Name: "gogoproto.protosizer_all", - Tag: "varint,63028,opt,name=protosizer_all,json=protosizerAll", -} - -var E_CompareAll = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63029, - Name: "gogoproto.compare_all", - Tag: "varint,63029,opt,name=compare_all,json=compareAll", -} - -var E_GoprotoGetters = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64001, - Name: "gogoproto.goproto_getters", - Tag: "varint,64001,opt,name=goproto_getters,json=goprotoGetters", -} - -var E_GoprotoStringer = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64003, - Name: "gogoproto.goproto_stringer", - Tag: "varint,64003,opt,name=goproto_stringer,json=goprotoStringer", -} - -var E_VerboseEqual = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64004, - Name: "gogoproto.verbose_equal", - Tag: "varint,64004,opt,name=verbose_equal,json=verboseEqual", -} - -var E_Face = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64005, - Name: "gogoproto.face", - Tag: "varint,64005,opt,name=face", -} - -var E_Gostring = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64006, - Name: "gogoproto.gostring", - Tag: "varint,64006,opt,name=gostring", -} - -var E_Populate = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64007, - Name: "gogoproto.populate", - Tag: "varint,64007,opt,name=populate", -} - -var E_Stringer = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 67008, - Name: "gogoproto.stringer", - Tag: "varint,67008,opt,name=stringer", -} - -var E_Onlyone = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64009, - Name: "gogoproto.onlyone", - Tag: "varint,64009,opt,name=onlyone", -} - -var E_Equal = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64013, - Name: "gogoproto.equal", - Tag: "varint,64013,opt,name=equal", -} - -var E_Description = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64014, - Name: "gogoproto.description", - Tag: "varint,64014,opt,name=description", -} - -var E_Testgen = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64015, - Name: "gogoproto.testgen", - Tag: "varint,64015,opt,name=testgen", -} - -var E_Benchgen = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64016, - Name: "gogoproto.benchgen", - Tag: "varint,64016,opt,name=benchgen", -} - -var E_Marshaler = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64017, - Name: "gogoproto.marshaler", - Tag: "varint,64017,opt,name=marshaler", -} - -var E_Unmarshaler = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64018, - Name: "gogoproto.unmarshaler", - Tag: "varint,64018,opt,name=unmarshaler", -} - -var E_StableMarshaler = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64019, - Name: "gogoproto.stable_marshaler", - Tag: "varint,64019,opt,name=stable_marshaler,json=stableMarshaler", -} - -var E_Sizer = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64020, - Name: "gogoproto.sizer", - Tag: "varint,64020,opt,name=sizer", -} - -var E_UnsafeMarshaler = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64023, - Name: "gogoproto.unsafe_marshaler", - Tag: "varint,64023,opt,name=unsafe_marshaler,json=unsafeMarshaler", -} - -var E_UnsafeUnmarshaler = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64024, - Name: "gogoproto.unsafe_unmarshaler", - Tag: "varint,64024,opt,name=unsafe_unmarshaler,json=unsafeUnmarshaler", -} - -var E_GoprotoExtensionsMap = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64025, - Name: "gogoproto.goproto_extensions_map", - Tag: "varint,64025,opt,name=goproto_extensions_map,json=goprotoExtensionsMap", -} - -var E_GoprotoUnrecognized = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64026, - Name: "gogoproto.goproto_unrecognized", - Tag: "varint,64026,opt,name=goproto_unrecognized,json=goprotoUnrecognized", -} - -var E_Protosizer = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64028, - Name: "gogoproto.protosizer", - Tag: "varint,64028,opt,name=protosizer", -} - -var E_Compare = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64029, - Name: "gogoproto.compare", - Tag: "varint,64029,opt,name=compare", -} - -var E_Nullable = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65001, - Name: "gogoproto.nullable", - Tag: "varint,65001,opt,name=nullable", -} - -var E_Embed = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65002, - Name: "gogoproto.embed", - Tag: "varint,65002,opt,name=embed", -} - -var E_Customtype = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65003, - Name: "gogoproto.customtype", - Tag: "bytes,65003,opt,name=customtype", -} - -var E_Customname = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65004, - Name: "gogoproto.customname", - Tag: "bytes,65004,opt,name=customname", -} - -var E_Jsontag = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65005, - Name: "gogoproto.jsontag", - Tag: "bytes,65005,opt,name=jsontag", -} - -var E_Moretags = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65006, - Name: "gogoproto.moretags", - Tag: "bytes,65006,opt,name=moretags", -} - -var E_Casttype = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65007, - Name: "gogoproto.casttype", - Tag: "bytes,65007,opt,name=casttype", -} - -var E_Castkey = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65008, - Name: "gogoproto.castkey", - Tag: "bytes,65008,opt,name=castkey", -} - -var E_Castvalue = &proto.ExtensionDesc{ - ExtendedType: (*google_protobuf.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65009, - Name: "gogoproto.castvalue", - Tag: "bytes,65009,opt,name=castvalue", -} - -func init() { - proto.RegisterExtension(E_GoprotoEnumPrefix) - proto.RegisterExtension(E_GoprotoEnumStringer) - proto.RegisterExtension(E_EnumStringer) - proto.RegisterExtension(E_EnumCustomname) - proto.RegisterExtension(E_EnumvalueCustomname) - proto.RegisterExtension(E_GoprotoGettersAll) - proto.RegisterExtension(E_GoprotoEnumPrefixAll) - proto.RegisterExtension(E_GoprotoStringerAll) - proto.RegisterExtension(E_VerboseEqualAll) - proto.RegisterExtension(E_FaceAll) - proto.RegisterExtension(E_GostringAll) - proto.RegisterExtension(E_PopulateAll) - proto.RegisterExtension(E_StringerAll) - proto.RegisterExtension(E_OnlyoneAll) - proto.RegisterExtension(E_EqualAll) - proto.RegisterExtension(E_DescriptionAll) - proto.RegisterExtension(E_TestgenAll) - proto.RegisterExtension(E_BenchgenAll) - proto.RegisterExtension(E_MarshalerAll) - proto.RegisterExtension(E_UnmarshalerAll) - proto.RegisterExtension(E_StableMarshalerAll) - proto.RegisterExtension(E_SizerAll) - proto.RegisterExtension(E_GoprotoEnumStringerAll) - proto.RegisterExtension(E_EnumStringerAll) - proto.RegisterExtension(E_UnsafeMarshalerAll) - proto.RegisterExtension(E_UnsafeUnmarshalerAll) - proto.RegisterExtension(E_GoprotoExtensionsMapAll) - proto.RegisterExtension(E_GoprotoUnrecognizedAll) - proto.RegisterExtension(E_GogoprotoImport) - proto.RegisterExtension(E_ProtosizerAll) - proto.RegisterExtension(E_CompareAll) - proto.RegisterExtension(E_GoprotoGetters) - proto.RegisterExtension(E_GoprotoStringer) - proto.RegisterExtension(E_VerboseEqual) - proto.RegisterExtension(E_Face) - proto.RegisterExtension(E_Gostring) - proto.RegisterExtension(E_Populate) - proto.RegisterExtension(E_Stringer) - proto.RegisterExtension(E_Onlyone) - proto.RegisterExtension(E_Equal) - proto.RegisterExtension(E_Description) - proto.RegisterExtension(E_Testgen) - proto.RegisterExtension(E_Benchgen) - proto.RegisterExtension(E_Marshaler) - proto.RegisterExtension(E_Unmarshaler) - proto.RegisterExtension(E_StableMarshaler) - proto.RegisterExtension(E_Sizer) - proto.RegisterExtension(E_UnsafeMarshaler) - proto.RegisterExtension(E_UnsafeUnmarshaler) - proto.RegisterExtension(E_GoprotoExtensionsMap) - proto.RegisterExtension(E_GoprotoUnrecognized) - proto.RegisterExtension(E_Protosizer) - proto.RegisterExtension(E_Compare) - proto.RegisterExtension(E_Nullable) - proto.RegisterExtension(E_Embed) - proto.RegisterExtension(E_Customtype) - proto.RegisterExtension(E_Customname) - proto.RegisterExtension(E_Jsontag) - proto.RegisterExtension(E_Moretags) - proto.RegisterExtension(E_Casttype) - proto.RegisterExtension(E_Castkey) - proto.RegisterExtension(E_Castvalue) -} - -func init() { proto.RegisterFile("gogo.proto", fileDescriptorGogo) } - -var fileDescriptorGogo = []byte{ - // 1098 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x97, 0xc9, 0x6f, 0x1c, 0x45, - 0x14, 0x87, 0x85, 0x70, 0xe4, 0x99, 0xe7, 0x0d, 0x8f, 0x8d, 0x09, 0x11, 0x88, 0xe4, 0xc6, 0xc9, - 0x39, 0x45, 0x28, 0x65, 0x45, 0x96, 0x63, 0x39, 0xa3, 0x20, 0x0c, 0x23, 0x13, 0x07, 0x10, 0x87, - 0x51, 0xcf, 0xb8, 0xdc, 0x19, 0xe8, 0xee, 0x6a, 0xba, 0xba, 0xa3, 0x38, 0x37, 0x14, 0x16, 0x21, - 0xc4, 0x8e, 0x04, 0x09, 0x09, 0xcb, 0x81, 0x7d, 0x0d, 0xcb, 0x9d, 0x0b, 0x70, 0xe6, 0x7f, 0xe0, - 0x02, 0x98, 0x4d, 0xf2, 0xcd, 0x17, 0xf4, 0xba, 0xdf, 0xeb, 0xa9, 0x1e, 0x8f, 0x54, 0x35, 0xb7, - 0xf6, 0xb8, 0xbe, 0x6f, 0xaa, 0xdf, 0xeb, 0x7a, 0xbf, 0x69, 0x00, 0x5f, 0xf9, 0x6a, 0x31, 0x4e, - 0x54, 0xaa, 0x1a, 0x75, 0xbc, 0xce, 0x2f, 0x8f, 0x1c, 0xf5, 0x95, 0xf2, 0x03, 0x79, 0x3c, 0xff, - 0xab, 0x93, 0x6d, 0x1f, 0xdf, 0x92, 0xba, 0x9b, 0xf4, 0xe2, 0x54, 0x25, 0xc5, 0x62, 0xf1, 0x20, - 0xcc, 0xd1, 0xe2, 0xb6, 0x8c, 0xb2, 0xb0, 0x1d, 0x27, 0x72, 0xbb, 0x77, 0xa9, 0x71, 0xd7, 0x62, - 0x41, 0x2e, 0x32, 0xb9, 0xb8, 0x16, 0x65, 0xe1, 0x43, 0x71, 0xda, 0x53, 0x91, 0x3e, 0x7c, 0xf3, - 0xb7, 0x5b, 0x8f, 0xde, 0x72, 0x6f, 0x6d, 0x63, 0x96, 0x50, 0xfc, 0x5f, 0x2b, 0x07, 0xc5, 0x06, - 0xdc, 0x5e, 0xf1, 0xe9, 0x34, 0xe9, 0x45, 0xbe, 0x4c, 0x2c, 0xc6, 0x9f, 0xc8, 0x38, 0x67, 0x18, - 0x1f, 0x26, 0x54, 0xac, 0xc2, 0xd4, 0x28, 0xae, 0x9f, 0xc9, 0x35, 0x29, 0x4d, 0x49, 0x13, 0x66, - 0x72, 0x49, 0x37, 0xd3, 0xa9, 0x0a, 0x23, 0x2f, 0x94, 0x16, 0xcd, 0x2f, 0xb9, 0xa6, 0xbe, 0x31, - 0x8d, 0xd8, 0x6a, 0x49, 0x89, 0xf3, 0x30, 0x8f, 0x9f, 0x5c, 0xf4, 0x82, 0x4c, 0x9a, 0xb6, 0x63, - 0x43, 0x6d, 0xe7, 0x71, 0x19, 0x2b, 0x7f, 0xbd, 0x32, 0x96, 0x2b, 0xe7, 0x4a, 0x81, 0xe1, 0x35, - 0x3a, 0xe1, 0xcb, 0x34, 0x95, 0x89, 0x6e, 0x7b, 0x41, 0x30, 0x64, 0x93, 0x67, 0x7a, 0x41, 0x69, - 0xbc, 0xba, 0x5b, 0xed, 0x44, 0xb3, 0x20, 0x57, 0x82, 0x40, 0x6c, 0xc2, 0x1d, 0x43, 0x3a, 0xeb, - 0xe0, 0xbc, 0x46, 0xce, 0xf9, 0x03, 0xdd, 0x45, 0x6d, 0x0b, 0xf8, 0xf3, 0xb2, 0x1f, 0x0e, 0xce, - 0x77, 0xc8, 0xd9, 0x20, 0x96, 0xdb, 0x82, 0xc6, 0xfb, 0x61, 0xf6, 0xa2, 0x4c, 0x3a, 0x4a, 0xcb, - 0xb6, 0x7c, 0x2a, 0xf3, 0x02, 0x07, 0xdd, 0x75, 0xd2, 0xcd, 0x10, 0xb8, 0x86, 0x1c, 0xba, 0x4e, - 0x42, 0x6d, 0xdb, 0xeb, 0x4a, 0x07, 0xc5, 0x0d, 0x52, 0x8c, 0xe3, 0x7a, 0x44, 0x57, 0x60, 0xd2, - 0x57, 0xc5, 0x2d, 0x39, 0xe0, 0xef, 0x12, 0x3e, 0xc1, 0x0c, 0x29, 0x62, 0x15, 0x67, 0x81, 0x97, - 0xba, 0xec, 0xe0, 0x3d, 0x56, 0x30, 0x43, 0x8a, 0x11, 0xca, 0xfa, 0x3e, 0x2b, 0xb4, 0x51, 0xcf, - 0x65, 0x98, 0x50, 0x51, 0xb0, 0xa3, 0x22, 0x97, 0x4d, 0x7c, 0x40, 0x06, 0x20, 0x04, 0x05, 0x4b, - 0x50, 0x77, 0x6d, 0xc4, 0x87, 0x84, 0xd7, 0x24, 0x77, 0xa0, 0x09, 0x33, 0x3c, 0x64, 0x7a, 0x2a, - 0x72, 0x50, 0x7c, 0x44, 0x8a, 0x69, 0x03, 0xa3, 0xdb, 0x48, 0xa5, 0x4e, 0x7d, 0xe9, 0x22, 0xf9, - 0x98, 0x6f, 0x83, 0x10, 0x2a, 0x65, 0x47, 0x46, 0xdd, 0x0b, 0x6e, 0x86, 0x4f, 0xb8, 0x94, 0xcc, - 0xa0, 0x62, 0x15, 0xa6, 0x42, 0x2f, 0xd1, 0x17, 0xbc, 0xc0, 0xa9, 0x1d, 0x9f, 0x92, 0x63, 0xb2, - 0x84, 0xa8, 0x22, 0x59, 0x34, 0x8a, 0xe6, 0x33, 0xae, 0x88, 0x81, 0xd1, 0xd1, 0xd3, 0xa9, 0xd7, - 0x09, 0x64, 0x7b, 0x14, 0xdb, 0xe7, 0x7c, 0xf4, 0x0a, 0x76, 0xdd, 0x34, 0x2e, 0x41, 0x5d, 0xf7, - 0x2e, 0x3b, 0x69, 0xbe, 0xe0, 0x4e, 0xe7, 0x00, 0xc2, 0x8f, 0xc1, 0x9d, 0x43, 0x47, 0xbd, 0x83, - 0xec, 0x4b, 0x92, 0x2d, 0x0c, 0x19, 0xf7, 0x34, 0x12, 0x46, 0x55, 0x7e, 0xc5, 0x23, 0x41, 0x0e, - 0xb8, 0x5a, 0x30, 0x9f, 0x45, 0xda, 0xdb, 0x1e, 0xad, 0x6a, 0x5f, 0x73, 0xd5, 0x0a, 0xb6, 0x52, - 0xb5, 0x73, 0xb0, 0x40, 0xc6, 0xd1, 0xfa, 0xfa, 0x0d, 0x0f, 0xd6, 0x82, 0xde, 0xac, 0x76, 0xf7, - 0x71, 0x38, 0x52, 0x96, 0xf3, 0x52, 0x2a, 0x23, 0x8d, 0x4c, 0x3b, 0xf4, 0x62, 0x07, 0xf3, 0x4d, - 0x32, 0xf3, 0xc4, 0x5f, 0x2b, 0x05, 0xeb, 0x5e, 0x8c, 0xf2, 0x47, 0xe1, 0x30, 0xcb, 0xb3, 0x28, - 0x91, 0x5d, 0xe5, 0x47, 0xbd, 0xcb, 0x72, 0xcb, 0x41, 0xfd, 0xed, 0x40, 0xab, 0x36, 0x0d, 0x1c, - 0xcd, 0x67, 0xe1, 0xb6, 0xf2, 0xf7, 0x46, 0xbb, 0x17, 0xc6, 0x2a, 0x49, 0x2d, 0xc6, 0xef, 0xb8, - 0x53, 0x25, 0x77, 0x36, 0xc7, 0xc4, 0x1a, 0x4c, 0xe7, 0x7f, 0xba, 0x3e, 0x92, 0xdf, 0x93, 0x68, - 0xaa, 0x4f, 0xd1, 0xe0, 0xe8, 0xaa, 0x30, 0xf6, 0x12, 0x97, 0xf9, 0xf7, 0x03, 0x0f, 0x0e, 0x42, - 0x8a, 0xa7, 0x6f, 0x66, 0x20, 0x89, 0x1b, 0xf7, 0x1c, 0x90, 0xac, 0x4b, 0xad, 0x3d, 0xbf, 0xf4, - 0x3c, 0xbd, 0x47, 0x67, 0xb6, 0x1a, 0xc4, 0xe2, 0x01, 0x2c, 0x4f, 0x35, 0x2e, 0xed, 0xb2, 0x2b, - 0x7b, 0x65, 0x85, 0x2a, 0x69, 0x29, 0xce, 0xc0, 0x54, 0x25, 0x2a, 0xed, 0xaa, 0x67, 0x48, 0x35, - 0x69, 0x26, 0xa5, 0x38, 0x01, 0x63, 0x18, 0x7b, 0x76, 0xfc, 0x59, 0xc2, 0xf3, 0xe5, 0xe2, 0x14, - 0xd4, 0x38, 0xee, 0xec, 0xe8, 0x73, 0x84, 0x96, 0x08, 0xe2, 0x1c, 0x75, 0x76, 0xfc, 0x79, 0xc6, - 0x19, 0x41, 0xdc, 0xbd, 0x84, 0x3f, 0xbe, 0x38, 0x46, 0xe3, 0x8a, 0x6b, 0xb7, 0x04, 0xe3, 0x94, - 0x71, 0x76, 0xfa, 0x05, 0xfa, 0x72, 0x26, 0xc4, 0x7d, 0x70, 0xc8, 0xb1, 0xe0, 0x2f, 0x11, 0x5a, - 0xac, 0x17, 0xab, 0x30, 0x61, 0xe4, 0x9a, 0x1d, 0x7f, 0x99, 0x70, 0x93, 0xc2, 0xad, 0x53, 0xae, - 0xd9, 0x05, 0xaf, 0xf0, 0xd6, 0x89, 0xc0, 0xb2, 0x71, 0xa4, 0xd9, 0xe9, 0x57, 0xb9, 0xea, 0x8c, - 0x88, 0x65, 0xa8, 0x97, 0x63, 0xca, 0xce, 0xbf, 0x46, 0x7c, 0x9f, 0xc1, 0x0a, 0x18, 0x63, 0xd2, - 0xae, 0x78, 0x9d, 0x2b, 0x60, 0x50, 0x78, 0x8c, 0x06, 0xa3, 0xcf, 0x6e, 0x7a, 0x83, 0x8f, 0xd1, - 0x40, 0xf2, 0x61, 0x37, 0xf3, 0x69, 0x61, 0x57, 0xbc, 0xc9, 0xdd, 0xcc, 0xd7, 0xe3, 0x36, 0x06, - 0xb3, 0xc4, 0xee, 0x78, 0x8b, 0xb7, 0x31, 0x10, 0x25, 0xa2, 0x05, 0x8d, 0x83, 0x39, 0x62, 0xf7, - 0xbd, 0x4d, 0xbe, 0xd9, 0x03, 0x31, 0x22, 0x1e, 0x81, 0x85, 0xe1, 0x19, 0x62, 0xb7, 0x5e, 0xdd, - 0x1b, 0xf8, 0xd5, 0x6f, 0x46, 0x88, 0x38, 0xd7, 0xff, 0xd5, 0x6f, 0xe6, 0x87, 0x5d, 0x7b, 0x6d, - 0xaf, 0xfa, 0x62, 0x67, 0xc6, 0x87, 0x58, 0x01, 0xe8, 0x8f, 0x6e, 0xbb, 0xeb, 0x3a, 0xb9, 0x0c, - 0x08, 0x8f, 0x06, 0x4d, 0x6e, 0x3b, 0x7f, 0x83, 0x8f, 0x06, 0x11, 0x62, 0x09, 0x6a, 0x51, 0x16, - 0x04, 0xf8, 0x70, 0x34, 0xee, 0x1e, 0x12, 0x13, 0x32, 0xd8, 0x62, 0xf6, 0xf7, 0x7d, 0x3a, 0x18, - 0x0c, 0x88, 0x13, 0x70, 0x48, 0x86, 0x1d, 0xb9, 0x65, 0x23, 0xff, 0xd8, 0xe7, 0x81, 0x80, 0xab, - 0xc5, 0x32, 0x40, 0xf1, 0xd2, 0x98, 0xee, 0xc4, 0xd6, 0x6f, 0xfd, 0x73, 0xbf, 0x78, 0x07, 0x35, - 0x90, 0xbe, 0x20, 0x7f, 0xeb, 0xb4, 0x08, 0x76, 0xab, 0x82, 0xfc, 0x45, 0xf3, 0x24, 0x8c, 0x3f, - 0xa1, 0x55, 0x94, 0x7a, 0xbe, 0x8d, 0xfe, 0x8b, 0x68, 0x5e, 0x8f, 0x05, 0x0b, 0x55, 0x22, 0x53, - 0xcf, 0xd7, 0x36, 0xf6, 0x6f, 0x62, 0x4b, 0x00, 0xe1, 0xae, 0xa7, 0x53, 0x97, 0xfb, 0xfe, 0x87, - 0x61, 0x06, 0x70, 0xd3, 0x78, 0xfd, 0xa4, 0xdc, 0xb1, 0xb1, 0xff, 0xf2, 0xa6, 0x69, 0xbd, 0x38, - 0x05, 0x75, 0xbc, 0xcc, 0xdf, 0xb7, 0x6d, 0xf0, 0x7f, 0x04, 0xf7, 0x89, 0xd3, 0xc7, 0x60, 0xae, - 0xab, 0xc2, 0x41, 0xec, 0x34, 0x34, 0x55, 0x53, 0xb5, 0xf2, 0x07, 0xf1, 0xff, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x87, 0x5c, 0xee, 0x2b, 0x7e, 0x11, 0x00, 0x00, -} diff --git a/vendor/github.com/gogo/protobuf/gogoproto/helper.go b/vendor/github.com/gogo/protobuf/gogoproto/helper.go deleted file mode 100644 index 670021fed..000000000 --- a/vendor/github.com/gogo/protobuf/gogoproto/helper.go +++ /dev/null @@ -1,310 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package gogoproto - -import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" -import proto "github.com/gogo/protobuf/proto" - -func IsEmbed(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Embed, false) -} - -func IsNullable(field *google_protobuf.FieldDescriptorProto) bool { - return proto.GetBoolExtension(field.Options, E_Nullable, true) -} - -func NeedsNilCheck(proto3 bool, field *google_protobuf.FieldDescriptorProto) bool { - nullable := IsNullable(field) - if field.IsMessage() || IsCustomType(field) { - return nullable - } - if proto3 { - return false - } - return nullable || *field.Type == google_protobuf.FieldDescriptorProto_TYPE_BYTES -} - -func IsCustomType(field *google_protobuf.FieldDescriptorProto) bool { - typ := GetCustomType(field) - if len(typ) > 0 { - return true - } - return false -} - -func IsCastType(field *google_protobuf.FieldDescriptorProto) bool { - typ := GetCastType(field) - if len(typ) > 0 { - return true - } - return false -} - -func IsCastKey(field *google_protobuf.FieldDescriptorProto) bool { - typ := GetCastKey(field) - if len(typ) > 0 { - return true - } - return false -} - -func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool { - typ := GetCastValue(field) - if len(typ) > 0 { - return true - } - return false -} - -func GetCustomType(field *google_protobuf.FieldDescriptorProto) string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Customtype) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetCastType(field *google_protobuf.FieldDescriptorProto) string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Casttype) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetCastKey(field *google_protobuf.FieldDescriptorProto) string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Castkey) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetCastValue(field *google_protobuf.FieldDescriptorProto) string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Castvalue) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func IsCustomName(field *google_protobuf.FieldDescriptorProto) bool { - name := GetCustomName(field) - if len(name) > 0 { - return true - } - return false -} - -func IsEnumCustomName(field *google_protobuf.EnumDescriptorProto) bool { - name := GetEnumCustomName(field) - if len(name) > 0 { - return true - } - return false -} - -func IsEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) bool { - name := GetEnumValueCustomName(field) - if len(name) > 0 { - return true - } - return false -} - -func GetCustomName(field *google_protobuf.FieldDescriptorProto) string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Customname) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetEnumCustomName(field *google_protobuf.EnumDescriptorProto) string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_EnumCustomname) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_EnumvalueCustomname) - if err == nil && v.(*string) != nil { - return *(v.(*string)) - } - } - return "" -} - -func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Jsontag) - if err == nil && v.(*string) != nil { - return (v.(*string)) - } - } - return nil -} - -func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, E_Moretags) - if err == nil && v.(*string) != nil { - return (v.(*string)) - } - } - return nil -} - -type EnableFunc func(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool - -func EnabledGoEnumPrefix(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { - return proto.GetBoolExtension(enum.Options, E_GoprotoEnumPrefix, proto.GetBoolExtension(file.Options, E_GoprotoEnumPrefixAll, true)) -} - -func EnabledGoStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoStringer, proto.GetBoolExtension(file.Options, E_GoprotoStringerAll, true)) -} - -func HasGoGetters(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoGetters, proto.GetBoolExtension(file.Options, E_GoprotoGettersAll, true)) -} - -func IsUnion(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Onlyone, proto.GetBoolExtension(file.Options, E_OnlyoneAll, false)) -} - -func HasGoString(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Gostring, proto.GetBoolExtension(file.Options, E_GostringAll, false)) -} - -func HasEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Equal, proto.GetBoolExtension(file.Options, E_EqualAll, false)) -} - -func HasVerboseEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_VerboseEqual, proto.GetBoolExtension(file.Options, E_VerboseEqualAll, false)) -} - -func IsStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Stringer, proto.GetBoolExtension(file.Options, E_StringerAll, false)) -} - -func IsFace(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Face, proto.GetBoolExtension(file.Options, E_FaceAll, false)) -} - -func HasDescription(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Description, proto.GetBoolExtension(file.Options, E_DescriptionAll, false)) -} - -func HasPopulate(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Populate, proto.GetBoolExtension(file.Options, E_PopulateAll, false)) -} - -func HasTestGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Testgen, proto.GetBoolExtension(file.Options, E_TestgenAll, false)) -} - -func HasBenchGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Benchgen, proto.GetBoolExtension(file.Options, E_BenchgenAll, false)) -} - -func IsMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Marshaler, proto.GetBoolExtension(file.Options, E_MarshalerAll, false)) -} - -func IsUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Unmarshaler, proto.GetBoolExtension(file.Options, E_UnmarshalerAll, false)) -} - -func IsStableMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_StableMarshaler, proto.GetBoolExtension(file.Options, E_StableMarshalerAll, false)) -} - -func IsSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Sizer, proto.GetBoolExtension(file.Options, E_SizerAll, false)) -} - -func IsProtoSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Protosizer, proto.GetBoolExtension(file.Options, E_ProtosizerAll, false)) -} - -func IsGoEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { - return proto.GetBoolExtension(enum.Options, E_GoprotoEnumStringer, proto.GetBoolExtension(file.Options, E_GoprotoEnumStringerAll, true)) -} - -func IsEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { - return proto.GetBoolExtension(enum.Options, E_EnumStringer, proto.GetBoolExtension(file.Options, E_EnumStringerAll, false)) -} - -func IsUnsafeMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_UnsafeMarshaler, proto.GetBoolExtension(file.Options, E_UnsafeMarshalerAll, false)) -} - -func IsUnsafeUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_UnsafeUnmarshaler, proto.GetBoolExtension(file.Options, E_UnsafeUnmarshalerAll, false)) -} - -func HasExtensionsMap(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_GoprotoExtensionsMap, proto.GetBoolExtension(file.Options, E_GoprotoExtensionsMapAll, true)) -} - -func HasUnrecognized(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - if IsProto3(file) { - return false - } - return proto.GetBoolExtension(message.Options, E_GoprotoUnrecognized, proto.GetBoolExtension(file.Options, E_GoprotoUnrecognizedAll, true)) -} - -func IsProto3(file *google_protobuf.FileDescriptorProto) bool { - return file.GetSyntax() == "proto3" -} - -func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool { - return proto.GetBoolExtension(file.Options, E_GogoprotoImport, true) -} - -func HasCompare(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { - return proto.GetBoolExtension(message.Options, E_Compare, proto.GetBoolExtension(file.Options, E_CompareAll, false)) -} diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go deleted file mode 100644 index 341b59c53..000000000 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go +++ /dev/null @@ -1,1981 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: descriptor.proto -// DO NOT EDIT! - -/* -Package descriptor is a generated protocol buffer package. - -It is generated from these files: - descriptor.proto - -It has these top-level messages: - FileDescriptorSet - FileDescriptorProto - DescriptorProto - FieldDescriptorProto - OneofDescriptorProto - EnumDescriptorProto - EnumValueDescriptorProto - ServiceDescriptorProto - MethodDescriptorProto - FileOptions - MessageOptions - FieldOptions - EnumOptions - EnumValueOptions - ServiceOptions - MethodOptions - UninterpretedOption - SourceCodeInfo -*/ -package descriptor - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - -type FieldDescriptorProto_Type int32 - -const ( - // 0 is reserved for errors. - // Order is weird for historical reasons. - FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1 - FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2 - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3 - FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4 - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5 - FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6 - FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7 - FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 - FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 - FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 - FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 - // New in version 2. - FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12 - FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13 - FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14 - FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15 - FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16 - FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17 - FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18 -) - -var FieldDescriptorProto_Type_name = map[int32]string{ - 1: "TYPE_DOUBLE", - 2: "TYPE_FLOAT", - 3: "TYPE_INT64", - 4: "TYPE_UINT64", - 5: "TYPE_INT32", - 6: "TYPE_FIXED64", - 7: "TYPE_FIXED32", - 8: "TYPE_BOOL", - 9: "TYPE_STRING", - 10: "TYPE_GROUP", - 11: "TYPE_MESSAGE", - 12: "TYPE_BYTES", - 13: "TYPE_UINT32", - 14: "TYPE_ENUM", - 15: "TYPE_SFIXED32", - 16: "TYPE_SFIXED64", - 17: "TYPE_SINT32", - 18: "TYPE_SINT64", -} -var FieldDescriptorProto_Type_value = map[string]int32{ - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18, -} - -func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type { - p := new(FieldDescriptorProto_Type) - *p = x - return p -} -func (x FieldDescriptorProto_Type) String() string { - return proto.EnumName(FieldDescriptorProto_Type_name, int32(x)) -} -func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type") - if err != nil { - return err - } - *x = FieldDescriptorProto_Type(value) - return nil -} -func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{3, 0} -} - -type FieldDescriptorProto_Label int32 - -const ( - // 0 is reserved for errors - FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 - FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 - FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 -) - -var FieldDescriptorProto_Label_name = map[int32]string{ - 1: "LABEL_OPTIONAL", - 2: "LABEL_REQUIRED", - 3: "LABEL_REPEATED", -} -var FieldDescriptorProto_Label_value = map[string]int32{ - "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3, -} - -func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label { - p := new(FieldDescriptorProto_Label) - *p = x - return p -} -func (x FieldDescriptorProto_Label) String() string { - return proto.EnumName(FieldDescriptorProto_Label_name, int32(x)) -} -func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label") - if err != nil { - return err - } - *x = FieldDescriptorProto_Label(value) - return nil -} -func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{3, 1} -} - -// Generated classes can be optimized for speed or code size. -type FileOptions_OptimizeMode int32 - -const ( - FileOptions_SPEED FileOptions_OptimizeMode = 1 - // etc. - FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2 - FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3 -) - -var FileOptions_OptimizeMode_name = map[int32]string{ - 1: "SPEED", - 2: "CODE_SIZE", - 3: "LITE_RUNTIME", -} -var FileOptions_OptimizeMode_value = map[string]int32{ - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3, -} - -func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode { - p := new(FileOptions_OptimizeMode) - *p = x - return p -} -func (x FileOptions_OptimizeMode) String() string { - return proto.EnumName(FileOptions_OptimizeMode_name, int32(x)) -} -func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode") - if err != nil { - return err - } - *x = FileOptions_OptimizeMode(value) - return nil -} -func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{9, 0} -} - -type FieldOptions_CType int32 - -const ( - // Default mode. - FieldOptions_STRING FieldOptions_CType = 0 - FieldOptions_CORD FieldOptions_CType = 1 - FieldOptions_STRING_PIECE FieldOptions_CType = 2 -) - -var FieldOptions_CType_name = map[int32]string{ - 0: "STRING", - 1: "CORD", - 2: "STRING_PIECE", -} -var FieldOptions_CType_value = map[string]int32{ - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2, -} - -func (x FieldOptions_CType) Enum() *FieldOptions_CType { - p := new(FieldOptions_CType) - *p = x - return p -} -func (x FieldOptions_CType) String() string { - return proto.EnumName(FieldOptions_CType_name, int32(x)) -} -func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType") - if err != nil { - return err - } - *x = FieldOptions_CType(value) - return nil -} -func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{11, 0} -} - -type FieldOptions_JSType int32 - -const ( - // Use the default type. - FieldOptions_JS_NORMAL FieldOptions_JSType = 0 - // Use JavaScript strings. - FieldOptions_JS_STRING FieldOptions_JSType = 1 - // Use JavaScript numbers. - FieldOptions_JS_NUMBER FieldOptions_JSType = 2 -) - -var FieldOptions_JSType_name = map[int32]string{ - 0: "JS_NORMAL", - 1: "JS_STRING", - 2: "JS_NUMBER", -} -var FieldOptions_JSType_value = map[string]int32{ - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2, -} - -func (x FieldOptions_JSType) Enum() *FieldOptions_JSType { - p := new(FieldOptions_JSType) - *p = x - return p -} -func (x FieldOptions_JSType) String() string { - return proto.EnumName(FieldOptions_JSType_name, int32(x)) -} -func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType") - if err != nil { - return err - } - *x = FieldOptions_JSType(value) - return nil -} -func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{11, 1} -} - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -type FileDescriptorSet struct { - File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} } -func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) } -func (*FileDescriptorSet) ProtoMessage() {} -func (*FileDescriptorSet) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{0} } - -func (m *FileDescriptorSet) GetFile() []*FileDescriptorProto { - if m != nil { - return m.File - } - return nil -} - -// Describes a complete .proto file. -type FileDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` - // Names of files imported by this file. - Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"` - // Indexes of the public imported files in the dependency list above. - PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"` - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"` - // All top-level definitions in this file. - MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"` - EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` - Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"` - Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"` - Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"` - // The syntax of the proto file. - // The supported values are "proto2" and "proto3". - Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} } -func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*FileDescriptorProto) ProtoMessage() {} -func (*FileDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{1} } - -func (m *FileDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FileDescriptorProto) GetPackage() string { - if m != nil && m.Package != nil { - return *m.Package - } - return "" -} - -func (m *FileDescriptorProto) GetDependency() []string { - if m != nil { - return m.Dependency - } - return nil -} - -func (m *FileDescriptorProto) GetPublicDependency() []int32 { - if m != nil { - return m.PublicDependency - } - return nil -} - -func (m *FileDescriptorProto) GetWeakDependency() []int32 { - if m != nil { - return m.WeakDependency - } - return nil -} - -func (m *FileDescriptorProto) GetMessageType() []*DescriptorProto { - if m != nil { - return m.MessageType - } - return nil -} - -func (m *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto { - if m != nil { - return m.EnumType - } - return nil -} - -func (m *FileDescriptorProto) GetService() []*ServiceDescriptorProto { - if m != nil { - return m.Service - } - return nil -} - -func (m *FileDescriptorProto) GetExtension() []*FieldDescriptorProto { - if m != nil { - return m.Extension - } - return nil -} - -func (m *FileDescriptorProto) GetOptions() *FileOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo { - if m != nil { - return m.SourceCodeInfo - } - return nil -} - -func (m *FileDescriptorProto) GetSyntax() string { - if m != nil && m.Syntax != nil { - return *m.Syntax - } - return "" -} - -// Describes a message type. -type DescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"` - Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"` - NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"` - EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` - ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"` - OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"` - Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"` - ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DescriptorProto) Reset() { *m = DescriptorProto{} } -func (m *DescriptorProto) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto) ProtoMessage() {} -func (*DescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{2} } - -func (m *DescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *DescriptorProto) GetField() []*FieldDescriptorProto { - if m != nil { - return m.Field - } - return nil -} - -func (m *DescriptorProto) GetExtension() []*FieldDescriptorProto { - if m != nil { - return m.Extension - } - return nil -} - -func (m *DescriptorProto) GetNestedType() []*DescriptorProto { - if m != nil { - return m.NestedType - } - return nil -} - -func (m *DescriptorProto) GetEnumType() []*EnumDescriptorProto { - if m != nil { - return m.EnumType - } - return nil -} - -func (m *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange { - if m != nil { - return m.ExtensionRange - } - return nil -} - -func (m *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto { - if m != nil { - return m.OneofDecl - } - return nil -} - -func (m *DescriptorProto) GetOptions() *MessageOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange { - if m != nil { - return m.ReservedRange - } - return nil -} - -func (m *DescriptorProto) GetReservedName() []string { - if m != nil { - return m.ReservedName - } - return nil -} - -type DescriptorProto_ExtensionRange struct { - Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` - End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ExtensionRange{} } -func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto_ExtensionRange) ProtoMessage() {} -func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{2, 0} -} - -func (m *DescriptorProto_ExtensionRange) GetStart() int32 { - if m != nil && m.Start != nil { - return *m.Start - } - return 0 -} - -func (m *DescriptorProto_ExtensionRange) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -// Range of reserved tag numbers. Reserved tag numbers may not be used by -// fields or extension ranges in the same message. Reserved ranges may -// not overlap. -type DescriptorProto_ReservedRange struct { - Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` - End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_ReservedRange{} } -func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) } -func (*DescriptorProto_ReservedRange) ProtoMessage() {} -func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{2, 1} -} - -func (m *DescriptorProto_ReservedRange) GetStart() int32 { - if m != nil && m.Start != nil { - return *m.Start - } - return 0 -} - -func (m *DescriptorProto_ReservedRange) GetEnd() int32 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -// Describes a field within a message. -type FieldDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"` - Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"` - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"` - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"` - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"` - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"` - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"` - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"` - Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} } -func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*FieldDescriptorProto) ProtoMessage() {} -func (*FieldDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{3} } - -func (m *FieldDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FieldDescriptorProto) GetNumber() int32 { - if m != nil && m.Number != nil { - return *m.Number - } - return 0 -} - -func (m *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label { - if m != nil && m.Label != nil { - return *m.Label - } - return FieldDescriptorProto_LABEL_OPTIONAL -} - -func (m *FieldDescriptorProto) GetType() FieldDescriptorProto_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return FieldDescriptorProto_TYPE_DOUBLE -} - -func (m *FieldDescriptorProto) GetTypeName() string { - if m != nil && m.TypeName != nil { - return *m.TypeName - } - return "" -} - -func (m *FieldDescriptorProto) GetExtendee() string { - if m != nil && m.Extendee != nil { - return *m.Extendee - } - return "" -} - -func (m *FieldDescriptorProto) GetDefaultValue() string { - if m != nil && m.DefaultValue != nil { - return *m.DefaultValue - } - return "" -} - -func (m *FieldDescriptorProto) GetOneofIndex() int32 { - if m != nil && m.OneofIndex != nil { - return *m.OneofIndex - } - return 0 -} - -func (m *FieldDescriptorProto) GetJsonName() string { - if m != nil && m.JsonName != nil { - return *m.JsonName - } - return "" -} - -func (m *FieldDescriptorProto) GetOptions() *FieldOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a oneof. -type OneofDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} } -func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*OneofDescriptorProto) ProtoMessage() {} -func (*OneofDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{4} } - -func (m *OneofDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -// Describes an enum type. -type EnumDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` - Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} } -func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*EnumDescriptorProto) ProtoMessage() {} -func (*EnumDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{5} } - -func (m *EnumDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto { - if m != nil { - return m.Value - } - return nil -} - -func (m *EnumDescriptorProto) GetOptions() *EnumOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a value within an enum. -type EnumValueDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` - Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorProto{} } -func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*EnumValueDescriptorProto) ProtoMessage() {} -func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{6} -} - -func (m *EnumValueDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *EnumValueDescriptorProto) GetNumber() int32 { - if m != nil && m.Number != nil { - return *m.Number - } - return 0 -} - -func (m *EnumValueDescriptorProto) GetOptions() *EnumValueOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a service. -type ServiceDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"` - Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} } -func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*ServiceDescriptorProto) ProtoMessage() {} -func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{7} } - -func (m *ServiceDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto { - if m != nil { - return m.Method - } - return nil -} - -func (m *ServiceDescriptorProto) GetOptions() *ServiceOptions { - if m != nil { - return m.Options - } - return nil -} - -// Describes a method of a service. -type MethodDescriptorProto struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"` - OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"` - Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` - // Identifies if client streams multiple client messages - ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"` - // Identifies if server streams multiple server messages - ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} } -func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) } -func (*MethodDescriptorProto) ProtoMessage() {} -func (*MethodDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{8} } - -const Default_MethodDescriptorProto_ClientStreaming bool = false -const Default_MethodDescriptorProto_ServerStreaming bool = false - -func (m *MethodDescriptorProto) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *MethodDescriptorProto) GetInputType() string { - if m != nil && m.InputType != nil { - return *m.InputType - } - return "" -} - -func (m *MethodDescriptorProto) GetOutputType() string { - if m != nil && m.OutputType != nil { - return *m.OutputType - } - return "" -} - -func (m *MethodDescriptorProto) GetOptions() *MethodOptions { - if m != nil { - return m.Options - } - return nil -} - -func (m *MethodDescriptorProto) GetClientStreaming() bool { - if m != nil && m.ClientStreaming != nil { - return *m.ClientStreaming - } - return Default_MethodDescriptorProto_ClientStreaming -} - -func (m *MethodDescriptorProto) GetServerStreaming() bool { - if m != nil && m.ServerStreaming != nil { - return *m.ServerStreaming - } - return Default_MethodDescriptorProto_ServerStreaming -} - -type FileOptions struct { - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"` - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"` - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"` - // If set true, then the Java code generator will generate equals() and - // hashCode() methods for all messages defined in the .proto file. - // This increases generated code size, potentially substantially for large - // protos, which may harm a memory-constrained application. - // - In the full runtime this is a speed optimization, as the - // AbstractMessage base class includes reflection-based implementations of - // these methods. - // - In the lite runtime, setting this option changes the semantics of - // equals() and hashCode() to more closely match those of the full runtime; - // the generated methods compute their results based on field values rather - // than object identity. (Implementations should not assume that hashcodes - // will be consistent across runtimes or versions of the protocol compiler.) - JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash,def=0" json:"java_generate_equals_and_hash,omitempty"` - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"` - OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"` - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"` - JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"` - PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"` - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=0" json:"cc_enable_arenas,omitempty"` - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"` - // Namespace for generated classes; defaults to the package. - CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"` - // Whether the nano proto compiler should generate in the deprecated non-nano - // suffixed package. - JavananoUseDeprecatedPackage *bool `protobuf:"varint,38,opt,name=javanano_use_deprecated_package,json=javananoUseDeprecatedPackage" json:"javanano_use_deprecated_package,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FileOptions) Reset() { *m = FileOptions{} } -func (m *FileOptions) String() string { return proto.CompactTextString(m) } -func (*FileOptions) ProtoMessage() {} -func (*FileOptions) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{9} } - -var extRange_FileOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_FileOptions -} - -const Default_FileOptions_JavaMultipleFiles bool = false -const Default_FileOptions_JavaGenerateEqualsAndHash bool = false -const Default_FileOptions_JavaStringCheckUtf8 bool = false -const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED -const Default_FileOptions_CcGenericServices bool = false -const Default_FileOptions_JavaGenericServices bool = false -const Default_FileOptions_PyGenericServices bool = false -const Default_FileOptions_Deprecated bool = false -const Default_FileOptions_CcEnableArenas bool = false - -func (m *FileOptions) GetJavaPackage() string { - if m != nil && m.JavaPackage != nil { - return *m.JavaPackage - } - return "" -} - -func (m *FileOptions) GetJavaOuterClassname() string { - if m != nil && m.JavaOuterClassname != nil { - return *m.JavaOuterClassname - } - return "" -} - -func (m *FileOptions) GetJavaMultipleFiles() bool { - if m != nil && m.JavaMultipleFiles != nil { - return *m.JavaMultipleFiles - } - return Default_FileOptions_JavaMultipleFiles -} - -func (m *FileOptions) GetJavaGenerateEqualsAndHash() bool { - if m != nil && m.JavaGenerateEqualsAndHash != nil { - return *m.JavaGenerateEqualsAndHash - } - return Default_FileOptions_JavaGenerateEqualsAndHash -} - -func (m *FileOptions) GetJavaStringCheckUtf8() bool { - if m != nil && m.JavaStringCheckUtf8 != nil { - return *m.JavaStringCheckUtf8 - } - return Default_FileOptions_JavaStringCheckUtf8 -} - -func (m *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode { - if m != nil && m.OptimizeFor != nil { - return *m.OptimizeFor - } - return Default_FileOptions_OptimizeFor -} - -func (m *FileOptions) GetGoPackage() string { - if m != nil && m.GoPackage != nil { - return *m.GoPackage - } - return "" -} - -func (m *FileOptions) GetCcGenericServices() bool { - if m != nil && m.CcGenericServices != nil { - return *m.CcGenericServices - } - return Default_FileOptions_CcGenericServices -} - -func (m *FileOptions) GetJavaGenericServices() bool { - if m != nil && m.JavaGenericServices != nil { - return *m.JavaGenericServices - } - return Default_FileOptions_JavaGenericServices -} - -func (m *FileOptions) GetPyGenericServices() bool { - if m != nil && m.PyGenericServices != nil { - return *m.PyGenericServices - } - return Default_FileOptions_PyGenericServices -} - -func (m *FileOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_FileOptions_Deprecated -} - -func (m *FileOptions) GetCcEnableArenas() bool { - if m != nil && m.CcEnableArenas != nil { - return *m.CcEnableArenas - } - return Default_FileOptions_CcEnableArenas -} - -func (m *FileOptions) GetObjcClassPrefix() string { - if m != nil && m.ObjcClassPrefix != nil { - return *m.ObjcClassPrefix - } - return "" -} - -func (m *FileOptions) GetCsharpNamespace() string { - if m != nil && m.CsharpNamespace != nil { - return *m.CsharpNamespace - } - return "" -} - -func (m *FileOptions) GetJavananoUseDeprecatedPackage() bool { - if m != nil && m.JavananoUseDeprecatedPackage != nil { - return *m.JavananoUseDeprecatedPackage - } - return false -} - -func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type MessageOptions struct { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"` - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"` - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementions still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MessageOptions) Reset() { *m = MessageOptions{} } -func (m *MessageOptions) String() string { return proto.CompactTextString(m) } -func (*MessageOptions) ProtoMessage() {} -func (*MessageOptions) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{10} } - -var extRange_MessageOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_MessageOptions -} - -const Default_MessageOptions_MessageSetWireFormat bool = false -const Default_MessageOptions_NoStandardDescriptorAccessor bool = false -const Default_MessageOptions_Deprecated bool = false - -func (m *MessageOptions) GetMessageSetWireFormat() bool { - if m != nil && m.MessageSetWireFormat != nil { - return *m.MessageSetWireFormat - } - return Default_MessageOptions_MessageSetWireFormat -} - -func (m *MessageOptions) GetNoStandardDescriptorAccessor() bool { - if m != nil && m.NoStandardDescriptorAccessor != nil { - return *m.NoStandardDescriptorAccessor - } - return Default_MessageOptions_NoStandardDescriptorAccessor -} - -func (m *MessageOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_MessageOptions_Deprecated -} - -func (m *MessageOptions) GetMapEntry() bool { - if m != nil && m.MapEntry != nil { - return *m.MapEntry - } - return false -} - -func (m *MessageOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type FieldOptions struct { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"` - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). By default these types are - // represented as JavaScript strings. This avoids loss of precision that can - // happen when a large value is converted to a floating point JavaScript - // numbers. Specifying JS_NUMBER for the jstype causes the generated - // JavaScript code to use the JavaScript "number" type instead of strings. - // This option is an enum to permit additional types to be added, - // e.g. goog.math.Integer. - Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"` - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outher message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"` - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // For Google-internal migration only. Do not use. - Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FieldOptions) Reset() { *m = FieldOptions{} } -func (m *FieldOptions) String() string { return proto.CompactTextString(m) } -func (*FieldOptions) ProtoMessage() {} -func (*FieldOptions) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{11} } - -var extRange_FieldOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_FieldOptions -} - -const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING -const Default_FieldOptions_Jstype FieldOptions_JSType = FieldOptions_JS_NORMAL -const Default_FieldOptions_Lazy bool = false -const Default_FieldOptions_Deprecated bool = false -const Default_FieldOptions_Weak bool = false - -func (m *FieldOptions) GetCtype() FieldOptions_CType { - if m != nil && m.Ctype != nil { - return *m.Ctype - } - return Default_FieldOptions_Ctype -} - -func (m *FieldOptions) GetPacked() bool { - if m != nil && m.Packed != nil { - return *m.Packed - } - return false -} - -func (m *FieldOptions) GetJstype() FieldOptions_JSType { - if m != nil && m.Jstype != nil { - return *m.Jstype - } - return Default_FieldOptions_Jstype -} - -func (m *FieldOptions) GetLazy() bool { - if m != nil && m.Lazy != nil { - return *m.Lazy - } - return Default_FieldOptions_Lazy -} - -func (m *FieldOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_FieldOptions_Deprecated -} - -func (m *FieldOptions) GetWeak() bool { - if m != nil && m.Weak != nil { - return *m.Weak - } - return Default_FieldOptions_Weak -} - -func (m *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type EnumOptions struct { - // Set this option to true to allow mapping different tag names to the same - // value. - AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"` - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *EnumOptions) Reset() { *m = EnumOptions{} } -func (m *EnumOptions) String() string { return proto.CompactTextString(m) } -func (*EnumOptions) ProtoMessage() {} -func (*EnumOptions) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{12} } - -var extRange_EnumOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_EnumOptions -} - -const Default_EnumOptions_Deprecated bool = false - -func (m *EnumOptions) GetAllowAlias() bool { - if m != nil && m.AllowAlias != nil { - return *m.AllowAlias - } - return false -} - -func (m *EnumOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_EnumOptions_Deprecated -} - -func (m *EnumOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type EnumValueOptions struct { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} } -func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) } -func (*EnumValueOptions) ProtoMessage() {} -func (*EnumValueOptions) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{13} } - -var extRange_EnumValueOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_EnumValueOptions -} - -const Default_EnumValueOptions_Deprecated bool = false - -func (m *EnumValueOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_EnumValueOptions_Deprecated -} - -func (m *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type ServiceOptions struct { - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ServiceOptions) Reset() { *m = ServiceOptions{} } -func (m *ServiceOptions) String() string { return proto.CompactTextString(m) } -func (*ServiceOptions) ProtoMessage() {} -func (*ServiceOptions) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{14} } - -var extRange_ServiceOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_ServiceOptions -} - -const Default_ServiceOptions_Deprecated bool = false - -func (m *ServiceOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_ServiceOptions_Deprecated -} - -func (m *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -type MethodOptions struct { - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` - // The parser stores options it doesn't recognize here. See above. - UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - proto.XXX_InternalExtensions `json:"-"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MethodOptions) Reset() { *m = MethodOptions{} } -func (m *MethodOptions) String() string { return proto.CompactTextString(m) } -func (*MethodOptions) ProtoMessage() {} -func (*MethodOptions) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{15} } - -var extRange_MethodOptions = []proto.ExtensionRange{ - {Start: 1000, End: 536870911}, -} - -func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange { - return extRange_MethodOptions -} - -const Default_MethodOptions_Deprecated bool = false - -func (m *MethodOptions) GetDeprecated() bool { - if m != nil && m.Deprecated != nil { - return *m.Deprecated - } - return Default_MethodOptions_Deprecated -} - -func (m *MethodOptions) GetUninterpretedOption() []*UninterpretedOption { - if m != nil { - return m.UninterpretedOption - } - return nil -} - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -type UninterpretedOption struct { - Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"` - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"` - PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"` - NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"` - DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"` - StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"` - AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} } -func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) } -func (*UninterpretedOption) ProtoMessage() {} -func (*UninterpretedOption) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{16} } - -func (m *UninterpretedOption) GetName() []*UninterpretedOption_NamePart { - if m != nil { - return m.Name - } - return nil -} - -func (m *UninterpretedOption) GetIdentifierValue() string { - if m != nil && m.IdentifierValue != nil { - return *m.IdentifierValue - } - return "" -} - -func (m *UninterpretedOption) GetPositiveIntValue() uint64 { - if m != nil && m.PositiveIntValue != nil { - return *m.PositiveIntValue - } - return 0 -} - -func (m *UninterpretedOption) GetNegativeIntValue() int64 { - if m != nil && m.NegativeIntValue != nil { - return *m.NegativeIntValue - } - return 0 -} - -func (m *UninterpretedOption) GetDoubleValue() float64 { - if m != nil && m.DoubleValue != nil { - return *m.DoubleValue - } - return 0 -} - -func (m *UninterpretedOption) GetStringValue() []byte { - if m != nil { - return m.StringValue - } - return nil -} - -func (m *UninterpretedOption) GetAggregateValue() string { - if m != nil && m.AggregateValue != nil { - return *m.AggregateValue - } - return "" -} - -// The name of the uninterpreted option. Each string represents a segment in -// a dot-separated name. is_extension is true iff a segment represents an -// extension (denoted with parentheses in options specs in .proto files). -// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents -// "foo.(bar.baz).qux". -type UninterpretedOption_NamePart struct { - NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"` - IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOption_NamePart{} } -func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) } -func (*UninterpretedOption_NamePart) ProtoMessage() {} -func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{16, 0} -} - -func (m *UninterpretedOption_NamePart) GetNamePart() string { - if m != nil && m.NamePart != nil { - return *m.NamePart - } - return "" -} - -func (m *UninterpretedOption_NamePart) GetIsExtension() bool { - if m != nil && m.IsExtension != nil { - return *m.IsExtension - } - return false -} - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -type SourceCodeInfo struct { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendent. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} } -func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) } -func (*SourceCodeInfo) ProtoMessage() {} -func (*SourceCodeInfo) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{17} } - -func (m *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location { - if m != nil { - return m.Location - } - return nil -} - -type SourceCodeInfo_Location struct { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"` - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"` - TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"` - LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location{} } -func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) } -func (*SourceCodeInfo_Location) ProtoMessage() {} -func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { - return fileDescriptorDescriptor, []int{17, 0} -} - -func (m *SourceCodeInfo_Location) GetPath() []int32 { - if m != nil { - return m.Path - } - return nil -} - -func (m *SourceCodeInfo_Location) GetSpan() []int32 { - if m != nil { - return m.Span - } - return nil -} - -func (m *SourceCodeInfo_Location) GetLeadingComments() string { - if m != nil && m.LeadingComments != nil { - return *m.LeadingComments - } - return "" -} - -func (m *SourceCodeInfo_Location) GetTrailingComments() string { - if m != nil && m.TrailingComments != nil { - return *m.TrailingComments - } - return "" -} - -func (m *SourceCodeInfo_Location) GetLeadingDetachedComments() []string { - if m != nil { - return m.LeadingDetachedComments - } - return nil -} - -func init() { - proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet") - proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto") - proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto") - proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange") - proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange") - proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto") - proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto") - proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto") - proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto") - proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto") - proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto") - proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions") - proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions") - proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions") - proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions") - proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions") - proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions") - proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions") - proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption") - proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart") - proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo") - proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location") - proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value) - proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value) - proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value) - proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value) - proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value) -} - -func init() { proto.RegisterFile("descriptor.proto", fileDescriptorDescriptor) } - -var fileDescriptorDescriptor = []byte{ - // 2211 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x73, 0xdb, 0xc6, - 0x15, 0x0f, 0xf8, 0x4f, 0xe4, 0x23, 0x45, 0xad, 0x56, 0x8a, 0x03, 0xcb, 0x76, 0x2c, 0x33, 0x76, - 0x2c, 0xdb, 0xad, 0x9c, 0x91, 0xff, 0x44, 0x51, 0x3a, 0xe9, 0x50, 0x24, 0xac, 0xd0, 0x43, 0x89, - 0x2c, 0x28, 0xb6, 0x4e, 0x2e, 0x98, 0x15, 0xb0, 0xa4, 0x60, 0x83, 0x0b, 0x14, 0x00, 0x6d, 0x2b, - 0x27, 0xcf, 0xf4, 0xd4, 0x6f, 0xd0, 0x69, 0x3b, 0x3d, 0xe4, 0x92, 0x99, 0x7e, 0x80, 0x1e, 0x7a, - 0xef, 0xb5, 0x87, 0x9e, 0x7b, 0xec, 0x4c, 0xfb, 0x0d, 0x7a, 0xed, 0xec, 0x2e, 0x00, 0x82, 0x7f, - 0x14, 0xab, 0x99, 0x49, 0xd3, 0x93, 0xb4, 0xbf, 0xf7, 0x7b, 0x8f, 0x6f, 0xdf, 0xfe, 0xb0, 0xef, - 0x01, 0x80, 0x2c, 0x1a, 0x98, 0xbe, 0xed, 0x85, 0xae, 0xbf, 0xed, 0xf9, 0x6e, 0xe8, 0xe2, 0x95, - 0xa1, 0xeb, 0x0e, 0x1d, 0x2a, 0x57, 0x27, 0xe3, 0x41, 0xed, 0x10, 0x56, 0x9f, 0xd8, 0x0e, 0x6d, - 0x26, 0xc4, 0x1e, 0x0d, 0xf1, 0x2e, 0xe4, 0x06, 0xb6, 0x43, 0x55, 0x65, 0x33, 0xbb, 0x55, 0xde, - 0xb9, 0xb9, 0x3d, 0xe3, 0xb4, 0x3d, 0xed, 0xd1, 0xe5, 0xb0, 0x2e, 0x3c, 0x6a, 0xff, 0xc8, 0xc1, - 0xda, 0x02, 0x2b, 0xc6, 0x90, 0x63, 0x64, 0xc4, 0x23, 0x2a, 0x5b, 0x25, 0x5d, 0xfc, 0x8f, 0x55, - 0x58, 0xf2, 0x88, 0xf9, 0x82, 0x0c, 0xa9, 0x9a, 0x11, 0x70, 0xbc, 0xc4, 0xef, 0x03, 0x58, 0xd4, - 0xa3, 0xcc, 0xa2, 0xcc, 0x3c, 0x53, 0xb3, 0x9b, 0xd9, 0xad, 0x92, 0x9e, 0x42, 0xf0, 0x3d, 0x58, - 0xf5, 0xc6, 0x27, 0x8e, 0x6d, 0x1a, 0x29, 0x1a, 0x6c, 0x66, 0xb7, 0xf2, 0x3a, 0x92, 0x86, 0xe6, - 0x84, 0x7c, 0x1b, 0x56, 0x5e, 0x51, 0xf2, 0x22, 0x4d, 0x2d, 0x0b, 0x6a, 0x95, 0xc3, 0x29, 0x62, - 0x03, 0x2a, 0x23, 0x1a, 0x04, 0x64, 0x48, 0x8d, 0xf0, 0xcc, 0xa3, 0x6a, 0x4e, 0xec, 0x7e, 0x73, - 0x6e, 0xf7, 0xb3, 0x3b, 0x2f, 0x47, 0x5e, 0xc7, 0x67, 0x1e, 0xc5, 0x75, 0x28, 0x51, 0x36, 0x1e, - 0xc9, 0x08, 0xf9, 0x73, 0xea, 0xa7, 0xb1, 0xf1, 0x68, 0x36, 0x4a, 0x91, 0xbb, 0x45, 0x21, 0x96, - 0x02, 0xea, 0xbf, 0xb4, 0x4d, 0xaa, 0x16, 0x44, 0x80, 0xdb, 0x73, 0x01, 0x7a, 0xd2, 0x3e, 0x1b, - 0x23, 0xf6, 0xc3, 0x0d, 0x28, 0xd1, 0xd7, 0x21, 0x65, 0x81, 0xed, 0x32, 0x75, 0x49, 0x04, 0xb9, - 0xb5, 0xe0, 0x14, 0xa9, 0x63, 0xcd, 0x86, 0x98, 0xf8, 0xe1, 0xc7, 0xb0, 0xe4, 0x7a, 0xa1, 0xed, - 0xb2, 0x40, 0x2d, 0x6e, 0x2a, 0x5b, 0xe5, 0x9d, 0xab, 0x0b, 0x85, 0xd0, 0x91, 0x1c, 0x3d, 0x26, - 0xe3, 0x16, 0xa0, 0xc0, 0x1d, 0xfb, 0x26, 0x35, 0x4c, 0xd7, 0xa2, 0x86, 0xcd, 0x06, 0xae, 0x5a, - 0x12, 0x01, 0xae, 0xcf, 0x6f, 0x44, 0x10, 0x1b, 0xae, 0x45, 0x5b, 0x6c, 0xe0, 0xea, 0xd5, 0x60, - 0x6a, 0x8d, 0x2f, 0x41, 0x21, 0x38, 0x63, 0x21, 0x79, 0xad, 0x56, 0x84, 0x42, 0xa2, 0x55, 0xed, - 0xdf, 0x79, 0x58, 0xb9, 0x88, 0xc4, 0x3e, 0x85, 0xfc, 0x80, 0xef, 0x52, 0xcd, 0xfc, 0x37, 0x35, - 0x90, 0x3e, 0xd3, 0x45, 0x2c, 0x7c, 0xc7, 0x22, 0xd6, 0xa1, 0xcc, 0x68, 0x10, 0x52, 0x4b, 0x2a, - 0x22, 0x7b, 0x41, 0x4d, 0x81, 0x74, 0x9a, 0x97, 0x54, 0xee, 0x3b, 0x49, 0xea, 0x19, 0xac, 0x24, - 0x29, 0x19, 0x3e, 0x61, 0xc3, 0x58, 0x9b, 0xf7, 0xdf, 0x96, 0xc9, 0xb6, 0x16, 0xfb, 0xe9, 0xdc, - 0x4d, 0xaf, 0xd2, 0xa9, 0x35, 0x6e, 0x02, 0xb8, 0x8c, 0xba, 0x03, 0xc3, 0xa2, 0xa6, 0xa3, 0x16, - 0xcf, 0xa9, 0x52, 0x87, 0x53, 0xe6, 0xaa, 0xe4, 0x4a, 0xd4, 0x74, 0xf0, 0x27, 0x13, 0xa9, 0x2d, - 0x9d, 0xa3, 0x94, 0x43, 0xf9, 0x90, 0xcd, 0xa9, 0xad, 0x0f, 0x55, 0x9f, 0x72, 0xdd, 0x53, 0x2b, - 0xda, 0x59, 0x49, 0x24, 0xb1, 0xfd, 0xd6, 0x9d, 0xe9, 0x91, 0x9b, 0xdc, 0xd8, 0xb2, 0x9f, 0x5e, - 0xe2, 0x0f, 0x20, 0x01, 0x0c, 0x21, 0x2b, 0x10, 0xb7, 0x50, 0x25, 0x06, 0x8f, 0xc8, 0x88, 0x6e, - 0xec, 0x42, 0x75, 0xba, 0x3c, 0x78, 0x1d, 0xf2, 0x41, 0x48, 0xfc, 0x50, 0xa8, 0x30, 0xaf, 0xcb, - 0x05, 0x46, 0x90, 0xa5, 0xcc, 0x12, 0xb7, 0x5c, 0x5e, 0xe7, 0xff, 0x6e, 0x7c, 0x0c, 0xcb, 0x53, - 0x3f, 0x7f, 0x51, 0xc7, 0xda, 0x6f, 0x0a, 0xb0, 0xbe, 0x48, 0x73, 0x0b, 0xe5, 0x7f, 0x09, 0x0a, - 0x6c, 0x3c, 0x3a, 0xa1, 0xbe, 0x9a, 0x15, 0x11, 0xa2, 0x15, 0xae, 0x43, 0xde, 0x21, 0x27, 0xd4, - 0x51, 0x73, 0x9b, 0xca, 0x56, 0x75, 0xe7, 0xde, 0x85, 0x54, 0xbd, 0xdd, 0xe6, 0x2e, 0xba, 0xf4, - 0xc4, 0x9f, 0x41, 0x2e, 0xba, 0xe2, 0x78, 0x84, 0xbb, 0x17, 0x8b, 0xc0, 0xb5, 0xa8, 0x0b, 0x3f, - 0x7c, 0x05, 0x4a, 0xfc, 0xaf, 0xac, 0x6d, 0x41, 0xe4, 0x5c, 0xe4, 0x00, 0xaf, 0x2b, 0xde, 0x80, - 0xa2, 0x90, 0x99, 0x45, 0xe3, 0xd6, 0x90, 0xac, 0xf9, 0xc1, 0x58, 0x74, 0x40, 0xc6, 0x4e, 0x68, - 0xbc, 0x24, 0xce, 0x98, 0x0a, 0xc1, 0x94, 0xf4, 0x4a, 0x04, 0xfe, 0x9c, 0x63, 0xf8, 0x3a, 0x94, - 0xa5, 0x2a, 0x6d, 0x66, 0xd1, 0xd7, 0xe2, 0xf6, 0xc9, 0xeb, 0x52, 0xa8, 0x2d, 0x8e, 0xf0, 0x9f, - 0x7f, 0x1e, 0xb8, 0x2c, 0x3e, 0x5a, 0xf1, 0x13, 0x1c, 0x10, 0x3f, 0xff, 0xf1, 0xec, 0xc5, 0x77, - 0x6d, 0xf1, 0xf6, 0x66, 0xb5, 0x58, 0xfb, 0x53, 0x06, 0x72, 0xe2, 0x79, 0x5b, 0x81, 0xf2, 0xf1, - 0x17, 0x5d, 0xcd, 0x68, 0x76, 0xfa, 0xfb, 0x6d, 0x0d, 0x29, 0xb8, 0x0a, 0x20, 0x80, 0x27, 0xed, - 0x4e, 0xfd, 0x18, 0x65, 0x92, 0x75, 0xeb, 0xe8, 0xf8, 0xf1, 0x43, 0x94, 0x4d, 0x1c, 0xfa, 0x12, - 0xc8, 0xa5, 0x09, 0x0f, 0x76, 0x50, 0x1e, 0x23, 0xa8, 0xc8, 0x00, 0xad, 0x67, 0x5a, 0xf3, 0xf1, - 0x43, 0x54, 0x98, 0x46, 0x1e, 0xec, 0xa0, 0x25, 0xbc, 0x0c, 0x25, 0x81, 0xec, 0x77, 0x3a, 0x6d, - 0x54, 0x4c, 0x62, 0xf6, 0x8e, 0xf5, 0xd6, 0xd1, 0x01, 0x2a, 0x25, 0x31, 0x0f, 0xf4, 0x4e, 0xbf, - 0x8b, 0x20, 0x89, 0x70, 0xa8, 0xf5, 0x7a, 0xf5, 0x03, 0x0d, 0x95, 0x13, 0xc6, 0xfe, 0x17, 0xc7, - 0x5a, 0x0f, 0x55, 0xa6, 0xd2, 0x7a, 0xb0, 0x83, 0x96, 0x93, 0x9f, 0xd0, 0x8e, 0xfa, 0x87, 0xa8, - 0x8a, 0x57, 0x61, 0x59, 0xfe, 0x44, 0x9c, 0xc4, 0xca, 0x0c, 0xf4, 0xf8, 0x21, 0x42, 0x93, 0x44, - 0x64, 0x94, 0xd5, 0x29, 0xe0, 0xf1, 0x43, 0x84, 0x6b, 0x0d, 0xc8, 0x0b, 0x75, 0x61, 0x0c, 0xd5, - 0x76, 0x7d, 0x5f, 0x6b, 0x1b, 0x9d, 0xee, 0x71, 0xab, 0x73, 0x54, 0x6f, 0x23, 0x65, 0x82, 0xe9, - 0xda, 0xcf, 0xfa, 0x2d, 0x5d, 0x6b, 0xa2, 0x4c, 0x1a, 0xeb, 0x6a, 0xf5, 0x63, 0xad, 0x89, 0xb2, - 0xb5, 0xbb, 0xb0, 0xbe, 0xe8, 0x9e, 0x59, 0xf4, 0x64, 0xd4, 0xbe, 0x56, 0x60, 0x6d, 0xc1, 0x95, - 0xb9, 0xf0, 0x29, 0xfa, 0x29, 0xe4, 0xa5, 0xd2, 0x64, 0x13, 0xb9, 0xb3, 0xf0, 0xee, 0x15, 0xba, - 0x9b, 0x6b, 0x24, 0xc2, 0x2f, 0xdd, 0x48, 0xb3, 0xe7, 0x34, 0x52, 0x1e, 0x62, 0x4e, 0x4e, 0xbf, - 0x52, 0x40, 0x3d, 0x2f, 0xf6, 0x5b, 0x9e, 0xf7, 0xcc, 0xd4, 0xf3, 0xfe, 0xe9, 0x6c, 0x02, 0x37, - 0xce, 0xdf, 0xc3, 0x5c, 0x16, 0xdf, 0x28, 0x70, 0x69, 0xf1, 0xbc, 0xb1, 0x30, 0x87, 0xcf, 0xa0, - 0x30, 0xa2, 0xe1, 0xa9, 0x1b, 0xf7, 0xdc, 0x0f, 0x17, 0xdc, 0xe4, 0xdc, 0x3c, 0x5b, 0xab, 0xc8, - 0x2b, 0xdd, 0x0a, 0xb2, 0xe7, 0x0d, 0x0d, 0x32, 0x9b, 0xb9, 0x4c, 0x7f, 0x9d, 0x81, 0x77, 0x17, - 0x06, 0x5f, 0x98, 0xe8, 0x35, 0x00, 0x9b, 0x79, 0xe3, 0x50, 0xf6, 0x55, 0x79, 0xcd, 0x94, 0x04, - 0x22, 0x1e, 0x61, 0x7e, 0x85, 0x8c, 0xc3, 0xc4, 0x9e, 0x15, 0x76, 0x90, 0x90, 0x20, 0xec, 0x4e, - 0x12, 0xcd, 0x89, 0x44, 0xdf, 0x3f, 0x67, 0xa7, 0x73, 0x2d, 0xeb, 0x23, 0x40, 0xa6, 0x63, 0x53, - 0x16, 0x1a, 0x41, 0xe8, 0x53, 0x32, 0xb2, 0xd9, 0x50, 0xdc, 0xa3, 0xc5, 0xbd, 0xfc, 0x80, 0x38, - 0x01, 0xd5, 0x57, 0xa4, 0xb9, 0x17, 0x5b, 0xb9, 0x87, 0x68, 0x16, 0x7e, 0xca, 0xa3, 0x30, 0xe5, - 0x21, 0xcd, 0x89, 0x47, 0xed, 0x6f, 0x4b, 0x50, 0x4e, 0x4d, 0x67, 0xf8, 0x06, 0x54, 0x9e, 0x93, - 0x97, 0xc4, 0x88, 0x27, 0x6e, 0x59, 0x89, 0x32, 0xc7, 0xba, 0xd1, 0xd4, 0xfd, 0x11, 0xac, 0x0b, - 0x8a, 0x3b, 0x0e, 0xa9, 0x6f, 0x98, 0x0e, 0x09, 0x02, 0x51, 0xb4, 0xa2, 0xa0, 0x62, 0x6e, 0xeb, - 0x70, 0x53, 0x23, 0xb6, 0xe0, 0x47, 0xb0, 0x26, 0x3c, 0x46, 0x63, 0x27, 0xb4, 0x3d, 0x87, 0x1a, - 0xfc, 0x1d, 0x20, 0x10, 0xf7, 0x69, 0x92, 0xd9, 0x2a, 0x67, 0x1c, 0x46, 0x04, 0x9e, 0x51, 0x80, - 0x0f, 0xe0, 0x9a, 0x70, 0x1b, 0x52, 0x46, 0x7d, 0x12, 0x52, 0x83, 0xfe, 0x72, 0x4c, 0x9c, 0xc0, - 0x20, 0xcc, 0x32, 0x4e, 0x49, 0x70, 0xaa, 0xae, 0xa7, 0x03, 0x5c, 0xe6, 0xdc, 0x83, 0x88, 0xaa, - 0x09, 0x66, 0x9d, 0x59, 0x9f, 0x93, 0xe0, 0x14, 0xef, 0xc1, 0x25, 0x11, 0x28, 0x08, 0x7d, 0x9b, - 0x0d, 0x0d, 0xf3, 0x94, 0x9a, 0x2f, 0x8c, 0x71, 0x38, 0xd8, 0x55, 0xaf, 0xa4, 0x23, 0x88, 0x24, - 0x7b, 0x82, 0xd3, 0xe0, 0x94, 0x7e, 0x38, 0xd8, 0xc5, 0x3d, 0xa8, 0xf0, 0xf3, 0x18, 0xd9, 0x5f, - 0x51, 0x63, 0xe0, 0xfa, 0xa2, 0x47, 0x54, 0x17, 0x3c, 0xdc, 0xa9, 0x22, 0x6e, 0x77, 0x22, 0x87, - 0x43, 0xd7, 0xa2, 0x7b, 0xf9, 0x5e, 0x57, 0xd3, 0x9a, 0x7a, 0x39, 0x8e, 0xf2, 0xc4, 0xf5, 0xb9, - 0xa6, 0x86, 0x6e, 0x52, 0xe3, 0xb2, 0xd4, 0xd4, 0xd0, 0x8d, 0x2b, 0xfc, 0x08, 0xd6, 0x4c, 0x53, - 0x6e, 0xdb, 0x36, 0x8d, 0x68, 0x58, 0x0f, 0x54, 0x34, 0x55, 0x2f, 0xd3, 0x3c, 0x90, 0x84, 0x48, - 0xe6, 0x01, 0xfe, 0x04, 0xde, 0x9d, 0xd4, 0x2b, 0xed, 0xb8, 0x3a, 0xb7, 0xcb, 0x59, 0xd7, 0x47, - 0xb0, 0xe6, 0x9d, 0xcd, 0x3b, 0xe2, 0xa9, 0x5f, 0xf4, 0xce, 0x66, 0xdd, 0x6e, 0x89, 0x17, 0x30, - 0x9f, 0x9a, 0x24, 0xa4, 0x96, 0xfa, 0x5e, 0x9a, 0x9d, 0x32, 0xe0, 0xfb, 0x80, 0x4c, 0xd3, 0xa0, - 0x8c, 0x9c, 0x38, 0xd4, 0x20, 0x3e, 0x65, 0x24, 0x50, 0xaf, 0xa7, 0xc9, 0x55, 0xd3, 0xd4, 0x84, - 0xb5, 0x2e, 0x8c, 0xf8, 0x2e, 0xac, 0xba, 0x27, 0xcf, 0x4d, 0x29, 0x2e, 0xc3, 0xf3, 0xe9, 0xc0, - 0x7e, 0xad, 0xde, 0x14, 0x65, 0x5a, 0xe1, 0x06, 0x21, 0xad, 0xae, 0x80, 0xf1, 0x1d, 0x40, 0x66, - 0x70, 0x4a, 0x7c, 0x4f, 0x34, 0xe9, 0xc0, 0x23, 0x26, 0x55, 0x6f, 0x49, 0xaa, 0xc4, 0x8f, 0x62, - 0x18, 0x6b, 0x70, 0x9d, 0x6f, 0x9e, 0x11, 0xe6, 0x1a, 0xe3, 0x80, 0x1a, 0x93, 0x14, 0x93, 0xb3, - 0xf8, 0x90, 0xa7, 0xa5, 0x5f, 0x8d, 0x69, 0xfd, 0x80, 0x36, 0x13, 0x52, 0x7c, 0x3c, 0xcf, 0x60, - 0x7d, 0xcc, 0x6c, 0x16, 0x52, 0xdf, 0xf3, 0x29, 0x77, 0x96, 0x0f, 0xac, 0xfa, 0xcf, 0xa5, 0x73, - 0x86, 0xee, 0x7e, 0x9a, 0x2d, 0x45, 0xa2, 0xaf, 0x8d, 0xe7, 0xc1, 0xda, 0x1e, 0x54, 0xd2, 0xda, - 0xc1, 0x25, 0x90, 0xea, 0x41, 0x0a, 0xef, 0xa8, 0x8d, 0x4e, 0x93, 0xf7, 0xc2, 0x2f, 0x35, 0x94, - 0xe1, 0x3d, 0xb9, 0xdd, 0x3a, 0xd6, 0x0c, 0xbd, 0x7f, 0x74, 0xdc, 0x3a, 0xd4, 0x50, 0xf6, 0x6e, - 0xa9, 0xf8, 0xaf, 0x25, 0xf4, 0xe6, 0xcd, 0x9b, 0x37, 0x99, 0xda, 0x5f, 0x32, 0x50, 0x9d, 0x9e, - 0x83, 0xf1, 0x4f, 0xe0, 0xbd, 0xf8, 0xa5, 0x35, 0xa0, 0xa1, 0xf1, 0xca, 0xf6, 0x85, 0x9c, 0x47, - 0x44, 0x4e, 0x92, 0xc9, 0x49, 0xac, 0x47, 0xac, 0x1e, 0x0d, 0x7f, 0x61, 0xfb, 0x5c, 0xac, 0x23, - 0x12, 0xe2, 0x36, 0x5c, 0x67, 0xae, 0x11, 0x84, 0x84, 0x59, 0xc4, 0xb7, 0x8c, 0xc9, 0xe7, 0x02, - 0x83, 0x98, 0x26, 0x0d, 0x02, 0x57, 0x76, 0x92, 0x24, 0xca, 0x55, 0xe6, 0xf6, 0x22, 0xf2, 0xe4, - 0x8a, 0xad, 0x47, 0xd4, 0x19, 0xd5, 0x64, 0xcf, 0x53, 0xcd, 0x15, 0x28, 0x8d, 0x88, 0x67, 0x50, - 0x16, 0xfa, 0x67, 0x62, 0x7a, 0x2b, 0xea, 0xc5, 0x11, 0xf1, 0x34, 0xbe, 0xfe, 0xfe, 0xce, 0x20, - 0x5d, 0xc7, 0xbf, 0x67, 0xa1, 0x92, 0x9e, 0xe0, 0xf8, 0x40, 0x6c, 0x8a, 0x6b, 0x5e, 0x11, 0xb7, - 0xc0, 0x07, 0xdf, 0x3a, 0xef, 0x6d, 0x37, 0xf8, 0xfd, 0xbf, 0x57, 0x90, 0x73, 0x95, 0x2e, 0x3d, - 0x79, 0xef, 0xe5, 0x5a, 0xa3, 0x72, 0x5a, 0x2f, 0xea, 0xd1, 0x0a, 0x1f, 0x40, 0xe1, 0x79, 0x20, - 0x62, 0x17, 0x44, 0xec, 0x9b, 0xdf, 0x1e, 0xfb, 0x69, 0x4f, 0x04, 0x2f, 0x3d, 0xed, 0x19, 0x47, - 0x1d, 0xfd, 0xb0, 0xde, 0xd6, 0x23, 0x77, 0x7c, 0x19, 0x72, 0x0e, 0xf9, 0xea, 0x6c, 0xba, 0x53, - 0x08, 0xe8, 0xa2, 0x85, 0xbf, 0x0c, 0xb9, 0x57, 0x94, 0xbc, 0x98, 0xbe, 0x9f, 0x05, 0xf4, 0x3d, - 0x4a, 0xff, 0x3e, 0xe4, 0x45, 0xbd, 0x30, 0x40, 0x54, 0x31, 0xf4, 0x0e, 0x2e, 0x42, 0xae, 0xd1, - 0xd1, 0xb9, 0xfc, 0x11, 0x54, 0x24, 0x6a, 0x74, 0x5b, 0x5a, 0x43, 0x43, 0x99, 0xda, 0x23, 0x28, - 0xc8, 0x22, 0xf0, 0x47, 0x23, 0x29, 0x03, 0x7a, 0x27, 0x5a, 0x46, 0x31, 0x94, 0xd8, 0xda, 0x3f, - 0xdc, 0xd7, 0x74, 0x94, 0x49, 0x1f, 0xef, 0x9f, 0x15, 0x28, 0xa7, 0x06, 0x2a, 0xde, 0xca, 0x89, - 0xe3, 0xb8, 0xaf, 0x0c, 0xe2, 0xd8, 0x24, 0x88, 0xce, 0x07, 0x04, 0x54, 0xe7, 0xc8, 0x45, 0xeb, - 0xf7, 0x3f, 0xd1, 0xe6, 0x1f, 0x14, 0x40, 0xb3, 0xc3, 0xd8, 0x4c, 0x82, 0xca, 0x0f, 0x9a, 0xe0, - 0xef, 0x15, 0xa8, 0x4e, 0x4f, 0x60, 0x33, 0xe9, 0xdd, 0xf8, 0x41, 0xd3, 0xfb, 0x9d, 0x02, 0xcb, - 0x53, 0x73, 0xd7, 0xff, 0x55, 0x76, 0xbf, 0xcd, 0xc2, 0xda, 0x02, 0x3f, 0x5c, 0x8f, 0x06, 0x54, - 0x39, 0x33, 0xff, 0xf8, 0x22, 0xbf, 0xb5, 0xcd, 0xfb, 0x5f, 0x97, 0xf8, 0x61, 0x34, 0xcf, 0xde, - 0x01, 0x64, 0x5b, 0x94, 0x85, 0xf6, 0xc0, 0xa6, 0x7e, 0xf4, 0x6e, 0x2c, 0xa7, 0xd6, 0x95, 0x09, - 0x2e, 0x5f, 0x8f, 0x7f, 0x04, 0xd8, 0x73, 0x03, 0x3b, 0xb4, 0x5f, 0x52, 0xc3, 0x66, 0xf1, 0x8b, - 0x34, 0x9f, 0x62, 0x73, 0x3a, 0x8a, 0x2d, 0x2d, 0x16, 0x26, 0x6c, 0x46, 0x87, 0x64, 0x86, 0xcd, - 0xaf, 0xa1, 0xac, 0x8e, 0x62, 0x4b, 0xc2, 0xbe, 0x01, 0x15, 0xcb, 0x1d, 0xf3, 0x81, 0x40, 0xf2, - 0xf8, 0xad, 0xa7, 0xe8, 0x65, 0x89, 0x25, 0x94, 0x68, 0x62, 0x9b, 0xbc, 0xc1, 0x57, 0xf4, 0xb2, - 0xc4, 0x24, 0xe5, 0x36, 0xac, 0x90, 0xe1, 0xd0, 0xe7, 0xc1, 0xe3, 0x40, 0x72, 0x0c, 0xad, 0x26, - 0xb0, 0x20, 0x6e, 0x3c, 0x85, 0x62, 0x5c, 0x07, 0xde, 0x58, 0x78, 0x25, 0x0c, 0x4f, 0x7e, 0x47, - 0xc9, 0xf0, 0x97, 0x7a, 0x16, 0x1b, 0x6f, 0x40, 0xc5, 0x0e, 0x8c, 0xc9, 0x07, 0xbd, 0xcc, 0x66, - 0x66, 0xab, 0xa8, 0x97, 0xed, 0x20, 0xf9, 0x82, 0x53, 0xfb, 0x26, 0x03, 0xd5, 0xe9, 0x0f, 0x92, - 0xb8, 0x09, 0x45, 0xc7, 0x35, 0x89, 0x10, 0x82, 0xfc, 0x1a, 0xbe, 0xf5, 0x96, 0x6f, 0x98, 0xdb, - 0xed, 0x88, 0xaf, 0x27, 0x9e, 0x1b, 0x7f, 0x55, 0xa0, 0x18, 0xc3, 0xf8, 0x12, 0xe4, 0x3c, 0x12, - 0x9e, 0x8a, 0x70, 0xf9, 0xfd, 0x0c, 0x52, 0x74, 0xb1, 0xe6, 0x78, 0xe0, 0x11, 0x26, 0x24, 0x10, - 0xe1, 0x7c, 0xcd, 0xcf, 0xd5, 0xa1, 0xc4, 0x12, 0x03, 0xae, 0x3b, 0x1a, 0x51, 0x16, 0x06, 0xf1, - 0xb9, 0x46, 0x78, 0x23, 0x82, 0xf1, 0x3d, 0x58, 0x0d, 0x7d, 0x62, 0x3b, 0x53, 0xdc, 0x9c, 0xe0, - 0xa2, 0xd8, 0x90, 0x90, 0xf7, 0xe0, 0x72, 0x1c, 0xd7, 0xa2, 0x21, 0x31, 0x4f, 0xa9, 0x35, 0x71, - 0x2a, 0x88, 0xaf, 0x5d, 0xef, 0x45, 0x84, 0x66, 0x64, 0x8f, 0x7d, 0xf7, 0x9f, 0xc1, 0x9a, 0xe9, - 0x8e, 0x66, 0x2b, 0xb1, 0x8f, 0x66, 0xde, 0xbb, 0x82, 0xcf, 0x95, 0x2f, 0x61, 0x32, 0x54, 0x7c, - 0x9d, 0xc9, 0x1e, 0x74, 0xf7, 0xff, 0x98, 0xd9, 0x38, 0x90, 0x7e, 0xdd, 0xb8, 0x82, 0x3a, 0x1d, - 0x38, 0xd4, 0xe4, 0xd5, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x42, 0x69, 0x71, 0xb3, - 0x18, 0x00, 0x00, -} diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go deleted file mode 100644 index b175f555b..000000000 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go +++ /dev/null @@ -1,658 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: descriptor.proto -// DO NOT EDIT! - -/* -Package descriptor is a generated protocol buffer package. - -It is generated from these files: - descriptor.proto - -It has these top-level messages: - FileDescriptorSet - FileDescriptorProto - DescriptorProto - FieldDescriptorProto - OneofDescriptorProto - EnumDescriptorProto - EnumValueDescriptorProto - ServiceDescriptorProto - MethodDescriptorProto - FileOptions - MessageOptions - FieldOptions - EnumOptions - EnumValueOptions - ServiceOptions - MethodOptions - UninterpretedOption - SourceCodeInfo -*/ -package descriptor - -import fmt "fmt" -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" -import proto "github.com/gogo/protobuf/proto" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -func (this *FileDescriptorSet) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&descriptor.FileDescriptorSet{") - if this.File != nil { - s = append(s, "File: "+fmt.Sprintf("%#v", this.File)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FileDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 16) - s = append(s, "&descriptor.FileDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Package != nil { - s = append(s, "Package: "+valueToGoStringDescriptor(this.Package, "string")+",\n") - } - if this.Dependency != nil { - s = append(s, "Dependency: "+fmt.Sprintf("%#v", this.Dependency)+",\n") - } - if this.PublicDependency != nil { - s = append(s, "PublicDependency: "+fmt.Sprintf("%#v", this.PublicDependency)+",\n") - } - if this.WeakDependency != nil { - s = append(s, "WeakDependency: "+fmt.Sprintf("%#v", this.WeakDependency)+",\n") - } - if this.MessageType != nil { - s = append(s, "MessageType: "+fmt.Sprintf("%#v", this.MessageType)+",\n") - } - if this.EnumType != nil { - s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n") - } - if this.Service != nil { - s = append(s, "Service: "+fmt.Sprintf("%#v", this.Service)+",\n") - } - if this.Extension != nil { - s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.SourceCodeInfo != nil { - s = append(s, "SourceCodeInfo: "+fmt.Sprintf("%#v", this.SourceCodeInfo)+",\n") - } - if this.Syntax != nil { - s = append(s, "Syntax: "+valueToGoStringDescriptor(this.Syntax, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 14) - s = append(s, "&descriptor.DescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Field != nil { - s = append(s, "Field: "+fmt.Sprintf("%#v", this.Field)+",\n") - } - if this.Extension != nil { - s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n") - } - if this.NestedType != nil { - s = append(s, "NestedType: "+fmt.Sprintf("%#v", this.NestedType)+",\n") - } - if this.EnumType != nil { - s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n") - } - if this.ExtensionRange != nil { - s = append(s, "ExtensionRange: "+fmt.Sprintf("%#v", this.ExtensionRange)+",\n") - } - if this.OneofDecl != nil { - s = append(s, "OneofDecl: "+fmt.Sprintf("%#v", this.OneofDecl)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.ReservedRange != nil { - s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n") - } - if this.ReservedName != nil { - s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DescriptorProto_ExtensionRange) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.DescriptorProto_ExtensionRange{") - if this.Start != nil { - s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n") - } - if this.End != nil { - s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DescriptorProto_ReservedRange) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.DescriptorProto_ReservedRange{") - if this.Start != nil { - s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n") - } - if this.End != nil { - s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FieldDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 14) - s = append(s, "&descriptor.FieldDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Number != nil { - s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n") - } - if this.Label != nil { - s = append(s, "Label: "+valueToGoStringDescriptor(this.Label, "descriptor.FieldDescriptorProto_Label")+",\n") - } - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringDescriptor(this.Type, "descriptor.FieldDescriptorProto_Type")+",\n") - } - if this.TypeName != nil { - s = append(s, "TypeName: "+valueToGoStringDescriptor(this.TypeName, "string")+",\n") - } - if this.Extendee != nil { - s = append(s, "Extendee: "+valueToGoStringDescriptor(this.Extendee, "string")+",\n") - } - if this.DefaultValue != nil { - s = append(s, "DefaultValue: "+valueToGoStringDescriptor(this.DefaultValue, "string")+",\n") - } - if this.OneofIndex != nil { - s = append(s, "OneofIndex: "+valueToGoStringDescriptor(this.OneofIndex, "int32")+",\n") - } - if this.JsonName != nil { - s = append(s, "JsonName: "+valueToGoStringDescriptor(this.JsonName, "string")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *OneofDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&descriptor.OneofDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.EnumDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumValueDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.EnumValueDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Number != nil { - s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ServiceDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.ServiceDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.Method != nil { - s = append(s, "Method: "+fmt.Sprintf("%#v", this.Method)+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *MethodDescriptorProto) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&descriptor.MethodDescriptorProto{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") - } - if this.InputType != nil { - s = append(s, "InputType: "+valueToGoStringDescriptor(this.InputType, "string")+",\n") - } - if this.OutputType != nil { - s = append(s, "OutputType: "+valueToGoStringDescriptor(this.OutputType, "string")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.ClientStreaming != nil { - s = append(s, "ClientStreaming: "+valueToGoStringDescriptor(this.ClientStreaming, "bool")+",\n") - } - if this.ServerStreaming != nil { - s = append(s, "ServerStreaming: "+valueToGoStringDescriptor(this.ServerStreaming, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FileOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 20) - s = append(s, "&descriptor.FileOptions{") - if this.JavaPackage != nil { - s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n") - } - if this.JavaOuterClassname != nil { - s = append(s, "JavaOuterClassname: "+valueToGoStringDescriptor(this.JavaOuterClassname, "string")+",\n") - } - if this.JavaMultipleFiles != nil { - s = append(s, "JavaMultipleFiles: "+valueToGoStringDescriptor(this.JavaMultipleFiles, "bool")+",\n") - } - if this.JavaGenerateEqualsAndHash != nil { - s = append(s, "JavaGenerateEqualsAndHash: "+valueToGoStringDescriptor(this.JavaGenerateEqualsAndHash, "bool")+",\n") - } - if this.JavaStringCheckUtf8 != nil { - s = append(s, "JavaStringCheckUtf8: "+valueToGoStringDescriptor(this.JavaStringCheckUtf8, "bool")+",\n") - } - if this.OptimizeFor != nil { - s = append(s, "OptimizeFor: "+valueToGoStringDescriptor(this.OptimizeFor, "descriptor.FileOptions_OptimizeMode")+",\n") - } - if this.GoPackage != nil { - s = append(s, "GoPackage: "+valueToGoStringDescriptor(this.GoPackage, "string")+",\n") - } - if this.CcGenericServices != nil { - s = append(s, "CcGenericServices: "+valueToGoStringDescriptor(this.CcGenericServices, "bool")+",\n") - } - if this.JavaGenericServices != nil { - s = append(s, "JavaGenericServices: "+valueToGoStringDescriptor(this.JavaGenericServices, "bool")+",\n") - } - if this.PyGenericServices != nil { - s = append(s, "PyGenericServices: "+valueToGoStringDescriptor(this.PyGenericServices, "bool")+",\n") - } - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.CcEnableArenas != nil { - s = append(s, "CcEnableArenas: "+valueToGoStringDescriptor(this.CcEnableArenas, "bool")+",\n") - } - if this.ObjcClassPrefix != nil { - s = append(s, "ObjcClassPrefix: "+valueToGoStringDescriptor(this.ObjcClassPrefix, "string")+",\n") - } - if this.CsharpNamespace != nil { - s = append(s, "CsharpNamespace: "+valueToGoStringDescriptor(this.CsharpNamespace, "string")+",\n") - } - if this.JavananoUseDeprecatedPackage != nil { - s = append(s, "JavananoUseDeprecatedPackage: "+valueToGoStringDescriptor(this.JavananoUseDeprecatedPackage, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *MessageOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&descriptor.MessageOptions{") - if this.MessageSetWireFormat != nil { - s = append(s, "MessageSetWireFormat: "+valueToGoStringDescriptor(this.MessageSetWireFormat, "bool")+",\n") - } - if this.NoStandardDescriptorAccessor != nil { - s = append(s, "NoStandardDescriptorAccessor: "+valueToGoStringDescriptor(this.NoStandardDescriptorAccessor, "bool")+",\n") - } - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.MapEntry != nil { - s = append(s, "MapEntry: "+valueToGoStringDescriptor(this.MapEntry, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FieldOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&descriptor.FieldOptions{") - if this.Ctype != nil { - s = append(s, "Ctype: "+valueToGoStringDescriptor(this.Ctype, "descriptor.FieldOptions_CType")+",\n") - } - if this.Packed != nil { - s = append(s, "Packed: "+valueToGoStringDescriptor(this.Packed, "bool")+",\n") - } - if this.Jstype != nil { - s = append(s, "Jstype: "+valueToGoStringDescriptor(this.Jstype, "descriptor.FieldOptions_JSType")+",\n") - } - if this.Lazy != nil { - s = append(s, "Lazy: "+valueToGoStringDescriptor(this.Lazy, "bool")+",\n") - } - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.Weak != nil { - s = append(s, "Weak: "+valueToGoStringDescriptor(this.Weak, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&descriptor.EnumOptions{") - if this.AllowAlias != nil { - s = append(s, "AllowAlias: "+valueToGoStringDescriptor(this.AllowAlias, "bool")+",\n") - } - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *EnumValueOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.EnumValueOptions{") - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ServiceOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.ServiceOptions{") - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *MethodOptions) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.MethodOptions{") - if this.Deprecated != nil { - s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") - } - if this.UninterpretedOption != nil { - s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") - } - s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UninterpretedOption) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&descriptor.UninterpretedOption{") - if this.Name != nil { - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - } - if this.IdentifierValue != nil { - s = append(s, "IdentifierValue: "+valueToGoStringDescriptor(this.IdentifierValue, "string")+",\n") - } - if this.PositiveIntValue != nil { - s = append(s, "PositiveIntValue: "+valueToGoStringDescriptor(this.PositiveIntValue, "uint64")+",\n") - } - if this.NegativeIntValue != nil { - s = append(s, "NegativeIntValue: "+valueToGoStringDescriptor(this.NegativeIntValue, "int64")+",\n") - } - if this.DoubleValue != nil { - s = append(s, "DoubleValue: "+valueToGoStringDescriptor(this.DoubleValue, "float64")+",\n") - } - if this.StringValue != nil { - s = append(s, "StringValue: "+valueToGoStringDescriptor(this.StringValue, "byte")+",\n") - } - if this.AggregateValue != nil { - s = append(s, "AggregateValue: "+valueToGoStringDescriptor(this.AggregateValue, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UninterpretedOption_NamePart) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&descriptor.UninterpretedOption_NamePart{") - if this.NamePart != nil { - s = append(s, "NamePart: "+valueToGoStringDescriptor(this.NamePart, "string")+",\n") - } - if this.IsExtension != nil { - s = append(s, "IsExtension: "+valueToGoStringDescriptor(this.IsExtension, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SourceCodeInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&descriptor.SourceCodeInfo{") - if this.Location != nil { - s = append(s, "Location: "+fmt.Sprintf("%#v", this.Location)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SourceCodeInfo_Location) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&descriptor.SourceCodeInfo_Location{") - if this.Path != nil { - s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") - } - if this.Span != nil { - s = append(s, "Span: "+fmt.Sprintf("%#v", this.Span)+",\n") - } - if this.LeadingComments != nil { - s = append(s, "LeadingComments: "+valueToGoStringDescriptor(this.LeadingComments, "string")+",\n") - } - if this.TrailingComments != nil { - s = append(s, "TrailingComments: "+valueToGoStringDescriptor(this.TrailingComments, "string")+",\n") - } - if this.LeadingDetachedComments != nil { - s = append(s, "LeadingDetachedComments: "+fmt.Sprintf("%#v", this.LeadingDetachedComments)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringDescriptor(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringDescriptor(m github_com_gogo_protobuf_proto.Message) string { - e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m) - if e == nil { - return "nil" - } - s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "})" - return s -} diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go deleted file mode 100644 index 861f4d028..000000000 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go +++ /dev/null @@ -1,357 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -package descriptor - -import ( - "strings" -) - -func (msg *DescriptorProto) GetMapFields() (*FieldDescriptorProto, *FieldDescriptorProto) { - if !msg.GetOptions().GetMapEntry() { - return nil, nil - } - return msg.GetField()[0], msg.GetField()[1] -} - -func dotToUnderscore(r rune) rune { - if r == '.' { - return '_' - } - return r -} - -func (field *FieldDescriptorProto) WireType() (wire int) { - switch *field.Type { - case FieldDescriptorProto_TYPE_DOUBLE: - return 1 - case FieldDescriptorProto_TYPE_FLOAT: - return 5 - case FieldDescriptorProto_TYPE_INT64: - return 0 - case FieldDescriptorProto_TYPE_UINT64: - return 0 - case FieldDescriptorProto_TYPE_INT32: - return 0 - case FieldDescriptorProto_TYPE_UINT32: - return 0 - case FieldDescriptorProto_TYPE_FIXED64: - return 1 - case FieldDescriptorProto_TYPE_FIXED32: - return 5 - case FieldDescriptorProto_TYPE_BOOL: - return 0 - case FieldDescriptorProto_TYPE_STRING: - return 2 - case FieldDescriptorProto_TYPE_GROUP: - return 2 - case FieldDescriptorProto_TYPE_MESSAGE: - return 2 - case FieldDescriptorProto_TYPE_BYTES: - return 2 - case FieldDescriptorProto_TYPE_ENUM: - return 0 - case FieldDescriptorProto_TYPE_SFIXED32: - return 5 - case FieldDescriptorProto_TYPE_SFIXED64: - return 1 - case FieldDescriptorProto_TYPE_SINT32: - return 0 - case FieldDescriptorProto_TYPE_SINT64: - return 0 - } - panic("unreachable") -} - -func (field *FieldDescriptorProto) GetKeyUint64() (x uint64) { - packed := field.IsPacked() - wireType := field.WireType() - fieldNumber := field.GetNumber() - if packed { - wireType = 2 - } - x = uint64(uint32(fieldNumber)<<3 | uint32(wireType)) - return x -} - -func (field *FieldDescriptorProto) GetKey() []byte { - x := field.GetKeyUint64() - i := 0 - keybuf := make([]byte, 0) - for i = 0; x > 127; i++ { - keybuf = append(keybuf, 0x80|uint8(x&0x7F)) - x >>= 7 - } - keybuf = append(keybuf, uint8(x)) - return keybuf -} - -func (desc *FileDescriptorSet) GetField(packageName, messageName, fieldName string) *FieldDescriptorProto { - msg := desc.GetMessage(packageName, messageName) - if msg == nil { - return nil - } - for _, field := range msg.GetField() { - if field.GetName() == fieldName { - return field - } - } - return nil -} - -func (file *FileDescriptorProto) GetMessage(typeName string) *DescriptorProto { - for _, msg := range file.GetMessageType() { - if msg.GetName() == typeName { - return msg - } - nes := file.GetNestedMessage(msg, strings.TrimPrefix(typeName, msg.GetName()+".")) - if nes != nil { - return nes - } - } - return nil -} - -func (file *FileDescriptorProto) GetNestedMessage(msg *DescriptorProto, typeName string) *DescriptorProto { - for _, nes := range msg.GetNestedType() { - if nes.GetName() == typeName { - return nes - } - res := file.GetNestedMessage(nes, strings.TrimPrefix(typeName, nes.GetName()+".")) - if res != nil { - return res - } - } - return nil -} - -func (desc *FileDescriptorSet) GetMessage(packageName string, typeName string) *DescriptorProto { - for _, file := range desc.GetFile() { - if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { - continue - } - for _, msg := range file.GetMessageType() { - if msg.GetName() == typeName { - return msg - } - } - for _, msg := range file.GetMessageType() { - for _, nes := range msg.GetNestedType() { - if nes.GetName() == typeName { - return nes - } - if msg.GetName()+"."+nes.GetName() == typeName { - return nes - } - } - } - } - return nil -} - -func (desc *FileDescriptorSet) IsProto3(packageName string, typeName string) bool { - for _, file := range desc.GetFile() { - if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { - continue - } - for _, msg := range file.GetMessageType() { - if msg.GetName() == typeName { - return file.GetSyntax() == "proto3" - } - } - for _, msg := range file.GetMessageType() { - for _, nes := range msg.GetNestedType() { - if nes.GetName() == typeName { - return file.GetSyntax() == "proto3" - } - if msg.GetName()+"."+nes.GetName() == typeName { - return file.GetSyntax() == "proto3" - } - } - } - } - return false -} - -func (msg *DescriptorProto) IsExtendable() bool { - return len(msg.GetExtensionRange()) > 0 -} - -func (desc *FileDescriptorSet) FindExtension(packageName string, typeName string, fieldName string) (extPackageName string, field *FieldDescriptorProto) { - parent := desc.GetMessage(packageName, typeName) - if parent == nil { - return "", nil - } - if !parent.IsExtendable() { - return "", nil - } - extendee := "." + packageName + "." + typeName - for _, file := range desc.GetFile() { - for _, ext := range file.GetExtension() { - if strings.Map(dotToUnderscore, file.GetPackage()) == strings.Map(dotToUnderscore, packageName) { - if !(ext.GetExtendee() == typeName || ext.GetExtendee() == extendee) { - continue - } - } else { - if ext.GetExtendee() != extendee { - continue - } - } - if ext.GetName() == fieldName { - return file.GetPackage(), ext - } - } - } - return "", nil -} - -func (desc *FileDescriptorSet) FindExtensionByFieldNumber(packageName string, typeName string, fieldNum int32) (extPackageName string, field *FieldDescriptorProto) { - parent := desc.GetMessage(packageName, typeName) - if parent == nil { - return "", nil - } - if !parent.IsExtendable() { - return "", nil - } - extendee := "." + packageName + "." + typeName - for _, file := range desc.GetFile() { - for _, ext := range file.GetExtension() { - if strings.Map(dotToUnderscore, file.GetPackage()) == strings.Map(dotToUnderscore, packageName) { - if !(ext.GetExtendee() == typeName || ext.GetExtendee() == extendee) { - continue - } - } else { - if ext.GetExtendee() != extendee { - continue - } - } - if ext.GetNumber() == fieldNum { - return file.GetPackage(), ext - } - } - } - return "", nil -} - -func (desc *FileDescriptorSet) FindMessage(packageName string, typeName string, fieldName string) (msgPackageName string, msgName string) { - parent := desc.GetMessage(packageName, typeName) - if parent == nil { - return "", "" - } - field := parent.GetFieldDescriptor(fieldName) - if field == nil { - var extPackageName string - extPackageName, field = desc.FindExtension(packageName, typeName, fieldName) - if field == nil { - return "", "" - } - packageName = extPackageName - } - typeNames := strings.Split(field.GetTypeName(), ".") - if len(typeNames) == 1 { - msg := desc.GetMessage(packageName, typeName) - if msg == nil { - return "", "" - } - return packageName, msg.GetName() - } - if len(typeNames) > 2 { - for i := 1; i < len(typeNames)-1; i++ { - packageName = strings.Join(typeNames[1:len(typeNames)-i], ".") - typeName = strings.Join(typeNames[len(typeNames)-i:], ".") - msg := desc.GetMessage(packageName, typeName) - if msg != nil { - typeNames := strings.Split(msg.GetName(), ".") - if len(typeNames) == 1 { - return packageName, msg.GetName() - } - return strings.Join(typeNames[1:len(typeNames)-1], "."), typeNames[len(typeNames)-1] - } - } - } - return "", "" -} - -func (msg *DescriptorProto) GetFieldDescriptor(fieldName string) *FieldDescriptorProto { - for _, field := range msg.GetField() { - if field.GetName() == fieldName { - return field - } - } - return nil -} - -func (desc *FileDescriptorSet) GetEnum(packageName string, typeName string) *EnumDescriptorProto { - for _, file := range desc.GetFile() { - if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { - continue - } - for _, enum := range file.GetEnumType() { - if enum.GetName() == typeName { - return enum - } - } - } - return nil -} - -func (f *FieldDescriptorProto) IsEnum() bool { - return *f.Type == FieldDescriptorProto_TYPE_ENUM -} - -func (f *FieldDescriptorProto) IsMessage() bool { - return *f.Type == FieldDescriptorProto_TYPE_MESSAGE -} - -func (f *FieldDescriptorProto) IsBytes() bool { - return *f.Type == FieldDescriptorProto_TYPE_BYTES -} - -func (f *FieldDescriptorProto) IsRepeated() bool { - return f.Label != nil && *f.Label == FieldDescriptorProto_LABEL_REPEATED -} - -func (f *FieldDescriptorProto) IsString() bool { - return *f.Type == FieldDescriptorProto_TYPE_STRING -} - -func (f *FieldDescriptorProto) IsBool() bool { - return *f.Type == FieldDescriptorProto_TYPE_BOOL -} - -func (f *FieldDescriptorProto) IsRequired() bool { - return f.Label != nil && *f.Label == FieldDescriptorProto_LABEL_REQUIRED -} - -func (f *FieldDescriptorProto) IsPacked() bool { - return f.Options != nil && f.GetOptions().GetPacked() -} - -func (m *DescriptorProto) HasExtension() bool { - return len(m.ExtensionRange) > 0 -} diff --git a/vendor/github.com/hashicorp/consul/LICENSE b/vendor/github.com/hashicorp/consul/LICENSE deleted file mode 100644 index c33dcc7c9..000000000 --- a/vendor/github.com/hashicorp/consul/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/hashicorp/consul/api/acl.go b/vendor/github.com/hashicorp/consul/api/acl.go deleted file mode 100644 index 6ea0a752e..000000000 --- a/vendor/github.com/hashicorp/consul/api/acl.go +++ /dev/null @@ -1,193 +0,0 @@ -package api - -import ( - "time" -) - -const ( - // ACLCLientType is the client type token - ACLClientType = "client" - - // ACLManagementType is the management type token - ACLManagementType = "management" -) - -// ACLEntry is used to represent an ACL entry -type ACLEntry struct { - CreateIndex uint64 - ModifyIndex uint64 - ID string - Name string - Type string - Rules string -} - -// ACLReplicationStatus is used to represent the status of ACL replication. -type ACLReplicationStatus struct { - Enabled bool - Running bool - SourceDatacenter string - ReplicatedIndex uint64 - LastSuccess time.Time - LastError time.Time -} - -// ACL can be used to query the ACL endpoints -type ACL struct { - c *Client -} - -// ACL returns a handle to the ACL endpoints -func (c *Client) ACL() *ACL { - return &ACL{c} -} - -// Bootstrap is used to perform a one-time ACL bootstrap operation on a cluster -// to get the first management token. -func (a *ACL) Bootstrap() (string, *WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/bootstrap") - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// Create is used to generate a new token with the given parameters -func (a *ACL) Create(acl *ACLEntry, q *WriteOptions) (string, *WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/create") - r.setWriteOptions(q) - r.obj = acl - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// Update is used to update the rules of an existing token -func (a *ACL) Update(acl *ACLEntry, q *WriteOptions) (*WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/update") - r.setWriteOptions(q) - r.obj = acl - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - return wm, nil -} - -// Destroy is used to destroy a given ACL token ID -func (a *ACL) Destroy(id string, q *WriteOptions) (*WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/destroy/"+id) - r.setWriteOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - return wm, nil -} - -// Clone is used to return a new token cloned from an existing one -func (a *ACL) Clone(id string, q *WriteOptions) (string, *WriteMeta, error) { - r := a.c.newRequest("PUT", "/v1/acl/clone/"+id) - r.setWriteOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// Info is used to query for information about an ACL token -func (a *ACL) Info(id string, q *QueryOptions) (*ACLEntry, *QueryMeta, error) { - r := a.c.newRequest("GET", "/v1/acl/info/"+id) - r.setQueryOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*ACLEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - if len(entries) > 0 { - return entries[0], qm, nil - } - return nil, qm, nil -} - -// List is used to get all the ACL tokens -func (a *ACL) List(q *QueryOptions) ([]*ACLEntry, *QueryMeta, error) { - r := a.c.newRequest("GET", "/v1/acl/list") - r.setQueryOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*ACLEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -// Replication returns the status of the ACL replication process in the datacenter -func (a *ACL) Replication(q *QueryOptions) (*ACLReplicationStatus, *QueryMeta, error) { - r := a.c.newRequest("GET", "/v1/acl/replication") - r.setQueryOptions(q) - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries *ACLReplicationStatus - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/agent.go b/vendor/github.com/hashicorp/consul/api/agent.go deleted file mode 100644 index 2c826660c..000000000 --- a/vendor/github.com/hashicorp/consul/api/agent.go +++ /dev/null @@ -1,624 +0,0 @@ -package api - -import ( - "bufio" - "fmt" -) - -// AgentCheck represents a check known to the agent -type AgentCheck struct { - Node string - CheckID string - Name string - Status string - Notes string - Output string - ServiceID string - ServiceName string - Definition HealthCheckDefinition -} - -// AgentService represents a service known to the agent -type AgentService struct { - ID string - Service string - Tags []string - Port int - Address string - EnableTagOverride bool - CreateIndex uint64 - ModifyIndex uint64 -} - -// AgentMember represents a cluster member known to the agent -type AgentMember struct { - Name string - Addr string - Port uint16 - Tags map[string]string - Status int - ProtocolMin uint8 - ProtocolMax uint8 - ProtocolCur uint8 - DelegateMin uint8 - DelegateMax uint8 - DelegateCur uint8 -} - -// AllSegments is used to select for all segments in MembersOpts. -const AllSegments = "_all" - -// MembersOpts is used for querying member information. -type MembersOpts struct { - // WAN is whether to show members from the WAN. - WAN bool - - // Segment is the LAN segment to show members for. Setting this to the - // AllSegments value above will show members in all segments. - Segment string -} - -// AgentServiceRegistration is used to register a new service -type AgentServiceRegistration struct { - ID string `json:",omitempty"` - Name string `json:",omitempty"` - Tags []string `json:",omitempty"` - Port int `json:",omitempty"` - Address string `json:",omitempty"` - EnableTagOverride bool `json:",omitempty"` - Check *AgentServiceCheck - Checks AgentServiceChecks -} - -// AgentCheckRegistration is used to register a new check -type AgentCheckRegistration struct { - ID string `json:",omitempty"` - Name string `json:",omitempty"` - Notes string `json:",omitempty"` - ServiceID string `json:",omitempty"` - AgentServiceCheck -} - -// AgentServiceCheck is used to define a node or service level check -type AgentServiceCheck struct { - CheckID string `json:",omitempty"` - Name string `json:",omitempty"` - Args []string `json:"ScriptArgs,omitempty"` - Script string `json:",omitempty"` // Deprecated, use Args. - DockerContainerID string `json:",omitempty"` - Shell string `json:",omitempty"` // Only supported for Docker. - Interval string `json:",omitempty"` - Timeout string `json:",omitempty"` - TTL string `json:",omitempty"` - HTTP string `json:",omitempty"` - Header map[string][]string `json:",omitempty"` - Method string `json:",omitempty"` - TCP string `json:",omitempty"` - Status string `json:",omitempty"` - Notes string `json:",omitempty"` - TLSSkipVerify bool `json:",omitempty"` - - // In Consul 0.7 and later, checks that are associated with a service - // may also contain this optional DeregisterCriticalServiceAfter field, - // which is a timeout in the same Go time format as Interval and TTL. If - // a check is in the critical state for more than this configured value, - // then its associated service (and all of its associated checks) will - // automatically be deregistered. - DeregisterCriticalServiceAfter string `json:",omitempty"` -} -type AgentServiceChecks []*AgentServiceCheck - -// AgentToken is used when updating ACL tokens for an agent. -type AgentToken struct { - Token string -} - -// Metrics info is used to store different types of metric values from the agent. -type MetricsInfo struct { - Timestamp string - Gauges []GaugeValue - Points []PointValue - Counters []SampledValue - Samples []SampledValue -} - -// GaugeValue stores one value that is updated as time goes on, such as -// the amount of memory allocated. -type GaugeValue struct { - Name string - Value float32 - Labels map[string]string -} - -// PointValue holds a series of points for a metric. -type PointValue struct { - Name string - Points []float32 -} - -// SampledValue stores info about a metric that is incremented over time, -// such as the number of requests to an HTTP endpoint. -type SampledValue struct { - Name string - Count int - Sum float64 - Min float64 - Max float64 - Mean float64 - Stddev float64 - Labels map[string]string -} - -// Agent can be used to query the Agent endpoints -type Agent struct { - c *Client - - // cache the node name - nodeName string -} - -// Agent returns a handle to the agent endpoints -func (c *Client) Agent() *Agent { - return &Agent{c: c} -} - -// Self is used to query the agent we are speaking to for -// information about itself -func (a *Agent) Self() (map[string]map[string]interface{}, error) { - r := a.c.newRequest("GET", "/v1/agent/self") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out map[string]map[string]interface{} - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Metrics is used to query the agent we are speaking to for -// its current internal metric data -func (a *Agent) Metrics() (*MetricsInfo, error) { - r := a.c.newRequest("GET", "/v1/agent/metrics") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out *MetricsInfo - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Reload triggers a configuration reload for the agent we are connected to. -func (a *Agent) Reload() error { - r := a.c.newRequest("PUT", "/v1/agent/reload") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// NodeName is used to get the node name of the agent -func (a *Agent) NodeName() (string, error) { - if a.nodeName != "" { - return a.nodeName, nil - } - info, err := a.Self() - if err != nil { - return "", err - } - name := info["Config"]["NodeName"].(string) - a.nodeName = name - return name, nil -} - -// Checks returns the locally registered checks -func (a *Agent) Checks() (map[string]*AgentCheck, error) { - r := a.c.newRequest("GET", "/v1/agent/checks") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out map[string]*AgentCheck - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Services returns the locally registered services -func (a *Agent) Services() (map[string]*AgentService, error) { - r := a.c.newRequest("GET", "/v1/agent/services") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out map[string]*AgentService - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Members returns the known gossip members. The WAN -// flag can be used to query a server for WAN members. -func (a *Agent) Members(wan bool) ([]*AgentMember, error) { - r := a.c.newRequest("GET", "/v1/agent/members") - if wan { - r.params.Set("wan", "1") - } - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out []*AgentMember - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// MembersOpts returns the known gossip members and can be passed -// additional options for WAN/segment filtering. -func (a *Agent) MembersOpts(opts MembersOpts) ([]*AgentMember, error) { - r := a.c.newRequest("GET", "/v1/agent/members") - r.params.Set("segment", opts.Segment) - if opts.WAN { - r.params.Set("wan", "1") - } - - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out []*AgentMember - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// ServiceRegister is used to register a new service with -// the local agent -func (a *Agent) ServiceRegister(service *AgentServiceRegistration) error { - r := a.c.newRequest("PUT", "/v1/agent/service/register") - r.obj = service - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// ServiceDeregister is used to deregister a service with -// the local agent -func (a *Agent) ServiceDeregister(serviceID string) error { - r := a.c.newRequest("PUT", "/v1/agent/service/deregister/"+serviceID) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// PassTTL is used to set a TTL check to the passing state. -// -// DEPRECATION NOTICE: This interface is deprecated in favor of UpdateTTL(). -// The client interface will be removed in 0.8 or changed to use -// UpdateTTL()'s endpoint and the server endpoints will be removed in 0.9. -func (a *Agent) PassTTL(checkID, note string) error { - return a.updateTTL(checkID, note, "pass") -} - -// WarnTTL is used to set a TTL check to the warning state. -// -// DEPRECATION NOTICE: This interface is deprecated in favor of UpdateTTL(). -// The client interface will be removed in 0.8 or changed to use -// UpdateTTL()'s endpoint and the server endpoints will be removed in 0.9. -func (a *Agent) WarnTTL(checkID, note string) error { - return a.updateTTL(checkID, note, "warn") -} - -// FailTTL is used to set a TTL check to the failing state. -// -// DEPRECATION NOTICE: This interface is deprecated in favor of UpdateTTL(). -// The client interface will be removed in 0.8 or changed to use -// UpdateTTL()'s endpoint and the server endpoints will be removed in 0.9. -func (a *Agent) FailTTL(checkID, note string) error { - return a.updateTTL(checkID, note, "fail") -} - -// updateTTL is used to update the TTL of a check. This is the internal -// method that uses the old API that's present in Consul versions prior to -// 0.6.4. Since Consul didn't have an analogous "update" API before it seemed -// ok to break this (former) UpdateTTL in favor of the new UpdateTTL below, -// but keep the old Pass/Warn/Fail methods using the old API under the hood. -// -// DEPRECATION NOTICE: This interface is deprecated in favor of UpdateTTL(). -// The client interface will be removed in 0.8 and the server endpoints will -// be removed in 0.9. -func (a *Agent) updateTTL(checkID, note, status string) error { - switch status { - case "pass": - case "warn": - case "fail": - default: - return fmt.Errorf("Invalid status: %s", status) - } - endpoint := fmt.Sprintf("/v1/agent/check/%s/%s", status, checkID) - r := a.c.newRequest("PUT", endpoint) - r.params.Set("note", note) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// checkUpdate is the payload for a PUT for a check update. -type checkUpdate struct { - // Status is one of the api.Health* states: HealthPassing - // ("passing"), HealthWarning ("warning"), or HealthCritical - // ("critical"). - Status string - - // Output is the information to post to the UI for operators as the - // output of the process that decided to hit the TTL check. This is - // different from the note field that's associated with the check - // itself. - Output string -} - -// UpdateTTL is used to update the TTL of a check. This uses the newer API -// that was introduced in Consul 0.6.4 and later. We translate the old status -// strings for compatibility (though a newer version of Consul will still be -// required to use this API). -func (a *Agent) UpdateTTL(checkID, output, status string) error { - switch status { - case "pass", HealthPassing: - status = HealthPassing - case "warn", HealthWarning: - status = HealthWarning - case "fail", HealthCritical: - status = HealthCritical - default: - return fmt.Errorf("Invalid status: %s", status) - } - - endpoint := fmt.Sprintf("/v1/agent/check/update/%s", checkID) - r := a.c.newRequest("PUT", endpoint) - r.obj = &checkUpdate{ - Status: status, - Output: output, - } - - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// CheckRegister is used to register a new check with -// the local agent -func (a *Agent) CheckRegister(check *AgentCheckRegistration) error { - r := a.c.newRequest("PUT", "/v1/agent/check/register") - r.obj = check - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// CheckDeregister is used to deregister a check with -// the local agent -func (a *Agent) CheckDeregister(checkID string) error { - r := a.c.newRequest("PUT", "/v1/agent/check/deregister/"+checkID) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// Join is used to instruct the agent to attempt a join to -// another cluster member -func (a *Agent) Join(addr string, wan bool) error { - r := a.c.newRequest("PUT", "/v1/agent/join/"+addr) - if wan { - r.params.Set("wan", "1") - } - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// Leave is used to have the agent gracefully leave the cluster and shutdown -func (a *Agent) Leave() error { - r := a.c.newRequest("PUT", "/v1/agent/leave") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// ForceLeave is used to have the agent eject a failed node -func (a *Agent) ForceLeave(node string) error { - r := a.c.newRequest("PUT", "/v1/agent/force-leave/"+node) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// EnableServiceMaintenance toggles service maintenance mode on -// for the given service ID. -func (a *Agent) EnableServiceMaintenance(serviceID, reason string) error { - r := a.c.newRequest("PUT", "/v1/agent/service/maintenance/"+serviceID) - r.params.Set("enable", "true") - r.params.Set("reason", reason) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// DisableServiceMaintenance toggles service maintenance mode off -// for the given service ID. -func (a *Agent) DisableServiceMaintenance(serviceID string) error { - r := a.c.newRequest("PUT", "/v1/agent/service/maintenance/"+serviceID) - r.params.Set("enable", "false") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// EnableNodeMaintenance toggles node maintenance mode on for the -// agent we are connected to. -func (a *Agent) EnableNodeMaintenance(reason string) error { - r := a.c.newRequest("PUT", "/v1/agent/maintenance") - r.params.Set("enable", "true") - r.params.Set("reason", reason) - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// DisableNodeMaintenance toggles node maintenance mode off for the -// agent we are connected to. -func (a *Agent) DisableNodeMaintenance() error { - r := a.c.newRequest("PUT", "/v1/agent/maintenance") - r.params.Set("enable", "false") - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// Monitor returns a channel which will receive streaming logs from the agent -// Providing a non-nil stopCh can be used to close the connection and stop the -// log stream. An empty string will be sent down the given channel when there's -// nothing left to stream, after which the caller should close the stopCh. -func (a *Agent) Monitor(loglevel string, stopCh <-chan struct{}, q *QueryOptions) (chan string, error) { - r := a.c.newRequest("GET", "/v1/agent/monitor") - r.setQueryOptions(q) - if loglevel != "" { - r.params.Add("loglevel", loglevel) - } - _, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - - logCh := make(chan string, 64) - go func() { - defer resp.Body.Close() - - scanner := bufio.NewScanner(resp.Body) - for { - select { - case <-stopCh: - close(logCh) - return - default: - } - if scanner.Scan() { - // An empty string signals to the caller that - // the scan is done, so make sure we only emit - // that when the scanner says it's done, not if - // we happen to ingest an empty line. - if text := scanner.Text(); text != "" { - logCh <- text - } else { - logCh <- " " - } - } else { - logCh <- "" - } - } - }() - - return logCh, nil -} - -// UpdateACLToken updates the agent's "acl_token". See updateToken for more -// details. -func (a *Agent) UpdateACLToken(token string, q *WriteOptions) (*WriteMeta, error) { - return a.updateToken("acl_token", token, q) -} - -// UpdateACLAgentToken updates the agent's "acl_agent_token". See updateToken -// for more details. -func (a *Agent) UpdateACLAgentToken(token string, q *WriteOptions) (*WriteMeta, error) { - return a.updateToken("acl_agent_token", token, q) -} - -// UpdateACLAgentMasterToken updates the agent's "acl_agent_master_token". See -// updateToken for more details. -func (a *Agent) UpdateACLAgentMasterToken(token string, q *WriteOptions) (*WriteMeta, error) { - return a.updateToken("acl_agent_master_token", token, q) -} - -// UpdateACLReplicationToken updates the agent's "acl_replication_token". See -// updateToken for more details. -func (a *Agent) UpdateACLReplicationToken(token string, q *WriteOptions) (*WriteMeta, error) { - return a.updateToken("acl_replication_token", token, q) -} - -// updateToken can be used to update an agent's ACL token after the agent has -// started. The tokens are not persisted, so will need to be updated again if -// the agent is restarted. -func (a *Agent) updateToken(target, token string, q *WriteOptions) (*WriteMeta, error) { - r := a.c.newRequest("PUT", fmt.Sprintf("/v1/agent/token/%s", target)) - r.setWriteOptions(q) - r.obj = &AgentToken{Token: token} - rtt, resp, err := requireOK(a.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - return wm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/api.go b/vendor/github.com/hashicorp/consul/api/api.go deleted file mode 100644 index b756ceb06..000000000 --- a/vendor/github.com/hashicorp/consul/api/api.go +++ /dev/null @@ -1,791 +0,0 @@ -package api - -import ( - "bytes" - "context" - "crypto/tls" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "log" - "net" - "net/http" - "net/url" - "os" - "strconv" - "strings" - "time" - - "github.com/hashicorp/go-cleanhttp" - "github.com/hashicorp/go-rootcerts" -) - -const ( - // HTTPAddrEnvName defines an environment variable name which sets - // the HTTP address if there is no -http-addr specified. - HTTPAddrEnvName = "CONSUL_HTTP_ADDR" - - // HTTPTokenEnvName defines an environment variable name which sets - // the HTTP token. - HTTPTokenEnvName = "CONSUL_HTTP_TOKEN" - - // HTTPAuthEnvName defines an environment variable name which sets - // the HTTP authentication header. - HTTPAuthEnvName = "CONSUL_HTTP_AUTH" - - // HTTPSSLEnvName defines an environment variable name which sets - // whether or not to use HTTPS. - HTTPSSLEnvName = "CONSUL_HTTP_SSL" - - // HTTPCAFile defines an environment variable name which sets the - // CA file to use for talking to Consul over TLS. - HTTPCAFile = "CONSUL_CACERT" - - // HTTPCAPath defines an environment variable name which sets the - // path to a directory of CA certs to use for talking to Consul over TLS. - HTTPCAPath = "CONSUL_CAPATH" - - // HTTPClientCert defines an environment variable name which sets the - // client cert file to use for talking to Consul over TLS. - HTTPClientCert = "CONSUL_CLIENT_CERT" - - // HTTPClientKey defines an environment variable name which sets the - // client key file to use for talking to Consul over TLS. - HTTPClientKey = "CONSUL_CLIENT_KEY" - - // HTTPTLSServerName defines an environment variable name which sets the - // server name to use as the SNI host when connecting via TLS - HTTPTLSServerName = "CONSUL_TLS_SERVER_NAME" - - // HTTPSSLVerifyEnvName defines an environment variable name which sets - // whether or not to disable certificate checking. - HTTPSSLVerifyEnvName = "CONSUL_HTTP_SSL_VERIFY" -) - -// QueryOptions are used to parameterize a query -type QueryOptions struct { - // Providing a datacenter overwrites the DC provided - // by the Config - Datacenter string - - // AllowStale allows any Consul server (non-leader) to service - // a read. This allows for lower latency and higher throughput - AllowStale bool - - // RequireConsistent forces the read to be fully consistent. - // This is more expensive but prevents ever performing a stale - // read. - RequireConsistent bool - - // WaitIndex is used to enable a blocking query. Waits - // until the timeout or the next index is reached - WaitIndex uint64 - - // WaitTime is used to bound the duration of a wait. - // Defaults to that of the Config, but can be overridden. - WaitTime time.Duration - - // Token is used to provide a per-request ACL token - // which overrides the agent's default token. - Token string - - // Near is used to provide a node name that will sort the results - // in ascending order based on the estimated round trip time from - // that node. Setting this to "_agent" will use the agent's node - // for the sort. - Near string - - // NodeMeta is used to filter results by nodes with the given - // metadata key/value pairs. Currently, only one key/value pair can - // be provided for filtering. - NodeMeta map[string]string - - // RelayFactor is used in keyring operations to cause reponses to be - // relayed back to the sender through N other random nodes. Must be - // a value from 0 to 5 (inclusive). - RelayFactor uint8 - - // ctx is an optional context pass through to the underlying HTTP - // request layer. Use Context() and WithContext() to manage this. - ctx context.Context -} - -func (o *QueryOptions) Context() context.Context { - if o != nil && o.ctx != nil { - return o.ctx - } - return context.Background() -} - -func (o *QueryOptions) WithContext(ctx context.Context) *QueryOptions { - o2 := new(QueryOptions) - if o != nil { - *o2 = *o - } - o2.ctx = ctx - return o2 -} - -// WriteOptions are used to parameterize a write -type WriteOptions struct { - // Providing a datacenter overwrites the DC provided - // by the Config - Datacenter string - - // Token is used to provide a per-request ACL token - // which overrides the agent's default token. - Token string - - // RelayFactor is used in keyring operations to cause reponses to be - // relayed back to the sender through N other random nodes. Must be - // a value from 0 to 5 (inclusive). - RelayFactor uint8 - - // ctx is an optional context pass through to the underlying HTTP - // request layer. Use Context() and WithContext() to manage this. - ctx context.Context -} - -func (o *WriteOptions) Context() context.Context { - if o != nil && o.ctx != nil { - return o.ctx - } - return context.Background() -} - -func (o *WriteOptions) WithContext(ctx context.Context) *WriteOptions { - o2 := new(WriteOptions) - if o != nil { - *o2 = *o - } - o2.ctx = ctx - return o2 -} - -// QueryMeta is used to return meta data about a query -type QueryMeta struct { - // LastIndex. This can be used as a WaitIndex to perform - // a blocking query - LastIndex uint64 - - // Time of last contact from the leader for the - // server servicing the request - LastContact time.Duration - - // Is there a known leader - KnownLeader bool - - // How long did the request take - RequestTime time.Duration - - // Is address translation enabled for HTTP responses on this agent - AddressTranslationEnabled bool -} - -// WriteMeta is used to return meta data about a write -type WriteMeta struct { - // How long did the request take - RequestTime time.Duration -} - -// HttpBasicAuth is used to authenticate http client with HTTP Basic Authentication -type HttpBasicAuth struct { - // Username to use for HTTP Basic Authentication - Username string - - // Password to use for HTTP Basic Authentication - Password string -} - -// Config is used to configure the creation of a client -type Config struct { - // Address is the address of the Consul server - Address string - - // Scheme is the URI scheme for the Consul server - Scheme string - - // Datacenter to use. If not provided, the default agent datacenter is used. - Datacenter string - - // Transport is the Transport to use for the http client. - Transport *http.Transport - - // HttpClient is the client to use. Default will be - // used if not provided. - HttpClient *http.Client - - // HttpAuth is the auth info to use for http access. - HttpAuth *HttpBasicAuth - - // WaitTime limits how long a Watch will block. If not provided, - // the agent default values will be used. - WaitTime time.Duration - - // Token is used to provide a per-request ACL token - // which overrides the agent's default token. - Token string - - TLSConfig TLSConfig -} - -// TLSConfig is used to generate a TLSClientConfig that's useful for talking to -// Consul using TLS. -type TLSConfig struct { - // Address is the optional address of the Consul server. The port, if any - // will be removed from here and this will be set to the ServerName of the - // resulting config. - Address string - - // CAFile is the optional path to the CA certificate used for Consul - // communication, defaults to the system bundle if not specified. - CAFile string - - // CAPath is the optional path to a directory of CA certificates to use for - // Consul communication, defaults to the system bundle if not specified. - CAPath string - - // CertFile is the optional path to the certificate for Consul - // communication. If this is set then you need to also set KeyFile. - CertFile string - - // KeyFile is the optional path to the private key for Consul communication. - // If this is set then you need to also set CertFile. - KeyFile string - - // InsecureSkipVerify if set to true will disable TLS host verification. - InsecureSkipVerify bool -} - -// DefaultConfig returns a default configuration for the client. By default this -// will pool and reuse idle connections to Consul. If you have a long-lived -// client object, this is the desired behavior and should make the most efficient -// use of the connections to Consul. If you don't reuse a client object , which -// is not recommended, then you may notice idle connections building up over -// time. To avoid this, use the DefaultNonPooledConfig() instead. -func DefaultConfig() *Config { - return defaultConfig(cleanhttp.DefaultPooledTransport) -} - -// DefaultNonPooledConfig returns a default configuration for the client which -// does not pool connections. This isn't a recommended configuration because it -// will reconnect to Consul on every request, but this is useful to avoid the -// accumulation of idle connections if you make many client objects during the -// lifetime of your application. -func DefaultNonPooledConfig() *Config { - return defaultConfig(cleanhttp.DefaultTransport) -} - -// defaultConfig returns the default configuration for the client, using the -// given function to make the transport. -func defaultConfig(transportFn func() *http.Transport) *Config { - config := &Config{ - Address: "127.0.0.1:8500", - Scheme: "http", - Transport: transportFn(), - } - - if addr := os.Getenv(HTTPAddrEnvName); addr != "" { - config.Address = addr - } - - if token := os.Getenv(HTTPTokenEnvName); token != "" { - config.Token = token - } - - if auth := os.Getenv(HTTPAuthEnvName); auth != "" { - var username, password string - if strings.Contains(auth, ":") { - split := strings.SplitN(auth, ":", 2) - username = split[0] - password = split[1] - } else { - username = auth - } - - config.HttpAuth = &HttpBasicAuth{ - Username: username, - Password: password, - } - } - - if ssl := os.Getenv(HTTPSSLEnvName); ssl != "" { - enabled, err := strconv.ParseBool(ssl) - if err != nil { - log.Printf("[WARN] client: could not parse %s: %s", HTTPSSLEnvName, err) - } - - if enabled { - config.Scheme = "https" - } - } - - if v := os.Getenv(HTTPTLSServerName); v != "" { - config.TLSConfig.Address = v - } - if v := os.Getenv(HTTPCAFile); v != "" { - config.TLSConfig.CAFile = v - } - if v := os.Getenv(HTTPCAPath); v != "" { - config.TLSConfig.CAPath = v - } - if v := os.Getenv(HTTPClientCert); v != "" { - config.TLSConfig.CertFile = v - } - if v := os.Getenv(HTTPClientKey); v != "" { - config.TLSConfig.KeyFile = v - } - if v := os.Getenv(HTTPSSLVerifyEnvName); v != "" { - doVerify, err := strconv.ParseBool(v) - if err != nil { - log.Printf("[WARN] client: could not parse %s: %s", HTTPSSLVerifyEnvName, err) - } - if !doVerify { - config.TLSConfig.InsecureSkipVerify = true - } - } - - return config -} - -// TLSConfig is used to generate a TLSClientConfig that's useful for talking to -// Consul using TLS. -func SetupTLSConfig(tlsConfig *TLSConfig) (*tls.Config, error) { - tlsClientConfig := &tls.Config{ - InsecureSkipVerify: tlsConfig.InsecureSkipVerify, - } - - if tlsConfig.Address != "" { - server := tlsConfig.Address - hasPort := strings.LastIndex(server, ":") > strings.LastIndex(server, "]") - if hasPort { - var err error - server, _, err = net.SplitHostPort(server) - if err != nil { - return nil, err - } - } - tlsClientConfig.ServerName = server - } - - if tlsConfig.CertFile != "" && tlsConfig.KeyFile != "" { - tlsCert, err := tls.LoadX509KeyPair(tlsConfig.CertFile, tlsConfig.KeyFile) - if err != nil { - return nil, err - } - tlsClientConfig.Certificates = []tls.Certificate{tlsCert} - } - - if tlsConfig.CAFile != "" || tlsConfig.CAPath != "" { - rootConfig := &rootcerts.Config{ - CAFile: tlsConfig.CAFile, - CAPath: tlsConfig.CAPath, - } - if err := rootcerts.ConfigureTLS(tlsClientConfig, rootConfig); err != nil { - return nil, err - } - } - - return tlsClientConfig, nil -} - -// Client provides a client to the Consul API -type Client struct { - config Config -} - -// NewClient returns a new client -func NewClient(config *Config) (*Client, error) { - // bootstrap the config - defConfig := DefaultConfig() - - if len(config.Address) == 0 { - config.Address = defConfig.Address - } - - if len(config.Scheme) == 0 { - config.Scheme = defConfig.Scheme - } - - if config.Transport == nil { - config.Transport = defConfig.Transport - } - - if config.TLSConfig.Address == "" { - config.TLSConfig.Address = defConfig.TLSConfig.Address - } - - if config.TLSConfig.CAFile == "" { - config.TLSConfig.CAFile = defConfig.TLSConfig.CAFile - } - - if config.TLSConfig.CAPath == "" { - config.TLSConfig.CAPath = defConfig.TLSConfig.CAPath - } - - if config.TLSConfig.CertFile == "" { - config.TLSConfig.CertFile = defConfig.TLSConfig.CertFile - } - - if config.TLSConfig.KeyFile == "" { - config.TLSConfig.KeyFile = defConfig.TLSConfig.KeyFile - } - - if !config.TLSConfig.InsecureSkipVerify { - config.TLSConfig.InsecureSkipVerify = defConfig.TLSConfig.InsecureSkipVerify - } - - if config.HttpClient == nil { - var err error - config.HttpClient, err = NewHttpClient(config.Transport, config.TLSConfig) - if err != nil { - return nil, err - } - } - - parts := strings.SplitN(config.Address, "://", 2) - if len(parts) == 2 { - switch parts[0] { - case "http": - config.Scheme = "http" - case "https": - config.Scheme = "https" - case "unix": - trans := cleanhttp.DefaultTransport() - trans.DialContext = func(_ context.Context, _, _ string) (net.Conn, error) { - return net.Dial("unix", parts[1]) - } - config.HttpClient = &http.Client{ - Transport: trans, - } - default: - return nil, fmt.Errorf("Unknown protocol scheme: %s", parts[0]) - } - config.Address = parts[1] - } - - if config.Token == "" { - config.Token = defConfig.Token - } - - return &Client{config: *config}, nil -} - -// NewHttpClient returns an http client configured with the given Transport and TLS -// config. -func NewHttpClient(transport *http.Transport, tlsConf TLSConfig) (*http.Client, error) { - client := &http.Client{ - Transport: transport, - } - - // TODO (slackpad) - Once we get some run time on the HTTP/2 support we - // should turn it on by default if TLS is enabled. We would basically - // just need to call http2.ConfigureTransport(transport) here. We also - // don't want to introduce another external dependency on - // golang.org/x/net/http2 at this time. For a complete recipe for how - // to enable HTTP/2 support on a transport suitable for the API client - // library see agent/http_test.go:TestHTTPServer_H2. - - if transport.TLSClientConfig == nil { - tlsClientConfig, err := SetupTLSConfig(&tlsConf) - - if err != nil { - return nil, err - } - - transport.TLSClientConfig = tlsClientConfig - } - - return client, nil -} - -// request is used to help build up a request -type request struct { - config *Config - method string - url *url.URL - params url.Values - body io.Reader - header http.Header - obj interface{} - ctx context.Context -} - -// setQueryOptions is used to annotate the request with -// additional query options -func (r *request) setQueryOptions(q *QueryOptions) { - if q == nil { - return - } - if q.Datacenter != "" { - r.params.Set("dc", q.Datacenter) - } - if q.AllowStale { - r.params.Set("stale", "") - } - if q.RequireConsistent { - r.params.Set("consistent", "") - } - if q.WaitIndex != 0 { - r.params.Set("index", strconv.FormatUint(q.WaitIndex, 10)) - } - if q.WaitTime != 0 { - r.params.Set("wait", durToMsec(q.WaitTime)) - } - if q.Token != "" { - r.header.Set("X-Consul-Token", q.Token) - } - if q.Near != "" { - r.params.Set("near", q.Near) - } - if len(q.NodeMeta) > 0 { - for key, value := range q.NodeMeta { - r.params.Add("node-meta", key+":"+value) - } - } - if q.RelayFactor != 0 { - r.params.Set("relay-factor", strconv.Itoa(int(q.RelayFactor))) - } - r.ctx = q.ctx -} - -// durToMsec converts a duration to a millisecond specified string. If the -// user selected a positive value that rounds to 0 ms, then we will use 1 ms -// so they get a short delay, otherwise Consul will translate the 0 ms into -// a huge default delay. -func durToMsec(dur time.Duration) string { - ms := dur / time.Millisecond - if dur > 0 && ms == 0 { - ms = 1 - } - return fmt.Sprintf("%dms", ms) -} - -// serverError is a string we look for to detect 500 errors. -const serverError = "Unexpected response code: 500" - -// IsRetryableError returns true for 500 errors from the Consul servers, and -// network connection errors. These are usually retryable at a later time. -// This applies to reads but NOT to writes. This may return true for errors -// on writes that may have still gone through, so do not use this to retry -// any write operations. -func IsRetryableError(err error) bool { - if err == nil { - return false - } - - if _, ok := err.(net.Error); ok { - return true - } - - // TODO (slackpad) - Make a real error type here instead of using - // a string check. - return strings.Contains(err.Error(), serverError) -} - -// setWriteOptions is used to annotate the request with -// additional write options -func (r *request) setWriteOptions(q *WriteOptions) { - if q == nil { - return - } - if q.Datacenter != "" { - r.params.Set("dc", q.Datacenter) - } - if q.Token != "" { - r.header.Set("X-Consul-Token", q.Token) - } - if q.RelayFactor != 0 { - r.params.Set("relay-factor", strconv.Itoa(int(q.RelayFactor))) - } - r.ctx = q.ctx -} - -// toHTTP converts the request to an HTTP request -func (r *request) toHTTP() (*http.Request, error) { - // Encode the query parameters - r.url.RawQuery = r.params.Encode() - - // Check if we should encode the body - if r.body == nil && r.obj != nil { - b, err := encodeBody(r.obj) - if err != nil { - return nil, err - } - r.body = b - } - - // Create the HTTP request - req, err := http.NewRequest(r.method, r.url.RequestURI(), r.body) - if err != nil { - return nil, err - } - - req.URL.Host = r.url.Host - req.URL.Scheme = r.url.Scheme - req.Host = r.url.Host - req.Header = r.header - - // Setup auth - if r.config.HttpAuth != nil { - req.SetBasicAuth(r.config.HttpAuth.Username, r.config.HttpAuth.Password) - } - if r.ctx != nil { - return req.WithContext(r.ctx), nil - } - - return req, nil -} - -// newRequest is used to create a new request -func (c *Client) newRequest(method, path string) *request { - r := &request{ - config: &c.config, - method: method, - url: &url.URL{ - Scheme: c.config.Scheme, - Host: c.config.Address, - Path: path, - }, - params: make(map[string][]string), - header: make(http.Header), - } - if c.config.Datacenter != "" { - r.params.Set("dc", c.config.Datacenter) - } - if c.config.WaitTime != 0 { - r.params.Set("wait", durToMsec(r.config.WaitTime)) - } - if c.config.Token != "" { - r.header.Set("X-Consul-Token", r.config.Token) - } - return r -} - -// doRequest runs a request with our client -func (c *Client) doRequest(r *request) (time.Duration, *http.Response, error) { - req, err := r.toHTTP() - if err != nil { - return 0, nil, err - } - start := time.Now() - resp, err := c.config.HttpClient.Do(req) - diff := time.Since(start) - return diff, resp, err -} - -// Query is used to do a GET request against an endpoint -// and deserialize the response into an interface using -// standard Consul conventions. -func (c *Client) query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) { - r := c.newRequest("GET", endpoint) - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - if err := decodeBody(resp, out); err != nil { - return nil, err - } - return qm, nil -} - -// write is used to do a PUT request against an endpoint -// and serialize/deserialized using the standard Consul conventions. -func (c *Client) write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) { - r := c.newRequest("PUT", endpoint) - r.setWriteOptions(q) - r.obj = in - rtt, resp, err := requireOK(c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - if out != nil { - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - } else if _, err := ioutil.ReadAll(resp.Body); err != nil { - return nil, err - } - return wm, nil -} - -// parseQueryMeta is used to help parse query meta-data -func parseQueryMeta(resp *http.Response, q *QueryMeta) error { - header := resp.Header - - // Parse the X-Consul-Index - index, err := strconv.ParseUint(header.Get("X-Consul-Index"), 10, 64) - if err != nil { - return fmt.Errorf("Failed to parse X-Consul-Index: %v", err) - } - q.LastIndex = index - - // Parse the X-Consul-LastContact - last, err := strconv.ParseUint(header.Get("X-Consul-LastContact"), 10, 64) - if err != nil { - return fmt.Errorf("Failed to parse X-Consul-LastContact: %v", err) - } - q.LastContact = time.Duration(last) * time.Millisecond - - // Parse the X-Consul-KnownLeader - switch header.Get("X-Consul-KnownLeader") { - case "true": - q.KnownLeader = true - default: - q.KnownLeader = false - } - - // Parse X-Consul-Translate-Addresses - switch header.Get("X-Consul-Translate-Addresses") { - case "true": - q.AddressTranslationEnabled = true - default: - q.AddressTranslationEnabled = false - } - - return nil -} - -// decodeBody is used to JSON decode a body -func decodeBody(resp *http.Response, out interface{}) error { - dec := json.NewDecoder(resp.Body) - return dec.Decode(out) -} - -// encodeBody is used to encode a request body -func encodeBody(obj interface{}) (io.Reader, error) { - buf := bytes.NewBuffer(nil) - enc := json.NewEncoder(buf) - if err := enc.Encode(obj); err != nil { - return nil, err - } - return buf, nil -} - -// requireOK is used to wrap doRequest and check for a 200 -func requireOK(d time.Duration, resp *http.Response, e error) (time.Duration, *http.Response, error) { - if e != nil { - if resp != nil { - resp.Body.Close() - } - return d, nil, e - } - if resp.StatusCode != 200 { - var buf bytes.Buffer - io.Copy(&buf, resp.Body) - resp.Body.Close() - return d, nil, fmt.Errorf("Unexpected response code: %d (%s)", resp.StatusCode, buf.Bytes()) - } - return d, resp, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/catalog.go b/vendor/github.com/hashicorp/consul/api/catalog.go deleted file mode 100644 index 08da6e16e..000000000 --- a/vendor/github.com/hashicorp/consul/api/catalog.go +++ /dev/null @@ -1,199 +0,0 @@ -package api - -type Node struct { - ID string - Node string - Address string - Datacenter string - TaggedAddresses map[string]string - Meta map[string]string - CreateIndex uint64 - ModifyIndex uint64 -} - -type CatalogService struct { - ID string - Node string - Address string - Datacenter string - TaggedAddresses map[string]string - NodeMeta map[string]string - ServiceID string - ServiceName string - ServiceAddress string - ServiceTags []string - ServicePort int - ServiceEnableTagOverride bool - CreateIndex uint64 - ModifyIndex uint64 -} - -type CatalogNode struct { - Node *Node - Services map[string]*AgentService -} - -type CatalogRegistration struct { - ID string - Node string - Address string - TaggedAddresses map[string]string - NodeMeta map[string]string - Datacenter string - Service *AgentService - Check *AgentCheck - SkipNodeUpdate bool -} - -type CatalogDeregistration struct { - Node string - Address string // Obsolete. - Datacenter string - ServiceID string - CheckID string -} - -// Catalog can be used to query the Catalog endpoints -type Catalog struct { - c *Client -} - -// Catalog returns a handle to the catalog endpoints -func (c *Client) Catalog() *Catalog { - return &Catalog{c} -} - -func (c *Catalog) Register(reg *CatalogRegistration, q *WriteOptions) (*WriteMeta, error) { - r := c.c.newRequest("PUT", "/v1/catalog/register") - r.setWriteOptions(q) - r.obj = reg - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - return wm, nil -} - -func (c *Catalog) Deregister(dereg *CatalogDeregistration, q *WriteOptions) (*WriteMeta, error) { - r := c.c.newRequest("PUT", "/v1/catalog/deregister") - r.setWriteOptions(q) - r.obj = dereg - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - return wm, nil -} - -// Datacenters is used to query for all the known datacenters -func (c *Catalog) Datacenters() ([]string, error) { - r := c.c.newRequest("GET", "/v1/catalog/datacenters") - _, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out []string - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Nodes is used to query all the known nodes -func (c *Catalog) Nodes(q *QueryOptions) ([]*Node, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/catalog/nodes") - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*Node - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Services is used to query for all known services -func (c *Catalog) Services(q *QueryOptions) (map[string][]string, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/catalog/services") - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out map[string][]string - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Service is used to query catalog entries for a given service -func (c *Catalog) Service(service, tag string, q *QueryOptions) ([]*CatalogService, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/catalog/service/"+service) - r.setQueryOptions(q) - if tag != "" { - r.params.Set("tag", tag) - } - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*CatalogService - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Node is used to query for service information about a single node -func (c *Catalog) Node(node string, q *QueryOptions) (*CatalogNode, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/catalog/node/"+node) - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out *CatalogNode - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/coordinate.go b/vendor/github.com/hashicorp/consul/api/coordinate.go deleted file mode 100644 index 53318f11d..000000000 --- a/vendor/github.com/hashicorp/consul/api/coordinate.go +++ /dev/null @@ -1,106 +0,0 @@ -package api - -import ( - "github.com/hashicorp/serf/coordinate" -) - -// CoordinateEntry represents a node and its associated network coordinate. -type CoordinateEntry struct { - Node string - Segment string - Coord *coordinate.Coordinate -} - -// CoordinateDatacenterMap has the coordinates for servers in a given datacenter -// and area. Network coordinates are only compatible within the same area. -type CoordinateDatacenterMap struct { - Datacenter string - AreaID string - Coordinates []CoordinateEntry -} - -// Coordinate can be used to query the coordinate endpoints -type Coordinate struct { - c *Client -} - -// Coordinate returns a handle to the coordinate endpoints -func (c *Client) Coordinate() *Coordinate { - return &Coordinate{c} -} - -// Datacenters is used to return the coordinates of all the servers in the WAN -// pool. -func (c *Coordinate) Datacenters() ([]*CoordinateDatacenterMap, error) { - r := c.c.newRequest("GET", "/v1/coordinate/datacenters") - _, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out []*CoordinateDatacenterMap - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// Nodes is used to return the coordinates of all the nodes in the LAN pool. -func (c *Coordinate) Nodes(q *QueryOptions) ([]*CoordinateEntry, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/coordinate/nodes") - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*CoordinateEntry - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Update inserts or updates the LAN coordinate of a node. -func (c *Coordinate) Update(coord *CoordinateEntry, q *WriteOptions) (*WriteMeta, error) { - r := c.c.newRequest("PUT", "/v1/coordinate/update") - r.setWriteOptions(q) - r.obj = coord - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - return wm, nil -} - -// Node is used to return the coordinates of a single in the LAN pool. -func (c *Coordinate) Node(node string, q *QueryOptions) ([]*CoordinateEntry, *QueryMeta, error) { - r := c.c.newRequest("GET", "/v1/coordinate/node/"+node) - r.setQueryOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*CoordinateEntry - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/event.go b/vendor/github.com/hashicorp/consul/api/event.go deleted file mode 100644 index 85b5b069b..000000000 --- a/vendor/github.com/hashicorp/consul/api/event.go +++ /dev/null @@ -1,104 +0,0 @@ -package api - -import ( - "bytes" - "strconv" -) - -// Event can be used to query the Event endpoints -type Event struct { - c *Client -} - -// UserEvent represents an event that was fired by the user -type UserEvent struct { - ID string - Name string - Payload []byte - NodeFilter string - ServiceFilter string - TagFilter string - Version int - LTime uint64 -} - -// Event returns a handle to the event endpoints -func (c *Client) Event() *Event { - return &Event{c} -} - -// Fire is used to fire a new user event. Only the Name, Payload and Filters -// are respected. This returns the ID or an associated error. Cross DC requests -// are supported. -func (e *Event) Fire(params *UserEvent, q *WriteOptions) (string, *WriteMeta, error) { - r := e.c.newRequest("PUT", "/v1/event/fire/"+params.Name) - r.setWriteOptions(q) - if params.NodeFilter != "" { - r.params.Set("node", params.NodeFilter) - } - if params.ServiceFilter != "" { - r.params.Set("service", params.ServiceFilter) - } - if params.TagFilter != "" { - r.params.Set("tag", params.TagFilter) - } - if params.Payload != nil { - r.body = bytes.NewReader(params.Payload) - } - - rtt, resp, err := requireOK(e.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - var out UserEvent - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// List is used to get the most recent events an agent has received. -// This list can be optionally filtered by the name. This endpoint supports -// quasi-blocking queries. The index is not monotonic, nor does it provide provide -// LastContact or KnownLeader. -func (e *Event) List(name string, q *QueryOptions) ([]*UserEvent, *QueryMeta, error) { - r := e.c.newRequest("GET", "/v1/event/list") - r.setQueryOptions(q) - if name != "" { - r.params.Set("name", name) - } - rtt, resp, err := requireOK(e.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var entries []*UserEvent - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -// IDToIndex is a bit of a hack. This simulates the index generation to -// convert an event ID into a WaitIndex. -func (e *Event) IDToIndex(uuid string) uint64 { - lower := uuid[0:8] + uuid[9:13] + uuid[14:18] - upper := uuid[19:23] + uuid[24:36] - lowVal, err := strconv.ParseUint(lower, 16, 64) - if err != nil { - panic("Failed to convert " + lower) - } - highVal, err := strconv.ParseUint(upper, 16, 64) - if err != nil { - panic("Failed to convert " + upper) - } - return lowVal ^ highVal -} diff --git a/vendor/github.com/hashicorp/consul/api/health.go b/vendor/github.com/hashicorp/consul/api/health.go deleted file mode 100644 index 53f3de4f7..000000000 --- a/vendor/github.com/hashicorp/consul/api/health.go +++ /dev/null @@ -1,215 +0,0 @@ -package api - -import ( - "fmt" - "strings" -) - -const ( - // HealthAny is special, and is used as a wild card, - // not as a specific state. - HealthAny = "any" - HealthPassing = "passing" - HealthWarning = "warning" - HealthCritical = "critical" - HealthMaint = "maintenance" -) - -const ( - // NodeMaint is the special key set by a node in maintenance mode. - NodeMaint = "_node_maintenance" - - // ServiceMaintPrefix is the prefix for a service in maintenance mode. - ServiceMaintPrefix = "_service_maintenance:" -) - -// HealthCheck is used to represent a single check -type HealthCheck struct { - Node string - CheckID string - Name string - Status string - Notes string - Output string - ServiceID string - ServiceName string - ServiceTags []string - - Definition HealthCheckDefinition -} - -// HealthCheckDefinition is used to store the details about -// a health check's execution. -type HealthCheckDefinition struct { - HTTP string - Header map[string][]string - Method string - TLSSkipVerify bool - TCP string - Interval ReadableDuration - Timeout ReadableDuration - DeregisterCriticalServiceAfter ReadableDuration -} - -// HealthChecks is a collection of HealthCheck structs. -type HealthChecks []*HealthCheck - -// AggregatedStatus returns the "best" status for the list of health checks. -// Because a given entry may have many service and node-level health checks -// attached, this function determines the best representative of the status as -// as single string using the following heuristic: -// -// maintenance > critical > warning > passing -// -func (c HealthChecks) AggregatedStatus() string { - var passing, warning, critical, maintenance bool - for _, check := range c { - id := string(check.CheckID) - if id == NodeMaint || strings.HasPrefix(id, ServiceMaintPrefix) { - maintenance = true - continue - } - - switch check.Status { - case HealthPassing: - passing = true - case HealthWarning: - warning = true - case HealthCritical: - critical = true - default: - return "" - } - } - - switch { - case maintenance: - return HealthMaint - case critical: - return HealthCritical - case warning: - return HealthWarning - case passing: - return HealthPassing - default: - return HealthPassing - } -} - -// ServiceEntry is used for the health service endpoint -type ServiceEntry struct { - Node *Node - Service *AgentService - Checks HealthChecks -} - -// Health can be used to query the Health endpoints -type Health struct { - c *Client -} - -// Health returns a handle to the health endpoints -func (c *Client) Health() *Health { - return &Health{c} -} - -// Node is used to query for checks belonging to a given node -func (h *Health) Node(node string, q *QueryOptions) (HealthChecks, *QueryMeta, error) { - r := h.c.newRequest("GET", "/v1/health/node/"+node) - r.setQueryOptions(q) - rtt, resp, err := requireOK(h.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out HealthChecks - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Checks is used to return the checks associated with a service -func (h *Health) Checks(service string, q *QueryOptions) (HealthChecks, *QueryMeta, error) { - r := h.c.newRequest("GET", "/v1/health/checks/"+service) - r.setQueryOptions(q) - rtt, resp, err := requireOK(h.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out HealthChecks - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Service is used to query health information along with service info -// for a given service. It can optionally do server-side filtering on a tag -// or nodes with passing health checks only. -func (h *Health) Service(service, tag string, passingOnly bool, q *QueryOptions) ([]*ServiceEntry, *QueryMeta, error) { - r := h.c.newRequest("GET", "/v1/health/service/"+service) - r.setQueryOptions(q) - if tag != "" { - r.params.Set("tag", tag) - } - if passingOnly { - r.params.Set(HealthPassing, "1") - } - rtt, resp, err := requireOK(h.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out []*ServiceEntry - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// State is used to retrieve all the checks in a given state. -// The wildcard "any" state can also be used for all checks. -func (h *Health) State(state string, q *QueryOptions) (HealthChecks, *QueryMeta, error) { - switch state { - case HealthAny: - case HealthWarning: - case HealthCritical: - case HealthPassing: - default: - return nil, nil, fmt.Errorf("Unsupported state: %v", state) - } - r := h.c.newRequest("GET", "/v1/health/state/"+state) - r.setQueryOptions(q) - rtt, resp, err := requireOK(h.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - var out HealthChecks - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, qm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/kv.go b/vendor/github.com/hashicorp/consul/api/kv.go deleted file mode 100644 index 97f515685..000000000 --- a/vendor/github.com/hashicorp/consul/api/kv.go +++ /dev/null @@ -1,420 +0,0 @@ -package api - -import ( - "bytes" - "fmt" - "io" - "net/http" - "strconv" - "strings" -) - -// KVPair is used to represent a single K/V entry -type KVPair struct { - // Key is the name of the key. It is also part of the URL path when accessed - // via the API. - Key string - - // CreateIndex holds the index corresponding the creation of this KVPair. This - // is a read-only field. - CreateIndex uint64 - - // ModifyIndex is used for the Check-And-Set operations and can also be fed - // back into the WaitIndex of the QueryOptions in order to perform blocking - // queries. - ModifyIndex uint64 - - // LockIndex holds the index corresponding to a lock on this key, if any. This - // is a read-only field. - LockIndex uint64 - - // Flags are any user-defined flags on the key. It is up to the implementer - // to check these values, since Consul does not treat them specially. - Flags uint64 - - // Value is the value for the key. This can be any value, but it will be - // base64 encoded upon transport. - Value []byte - - // Session is a string representing the ID of the session. Any other - // interactions with this key over the same session must specify the same - // session ID. - Session string -} - -// KVPairs is a list of KVPair objects -type KVPairs []*KVPair - -// KVOp constants give possible operations available in a KVTxn. -type KVOp string - -const ( - KVSet KVOp = "set" - KVDelete KVOp = "delete" - KVDeleteCAS KVOp = "delete-cas" - KVDeleteTree KVOp = "delete-tree" - KVCAS KVOp = "cas" - KVLock KVOp = "lock" - KVUnlock KVOp = "unlock" - KVGet KVOp = "get" - KVGetTree KVOp = "get-tree" - KVCheckSession KVOp = "check-session" - KVCheckIndex KVOp = "check-index" - KVCheckNotExists KVOp = "check-not-exists" -) - -// KVTxnOp defines a single operation inside a transaction. -type KVTxnOp struct { - Verb KVOp - Key string - Value []byte - Flags uint64 - Index uint64 - Session string -} - -// KVTxnOps defines a set of operations to be performed inside a single -// transaction. -type KVTxnOps []*KVTxnOp - -// KVTxnResponse has the outcome of a transaction. -type KVTxnResponse struct { - Results []*KVPair - Errors TxnErrors -} - -// KV is used to manipulate the K/V API -type KV struct { - c *Client -} - -// KV is used to return a handle to the K/V apis -func (c *Client) KV() *KV { - return &KV{c} -} - -// Get is used to lookup a single key. The returned pointer -// to the KVPair will be nil if the key does not exist. -func (k *KV) Get(key string, q *QueryOptions) (*KVPair, *QueryMeta, error) { - resp, qm, err := k.getInternal(key, nil, q) - if err != nil { - return nil, nil, err - } - if resp == nil { - return nil, qm, nil - } - defer resp.Body.Close() - - var entries []*KVPair - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - if len(entries) > 0 { - return entries[0], qm, nil - } - return nil, qm, nil -} - -// List is used to lookup all keys under a prefix -func (k *KV) List(prefix string, q *QueryOptions) (KVPairs, *QueryMeta, error) { - resp, qm, err := k.getInternal(prefix, map[string]string{"recurse": ""}, q) - if err != nil { - return nil, nil, err - } - if resp == nil { - return nil, qm, nil - } - defer resp.Body.Close() - - var entries []*KVPair - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -// Keys is used to list all the keys under a prefix. Optionally, -// a separator can be used to limit the responses. -func (k *KV) Keys(prefix, separator string, q *QueryOptions) ([]string, *QueryMeta, error) { - params := map[string]string{"keys": ""} - if separator != "" { - params["separator"] = separator - } - resp, qm, err := k.getInternal(prefix, params, q) - if err != nil { - return nil, nil, err - } - if resp == nil { - return nil, qm, nil - } - defer resp.Body.Close() - - var entries []string - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -func (k *KV) getInternal(key string, params map[string]string, q *QueryOptions) (*http.Response, *QueryMeta, error) { - r := k.c.newRequest("GET", "/v1/kv/"+strings.TrimPrefix(key, "/")) - r.setQueryOptions(q) - for param, val := range params { - r.params.Set(param, val) - } - rtt, resp, err := k.c.doRequest(r) - if err != nil { - return nil, nil, err - } - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - if resp.StatusCode == 404 { - resp.Body.Close() - return nil, qm, nil - } else if resp.StatusCode != 200 { - resp.Body.Close() - return nil, nil, fmt.Errorf("Unexpected response code: %d", resp.StatusCode) - } - return resp, qm, nil -} - -// Put is used to write a new value. Only the -// Key, Flags and Value is respected. -func (k *KV) Put(p *KVPair, q *WriteOptions) (*WriteMeta, error) { - params := make(map[string]string, 1) - if p.Flags != 0 { - params["flags"] = strconv.FormatUint(p.Flags, 10) - } - _, wm, err := k.put(p.Key, params, p.Value, q) - return wm, err -} - -// CAS is used for a Check-And-Set operation. The Key, -// ModifyIndex, Flags and Value are respected. Returns true -// on success or false on failures. -func (k *KV) CAS(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { - params := make(map[string]string, 2) - if p.Flags != 0 { - params["flags"] = strconv.FormatUint(p.Flags, 10) - } - params["cas"] = strconv.FormatUint(p.ModifyIndex, 10) - return k.put(p.Key, params, p.Value, q) -} - -// Acquire is used for a lock acquisition operation. The Key, -// Flags, Value and Session are respected. Returns true -// on success or false on failures. -func (k *KV) Acquire(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { - params := make(map[string]string, 2) - if p.Flags != 0 { - params["flags"] = strconv.FormatUint(p.Flags, 10) - } - params["acquire"] = p.Session - return k.put(p.Key, params, p.Value, q) -} - -// Release is used for a lock release operation. The Key, -// Flags, Value and Session are respected. Returns true -// on success or false on failures. -func (k *KV) Release(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { - params := make(map[string]string, 2) - if p.Flags != 0 { - params["flags"] = strconv.FormatUint(p.Flags, 10) - } - params["release"] = p.Session - return k.put(p.Key, params, p.Value, q) -} - -func (k *KV) put(key string, params map[string]string, body []byte, q *WriteOptions) (bool, *WriteMeta, error) { - if len(key) > 0 && key[0] == '/' { - return false, nil, fmt.Errorf("Invalid key. Key must not begin with a '/': %s", key) - } - - r := k.c.newRequest("PUT", "/v1/kv/"+key) - r.setWriteOptions(q) - for param, val := range params { - r.params.Set(param, val) - } - r.body = bytes.NewReader(body) - rtt, resp, err := requireOK(k.c.doRequest(r)) - if err != nil { - return false, nil, err - } - defer resp.Body.Close() - - qm := &WriteMeta{} - qm.RequestTime = rtt - - var buf bytes.Buffer - if _, err := io.Copy(&buf, resp.Body); err != nil { - return false, nil, fmt.Errorf("Failed to read response: %v", err) - } - res := strings.Contains(buf.String(), "true") - return res, qm, nil -} - -// Delete is used to delete a single key -func (k *KV) Delete(key string, w *WriteOptions) (*WriteMeta, error) { - _, qm, err := k.deleteInternal(key, nil, w) - return qm, err -} - -// DeleteCAS is used for a Delete Check-And-Set operation. The Key -// and ModifyIndex are respected. Returns true on success or false on failures. -func (k *KV) DeleteCAS(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { - params := map[string]string{ - "cas": strconv.FormatUint(p.ModifyIndex, 10), - } - return k.deleteInternal(p.Key, params, q) -} - -// DeleteTree is used to delete all keys under a prefix -func (k *KV) DeleteTree(prefix string, w *WriteOptions) (*WriteMeta, error) { - _, qm, err := k.deleteInternal(prefix, map[string]string{"recurse": ""}, w) - return qm, err -} - -func (k *KV) deleteInternal(key string, params map[string]string, q *WriteOptions) (bool, *WriteMeta, error) { - r := k.c.newRequest("DELETE", "/v1/kv/"+strings.TrimPrefix(key, "/")) - r.setWriteOptions(q) - for param, val := range params { - r.params.Set(param, val) - } - rtt, resp, err := requireOK(k.c.doRequest(r)) - if err != nil { - return false, nil, err - } - defer resp.Body.Close() - - qm := &WriteMeta{} - qm.RequestTime = rtt - - var buf bytes.Buffer - if _, err := io.Copy(&buf, resp.Body); err != nil { - return false, nil, fmt.Errorf("Failed to read response: %v", err) - } - res := strings.Contains(buf.String(), "true") - return res, qm, nil -} - -// TxnOp is the internal format we send to Consul. It's not specific to KV, -// though currently only KV operations are supported. -type TxnOp struct { - KV *KVTxnOp -} - -// TxnOps is a list of transaction operations. -type TxnOps []*TxnOp - -// TxnResult is the internal format we receive from Consul. -type TxnResult struct { - KV *KVPair -} - -// TxnResults is a list of TxnResult objects. -type TxnResults []*TxnResult - -// TxnError is used to return information about an operation in a transaction. -type TxnError struct { - OpIndex int - What string -} - -// TxnErrors is a list of TxnError objects. -type TxnErrors []*TxnError - -// TxnResponse is the internal format we receive from Consul. -type TxnResponse struct { - Results TxnResults - Errors TxnErrors -} - -// Txn is used to apply multiple KV operations in a single, atomic transaction. -// -// Note that Go will perform the required base64 encoding on the values -// automatically because the type is a byte slice. Transactions are defined as a -// list of operations to perform, using the KVOp constants and KVTxnOp structure -// to define operations. If any operation fails, none of the changes are applied -// to the state store. Note that this hides the internal raw transaction interface -// and munges the input and output types into KV-specific ones for ease of use. -// If there are more non-KV operations in the future we may break out a new -// transaction API client, but it will be easy to keep this KV-specific variant -// supported. -// -// Even though this is generally a write operation, we take a QueryOptions input -// and return a QueryMeta output. If the transaction contains only read ops, then -// Consul will fast-path it to a different endpoint internally which supports -// consistency controls, but not blocking. If there are write operations then -// the request will always be routed through raft and any consistency settings -// will be ignored. -// -// Here's an example: -// -// ops := KVTxnOps{ -// &KVTxnOp{ -// Verb: KVLock, -// Key: "test/lock", -// Session: "adf4238a-882b-9ddc-4a9d-5b6758e4159e", -// Value: []byte("hello"), -// }, -// &KVTxnOp{ -// Verb: KVGet, -// Key: "another/key", -// }, -// } -// ok, response, _, err := kv.Txn(&ops, nil) -// -// If there is a problem making the transaction request then an error will be -// returned. Otherwise, the ok value will be true if the transaction succeeded -// or false if it was rolled back. The response is a structured return value which -// will have the outcome of the transaction. Its Results member will have entries -// for each operation. Deleted keys will have a nil entry in the, and to save -// space, the Value of each key in the Results will be nil unless the operation -// is a KVGet. If the transaction was rolled back, the Errors member will have -// entries referencing the index of the operation that failed along with an error -// message. -func (k *KV) Txn(txn KVTxnOps, q *QueryOptions) (bool, *KVTxnResponse, *QueryMeta, error) { - r := k.c.newRequest("PUT", "/v1/txn") - r.setQueryOptions(q) - - // Convert into the internal format since this is an all-KV txn. - ops := make(TxnOps, 0, len(txn)) - for _, kvOp := range txn { - ops = append(ops, &TxnOp{KV: kvOp}) - } - r.obj = ops - rtt, resp, err := k.c.doRequest(r) - if err != nil { - return false, nil, nil, err - } - defer resp.Body.Close() - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - - if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusConflict { - var txnResp TxnResponse - if err := decodeBody(resp, &txnResp); err != nil { - return false, nil, nil, err - } - - // Convert from the internal format. - kvResp := KVTxnResponse{ - Errors: txnResp.Errors, - } - for _, result := range txnResp.Results { - kvResp.Results = append(kvResp.Results, result.KV) - } - return resp.StatusCode == http.StatusOK, &kvResp, qm, nil - } - - var buf bytes.Buffer - if _, err := io.Copy(&buf, resp.Body); err != nil { - return false, nil, nil, fmt.Errorf("Failed to read response: %v", err) - } - return false, nil, nil, fmt.Errorf("Failed request: %s", buf.String()) -} diff --git a/vendor/github.com/hashicorp/consul/api/lock.go b/vendor/github.com/hashicorp/consul/api/lock.go deleted file mode 100644 index 41f72e7d2..000000000 --- a/vendor/github.com/hashicorp/consul/api/lock.go +++ /dev/null @@ -1,385 +0,0 @@ -package api - -import ( - "fmt" - "sync" - "time" -) - -const ( - // DefaultLockSessionName is the Session Name we assign if none is provided - DefaultLockSessionName = "Consul API Lock" - - // DefaultLockSessionTTL is the default session TTL if no Session is provided - // when creating a new Lock. This is used because we do not have another - // other check to depend upon. - DefaultLockSessionTTL = "15s" - - // DefaultLockWaitTime is how long we block for at a time to check if lock - // acquisition is possible. This affects the minimum time it takes to cancel - // a Lock acquisition. - DefaultLockWaitTime = 15 * time.Second - - // DefaultLockRetryTime is how long we wait after a failed lock acquisition - // before attempting to do the lock again. This is so that once a lock-delay - // is in effect, we do not hot loop retrying the acquisition. - DefaultLockRetryTime = 5 * time.Second - - // DefaultMonitorRetryTime is how long we wait after a failed monitor check - // of a lock (500 response code). This allows the monitor to ride out brief - // periods of unavailability, subject to the MonitorRetries setting in the - // lock options which is by default set to 0, disabling this feature. This - // affects locks and semaphores. - DefaultMonitorRetryTime = 2 * time.Second - - // LockFlagValue is a magic flag we set to indicate a key - // is being used for a lock. It is used to detect a potential - // conflict with a semaphore. - LockFlagValue = 0x2ddccbc058a50c18 -) - -var ( - // ErrLockHeld is returned if we attempt to double lock - ErrLockHeld = fmt.Errorf("Lock already held") - - // ErrLockNotHeld is returned if we attempt to unlock a lock - // that we do not hold. - ErrLockNotHeld = fmt.Errorf("Lock not held") - - // ErrLockInUse is returned if we attempt to destroy a lock - // that is in use. - ErrLockInUse = fmt.Errorf("Lock in use") - - // ErrLockConflict is returned if the flags on a key - // used for a lock do not match expectation - ErrLockConflict = fmt.Errorf("Existing key does not match lock use") -) - -// Lock is used to implement client-side leader election. It is follows the -// algorithm as described here: https://www.consul.io/docs/guides/leader-election.html. -type Lock struct { - c *Client - opts *LockOptions - - isHeld bool - sessionRenew chan struct{} - lockSession string - l sync.Mutex -} - -// LockOptions is used to parameterize the Lock behavior. -type LockOptions struct { - Key string // Must be set and have write permissions - Value []byte // Optional, value to associate with the lock - Session string // Optional, created if not specified - SessionOpts *SessionEntry // Optional, options to use when creating a session - SessionName string // Optional, defaults to DefaultLockSessionName (ignored if SessionOpts is given) - SessionTTL string // Optional, defaults to DefaultLockSessionTTL (ignored if SessionOpts is given) - MonitorRetries int // Optional, defaults to 0 which means no retries - MonitorRetryTime time.Duration // Optional, defaults to DefaultMonitorRetryTime - LockWaitTime time.Duration // Optional, defaults to DefaultLockWaitTime - LockTryOnce bool // Optional, defaults to false which means try forever -} - -// LockKey returns a handle to a lock struct which can be used -// to acquire and release the mutex. The key used must have -// write permissions. -func (c *Client) LockKey(key string) (*Lock, error) { - opts := &LockOptions{ - Key: key, - } - return c.LockOpts(opts) -} - -// LockOpts returns a handle to a lock struct which can be used -// to acquire and release the mutex. The key used must have -// write permissions. -func (c *Client) LockOpts(opts *LockOptions) (*Lock, error) { - if opts.Key == "" { - return nil, fmt.Errorf("missing key") - } - if opts.SessionName == "" { - opts.SessionName = DefaultLockSessionName - } - if opts.SessionTTL == "" { - opts.SessionTTL = DefaultLockSessionTTL - } else { - if _, err := time.ParseDuration(opts.SessionTTL); err != nil { - return nil, fmt.Errorf("invalid SessionTTL: %v", err) - } - } - if opts.MonitorRetryTime == 0 { - opts.MonitorRetryTime = DefaultMonitorRetryTime - } - if opts.LockWaitTime == 0 { - opts.LockWaitTime = DefaultLockWaitTime - } - l := &Lock{ - c: c, - opts: opts, - } - return l, nil -} - -// Lock attempts to acquire the lock and blocks while doing so. -// Providing a non-nil stopCh can be used to abort the lock attempt. -// Returns a channel that is closed if our lock is lost or an error. -// This channel could be closed at any time due to session invalidation, -// communication errors, operator intervention, etc. It is NOT safe to -// assume that the lock is held until Unlock() unless the Session is specifically -// created without any associated health checks. By default Consul sessions -// prefer liveness over safety and an application must be able to handle -// the lock being lost. -func (l *Lock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error) { - // Hold the lock as we try to acquire - l.l.Lock() - defer l.l.Unlock() - - // Check if we already hold the lock - if l.isHeld { - return nil, ErrLockHeld - } - - // Check if we need to create a session first - l.lockSession = l.opts.Session - if l.lockSession == "" { - s, err := l.createSession() - if err != nil { - return nil, fmt.Errorf("failed to create session: %v", err) - } - - l.sessionRenew = make(chan struct{}) - l.lockSession = s - session := l.c.Session() - go session.RenewPeriodic(l.opts.SessionTTL, s, nil, l.sessionRenew) - - // If we fail to acquire the lock, cleanup the session - defer func() { - if !l.isHeld { - close(l.sessionRenew) - l.sessionRenew = nil - } - }() - } - - // Setup the query options - kv := l.c.KV() - qOpts := &QueryOptions{ - WaitTime: l.opts.LockWaitTime, - } - - start := time.Now() - attempts := 0 -WAIT: - // Check if we should quit - select { - case <-stopCh: - return nil, nil - default: - } - - // Handle the one-shot mode. - if l.opts.LockTryOnce && attempts > 0 { - elapsed := time.Since(start) - if elapsed > qOpts.WaitTime { - return nil, nil - } - - qOpts.WaitTime -= elapsed - } - attempts++ - - // Look for an existing lock, blocking until not taken - pair, meta, err := kv.Get(l.opts.Key, qOpts) - if err != nil { - return nil, fmt.Errorf("failed to read lock: %v", err) - } - if pair != nil && pair.Flags != LockFlagValue { - return nil, ErrLockConflict - } - locked := false - if pair != nil && pair.Session == l.lockSession { - goto HELD - } - if pair != nil && pair.Session != "" { - qOpts.WaitIndex = meta.LastIndex - goto WAIT - } - - // Try to acquire the lock - pair = l.lockEntry(l.lockSession) - locked, _, err = kv.Acquire(pair, nil) - if err != nil { - return nil, fmt.Errorf("failed to acquire lock: %v", err) - } - - // Handle the case of not getting the lock - if !locked { - // Determine why the lock failed - qOpts.WaitIndex = 0 - pair, meta, err = kv.Get(l.opts.Key, qOpts) - if pair != nil && pair.Session != "" { - //If the session is not null, this means that a wait can safely happen - //using a long poll - qOpts.WaitIndex = meta.LastIndex - goto WAIT - } else { - // If the session is empty and the lock failed to acquire, then it means - // a lock-delay is in effect and a timed wait must be used - select { - case <-time.After(DefaultLockRetryTime): - goto WAIT - case <-stopCh: - return nil, nil - } - } - } - -HELD: - // Watch to ensure we maintain leadership - leaderCh := make(chan struct{}) - go l.monitorLock(l.lockSession, leaderCh) - - // Set that we own the lock - l.isHeld = true - - // Locked! All done - return leaderCh, nil -} - -// Unlock released the lock. It is an error to call this -// if the lock is not currently held. -func (l *Lock) Unlock() error { - // Hold the lock as we try to release - l.l.Lock() - defer l.l.Unlock() - - // Ensure the lock is actually held - if !l.isHeld { - return ErrLockNotHeld - } - - // Set that we no longer own the lock - l.isHeld = false - - // Stop the session renew - if l.sessionRenew != nil { - defer func() { - close(l.sessionRenew) - l.sessionRenew = nil - }() - } - - // Get the lock entry, and clear the lock session - lockEnt := l.lockEntry(l.lockSession) - l.lockSession = "" - - // Release the lock explicitly - kv := l.c.KV() - _, _, err := kv.Release(lockEnt, nil) - if err != nil { - return fmt.Errorf("failed to release lock: %v", err) - } - return nil -} - -// Destroy is used to cleanup the lock entry. It is not necessary -// to invoke. It will fail if the lock is in use. -func (l *Lock) Destroy() error { - // Hold the lock as we try to release - l.l.Lock() - defer l.l.Unlock() - - // Check if we already hold the lock - if l.isHeld { - return ErrLockHeld - } - - // Look for an existing lock - kv := l.c.KV() - pair, _, err := kv.Get(l.opts.Key, nil) - if err != nil { - return fmt.Errorf("failed to read lock: %v", err) - } - - // Nothing to do if the lock does not exist - if pair == nil { - return nil - } - - // Check for possible flag conflict - if pair.Flags != LockFlagValue { - return ErrLockConflict - } - - // Check if it is in use - if pair.Session != "" { - return ErrLockInUse - } - - // Attempt the delete - didRemove, _, err := kv.DeleteCAS(pair, nil) - if err != nil { - return fmt.Errorf("failed to remove lock: %v", err) - } - if !didRemove { - return ErrLockInUse - } - return nil -} - -// createSession is used to create a new managed session -func (l *Lock) createSession() (string, error) { - session := l.c.Session() - se := l.opts.SessionOpts - if se == nil { - se = &SessionEntry{ - Name: l.opts.SessionName, - TTL: l.opts.SessionTTL, - } - } - id, _, err := session.Create(se, nil) - if err != nil { - return "", err - } - return id, nil -} - -// lockEntry returns a formatted KVPair for the lock -func (l *Lock) lockEntry(session string) *KVPair { - return &KVPair{ - Key: l.opts.Key, - Value: l.opts.Value, - Session: session, - Flags: LockFlagValue, - } -} - -// monitorLock is a long running routine to monitor a lock ownership -// It closes the stopCh if we lose our leadership. -func (l *Lock) monitorLock(session string, stopCh chan struct{}) { - defer close(stopCh) - kv := l.c.KV() - opts := &QueryOptions{RequireConsistent: true} -WAIT: - retries := l.opts.MonitorRetries -RETRY: - pair, meta, err := kv.Get(l.opts.Key, opts) - if err != nil { - // If configured we can try to ride out a brief Consul unavailability - // by doing retries. Note that we have to attempt the retry in a non- - // blocking fashion so that we have a clean place to reset the retry - // counter if service is restored. - if retries > 0 && IsRetryableError(err) { - time.Sleep(l.opts.MonitorRetryTime) - retries-- - opts.WaitIndex = 0 - goto RETRY - } - return - } - if pair != nil && pair.Session == session { - opts.WaitIndex = meta.LastIndex - goto WAIT - } -} diff --git a/vendor/github.com/hashicorp/consul/api/operator.go b/vendor/github.com/hashicorp/consul/api/operator.go deleted file mode 100644 index 079e22486..000000000 --- a/vendor/github.com/hashicorp/consul/api/operator.go +++ /dev/null @@ -1,11 +0,0 @@ -package api - -// Operator can be used to perform low-level operator tasks for Consul. -type Operator struct { - c *Client -} - -// Operator returns a handle to the operator endpoints. -func (c *Client) Operator() *Operator { - return &Operator{c} -} diff --git a/vendor/github.com/hashicorp/consul/api/operator_area.go b/vendor/github.com/hashicorp/consul/api/operator_area.go deleted file mode 100644 index a630b694c..000000000 --- a/vendor/github.com/hashicorp/consul/api/operator_area.go +++ /dev/null @@ -1,193 +0,0 @@ -// The /v1/operator/area endpoints are available only in Consul Enterprise and -// interact with its network area subsystem. Network areas are used to link -// together Consul servers in different Consul datacenters. With network areas, -// Consul datacenters can be linked together in ways other than a fully-connected -// mesh, as is required for Consul's WAN. -package api - -import ( - "net" - "time" -) - -// Area defines a network area. -type Area struct { - // ID is this identifier for an area (a UUID). This must be left empty - // when creating a new area. - ID string - - // PeerDatacenter is the peer Consul datacenter that will make up the - // other side of this network area. Network areas always involve a pair - // of datacenters: the datacenter where the area was created, and the - // peer datacenter. This is required. - PeerDatacenter string - - // RetryJoin specifies the address of Consul servers to join to, such as - // an IPs or hostnames with an optional port number. This is optional. - RetryJoin []string - - // UseTLS specifies whether gossip over this area should be encrypted with TLS - // if possible. - UseTLS bool -} - -// AreaJoinResponse is returned when a join occurs and gives the result for each -// address. -type AreaJoinResponse struct { - // The address that was joined. - Address string - - // Whether or not the join was a success. - Joined bool - - // If we couldn't join, this is the message with information. - Error string -} - -// SerfMember is a generic structure for reporting information about members in -// a Serf cluster. This is only used by the area endpoints right now, but this -// could be expanded to other endpoints in the future. -type SerfMember struct { - // ID is the node identifier (a UUID). - ID string - - // Name is the node name. - Name string - - // Addr has the IP address. - Addr net.IP - - // Port is the RPC port. - Port uint16 - - // Datacenter is the DC name. - Datacenter string - - // Role is "client", "server", or "unknown". - Role string - - // Build has the version of the Consul agent. - Build string - - // Protocol is the protocol of the Consul agent. - Protocol int - - // Status is the Serf health status "none", "alive", "leaving", "left", - // or "failed". - Status string - - // RTT is the estimated round trip time from the server handling the - // request to the this member. This will be negative if no RTT estimate - // is available. - RTT time.Duration -} - -// AreaCreate will create a new network area. The ID in the given structure must -// be empty and a generated ID will be returned on success. -func (op *Operator) AreaCreate(area *Area, q *WriteOptions) (string, *WriteMeta, error) { - r := op.c.newRequest("POST", "/v1/operator/area") - r.setWriteOptions(q) - r.obj = area - rtt, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// AreaUpdate will update the configuration of the network area with the given ID. -func (op *Operator) AreaUpdate(areaID string, area *Area, q *WriteOptions) (string, *WriteMeta, error) { - r := op.c.newRequest("PUT", "/v1/operator/area/"+areaID) - r.setWriteOptions(q) - r.obj = area - rtt, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// AreaGet returns a single network area. -func (op *Operator) AreaGet(areaID string, q *QueryOptions) ([]*Area, *QueryMeta, error) { - var out []*Area - qm, err := op.c.query("/v1/operator/area/"+areaID, &out, q) - if err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// AreaList returns all the available network areas. -func (op *Operator) AreaList(q *QueryOptions) ([]*Area, *QueryMeta, error) { - var out []*Area - qm, err := op.c.query("/v1/operator/area", &out, q) - if err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// AreaDelete deletes the given network area. -func (op *Operator) AreaDelete(areaID string, q *WriteOptions) (*WriteMeta, error) { - r := op.c.newRequest("DELETE", "/v1/operator/area/"+areaID) - r.setWriteOptions(q) - rtt, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - return wm, nil -} - -// AreaJoin attempts to join the given set of join addresses to the given -// network area. See the Area structure for details about join addresses. -func (op *Operator) AreaJoin(areaID string, addresses []string, q *WriteOptions) ([]*AreaJoinResponse, *WriteMeta, error) { - r := op.c.newRequest("PUT", "/v1/operator/area/"+areaID+"/join") - r.setWriteOptions(q) - r.obj = addresses - rtt, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - var out []*AreaJoinResponse - if err := decodeBody(resp, &out); err != nil { - return nil, nil, err - } - return out, wm, nil -} - -// AreaMembers lists the Serf information about the members in the given area. -func (op *Operator) AreaMembers(areaID string, q *QueryOptions) ([]*SerfMember, *QueryMeta, error) { - var out []*SerfMember - qm, err := op.c.query("/v1/operator/area/"+areaID+"/members", &out, q) - if err != nil { - return nil, nil, err - } - return out, qm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/operator_autopilot.go b/vendor/github.com/hashicorp/consul/api/operator_autopilot.go deleted file mode 100644 index b179406dc..000000000 --- a/vendor/github.com/hashicorp/consul/api/operator_autopilot.go +++ /dev/null @@ -1,219 +0,0 @@ -package api - -import ( - "bytes" - "fmt" - "io" - "strconv" - "strings" - "time" -) - -// AutopilotConfiguration is used for querying/setting the Autopilot configuration. -// Autopilot helps manage operator tasks related to Consul servers like removing -// failed servers from the Raft quorum. -type AutopilotConfiguration struct { - // CleanupDeadServers controls whether to remove dead servers from the Raft - // peer list when a new server joins - CleanupDeadServers bool - - // LastContactThreshold is the limit on the amount of time a server can go - // without leader contact before being considered unhealthy. - LastContactThreshold *ReadableDuration - - // MaxTrailingLogs is the amount of entries in the Raft Log that a server can - // be behind before being considered unhealthy. - MaxTrailingLogs uint64 - - // ServerStabilizationTime is the minimum amount of time a server must be - // in a stable, healthy state before it can be added to the cluster. Only - // applicable with Raft protocol version 3 or higher. - ServerStabilizationTime *ReadableDuration - - // (Enterprise-only) RedundancyZoneTag is the node tag to use for separating - // servers into zones for redundancy. If left blank, this feature will be disabled. - RedundancyZoneTag string - - // (Enterprise-only) DisableUpgradeMigration will disable Autopilot's upgrade migration - // strategy of waiting until enough newer-versioned servers have been added to the - // cluster before promoting them to voters. - DisableUpgradeMigration bool - - // (Enterprise-only) UpgradeVersionTag is the node tag to use for version info when - // performing upgrade migrations. If left blank, the Consul version will be used. - UpgradeVersionTag string - - // CreateIndex holds the index corresponding the creation of this configuration. - // This is a read-only field. - CreateIndex uint64 - - // ModifyIndex will be set to the index of the last update when retrieving the - // Autopilot configuration. Resubmitting a configuration with - // AutopilotCASConfiguration will perform a check-and-set operation which ensures - // there hasn't been a subsequent update since the configuration was retrieved. - ModifyIndex uint64 -} - -// ServerHealth is the health (from the leader's point of view) of a server. -type ServerHealth struct { - // ID is the raft ID of the server. - ID string - - // Name is the node name of the server. - Name string - - // Address is the address of the server. - Address string - - // The status of the SerfHealth check for the server. - SerfStatus string - - // Version is the Consul version of the server. - Version string - - // Leader is whether this server is currently the leader. - Leader bool - - // LastContact is the time since this node's last contact with the leader. - LastContact *ReadableDuration - - // LastTerm is the highest leader term this server has a record of in its Raft log. - LastTerm uint64 - - // LastIndex is the last log index this server has a record of in its Raft log. - LastIndex uint64 - - // Healthy is whether or not the server is healthy according to the current - // Autopilot config. - Healthy bool - - // Voter is whether this is a voting server. - Voter bool - - // StableSince is the last time this server's Healthy value changed. - StableSince time.Time -} - -// OperatorHealthReply is a representation of the overall health of the cluster -type OperatorHealthReply struct { - // Healthy is true if all the servers in the cluster are healthy. - Healthy bool - - // FailureTolerance is the number of healthy servers that could be lost without - // an outage occurring. - FailureTolerance int - - // Servers holds the health of each server. - Servers []ServerHealth -} - -// ReadableDuration is a duration type that is serialized to JSON in human readable format. -type ReadableDuration time.Duration - -func NewReadableDuration(dur time.Duration) *ReadableDuration { - d := ReadableDuration(dur) - return &d -} - -func (d *ReadableDuration) String() string { - return d.Duration().String() -} - -func (d *ReadableDuration) Duration() time.Duration { - if d == nil { - return time.Duration(0) - } - return time.Duration(*d) -} - -func (d *ReadableDuration) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, d.Duration().String())), nil -} - -func (d *ReadableDuration) UnmarshalJSON(raw []byte) error { - if d == nil { - return fmt.Errorf("cannot unmarshal to nil pointer") - } - - str := string(raw) - if len(str) < 2 || str[0] != '"' || str[len(str)-1] != '"' { - return fmt.Errorf("must be enclosed with quotes: %s", str) - } - dur, err := time.ParseDuration(str[1 : len(str)-1]) - if err != nil { - return err - } - *d = ReadableDuration(dur) - return nil -} - -// AutopilotGetConfiguration is used to query the current Autopilot configuration. -func (op *Operator) AutopilotGetConfiguration(q *QueryOptions) (*AutopilotConfiguration, error) { - r := op.c.newRequest("GET", "/v1/operator/autopilot/configuration") - r.setQueryOptions(q) - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out AutopilotConfiguration - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - - return &out, nil -} - -// AutopilotSetConfiguration is used to set the current Autopilot configuration. -func (op *Operator) AutopilotSetConfiguration(conf *AutopilotConfiguration, q *WriteOptions) error { - r := op.c.newRequest("PUT", "/v1/operator/autopilot/configuration") - r.setWriteOptions(q) - r.obj = conf - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// AutopilotCASConfiguration is used to perform a Check-And-Set update on the -// Autopilot configuration. The ModifyIndex value will be respected. Returns -// true on success or false on failures. -func (op *Operator) AutopilotCASConfiguration(conf *AutopilotConfiguration, q *WriteOptions) (bool, error) { - r := op.c.newRequest("PUT", "/v1/operator/autopilot/configuration") - r.setWriteOptions(q) - r.params.Set("cas", strconv.FormatUint(conf.ModifyIndex, 10)) - r.obj = conf - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return false, err - } - defer resp.Body.Close() - - var buf bytes.Buffer - if _, err := io.Copy(&buf, resp.Body); err != nil { - return false, fmt.Errorf("Failed to read response: %v", err) - } - res := strings.Contains(buf.String(), "true") - - return res, nil -} - -// AutopilotServerHealth -func (op *Operator) AutopilotServerHealth(q *QueryOptions) (*OperatorHealthReply, error) { - r := op.c.newRequest("GET", "/v1/operator/autopilot/health") - r.setQueryOptions(q) - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out OperatorHealthReply - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/operator_keyring.go b/vendor/github.com/hashicorp/consul/api/operator_keyring.go deleted file mode 100644 index 6b614296c..000000000 --- a/vendor/github.com/hashicorp/consul/api/operator_keyring.go +++ /dev/null @@ -1,86 +0,0 @@ -package api - -// keyringRequest is used for performing Keyring operations -type keyringRequest struct { - Key string -} - -// KeyringResponse is returned when listing the gossip encryption keys -type KeyringResponse struct { - // Whether this response is for a WAN ring - WAN bool - - // The datacenter name this request corresponds to - Datacenter string - - // Segment has the network segment this request corresponds to. - Segment string - - // A map of the encryption keys to the number of nodes they're installed on - Keys map[string]int - - // The total number of nodes in this ring - NumNodes int -} - -// KeyringInstall is used to install a new gossip encryption key into the cluster -func (op *Operator) KeyringInstall(key string, q *WriteOptions) error { - r := op.c.newRequest("POST", "/v1/operator/keyring") - r.setWriteOptions(q) - r.obj = keyringRequest{ - Key: key, - } - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// KeyringList is used to list the gossip keys installed in the cluster -func (op *Operator) KeyringList(q *QueryOptions) ([]*KeyringResponse, error) { - r := op.c.newRequest("GET", "/v1/operator/keyring") - r.setQueryOptions(q) - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out []*KeyringResponse - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return out, nil -} - -// KeyringRemove is used to remove a gossip encryption key from the cluster -func (op *Operator) KeyringRemove(key string, q *WriteOptions) error { - r := op.c.newRequest("DELETE", "/v1/operator/keyring") - r.setWriteOptions(q) - r.obj = keyringRequest{ - Key: key, - } - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} - -// KeyringUse is used to change the active gossip encryption key -func (op *Operator) KeyringUse(key string, q *WriteOptions) error { - r := op.c.newRequest("PUT", "/v1/operator/keyring") - r.setWriteOptions(q) - r.obj = keyringRequest{ - Key: key, - } - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return err - } - resp.Body.Close() - return nil -} diff --git a/vendor/github.com/hashicorp/consul/api/operator_raft.go b/vendor/github.com/hashicorp/consul/api/operator_raft.go deleted file mode 100644 index a9844df2d..000000000 --- a/vendor/github.com/hashicorp/consul/api/operator_raft.go +++ /dev/null @@ -1,89 +0,0 @@ -package api - -// RaftServer has information about a server in the Raft configuration. -type RaftServer struct { - // ID is the unique ID for the server. These are currently the same - // as the address, but they will be changed to a real GUID in a future - // release of Consul. - ID string - - // Node is the node name of the server, as known by Consul, or this - // will be set to "(unknown)" otherwise. - Node string - - // Address is the IP:port of the server, used for Raft communications. - Address string - - // Leader is true if this server is the current cluster leader. - Leader bool - - // Protocol version is the raft protocol version used by the server - ProtocolVersion string - - // Voter is true if this server has a vote in the cluster. This might - // be false if the server is staging and still coming online, or if - // it's a non-voting server, which will be added in a future release of - // Consul. - Voter bool -} - -// RaftConfiguration is returned when querying for the current Raft configuration. -type RaftConfiguration struct { - // Servers has the list of servers in the Raft configuration. - Servers []*RaftServer - - // Index has the Raft index of this configuration. - Index uint64 -} - -// RaftGetConfiguration is used to query the current Raft peer set. -func (op *Operator) RaftGetConfiguration(q *QueryOptions) (*RaftConfiguration, error) { - r := op.c.newRequest("GET", "/v1/operator/raft/configuration") - r.setQueryOptions(q) - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var out RaftConfiguration - if err := decodeBody(resp, &out); err != nil { - return nil, err - } - return &out, nil -} - -// RaftRemovePeerByAddress is used to kick a stale peer (one that it in the Raft -// quorum but no longer known to Serf or the catalog) by address in the form of -// "IP:port". -func (op *Operator) RaftRemovePeerByAddress(address string, q *WriteOptions) error { - r := op.c.newRequest("DELETE", "/v1/operator/raft/peer") - r.setWriteOptions(q) - - r.params.Set("address", string(address)) - - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return err - } - - resp.Body.Close() - return nil -} - -// RaftRemovePeerByID is used to kick a stale peer (one that it in the Raft -// quorum but no longer known to Serf or the catalog) by ID. -func (op *Operator) RaftRemovePeerByID(id string, q *WriteOptions) error { - r := op.c.newRequest("DELETE", "/v1/operator/raft/peer") - r.setWriteOptions(q) - - r.params.Set("id", string(id)) - - _, resp, err := requireOK(op.c.doRequest(r)) - if err != nil { - return err - } - - resp.Body.Close() - return nil -} diff --git a/vendor/github.com/hashicorp/consul/api/operator_segment.go b/vendor/github.com/hashicorp/consul/api/operator_segment.go deleted file mode 100644 index 92b05d3c0..000000000 --- a/vendor/github.com/hashicorp/consul/api/operator_segment.go +++ /dev/null @@ -1,11 +0,0 @@ -package api - -// SegmentList returns all the available LAN segments. -func (op *Operator) SegmentList(q *QueryOptions) ([]string, *QueryMeta, error) { - var out []string - qm, err := op.c.query("/v1/operator/segment", &out, q) - if err != nil { - return nil, nil, err - } - return out, qm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/prepared_query.go b/vendor/github.com/hashicorp/consul/api/prepared_query.go deleted file mode 100644 index ff210de3f..000000000 --- a/vendor/github.com/hashicorp/consul/api/prepared_query.go +++ /dev/null @@ -1,198 +0,0 @@ -package api - -// QueryDatacenterOptions sets options about how we fail over if there are no -// healthy nodes in the local datacenter. -type QueryDatacenterOptions struct { - // NearestN is set to the number of remote datacenters to try, based on - // network coordinates. - NearestN int - - // Datacenters is a fixed list of datacenters to try after NearestN. We - // never try a datacenter multiple times, so those are subtracted from - // this list before proceeding. - Datacenters []string -} - -// QueryDNSOptions controls settings when query results are served over DNS. -type QueryDNSOptions struct { - // TTL is the time to live for the served DNS results. - TTL string -} - -// ServiceQuery is used to query for a set of healthy nodes offering a specific -// service. -type ServiceQuery struct { - // Service is the service to query. - Service string - - // Near allows baking in the name of a node to automatically distance- - // sort from. The magic "_agent" value is supported, which sorts near - // the agent which initiated the request by default. - Near string - - // Failover controls what we do if there are no healthy nodes in the - // local datacenter. - Failover QueryDatacenterOptions - - // If OnlyPassing is true then we will only include nodes with passing - // health checks (critical AND warning checks will cause a node to be - // discarded) - OnlyPassing bool - - // Tags are a set of required and/or disallowed tags. If a tag is in - // this list it must be present. If the tag is preceded with "!" then - // it is disallowed. - Tags []string - - // NodeMeta is a map of required node metadata fields. If a key/value - // pair is in this map it must be present on the node in order for the - // service entry to be returned. - NodeMeta map[string]string -} - -// QueryTemplate carries the arguments for creating a templated query. -type QueryTemplate struct { - // Type specifies the type of the query template. Currently only - // "name_prefix_match" is supported. This field is required. - Type string - - // Regexp allows specifying a regex pattern to match against the name - // of the query being executed. - Regexp string -} - -// PrepatedQueryDefinition defines a complete prepared query. -type PreparedQueryDefinition struct { - // ID is this UUID-based ID for the query, always generated by Consul. - ID string - - // Name is an optional friendly name for the query supplied by the - // user. NOTE - if this feature is used then it will reduce the security - // of any read ACL associated with this query/service since this name - // can be used to locate nodes with supplying any ACL. - Name string - - // Session is an optional session to tie this query's lifetime to. If - // this is omitted then the query will not expire. - Session string - - // Token is the ACL token used when the query was created, and it is - // used when a query is subsequently executed. This token, or a token - // with management privileges, must be used to change the query later. - Token string - - // Service defines a service query (leaving things open for other types - // later). - Service ServiceQuery - - // DNS has options that control how the results of this query are - // served over DNS. - DNS QueryDNSOptions - - // Template is used to pass through the arguments for creating a - // prepared query with an attached template. If a template is given, - // interpolations are possible in other struct fields. - Template QueryTemplate -} - -// PreparedQueryExecuteResponse has the results of executing a query. -type PreparedQueryExecuteResponse struct { - // Service is the service that was queried. - Service string - - // Nodes has the nodes that were output by the query. - Nodes []ServiceEntry - - // DNS has the options for serving these results over DNS. - DNS QueryDNSOptions - - // Datacenter is the datacenter that these results came from. - Datacenter string - - // Failovers is a count of how many times we had to query a remote - // datacenter. - Failovers int -} - -// PreparedQuery can be used to query the prepared query endpoints. -type PreparedQuery struct { - c *Client -} - -// PreparedQuery returns a handle to the prepared query endpoints. -func (c *Client) PreparedQuery() *PreparedQuery { - return &PreparedQuery{c} -} - -// Create makes a new prepared query. The ID of the new query is returned. -func (c *PreparedQuery) Create(query *PreparedQueryDefinition, q *WriteOptions) (string, *WriteMeta, error) { - r := c.c.newRequest("POST", "/v1/query") - r.setWriteOptions(q) - r.obj = query - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return "", nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - - var out struct{ ID string } - if err := decodeBody(resp, &out); err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// Update makes updates to an existing prepared query. -func (c *PreparedQuery) Update(query *PreparedQueryDefinition, q *WriteOptions) (*WriteMeta, error) { - return c.c.write("/v1/query/"+query.ID, query, nil, q) -} - -// List is used to fetch all the prepared queries (always requires a management -// token). -func (c *PreparedQuery) List(q *QueryOptions) ([]*PreparedQueryDefinition, *QueryMeta, error) { - var out []*PreparedQueryDefinition - qm, err := c.c.query("/v1/query", &out, q) - if err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Get is used to fetch a specific prepared query. -func (c *PreparedQuery) Get(queryID string, q *QueryOptions) ([]*PreparedQueryDefinition, *QueryMeta, error) { - var out []*PreparedQueryDefinition - qm, err := c.c.query("/v1/query/"+queryID, &out, q) - if err != nil { - return nil, nil, err - } - return out, qm, nil -} - -// Delete is used to delete a specific prepared query. -func (c *PreparedQuery) Delete(queryID string, q *WriteOptions) (*WriteMeta, error) { - r := c.c.newRequest("DELETE", "/v1/query/"+queryID) - r.setWriteOptions(q) - rtt, resp, err := requireOK(c.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{} - wm.RequestTime = rtt - return wm, nil -} - -// Execute is used to execute a specific prepared query. You can execute using -// a query ID or name. -func (c *PreparedQuery) Execute(queryIDOrName string, q *QueryOptions) (*PreparedQueryExecuteResponse, *QueryMeta, error) { - var out *PreparedQueryExecuteResponse - qm, err := c.c.query("/v1/query/"+queryIDOrName+"/execute", &out, q) - if err != nil { - return nil, nil, err - } - return out, qm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/raw.go b/vendor/github.com/hashicorp/consul/api/raw.go deleted file mode 100644 index 745a208c9..000000000 --- a/vendor/github.com/hashicorp/consul/api/raw.go +++ /dev/null @@ -1,24 +0,0 @@ -package api - -// Raw can be used to do raw queries against custom endpoints -type Raw struct { - c *Client -} - -// Raw returns a handle to query endpoints -func (c *Client) Raw() *Raw { - return &Raw{c} -} - -// Query is used to do a GET request against an endpoint -// and deserialize the response into an interface using -// standard Consul conventions. -func (raw *Raw) Query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) { - return raw.c.query(endpoint, out, q) -} - -// Write is used to do a PUT request against an endpoint -// and serialize/deserialized using the standard Consul conventions. -func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) { - return raw.c.write(endpoint, in, out, q) -} diff --git a/vendor/github.com/hashicorp/consul/api/semaphore.go b/vendor/github.com/hashicorp/consul/api/semaphore.go deleted file mode 100644 index d0c574177..000000000 --- a/vendor/github.com/hashicorp/consul/api/semaphore.go +++ /dev/null @@ -1,513 +0,0 @@ -package api - -import ( - "encoding/json" - "fmt" - "path" - "sync" - "time" -) - -const ( - // DefaultSemaphoreSessionName is the Session Name we assign if none is provided - DefaultSemaphoreSessionName = "Consul API Semaphore" - - // DefaultSemaphoreSessionTTL is the default session TTL if no Session is provided - // when creating a new Semaphore. This is used because we do not have another - // other check to depend upon. - DefaultSemaphoreSessionTTL = "15s" - - // DefaultSemaphoreWaitTime is how long we block for at a time to check if semaphore - // acquisition is possible. This affects the minimum time it takes to cancel - // a Semaphore acquisition. - DefaultSemaphoreWaitTime = 15 * time.Second - - // DefaultSemaphoreKey is the key used within the prefix to - // use for coordination between all the contenders. - DefaultSemaphoreKey = ".lock" - - // SemaphoreFlagValue is a magic flag we set to indicate a key - // is being used for a semaphore. It is used to detect a potential - // conflict with a lock. - SemaphoreFlagValue = 0xe0f69a2baa414de0 -) - -var ( - // ErrSemaphoreHeld is returned if we attempt to double lock - ErrSemaphoreHeld = fmt.Errorf("Semaphore already held") - - // ErrSemaphoreNotHeld is returned if we attempt to unlock a semaphore - // that we do not hold. - ErrSemaphoreNotHeld = fmt.Errorf("Semaphore not held") - - // ErrSemaphoreInUse is returned if we attempt to destroy a semaphore - // that is in use. - ErrSemaphoreInUse = fmt.Errorf("Semaphore in use") - - // ErrSemaphoreConflict is returned if the flags on a key - // used for a semaphore do not match expectation - ErrSemaphoreConflict = fmt.Errorf("Existing key does not match semaphore use") -) - -// Semaphore is used to implement a distributed semaphore -// using the Consul KV primitives. -type Semaphore struct { - c *Client - opts *SemaphoreOptions - - isHeld bool - sessionRenew chan struct{} - lockSession string - l sync.Mutex -} - -// SemaphoreOptions is used to parameterize the Semaphore -type SemaphoreOptions struct { - Prefix string // Must be set and have write permissions - Limit int // Must be set, and be positive - Value []byte // Optional, value to associate with the contender entry - Session string // Optional, created if not specified - SessionName string // Optional, defaults to DefaultLockSessionName - SessionTTL string // Optional, defaults to DefaultLockSessionTTL - MonitorRetries int // Optional, defaults to 0 which means no retries - MonitorRetryTime time.Duration // Optional, defaults to DefaultMonitorRetryTime - SemaphoreWaitTime time.Duration // Optional, defaults to DefaultSemaphoreWaitTime - SemaphoreTryOnce bool // Optional, defaults to false which means try forever -} - -// semaphoreLock is written under the DefaultSemaphoreKey and -// is used to coordinate between all the contenders. -type semaphoreLock struct { - // Limit is the integer limit of holders. This is used to - // verify that all the holders agree on the value. - Limit int - - // Holders is a list of all the semaphore holders. - // It maps the session ID to true. It is used as a set effectively. - Holders map[string]bool -} - -// SemaphorePrefix is used to created a Semaphore which will operate -// at the given KV prefix and uses the given limit for the semaphore. -// The prefix must have write privileges, and the limit must be agreed -// upon by all contenders. -func (c *Client) SemaphorePrefix(prefix string, limit int) (*Semaphore, error) { - opts := &SemaphoreOptions{ - Prefix: prefix, - Limit: limit, - } - return c.SemaphoreOpts(opts) -} - -// SemaphoreOpts is used to create a Semaphore with the given options. -// The prefix must have write privileges, and the limit must be agreed -// upon by all contenders. If a Session is not provided, one will be created. -func (c *Client) SemaphoreOpts(opts *SemaphoreOptions) (*Semaphore, error) { - if opts.Prefix == "" { - return nil, fmt.Errorf("missing prefix") - } - if opts.Limit <= 0 { - return nil, fmt.Errorf("semaphore limit must be positive") - } - if opts.SessionName == "" { - opts.SessionName = DefaultSemaphoreSessionName - } - if opts.SessionTTL == "" { - opts.SessionTTL = DefaultSemaphoreSessionTTL - } else { - if _, err := time.ParseDuration(opts.SessionTTL); err != nil { - return nil, fmt.Errorf("invalid SessionTTL: %v", err) - } - } - if opts.MonitorRetryTime == 0 { - opts.MonitorRetryTime = DefaultMonitorRetryTime - } - if opts.SemaphoreWaitTime == 0 { - opts.SemaphoreWaitTime = DefaultSemaphoreWaitTime - } - s := &Semaphore{ - c: c, - opts: opts, - } - return s, nil -} - -// Acquire attempts to reserve a slot in the semaphore, blocking until -// success, interrupted via the stopCh or an error is encountered. -// Providing a non-nil stopCh can be used to abort the attempt. -// On success, a channel is returned that represents our slot. -// This channel could be closed at any time due to session invalidation, -// communication errors, operator intervention, etc. It is NOT safe to -// assume that the slot is held until Release() unless the Session is specifically -// created without any associated health checks. By default Consul sessions -// prefer liveness over safety and an application must be able to handle -// the session being lost. -func (s *Semaphore) Acquire(stopCh <-chan struct{}) (<-chan struct{}, error) { - // Hold the lock as we try to acquire - s.l.Lock() - defer s.l.Unlock() - - // Check if we already hold the semaphore - if s.isHeld { - return nil, ErrSemaphoreHeld - } - - // Check if we need to create a session first - s.lockSession = s.opts.Session - if s.lockSession == "" { - sess, err := s.createSession() - if err != nil { - return nil, fmt.Errorf("failed to create session: %v", err) - } - - s.sessionRenew = make(chan struct{}) - s.lockSession = sess - session := s.c.Session() - go session.RenewPeriodic(s.opts.SessionTTL, sess, nil, s.sessionRenew) - - // If we fail to acquire the lock, cleanup the session - defer func() { - if !s.isHeld { - close(s.sessionRenew) - s.sessionRenew = nil - } - }() - } - - // Create the contender entry - kv := s.c.KV() - made, _, err := kv.Acquire(s.contenderEntry(s.lockSession), nil) - if err != nil || !made { - return nil, fmt.Errorf("failed to make contender entry: %v", err) - } - - // Setup the query options - qOpts := &QueryOptions{ - WaitTime: s.opts.SemaphoreWaitTime, - } - - start := time.Now() - attempts := 0 -WAIT: - // Check if we should quit - select { - case <-stopCh: - return nil, nil - default: - } - - // Handle the one-shot mode. - if s.opts.SemaphoreTryOnce && attempts > 0 { - elapsed := time.Since(start) - if elapsed > qOpts.WaitTime { - return nil, nil - } - - qOpts.WaitTime -= elapsed - } - attempts++ - - // Read the prefix - pairs, meta, err := kv.List(s.opts.Prefix, qOpts) - if err != nil { - return nil, fmt.Errorf("failed to read prefix: %v", err) - } - - // Decode the lock - lockPair := s.findLock(pairs) - if lockPair.Flags != SemaphoreFlagValue { - return nil, ErrSemaphoreConflict - } - lock, err := s.decodeLock(lockPair) - if err != nil { - return nil, err - } - - // Verify we agree with the limit - if lock.Limit != s.opts.Limit { - return nil, fmt.Errorf("semaphore limit conflict (lock: %d, local: %d)", - lock.Limit, s.opts.Limit) - } - - // Prune the dead holders - s.pruneDeadHolders(lock, pairs) - - // Check if the lock is held - if len(lock.Holders) >= lock.Limit { - qOpts.WaitIndex = meta.LastIndex - goto WAIT - } - - // Create a new lock with us as a holder - lock.Holders[s.lockSession] = true - newLock, err := s.encodeLock(lock, lockPair.ModifyIndex) - if err != nil { - return nil, err - } - - // Attempt the acquisition - didSet, _, err := kv.CAS(newLock, nil) - if err != nil { - return nil, fmt.Errorf("failed to update lock: %v", err) - } - if !didSet { - // Update failed, could have been a race with another contender, - // retry the operation - goto WAIT - } - - // Watch to ensure we maintain ownership of the slot - lockCh := make(chan struct{}) - go s.monitorLock(s.lockSession, lockCh) - - // Set that we own the lock - s.isHeld = true - - // Acquired! All done - return lockCh, nil -} - -// Release is used to voluntarily give up our semaphore slot. It is -// an error to call this if the semaphore has not been acquired. -func (s *Semaphore) Release() error { - // Hold the lock as we try to release - s.l.Lock() - defer s.l.Unlock() - - // Ensure the lock is actually held - if !s.isHeld { - return ErrSemaphoreNotHeld - } - - // Set that we no longer own the lock - s.isHeld = false - - // Stop the session renew - if s.sessionRenew != nil { - defer func() { - close(s.sessionRenew) - s.sessionRenew = nil - }() - } - - // Get and clear the lock session - lockSession := s.lockSession - s.lockSession = "" - - // Remove ourselves as a lock holder - kv := s.c.KV() - key := path.Join(s.opts.Prefix, DefaultSemaphoreKey) -READ: - pair, _, err := kv.Get(key, nil) - if err != nil { - return err - } - if pair == nil { - pair = &KVPair{} - } - lock, err := s.decodeLock(pair) - if err != nil { - return err - } - - // Create a new lock without us as a holder - if _, ok := lock.Holders[lockSession]; ok { - delete(lock.Holders, lockSession) - newLock, err := s.encodeLock(lock, pair.ModifyIndex) - if err != nil { - return err - } - - // Swap the locks - didSet, _, err := kv.CAS(newLock, nil) - if err != nil { - return fmt.Errorf("failed to update lock: %v", err) - } - if !didSet { - goto READ - } - } - - // Destroy the contender entry - contenderKey := path.Join(s.opts.Prefix, lockSession) - if _, err := kv.Delete(contenderKey, nil); err != nil { - return err - } - return nil -} - -// Destroy is used to cleanup the semaphore entry. It is not necessary -// to invoke. It will fail if the semaphore is in use. -func (s *Semaphore) Destroy() error { - // Hold the lock as we try to acquire - s.l.Lock() - defer s.l.Unlock() - - // Check if we already hold the semaphore - if s.isHeld { - return ErrSemaphoreHeld - } - - // List for the semaphore - kv := s.c.KV() - pairs, _, err := kv.List(s.opts.Prefix, nil) - if err != nil { - return fmt.Errorf("failed to read prefix: %v", err) - } - - // Find the lock pair, bail if it doesn't exist - lockPair := s.findLock(pairs) - if lockPair.ModifyIndex == 0 { - return nil - } - if lockPair.Flags != SemaphoreFlagValue { - return ErrSemaphoreConflict - } - - // Decode the lock - lock, err := s.decodeLock(lockPair) - if err != nil { - return err - } - - // Prune the dead holders - s.pruneDeadHolders(lock, pairs) - - // Check if there are any holders - if len(lock.Holders) > 0 { - return ErrSemaphoreInUse - } - - // Attempt the delete - didRemove, _, err := kv.DeleteCAS(lockPair, nil) - if err != nil { - return fmt.Errorf("failed to remove semaphore: %v", err) - } - if !didRemove { - return ErrSemaphoreInUse - } - return nil -} - -// createSession is used to create a new managed session -func (s *Semaphore) createSession() (string, error) { - session := s.c.Session() - se := &SessionEntry{ - Name: s.opts.SessionName, - TTL: s.opts.SessionTTL, - Behavior: SessionBehaviorDelete, - } - id, _, err := session.Create(se, nil) - if err != nil { - return "", err - } - return id, nil -} - -// contenderEntry returns a formatted KVPair for the contender -func (s *Semaphore) contenderEntry(session string) *KVPair { - return &KVPair{ - Key: path.Join(s.opts.Prefix, session), - Value: s.opts.Value, - Session: session, - Flags: SemaphoreFlagValue, - } -} - -// findLock is used to find the KV Pair which is used for coordination -func (s *Semaphore) findLock(pairs KVPairs) *KVPair { - key := path.Join(s.opts.Prefix, DefaultSemaphoreKey) - for _, pair := range pairs { - if pair.Key == key { - return pair - } - } - return &KVPair{Flags: SemaphoreFlagValue} -} - -// decodeLock is used to decode a semaphoreLock from an -// entry in Consul -func (s *Semaphore) decodeLock(pair *KVPair) (*semaphoreLock, error) { - // Handle if there is no lock - if pair == nil || pair.Value == nil { - return &semaphoreLock{ - Limit: s.opts.Limit, - Holders: make(map[string]bool), - }, nil - } - - l := &semaphoreLock{} - if err := json.Unmarshal(pair.Value, l); err != nil { - return nil, fmt.Errorf("lock decoding failed: %v", err) - } - return l, nil -} - -// encodeLock is used to encode a semaphoreLock into a KVPair -// that can be PUT -func (s *Semaphore) encodeLock(l *semaphoreLock, oldIndex uint64) (*KVPair, error) { - enc, err := json.Marshal(l) - if err != nil { - return nil, fmt.Errorf("lock encoding failed: %v", err) - } - pair := &KVPair{ - Key: path.Join(s.opts.Prefix, DefaultSemaphoreKey), - Value: enc, - Flags: SemaphoreFlagValue, - ModifyIndex: oldIndex, - } - return pair, nil -} - -// pruneDeadHolders is used to remove all the dead lock holders -func (s *Semaphore) pruneDeadHolders(lock *semaphoreLock, pairs KVPairs) { - // Gather all the live holders - alive := make(map[string]struct{}, len(pairs)) - for _, pair := range pairs { - if pair.Session != "" { - alive[pair.Session] = struct{}{} - } - } - - // Remove any holders that are dead - for holder := range lock.Holders { - if _, ok := alive[holder]; !ok { - delete(lock.Holders, holder) - } - } -} - -// monitorLock is a long running routine to monitor a semaphore ownership -// It closes the stopCh if we lose our slot. -func (s *Semaphore) monitorLock(session string, stopCh chan struct{}) { - defer close(stopCh) - kv := s.c.KV() - opts := &QueryOptions{RequireConsistent: true} -WAIT: - retries := s.opts.MonitorRetries -RETRY: - pairs, meta, err := kv.List(s.opts.Prefix, opts) - if err != nil { - // If configured we can try to ride out a brief Consul unavailability - // by doing retries. Note that we have to attempt the retry in a non- - // blocking fashion so that we have a clean place to reset the retry - // counter if service is restored. - if retries > 0 && IsRetryableError(err) { - time.Sleep(s.opts.MonitorRetryTime) - retries-- - opts.WaitIndex = 0 - goto RETRY - } - return - } - lockPair := s.findLock(pairs) - lock, err := s.decodeLock(lockPair) - if err != nil { - return - } - s.pruneDeadHolders(lock, pairs) - if _, ok := lock.Holders[session]; ok { - opts.WaitIndex = meta.LastIndex - goto WAIT - } -} diff --git a/vendor/github.com/hashicorp/consul/api/session.go b/vendor/github.com/hashicorp/consul/api/session.go deleted file mode 100644 index 1613f11a6..000000000 --- a/vendor/github.com/hashicorp/consul/api/session.go +++ /dev/null @@ -1,224 +0,0 @@ -package api - -import ( - "errors" - "fmt" - "time" -) - -const ( - // SessionBehaviorRelease is the default behavior and causes - // all associated locks to be released on session invalidation. - SessionBehaviorRelease = "release" - - // SessionBehaviorDelete is new in Consul 0.5 and changes the - // behavior to delete all associated locks on session invalidation. - // It can be used in a way similar to Ephemeral Nodes in ZooKeeper. - SessionBehaviorDelete = "delete" -) - -var ErrSessionExpired = errors.New("session expired") - -// SessionEntry represents a session in consul -type SessionEntry struct { - CreateIndex uint64 - ID string - Name string - Node string - Checks []string - LockDelay time.Duration - Behavior string - TTL string -} - -// Session can be used to query the Session endpoints -type Session struct { - c *Client -} - -// Session returns a handle to the session endpoints -func (c *Client) Session() *Session { - return &Session{c} -} - -// CreateNoChecks is like Create but is used specifically to create -// a session with no associated health checks. -func (s *Session) CreateNoChecks(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) { - body := make(map[string]interface{}) - body["Checks"] = []string{} - if se != nil { - if se.Name != "" { - body["Name"] = se.Name - } - if se.Node != "" { - body["Node"] = se.Node - } - if se.LockDelay != 0 { - body["LockDelay"] = durToMsec(se.LockDelay) - } - if se.Behavior != "" { - body["Behavior"] = se.Behavior - } - if se.TTL != "" { - body["TTL"] = se.TTL - } - } - return s.create(body, q) - -} - -// Create makes a new session. Providing a session entry can -// customize the session. It can also be nil to use defaults. -func (s *Session) Create(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) { - var obj interface{} - if se != nil { - body := make(map[string]interface{}) - obj = body - if se.Name != "" { - body["Name"] = se.Name - } - if se.Node != "" { - body["Node"] = se.Node - } - if se.LockDelay != 0 { - body["LockDelay"] = durToMsec(se.LockDelay) - } - if len(se.Checks) > 0 { - body["Checks"] = se.Checks - } - if se.Behavior != "" { - body["Behavior"] = se.Behavior - } - if se.TTL != "" { - body["TTL"] = se.TTL - } - } - return s.create(obj, q) -} - -func (s *Session) create(obj interface{}, q *WriteOptions) (string, *WriteMeta, error) { - var out struct{ ID string } - wm, err := s.c.write("/v1/session/create", obj, &out, q) - if err != nil { - return "", nil, err - } - return out.ID, wm, nil -} - -// Destroy invalidates a given session -func (s *Session) Destroy(id string, q *WriteOptions) (*WriteMeta, error) { - wm, err := s.c.write("/v1/session/destroy/"+id, nil, nil, q) - if err != nil { - return nil, err - } - return wm, nil -} - -// Renew renews the TTL on a given session -func (s *Session) Renew(id string, q *WriteOptions) (*SessionEntry, *WriteMeta, error) { - r := s.c.newRequest("PUT", "/v1/session/renew/"+id) - r.setWriteOptions(q) - rtt, resp, err := s.c.doRequest(r) - if err != nil { - return nil, nil, err - } - defer resp.Body.Close() - - wm := &WriteMeta{RequestTime: rtt} - - if resp.StatusCode == 404 { - return nil, wm, nil - } else if resp.StatusCode != 200 { - return nil, nil, fmt.Errorf("Unexpected response code: %d", resp.StatusCode) - } - - var entries []*SessionEntry - if err := decodeBody(resp, &entries); err != nil { - return nil, nil, fmt.Errorf("Failed to read response: %v", err) - } - if len(entries) > 0 { - return entries[0], wm, nil - } - return nil, wm, nil -} - -// RenewPeriodic is used to periodically invoke Session.Renew on a -// session until a doneCh is closed. This is meant to be used in a long running -// goroutine to ensure a session stays valid. -func (s *Session) RenewPeriodic(initialTTL string, id string, q *WriteOptions, doneCh <-chan struct{}) error { - ctx := q.Context() - - ttl, err := time.ParseDuration(initialTTL) - if err != nil { - return err - } - - waitDur := ttl / 2 - lastRenewTime := time.Now() - var lastErr error - for { - if time.Since(lastRenewTime) > ttl { - return lastErr - } - select { - case <-time.After(waitDur): - entry, _, err := s.Renew(id, q) - if err != nil { - waitDur = time.Second - lastErr = err - continue - } - if entry == nil { - return ErrSessionExpired - } - - // Handle the server updating the TTL - ttl, _ = time.ParseDuration(entry.TTL) - waitDur = ttl / 2 - lastRenewTime = time.Now() - - case <-doneCh: - // Attempt a session destroy - s.Destroy(id, q) - return nil - - case <-ctx.Done(): - // Bail immediately since attempting the destroy would - // use the canceled context in q, which would just bail. - return ctx.Err() - } - } -} - -// Info looks up a single session -func (s *Session) Info(id string, q *QueryOptions) (*SessionEntry, *QueryMeta, error) { - var entries []*SessionEntry - qm, err := s.c.query("/v1/session/info/"+id, &entries, q) - if err != nil { - return nil, nil, err - } - if len(entries) > 0 { - return entries[0], qm, nil - } - return nil, qm, nil -} - -// List gets sessions for a node -func (s *Session) Node(node string, q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) { - var entries []*SessionEntry - qm, err := s.c.query("/v1/session/node/"+node, &entries, q) - if err != nil { - return nil, nil, err - } - return entries, qm, nil -} - -// List gets all active sessions -func (s *Session) List(q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) { - var entries []*SessionEntry - qm, err := s.c.query("/v1/session/list", &entries, q) - if err != nil { - return nil, nil, err - } - return entries, qm, nil -} diff --git a/vendor/github.com/hashicorp/consul/api/snapshot.go b/vendor/github.com/hashicorp/consul/api/snapshot.go deleted file mode 100644 index e902377dd..000000000 --- a/vendor/github.com/hashicorp/consul/api/snapshot.go +++ /dev/null @@ -1,47 +0,0 @@ -package api - -import ( - "io" -) - -// Snapshot can be used to query the /v1/snapshot endpoint to take snapshots of -// Consul's internal state and restore snapshots for disaster recovery. -type Snapshot struct { - c *Client -} - -// Snapshot returns a handle that exposes the snapshot endpoints. -func (c *Client) Snapshot() *Snapshot { - return &Snapshot{c} -} - -// Save requests a new snapshot and provides an io.ReadCloser with the snapshot -// data to save. If this doesn't return an error, then it's the responsibility -// of the caller to close it. Only a subset of the QueryOptions are supported: -// Datacenter, AllowStale, and Token. -func (s *Snapshot) Save(q *QueryOptions) (io.ReadCloser, *QueryMeta, error) { - r := s.c.newRequest("GET", "/v1/snapshot") - r.setQueryOptions(q) - - rtt, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, nil, err - } - - qm := &QueryMeta{} - parseQueryMeta(resp, qm) - qm.RequestTime = rtt - return resp.Body, qm, nil -} - -// Restore streams in an existing snapshot and attempts to restore it. -func (s *Snapshot) Restore(q *WriteOptions, in io.Reader) error { - r := s.c.newRequest("PUT", "/v1/snapshot") - r.body = in - r.setWriteOptions(q) - _, _, err := requireOK(s.c.doRequest(r)) - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/hashicorp/consul/api/status.go b/vendor/github.com/hashicorp/consul/api/status.go deleted file mode 100644 index 74ef61a67..000000000 --- a/vendor/github.com/hashicorp/consul/api/status.go +++ /dev/null @@ -1,43 +0,0 @@ -package api - -// Status can be used to query the Status endpoints -type Status struct { - c *Client -} - -// Status returns a handle to the status endpoints -func (c *Client) Status() *Status { - return &Status{c} -} - -// Leader is used to query for a known leader -func (s *Status) Leader() (string, error) { - r := s.c.newRequest("GET", "/v1/status/leader") - _, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return "", err - } - defer resp.Body.Close() - - var leader string - if err := decodeBody(resp, &leader); err != nil { - return "", err - } - return leader, nil -} - -// Peers is used to query for a known raft peers -func (s *Status) Peers() ([]string, error) { - r := s.c.newRequest("GET", "/v1/status/peers") - _, resp, err := requireOK(s.c.doRequest(r)) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var peers []string - if err := decodeBody(resp, &peers); err != nil { - return nil, err - } - return peers, nil -} diff --git a/vendor/github.com/hashicorp/consul/website/LICENSE.md b/vendor/github.com/hashicorp/consul/website/LICENSE.md deleted file mode 100644 index 3189f43a6..000000000 --- a/vendor/github.com/hashicorp/consul/website/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -# Proprietary License - -This license is temporary while a more official one is drafted. However, -this should make it clear: - -The text contents of this website are MPL 2.0 licensed. - -The design contents of this website are proprietary and may not be reproduced -or reused in any way other than to run the website locally. The license for -the design is owned solely by HashiCorp, Inc. diff --git a/vendor/github.com/hashicorp/go-cleanhttp/LICENSE b/vendor/github.com/hashicorp/go-cleanhttp/LICENSE deleted file mode 100644 index e87a115e4..000000000 --- a/vendor/github.com/hashicorp/go-cleanhttp/LICENSE +++ /dev/null @@ -1,363 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go b/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go deleted file mode 100644 index 7d8a57c28..000000000 --- a/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go +++ /dev/null @@ -1,56 +0,0 @@ -package cleanhttp - -import ( - "net" - "net/http" - "runtime" - "time" -) - -// DefaultTransport returns a new http.Transport with similar default values to -// http.DefaultTransport, but with idle connections and keepalives disabled. -func DefaultTransport() *http.Transport { - transport := DefaultPooledTransport() - transport.DisableKeepAlives = true - transport.MaxIdleConnsPerHost = -1 - return transport -} - -// DefaultPooledTransport returns a new http.Transport with similar default -// values to http.DefaultTransport. Do not use this for transient transports as -// it can leak file descriptors over time. Only use this for transports that -// will be re-used for the same host(s). -func DefaultPooledTransport() *http.Transport { - transport := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).DialContext, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1, - } - return transport -} - -// DefaultClient returns a new http.Client with similar default values to -// http.Client, but with a non-shared Transport, idle connections disabled, and -// keepalives disabled. -func DefaultClient() *http.Client { - return &http.Client{ - Transport: DefaultTransport(), - } -} - -// DefaultPooledClient returns a new http.Client with similar default values to -// http.Client, but with a shared Transport. Do not use this function for -// transient clients as it can leak file descriptors over time. Only use this -// for clients that will be re-used for the same host(s). -func DefaultPooledClient() *http.Client { - return &http.Client{ - Transport: DefaultPooledTransport(), - } -} diff --git a/vendor/github.com/hashicorp/go-cleanhttp/doc.go b/vendor/github.com/hashicorp/go-cleanhttp/doc.go deleted file mode 100644 index 05841092a..000000000 --- a/vendor/github.com/hashicorp/go-cleanhttp/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Package cleanhttp offers convenience utilities for acquiring "clean" -// http.Transport and http.Client structs. -// -// Values set on http.DefaultClient and http.DefaultTransport affect all -// callers. This can have detrimental effects, esepcially in TLS contexts, -// where client or root certificates set to talk to multiple endpoints can end -// up displacing each other, leading to hard-to-debug issues. This package -// provides non-shared http.Client and http.Transport structs to ensure that -// the configuration will not be overwritten by other parts of the application -// or dependencies. -// -// The DefaultClient and DefaultTransport functions disable idle connections -// and keepalives. Without ensuring that idle connections are closed before -// garbage collection, short-term clients/transports can leak file descriptors, -// eventually leading to "too many open files" errors. If you will be -// connecting to the same hosts repeatedly from the same client, you can use -// DefaultPooledClient to receive a client that has connection pooling -// semantics similar to http.DefaultClient. -// -package cleanhttp diff --git a/vendor/github.com/hashicorp/go-rootcerts/LICENSE b/vendor/github.com/hashicorp/go-rootcerts/LICENSE deleted file mode 100644 index e87a115e4..000000000 --- a/vendor/github.com/hashicorp/go-rootcerts/LICENSE +++ /dev/null @@ -1,363 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/hashicorp/go-rootcerts/doc.go b/vendor/github.com/hashicorp/go-rootcerts/doc.go deleted file mode 100644 index b55cc6284..000000000 --- a/vendor/github.com/hashicorp/go-rootcerts/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Package rootcerts contains functions to aid in loading CA certificates for -// TLS connections. -// -// In addition, its default behavior on Darwin works around an open issue [1] -// in Go's crypto/x509 that prevents certicates from being loaded from the -// System or Login keychains. -// -// [1] https://github.com/golang/go/issues/14514 -package rootcerts diff --git a/vendor/github.com/hashicorp/go-rootcerts/rootcerts.go b/vendor/github.com/hashicorp/go-rootcerts/rootcerts.go deleted file mode 100644 index aeb30ece3..000000000 --- a/vendor/github.com/hashicorp/go-rootcerts/rootcerts.go +++ /dev/null @@ -1,103 +0,0 @@ -package rootcerts - -import ( - "crypto/tls" - "crypto/x509" - "fmt" - "io/ioutil" - "os" - "path/filepath" -) - -// Config determines where LoadCACerts will load certificates from. When both -// CAFile and CAPath are blank, this library's functions will either load -// system roots explicitly and return them, or set the CertPool to nil to allow -// Go's standard library to load system certs. -type Config struct { - // CAFile is a path to a PEM-encoded certificate file or bundle. Takes - // precedence over CAPath. - CAFile string - - // CAPath is a path to a directory populated with PEM-encoded certificates. - CAPath string -} - -// ConfigureTLS sets up the RootCAs on the provided tls.Config based on the -// Config specified. -func ConfigureTLS(t *tls.Config, c *Config) error { - if t == nil { - return nil - } - pool, err := LoadCACerts(c) - if err != nil { - return err - } - t.RootCAs = pool - return nil -} - -// LoadCACerts loads a CertPool based on the Config specified. -func LoadCACerts(c *Config) (*x509.CertPool, error) { - if c == nil { - c = &Config{} - } - if c.CAFile != "" { - return LoadCAFile(c.CAFile) - } - if c.CAPath != "" { - return LoadCAPath(c.CAPath) - } - - return LoadSystemCAs() -} - -// LoadCAFile loads a single PEM-encoded file from the path specified. -func LoadCAFile(caFile string) (*x509.CertPool, error) { - pool := x509.NewCertPool() - - pem, err := ioutil.ReadFile(caFile) - if err != nil { - return nil, fmt.Errorf("Error loading CA File: %s", err) - } - - ok := pool.AppendCertsFromPEM(pem) - if !ok { - return nil, fmt.Errorf("Error loading CA File: Couldn't parse PEM in: %s", caFile) - } - - return pool, nil -} - -// LoadCAPath walks the provided path and loads all certificates encounted into -// a pool. -func LoadCAPath(caPath string) (*x509.CertPool, error) { - pool := x509.NewCertPool() - walkFn := func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - if info.IsDir() { - return nil - } - - pem, err := ioutil.ReadFile(path) - if err != nil { - return fmt.Errorf("Error loading file from CAPath: %s", err) - } - - ok := pool.AppendCertsFromPEM(pem) - if !ok { - return fmt.Errorf("Error loading CA Path: Couldn't parse PEM in: %s", path) - } - - return nil - } - - err := filepath.Walk(caPath, walkFn) - if err != nil { - return nil, err - } - - return pool, nil -} diff --git a/vendor/github.com/hashicorp/go-rootcerts/rootcerts_base.go b/vendor/github.com/hashicorp/go-rootcerts/rootcerts_base.go deleted file mode 100644 index 66b1472c4..000000000 --- a/vendor/github.com/hashicorp/go-rootcerts/rootcerts_base.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build !darwin - -package rootcerts - -import "crypto/x509" - -// LoadSystemCAs does nothing on non-Darwin systems. We return nil so that -// default behavior of standard TLS config libraries is triggered, which is to -// load system certs. -func LoadSystemCAs() (*x509.CertPool, error) { - return nil, nil -} diff --git a/vendor/github.com/hashicorp/go-rootcerts/rootcerts_darwin.go b/vendor/github.com/hashicorp/go-rootcerts/rootcerts_darwin.go deleted file mode 100644 index a9a040657..000000000 --- a/vendor/github.com/hashicorp/go-rootcerts/rootcerts_darwin.go +++ /dev/null @@ -1,48 +0,0 @@ -package rootcerts - -import ( - "crypto/x509" - "os/exec" - "path" - - "github.com/mitchellh/go-homedir" -) - -// LoadSystemCAs has special behavior on Darwin systems to work around -func LoadSystemCAs() (*x509.CertPool, error) { - pool := x509.NewCertPool() - - for _, keychain := range certKeychains() { - err := addCertsFromKeychain(pool, keychain) - if err != nil { - return nil, err - } - } - - return pool, nil -} - -func addCertsFromKeychain(pool *x509.CertPool, keychain string) error { - cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", keychain) - data, err := cmd.Output() - if err != nil { - return err - } - - pool.AppendCertsFromPEM(data) - - return nil -} - -func certKeychains() []string { - keychains := []string{ - "/System/Library/Keychains/SystemRootCertificates.keychain", - "/Library/Keychains/System.keychain", - } - home, err := homedir.Dir() - if err == nil { - loginKeychain := path.Join(home, "Library", "Keychains", "login.keychain") - keychains = append(keychains, loginKeychain) - } - return keychains -} diff --git a/vendor/github.com/hashicorp/serf/LICENSE b/vendor/github.com/hashicorp/serf/LICENSE deleted file mode 100644 index c33dcc7c9..000000000 --- a/vendor/github.com/hashicorp/serf/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/hashicorp/serf/coordinate/client.go b/vendor/github.com/hashicorp/serf/coordinate/client.go deleted file mode 100644 index 613bfff89..000000000 --- a/vendor/github.com/hashicorp/serf/coordinate/client.go +++ /dev/null @@ -1,180 +0,0 @@ -package coordinate - -import ( - "fmt" - "math" - "sort" - "sync" - "time" -) - -// Client manages the estimated network coordinate for a given node, and adjusts -// it as the node observes round trip times and estimated coordinates from other -// nodes. The core algorithm is based on Vivaldi, see the documentation for Config -// for more details. -type Client struct { - // coord is the current estimate of the client's network coordinate. - coord *Coordinate - - // origin is a coordinate sitting at the origin. - origin *Coordinate - - // config contains the tuning parameters that govern the performance of - // the algorithm. - config *Config - - // adjustmentIndex is the current index into the adjustmentSamples slice. - adjustmentIndex uint - - // adjustment is used to store samples for the adjustment calculation. - adjustmentSamples []float64 - - // latencyFilterSamples is used to store the last several RTT samples, - // keyed by node name. We will use the config's LatencyFilterSamples - // value to determine how many samples we keep, per node. - latencyFilterSamples map[string][]float64 - - // mutex enables safe concurrent access to the client. - mutex sync.RWMutex -} - -// NewClient creates a new Client and verifies the configuration is valid. -func NewClient(config *Config) (*Client, error) { - if !(config.Dimensionality > 0) { - return nil, fmt.Errorf("dimensionality must be >0") - } - - return &Client{ - coord: NewCoordinate(config), - origin: NewCoordinate(config), - config: config, - adjustmentIndex: 0, - adjustmentSamples: make([]float64, config.AdjustmentWindowSize), - latencyFilterSamples: make(map[string][]float64), - }, nil -} - -// GetCoordinate returns a copy of the coordinate for this client. -func (c *Client) GetCoordinate() *Coordinate { - c.mutex.RLock() - defer c.mutex.RUnlock() - - return c.coord.Clone() -} - -// SetCoordinate forces the client's coordinate to a known state. -func (c *Client) SetCoordinate(coord *Coordinate) { - c.mutex.Lock() - defer c.mutex.Unlock() - - c.coord = coord.Clone() -} - -// ForgetNode removes any client state for the given node. -func (c *Client) ForgetNode(node string) { - c.mutex.Lock() - defer c.mutex.Unlock() - - delete(c.latencyFilterSamples, node) -} - -// latencyFilter applies a simple moving median filter with a new sample for -// a node. This assumes that the mutex has been locked already. -func (c *Client) latencyFilter(node string, rttSeconds float64) float64 { - samples, ok := c.latencyFilterSamples[node] - if !ok { - samples = make([]float64, 0, c.config.LatencyFilterSize) - } - - // Add the new sample and trim the list, if needed. - samples = append(samples, rttSeconds) - if len(samples) > int(c.config.LatencyFilterSize) { - samples = samples[1:] - } - c.latencyFilterSamples[node] = samples - - // Sort a copy of the samples and return the median. - sorted := make([]float64, len(samples)) - copy(sorted, samples) - sort.Float64s(sorted) - return sorted[len(sorted)/2] -} - -// updateVivialdi updates the Vivaldi portion of the client's coordinate. This -// assumes that the mutex has been locked already. -func (c *Client) updateVivaldi(other *Coordinate, rttSeconds float64) { - const zeroThreshold = 1.0e-6 - - dist := c.coord.DistanceTo(other).Seconds() - if rttSeconds < zeroThreshold { - rttSeconds = zeroThreshold - } - wrongness := math.Abs(dist-rttSeconds) / rttSeconds - - totalError := c.coord.Error + other.Error - if totalError < zeroThreshold { - totalError = zeroThreshold - } - weight := c.coord.Error / totalError - - c.coord.Error = c.config.VivaldiCE*weight*wrongness + c.coord.Error*(1.0-c.config.VivaldiCE*weight) - if c.coord.Error > c.config.VivaldiErrorMax { - c.coord.Error = c.config.VivaldiErrorMax - } - - delta := c.config.VivaldiCC * weight - force := delta * (rttSeconds - dist) - c.coord = c.coord.ApplyForce(c.config, force, other) -} - -// updateAdjustment updates the adjustment portion of the client's coordinate, if -// the feature is enabled. This assumes that the mutex has been locked already. -func (c *Client) updateAdjustment(other *Coordinate, rttSeconds float64) { - if c.config.AdjustmentWindowSize == 0 { - return - } - - // Note that the existing adjustment factors don't figure in to this - // calculation so we use the raw distance here. - dist := c.coord.rawDistanceTo(other) - c.adjustmentSamples[c.adjustmentIndex] = rttSeconds - dist - c.adjustmentIndex = (c.adjustmentIndex + 1) % c.config.AdjustmentWindowSize - - sum := 0.0 - for _, sample := range c.adjustmentSamples { - sum += sample - } - c.coord.Adjustment = sum / (2.0 * float64(c.config.AdjustmentWindowSize)) -} - -// updateGravity applies a small amount of gravity to pull coordinates towards -// the center of the coordinate system to combat drift. This assumes that the -// mutex is locked already. -func (c *Client) updateGravity() { - dist := c.origin.DistanceTo(c.coord).Seconds() - force := -1.0 * math.Pow(dist/c.config.GravityRho, 2.0) - c.coord = c.coord.ApplyForce(c.config, force, c.origin) -} - -// Update takes other, a coordinate for another node, and rtt, a round trip -// time observation for a ping to that node, and updates the estimated position of -// the client's coordinate. Returns the updated coordinate. -func (c *Client) Update(node string, other *Coordinate, rtt time.Duration) *Coordinate { - c.mutex.Lock() - defer c.mutex.Unlock() - - rttSeconds := c.latencyFilter(node, rtt.Seconds()) - c.updateVivaldi(other, rttSeconds) - c.updateAdjustment(other, rttSeconds) - c.updateGravity() - return c.coord.Clone() -} - -// DistanceTo returns the estimated RTT from the client's coordinate to other, the -// coordinate for another node. -func (c *Client) DistanceTo(other *Coordinate) time.Duration { - c.mutex.RLock() - defer c.mutex.RUnlock() - - return c.coord.DistanceTo(other) -} diff --git a/vendor/github.com/hashicorp/serf/coordinate/config.go b/vendor/github.com/hashicorp/serf/coordinate/config.go deleted file mode 100644 index b85a8ab7b..000000000 --- a/vendor/github.com/hashicorp/serf/coordinate/config.go +++ /dev/null @@ -1,70 +0,0 @@ -package coordinate - -// Config is used to set the parameters of the Vivaldi-based coordinate mapping -// algorithm. -// -// The following references are called out at various points in the documentation -// here: -// -// [1] Dabek, Frank, et al. "Vivaldi: A decentralized network coordinate system." -// ACM SIGCOMM Computer Communication Review. Vol. 34. No. 4. ACM, 2004. -// [2] Ledlie, Jonathan, Paul Gardner, and Margo I. Seltzer. "Network Coordinates -// in the Wild." NSDI. Vol. 7. 2007. -// [3] Lee, Sanghwan, et al. "On suitability of Euclidean embedding for -// host-based network coordinate systems." Networking, IEEE/ACM Transactions -// on 18.1 (2010): 27-40. -type Config struct { - // The dimensionality of the coordinate system. As discussed in [2], more - // dimensions improves the accuracy of the estimates up to a point. Per [2] - // we chose 8 dimensions plus a non-Euclidean height. - Dimensionality uint - - // VivaldiErrorMax is the default error value when a node hasn't yet made - // any observations. It also serves as an upper limit on the error value in - // case observations cause the error value to increase without bound. - VivaldiErrorMax float64 - - // VivaldiCE is a tuning factor that controls the maximum impact an - // observation can have on a node's confidence. See [1] for more details. - VivaldiCE float64 - - // VivaldiCC is a tuning factor that controls the maximum impact an - // observation can have on a node's coordinate. See [1] for more details. - VivaldiCC float64 - - // AdjustmentWindowSize is a tuning factor that determines how many samples - // we retain to calculate the adjustment factor as discussed in [3]. Setting - // this to zero disables this feature. - AdjustmentWindowSize uint - - // HeightMin is the minimum value of the height parameter. Since this - // always must be positive, it will introduce a small amount error, so - // the chosen value should be relatively small compared to "normal" - // coordinates. - HeightMin float64 - - // LatencyFilterSamples is the maximum number of samples that are retained - // per node, in order to compute a median. The intent is to ride out blips - // but still keep the delay low, since our time to probe any given node is - // pretty infrequent. See [2] for more details. - LatencyFilterSize uint - - // GravityRho is a tuning factor that sets how much gravity has an effect - // to try to re-center coordinates. See [2] for more details. - GravityRho float64 -} - -// DefaultConfig returns a Config that has some default values suitable for -// basic testing of the algorithm, but not tuned to any particular type of cluster. -func DefaultConfig() *Config { - return &Config{ - Dimensionality: 8, - VivaldiErrorMax: 1.5, - VivaldiCE: 0.25, - VivaldiCC: 0.25, - AdjustmentWindowSize: 20, - HeightMin: 10.0e-6, - LatencyFilterSize: 3, - GravityRho: 150.0, - } -} diff --git a/vendor/github.com/hashicorp/serf/coordinate/coordinate.go b/vendor/github.com/hashicorp/serf/coordinate/coordinate.go deleted file mode 100644 index c9194e048..000000000 --- a/vendor/github.com/hashicorp/serf/coordinate/coordinate.go +++ /dev/null @@ -1,183 +0,0 @@ -package coordinate - -import ( - "math" - "math/rand" - "time" -) - -// Coordinate is a specialized structure for holding network coordinates for the -// Vivaldi-based coordinate mapping algorithm. All of the fields should be public -// to enable this to be serialized. All values in here are in units of seconds. -type Coordinate struct { - // Vec is the Euclidean portion of the coordinate. This is used along - // with the other fields to provide an overall distance estimate. The - // units here are seconds. - Vec []float64 - - // Err reflects the confidence in the given coordinate and is updated - // dynamically by the Vivaldi Client. This is dimensionless. - Error float64 - - // Adjustment is a distance offset computed based on a calculation over - // observations from all other nodes over a fixed window and is updated - // dynamically by the Vivaldi Client. The units here are seconds. - Adjustment float64 - - // Height is a distance offset that accounts for non-Euclidean effects - // which model the access links from nodes to the core Internet. The access - // links are usually set by bandwidth and congestion, and the core links - // usually follow distance based on geography. - Height float64 -} - -const ( - // secondsToNanoseconds is used to convert float seconds to nanoseconds. - secondsToNanoseconds = 1.0e9 - - // zeroThreshold is used to decide if two coordinates are on top of each - // other. - zeroThreshold = 1.0e-6 -) - -// ErrDimensionalityConflict will be panic-d if you try to perform operations -// with incompatible dimensions. -type DimensionalityConflictError struct{} - -// Adds the error interface. -func (e DimensionalityConflictError) Error() string { - return "coordinate dimensionality does not match" -} - -// NewCoordinate creates a new coordinate at the origin, using the given config -// to supply key initial values. -func NewCoordinate(config *Config) *Coordinate { - return &Coordinate{ - Vec: make([]float64, config.Dimensionality), - Error: config.VivaldiErrorMax, - Adjustment: 0.0, - Height: config.HeightMin, - } -} - -// Clone creates an independent copy of this coordinate. -func (c *Coordinate) Clone() *Coordinate { - vec := make([]float64, len(c.Vec)) - copy(vec, c.Vec) - return &Coordinate{ - Vec: vec, - Error: c.Error, - Adjustment: c.Adjustment, - Height: c.Height, - } -} - -// IsCompatibleWith checks to see if the two coordinates are compatible -// dimensionally. If this returns true then you are guaranteed to not get -// any runtime errors operating on them. -func (c *Coordinate) IsCompatibleWith(other *Coordinate) bool { - return len(c.Vec) == len(other.Vec) -} - -// ApplyForce returns the result of applying the force from the direction of the -// other coordinate. -func (c *Coordinate) ApplyForce(config *Config, force float64, other *Coordinate) *Coordinate { - if !c.IsCompatibleWith(other) { - panic(DimensionalityConflictError{}) - } - - ret := c.Clone() - unit, mag := unitVectorAt(c.Vec, other.Vec) - ret.Vec = add(ret.Vec, mul(unit, force)) - if mag > zeroThreshold { - ret.Height = (ret.Height+other.Height)*force/mag + ret.Height - ret.Height = math.Max(ret.Height, config.HeightMin) - } - return ret -} - -// DistanceTo returns the distance between this coordinate and the other -// coordinate, including adjustments. -func (c *Coordinate) DistanceTo(other *Coordinate) time.Duration { - if !c.IsCompatibleWith(other) { - panic(DimensionalityConflictError{}) - } - - dist := c.rawDistanceTo(other) - adjustedDist := dist + c.Adjustment + other.Adjustment - if adjustedDist > 0.0 { - dist = adjustedDist - } - return time.Duration(dist * secondsToNanoseconds) -} - -// rawDistanceTo returns the Vivaldi distance between this coordinate and the -// other coordinate in seconds, not including adjustments. This assumes the -// dimensions have already been checked to be compatible. -func (c *Coordinate) rawDistanceTo(other *Coordinate) float64 { - return magnitude(diff(c.Vec, other.Vec)) + c.Height + other.Height -} - -// add returns the sum of vec1 and vec2. This assumes the dimensions have -// already been checked to be compatible. -func add(vec1 []float64, vec2 []float64) []float64 { - ret := make([]float64, len(vec1)) - for i, _ := range ret { - ret[i] = vec1[i] + vec2[i] - } - return ret -} - -// diff returns the difference between the vec1 and vec2. This assumes the -// dimensions have already been checked to be compatible. -func diff(vec1 []float64, vec2 []float64) []float64 { - ret := make([]float64, len(vec1)) - for i, _ := range ret { - ret[i] = vec1[i] - vec2[i] - } - return ret -} - -// mul returns vec multiplied by a scalar factor. -func mul(vec []float64, factor float64) []float64 { - ret := make([]float64, len(vec)) - for i, _ := range vec { - ret[i] = vec[i] * factor - } - return ret -} - -// magnitude computes the magnitude of the vec. -func magnitude(vec []float64) float64 { - sum := 0.0 - for i, _ := range vec { - sum += vec[i] * vec[i] - } - return math.Sqrt(sum) -} - -// unitVectorAt returns a unit vector pointing at vec1 from vec2. If the two -// positions are the same then a random unit vector is returned. We also return -// the distance between the points for use in the later height calculation. -func unitVectorAt(vec1 []float64, vec2 []float64) ([]float64, float64) { - ret := diff(vec1, vec2) - - // If the coordinates aren't on top of each other we can normalize. - if mag := magnitude(ret); mag > zeroThreshold { - return mul(ret, 1.0/mag), mag - } - - // Otherwise, just return a random unit vector. - for i, _ := range ret { - ret[i] = rand.Float64() - 0.5 - } - if mag := magnitude(ret); mag > zeroThreshold { - return mul(ret, 1.0/mag), 0.0 - } - - // And finally just give up and make a unit vector along the first - // dimension. This should be exceedingly rare. - ret = make([]float64, len(ret)) - ret[0] = 1.0 - return ret, 0.0 -} diff --git a/vendor/github.com/hashicorp/serf/coordinate/phantom.go b/vendor/github.com/hashicorp/serf/coordinate/phantom.go deleted file mode 100644 index 6fb033c0c..000000000 --- a/vendor/github.com/hashicorp/serf/coordinate/phantom.go +++ /dev/null @@ -1,187 +0,0 @@ -package coordinate - -import ( - "fmt" - "math" - "math/rand" - "time" -) - -// GenerateClients returns a slice with nodes number of clients, all with the -// given config. -func GenerateClients(nodes int, config *Config) ([]*Client, error) { - clients := make([]*Client, nodes) - for i, _ := range clients { - client, err := NewClient(config) - if err != nil { - return nil, err - } - - clients[i] = client - } - return clients, nil -} - -// GenerateLine returns a truth matrix as if all the nodes are in a straight linke -// with the given spacing between them. -func GenerateLine(nodes int, spacing time.Duration) [][]time.Duration { - truth := make([][]time.Duration, nodes) - for i := range truth { - truth[i] = make([]time.Duration, nodes) - } - - for i := 0; i < nodes; i++ { - for j := i + 1; j < nodes; j++ { - rtt := time.Duration(j-i) * spacing - truth[i][j], truth[j][i] = rtt, rtt - } - } - return truth -} - -// GenerateGrid returns a truth matrix as if all the nodes are in a two dimensional -// grid with the given spacing between them. -func GenerateGrid(nodes int, spacing time.Duration) [][]time.Duration { - truth := make([][]time.Duration, nodes) - for i := range truth { - truth[i] = make([]time.Duration, nodes) - } - - n := int(math.Sqrt(float64(nodes))) - for i := 0; i < nodes; i++ { - for j := i + 1; j < nodes; j++ { - x1, y1 := float64(i%n), float64(i/n) - x2, y2 := float64(j%n), float64(j/n) - dx, dy := x2-x1, y2-y1 - dist := math.Sqrt(dx*dx + dy*dy) - rtt := time.Duration(dist * float64(spacing)) - truth[i][j], truth[j][i] = rtt, rtt - } - } - return truth -} - -// GenerateSplit returns a truth matrix as if half the nodes are close together in -// one location and half the nodes are close together in another. The lan factor -// is used to separate the nodes locally and the wan factor represents the split -// between the two sides. -func GenerateSplit(nodes int, lan time.Duration, wan time.Duration) [][]time.Duration { - truth := make([][]time.Duration, nodes) - for i := range truth { - truth[i] = make([]time.Duration, nodes) - } - - split := nodes / 2 - for i := 0; i < nodes; i++ { - for j := i + 1; j < nodes; j++ { - rtt := lan - if (i <= split && j > split) || (i > split && j <= split) { - rtt += wan - } - truth[i][j], truth[j][i] = rtt, rtt - } - } - return truth -} - -// GenerateCircle returns a truth matrix for a set of nodes, evenly distributed -// around a circle with the given radius. The first node is at the "center" of the -// circle because it's equidistant from all the other nodes, but we place it at -// double the radius, so it should show up above all the other nodes in height. -func GenerateCircle(nodes int, radius time.Duration) [][]time.Duration { - truth := make([][]time.Duration, nodes) - for i := range truth { - truth[i] = make([]time.Duration, nodes) - } - - for i := 0; i < nodes; i++ { - for j := i + 1; j < nodes; j++ { - var rtt time.Duration - if i == 0 { - rtt = 2 * radius - } else { - t1 := 2.0 * math.Pi * float64(i) / float64(nodes) - x1, y1 := math.Cos(t1), math.Sin(t1) - t2 := 2.0 * math.Pi * float64(j) / float64(nodes) - x2, y2 := math.Cos(t2), math.Sin(t2) - dx, dy := x2-x1, y2-y1 - dist := math.Sqrt(dx*dx + dy*dy) - rtt = time.Duration(dist * float64(radius)) - } - truth[i][j], truth[j][i] = rtt, rtt - } - } - return truth -} - -// GenerateRandom returns a truth matrix for a set of nodes with normally -// distributed delays, with the given mean and deviation. The RNG is re-seeded -// so you always get the same matrix for a given size. -func GenerateRandom(nodes int, mean time.Duration, deviation time.Duration) [][]time.Duration { - rand.Seed(1) - - truth := make([][]time.Duration, nodes) - for i := range truth { - truth[i] = make([]time.Duration, nodes) - } - - for i := 0; i < nodes; i++ { - for j := i + 1; j < nodes; j++ { - rttSeconds := rand.NormFloat64()*deviation.Seconds() + mean.Seconds() - rtt := time.Duration(rttSeconds * secondsToNanoseconds) - truth[i][j], truth[j][i] = rtt, rtt - } - } - return truth -} - -// Simulate runs the given number of cycles using the given list of clients and -// truth matrix. On each cycle, each client will pick a random node and observe -// the truth RTT, updating its coordinate estimate. The RNG is re-seeded for -// each simulation run to get deterministic results (for this algorithm and the -// underlying algorithm which will use random numbers for position vectors when -// starting out with everything at the origin). -func Simulate(clients []*Client, truth [][]time.Duration, cycles int) { - rand.Seed(1) - - nodes := len(clients) - for cycle := 0; cycle < cycles; cycle++ { - for i, _ := range clients { - if j := rand.Intn(nodes); j != i { - c := clients[j].GetCoordinate() - rtt := truth[i][j] - node := fmt.Sprintf("node_%d", j) - clients[i].Update(node, c, rtt) - } - } - } -} - -// Stats is returned from the Evaluate function with a summary of the algorithm -// performance. -type Stats struct { - ErrorMax float64 - ErrorAvg float64 -} - -// Evaluate uses the coordinates of the given clients to calculate estimated -// distances and compares them with the given truth matrix, returning summary -// stats. -func Evaluate(clients []*Client, truth [][]time.Duration) (stats Stats) { - nodes := len(clients) - count := 0 - for i := 0; i < nodes; i++ { - for j := i + 1; j < nodes; j++ { - est := clients[i].DistanceTo(clients[j].GetCoordinate()).Seconds() - actual := truth[i][j].Seconds() - error := math.Abs(est-actual) / actual - stats.ErrorMax = math.Max(stats.ErrorMax, error) - stats.ErrorAvg += error - count += 1 - } - } - - stats.ErrorAvg /= float64(count) - fmt.Printf("Error avg=%9.6f max=%9.6f\n", stats.ErrorAvg, stats.ErrorMax) - return -} diff --git a/vendor/github.com/hashicorp/serf/ops-misc/debian/copyright b/vendor/github.com/hashicorp/serf/ops-misc/debian/copyright deleted file mode 100644 index 21a1a1b53..000000000 --- a/vendor/github.com/hashicorp/serf/ops-misc/debian/copyright +++ /dev/null @@ -1,2 +0,0 @@ -Name: serf -Copyright: Hashicorp 2013 diff --git a/vendor/github.com/hashicorp/serf/website/LICENSE.md b/vendor/github.com/hashicorp/serf/website/LICENSE.md deleted file mode 100644 index 3189f43a6..000000000 --- a/vendor/github.com/hashicorp/serf/website/LICENSE.md +++ /dev/null @@ -1,10 +0,0 @@ -# Proprietary License - -This license is temporary while a more official one is drafted. However, -this should make it clear: - -The text contents of this website are MPL 2.0 licensed. - -The design contents of this website are proprietary and may not be reproduced -or reused in any way other than to run the website locally. The license for -the design is owned solely by HashiCorp, Inc. diff --git a/vendor/github.com/hashicorp/serf/website/source/LICENSE b/vendor/github.com/hashicorp/serf/website/source/LICENSE deleted file mode 100644 index 36c29d7f7..000000000 --- a/vendor/github.com/hashicorp/serf/website/source/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ -# Proprietary License - -This license is temporary while a more official one is drafted. However, -this should make it clear: - -* The text contents of this website are MPL 2.0 licensed. - -* The design contents of this website are proprietary and may not be reproduced - or reused in any way other than to run the Serf website locally. The license - for the design is owned solely by HashiCorp, Inc. diff --git a/vendor/github.com/mattn/go-colorable/LICENSE b/vendor/github.com/mattn/go-colorable/LICENSE deleted file mode 100644 index 91b5cef30..000000000 --- a/vendor/github.com/mattn/go-colorable/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Yasuhiro Matsumoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/mattn/go-colorable/colorable_others.go b/vendor/github.com/mattn/go-colorable/colorable_others.go deleted file mode 100644 index a7fe19a8c..000000000 --- a/vendor/github.com/mattn/go-colorable/colorable_others.go +++ /dev/null @@ -1,27 +0,0 @@ -// +build !windows - -package colorable - -import ( - "io" - "os" -) - -// NewColorable return new instance of Writer which handle escape sequence. -func NewColorable(file *os.File) io.Writer { - if file == nil { - panic("nil passed instead of *os.File to NewColorable()") - } - - return file -} - -// NewColorableStdout return new instance of Writer which handle escape sequence for stdout. -func NewColorableStdout() io.Writer { - return os.Stdout -} - -// NewColorableStderr return new instance of Writer which handle escape sequence for stderr. -func NewColorableStderr() io.Writer { - return os.Stderr -} diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/vendor/github.com/mattn/go-colorable/colorable_windows.go deleted file mode 100644 index 628ad904e..000000000 --- a/vendor/github.com/mattn/go-colorable/colorable_windows.go +++ /dev/null @@ -1,820 +0,0 @@ -package colorable - -import ( - "bytes" - "io" - "math" - "os" - "strconv" - "strings" - "syscall" - "unsafe" - - "github.com/mattn/go-isatty" -) - -const ( - foregroundBlue = 0x1 - foregroundGreen = 0x2 - foregroundRed = 0x4 - foregroundIntensity = 0x8 - foregroundMask = (foregroundRed | foregroundBlue | foregroundGreen | foregroundIntensity) - backgroundBlue = 0x10 - backgroundGreen = 0x20 - backgroundRed = 0x40 - backgroundIntensity = 0x80 - backgroundMask = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity) -) - -type wchar uint16 -type short int16 -type dword uint32 -type word uint16 - -type coord struct { - x short - y short -} - -type smallRect struct { - left short - top short - right short - bottom short -} - -type consoleScreenBufferInfo struct { - size coord - cursorPosition coord - attributes word - window smallRect - maximumWindowSize coord -} - -type consoleCursorInfo struct { - size dword - visible int32 -} - -var ( - kernel32 = syscall.NewLazyDLL("kernel32.dll") - procGetConsoleScreenBufferInfo = kernel32.NewProc("GetConsoleScreenBufferInfo") - procSetConsoleTextAttribute = kernel32.NewProc("SetConsoleTextAttribute") - procSetConsoleCursorPosition = kernel32.NewProc("SetConsoleCursorPosition") - procFillConsoleOutputCharacter = kernel32.NewProc("FillConsoleOutputCharacterW") - procFillConsoleOutputAttribute = kernel32.NewProc("FillConsoleOutputAttribute") - procGetConsoleCursorInfo = kernel32.NewProc("GetConsoleCursorInfo") - procSetConsoleCursorInfo = kernel32.NewProc("SetConsoleCursorInfo") -) - -type Writer struct { - out io.Writer - handle syscall.Handle - lastbuf bytes.Buffer - oldattr word - oldpos coord -} - -// NewColorable return new instance of Writer which handle escape sequence from File. -func NewColorable(file *os.File) io.Writer { - if file == nil { - panic("nil passed instead of *os.File to NewColorable()") - } - - if isatty.IsTerminal(file.Fd()) { - var csbi consoleScreenBufferInfo - handle := syscall.Handle(file.Fd()) - procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) - return &Writer{out: file, handle: handle, oldattr: csbi.attributes, oldpos: coord{0, 0}} - } else { - return file - } -} - -// NewColorableStdout return new instance of Writer which handle escape sequence for stdout. -func NewColorableStdout() io.Writer { - return NewColorable(os.Stdout) -} - -// NewColorableStderr return new instance of Writer which handle escape sequence for stderr. -func NewColorableStderr() io.Writer { - return NewColorable(os.Stderr) -} - -var color256 = map[int]int{ - 0: 0x000000, - 1: 0x800000, - 2: 0x008000, - 3: 0x808000, - 4: 0x000080, - 5: 0x800080, - 6: 0x008080, - 7: 0xc0c0c0, - 8: 0x808080, - 9: 0xff0000, - 10: 0x00ff00, - 11: 0xffff00, - 12: 0x0000ff, - 13: 0xff00ff, - 14: 0x00ffff, - 15: 0xffffff, - 16: 0x000000, - 17: 0x00005f, - 18: 0x000087, - 19: 0x0000af, - 20: 0x0000d7, - 21: 0x0000ff, - 22: 0x005f00, - 23: 0x005f5f, - 24: 0x005f87, - 25: 0x005faf, - 26: 0x005fd7, - 27: 0x005fff, - 28: 0x008700, - 29: 0x00875f, - 30: 0x008787, - 31: 0x0087af, - 32: 0x0087d7, - 33: 0x0087ff, - 34: 0x00af00, - 35: 0x00af5f, - 36: 0x00af87, - 37: 0x00afaf, - 38: 0x00afd7, - 39: 0x00afff, - 40: 0x00d700, - 41: 0x00d75f, - 42: 0x00d787, - 43: 0x00d7af, - 44: 0x00d7d7, - 45: 0x00d7ff, - 46: 0x00ff00, - 47: 0x00ff5f, - 48: 0x00ff87, - 49: 0x00ffaf, - 50: 0x00ffd7, - 51: 0x00ffff, - 52: 0x5f0000, - 53: 0x5f005f, - 54: 0x5f0087, - 55: 0x5f00af, - 56: 0x5f00d7, - 57: 0x5f00ff, - 58: 0x5f5f00, - 59: 0x5f5f5f, - 60: 0x5f5f87, - 61: 0x5f5faf, - 62: 0x5f5fd7, - 63: 0x5f5fff, - 64: 0x5f8700, - 65: 0x5f875f, - 66: 0x5f8787, - 67: 0x5f87af, - 68: 0x5f87d7, - 69: 0x5f87ff, - 70: 0x5faf00, - 71: 0x5faf5f, - 72: 0x5faf87, - 73: 0x5fafaf, - 74: 0x5fafd7, - 75: 0x5fafff, - 76: 0x5fd700, - 77: 0x5fd75f, - 78: 0x5fd787, - 79: 0x5fd7af, - 80: 0x5fd7d7, - 81: 0x5fd7ff, - 82: 0x5fff00, - 83: 0x5fff5f, - 84: 0x5fff87, - 85: 0x5fffaf, - 86: 0x5fffd7, - 87: 0x5fffff, - 88: 0x870000, - 89: 0x87005f, - 90: 0x870087, - 91: 0x8700af, - 92: 0x8700d7, - 93: 0x8700ff, - 94: 0x875f00, - 95: 0x875f5f, - 96: 0x875f87, - 97: 0x875faf, - 98: 0x875fd7, - 99: 0x875fff, - 100: 0x878700, - 101: 0x87875f, - 102: 0x878787, - 103: 0x8787af, - 104: 0x8787d7, - 105: 0x8787ff, - 106: 0x87af00, - 107: 0x87af5f, - 108: 0x87af87, - 109: 0x87afaf, - 110: 0x87afd7, - 111: 0x87afff, - 112: 0x87d700, - 113: 0x87d75f, - 114: 0x87d787, - 115: 0x87d7af, - 116: 0x87d7d7, - 117: 0x87d7ff, - 118: 0x87ff00, - 119: 0x87ff5f, - 120: 0x87ff87, - 121: 0x87ffaf, - 122: 0x87ffd7, - 123: 0x87ffff, - 124: 0xaf0000, - 125: 0xaf005f, - 126: 0xaf0087, - 127: 0xaf00af, - 128: 0xaf00d7, - 129: 0xaf00ff, - 130: 0xaf5f00, - 131: 0xaf5f5f, - 132: 0xaf5f87, - 133: 0xaf5faf, - 134: 0xaf5fd7, - 135: 0xaf5fff, - 136: 0xaf8700, - 137: 0xaf875f, - 138: 0xaf8787, - 139: 0xaf87af, - 140: 0xaf87d7, - 141: 0xaf87ff, - 142: 0xafaf00, - 143: 0xafaf5f, - 144: 0xafaf87, - 145: 0xafafaf, - 146: 0xafafd7, - 147: 0xafafff, - 148: 0xafd700, - 149: 0xafd75f, - 150: 0xafd787, - 151: 0xafd7af, - 152: 0xafd7d7, - 153: 0xafd7ff, - 154: 0xafff00, - 155: 0xafff5f, - 156: 0xafff87, - 157: 0xafffaf, - 158: 0xafffd7, - 159: 0xafffff, - 160: 0xd70000, - 161: 0xd7005f, - 162: 0xd70087, - 163: 0xd700af, - 164: 0xd700d7, - 165: 0xd700ff, - 166: 0xd75f00, - 167: 0xd75f5f, - 168: 0xd75f87, - 169: 0xd75faf, - 170: 0xd75fd7, - 171: 0xd75fff, - 172: 0xd78700, - 173: 0xd7875f, - 174: 0xd78787, - 175: 0xd787af, - 176: 0xd787d7, - 177: 0xd787ff, - 178: 0xd7af00, - 179: 0xd7af5f, - 180: 0xd7af87, - 181: 0xd7afaf, - 182: 0xd7afd7, - 183: 0xd7afff, - 184: 0xd7d700, - 185: 0xd7d75f, - 186: 0xd7d787, - 187: 0xd7d7af, - 188: 0xd7d7d7, - 189: 0xd7d7ff, - 190: 0xd7ff00, - 191: 0xd7ff5f, - 192: 0xd7ff87, - 193: 0xd7ffaf, - 194: 0xd7ffd7, - 195: 0xd7ffff, - 196: 0xff0000, - 197: 0xff005f, - 198: 0xff0087, - 199: 0xff00af, - 200: 0xff00d7, - 201: 0xff00ff, - 202: 0xff5f00, - 203: 0xff5f5f, - 204: 0xff5f87, - 205: 0xff5faf, - 206: 0xff5fd7, - 207: 0xff5fff, - 208: 0xff8700, - 209: 0xff875f, - 210: 0xff8787, - 211: 0xff87af, - 212: 0xff87d7, - 213: 0xff87ff, - 214: 0xffaf00, - 215: 0xffaf5f, - 216: 0xffaf87, - 217: 0xffafaf, - 218: 0xffafd7, - 219: 0xffafff, - 220: 0xffd700, - 221: 0xffd75f, - 222: 0xffd787, - 223: 0xffd7af, - 224: 0xffd7d7, - 225: 0xffd7ff, - 226: 0xffff00, - 227: 0xffff5f, - 228: 0xffff87, - 229: 0xffffaf, - 230: 0xffffd7, - 231: 0xffffff, - 232: 0x080808, - 233: 0x121212, - 234: 0x1c1c1c, - 235: 0x262626, - 236: 0x303030, - 237: 0x3a3a3a, - 238: 0x444444, - 239: 0x4e4e4e, - 240: 0x585858, - 241: 0x626262, - 242: 0x6c6c6c, - 243: 0x767676, - 244: 0x808080, - 245: 0x8a8a8a, - 246: 0x949494, - 247: 0x9e9e9e, - 248: 0xa8a8a8, - 249: 0xb2b2b2, - 250: 0xbcbcbc, - 251: 0xc6c6c6, - 252: 0xd0d0d0, - 253: 0xdadada, - 254: 0xe4e4e4, - 255: 0xeeeeee, -} - -// Write write data on console -func (w *Writer) Write(data []byte) (n int, err error) { - var csbi consoleScreenBufferInfo - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - - er := bytes.NewReader(data) - var bw [1]byte -loop: - for { - r1, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - if r1 == 0 { - break loop - } - - c1, err := er.ReadByte() - if err != nil { - break loop - } - if c1 != 0x1b { - bw[0] = c1 - w.out.Write(bw[:]) - continue - } - c2, err := er.ReadByte() - if err != nil { - w.lastbuf.WriteByte(c1) - break loop - } - if c2 != 0x5b { - w.lastbuf.WriteByte(c1) - w.lastbuf.WriteByte(c2) - continue - } - - var buf bytes.Buffer - var m byte - for { - c, err := er.ReadByte() - if err != nil { - w.lastbuf.WriteByte(c1) - w.lastbuf.WriteByte(c2) - w.lastbuf.Write(buf.Bytes()) - break loop - } - if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { - m = c - break - } - buf.Write([]byte(string(c))) - } - - var csbi consoleScreenBufferInfo - switch m { - case 'A': - n, err = strconv.Atoi(buf.String()) - if err != nil { - continue - } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - csbi.cursorPosition.y -= short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) - case 'B': - n, err = strconv.Atoi(buf.String()) - if err != nil { - continue - } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - csbi.cursorPosition.y += short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) - case 'C': - n, err = strconv.Atoi(buf.String()) - if err != nil { - continue - } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - csbi.cursorPosition.x -= short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) - case 'D': - n, err = strconv.Atoi(buf.String()) - if err != nil { - continue - } - if n, err = strconv.Atoi(buf.String()); err == nil { - var csbi consoleScreenBufferInfo - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - csbi.cursorPosition.x += short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) - } - case 'E': - n, err = strconv.Atoi(buf.String()) - if err != nil { - continue - } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - csbi.cursorPosition.x = 0 - csbi.cursorPosition.y += short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) - case 'F': - n, err = strconv.Atoi(buf.String()) - if err != nil { - continue - } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - csbi.cursorPosition.x = 0 - csbi.cursorPosition.y -= short(n) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) - case 'G': - n, err = strconv.Atoi(buf.String()) - if err != nil { - continue - } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - csbi.cursorPosition.x = short(n - 1) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) - case 'H': - token := strings.Split(buf.String(), ";") - if len(token) != 2 { - continue - } - n1, err := strconv.Atoi(token[0]) - if err != nil { - continue - } - n2, err := strconv.Atoi(token[1]) - if err != nil { - continue - } - csbi.cursorPosition.x = short(n2 - 1) - csbi.cursorPosition.y = short(n1 - 1) - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) - case 'J': - n, err := strconv.Atoi(buf.String()) - if err != nil { - continue - } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - var cursor coord - switch n { - case 0: - cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y} - case 1: - cursor = coord{x: csbi.window.left, y: csbi.window.top} - case 2: - cursor = coord{x: csbi.window.left, y: csbi.window.top} - } - var count, written dword - count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x) - procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) - procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) - case 'K': - n, err := strconv.Atoi(buf.String()) - if err != nil { - continue - } - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - var cursor coord - switch n { - case 0: - cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y} - case 1: - cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y} - case 2: - cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y} - } - var count, written dword - count = dword(csbi.size.x - csbi.cursorPosition.x) - procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) - procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) - case 'm': - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - attr := csbi.attributes - cs := buf.String() - if cs == "" { - procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(w.oldattr)) - continue - } - token := strings.Split(cs, ";") - for i := 0; i < len(token); i++ { - ns := token[i] - if n, err = strconv.Atoi(ns); err == nil { - switch { - case n == 0 || n == 100: - attr = w.oldattr - case 1 <= n && n <= 5: - attr |= foregroundIntensity - case n == 7: - attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4) - case 22 == n || n == 25 || n == 25: - attr |= foregroundIntensity - case n == 27: - attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4) - case 30 <= n && n <= 37: - attr &= backgroundMask - if (n-30)&1 != 0 { - attr |= foregroundRed - } - if (n-30)&2 != 0 { - attr |= foregroundGreen - } - if (n-30)&4 != 0 { - attr |= foregroundBlue - } - case n == 38: // set foreground color. - if i < len(token)-2 && (token[i+1] == "5" || token[i+1] == "05") { - if n256, err := strconv.Atoi(token[i+2]); err == nil { - if n256foreAttr == nil { - n256setup() - } - attr &= backgroundMask - attr |= n256foreAttr[n256] - i += 2 - } - } else { - attr = attr & (w.oldattr & backgroundMask) - } - case n == 39: // reset foreground color. - attr &= backgroundMask - attr |= w.oldattr & foregroundMask - case 40 <= n && n <= 47: - attr &= foregroundMask - if (n-40)&1 != 0 { - attr |= backgroundRed - } - if (n-40)&2 != 0 { - attr |= backgroundGreen - } - if (n-40)&4 != 0 { - attr |= backgroundBlue - } - case n == 48: // set background color. - if i < len(token)-2 && token[i+1] == "5" { - if n256, err := strconv.Atoi(token[i+2]); err == nil { - if n256backAttr == nil { - n256setup() - } - attr &= foregroundMask - attr |= n256backAttr[n256] - i += 2 - } - } else { - attr = attr & (w.oldattr & foregroundMask) - } - case n == 49: // reset foreground color. - attr &= foregroundMask - attr |= w.oldattr & backgroundMask - case 90 <= n && n <= 97: - attr = (attr & backgroundMask) - attr |= foregroundIntensity - if (n-90)&1 != 0 { - attr |= foregroundRed - } - if (n-90)&2 != 0 { - attr |= foregroundGreen - } - if (n-90)&4 != 0 { - attr |= foregroundBlue - } - case 100 <= n && n <= 107: - attr = (attr & foregroundMask) - attr |= backgroundIntensity - if (n-100)&1 != 0 { - attr |= backgroundRed - } - if (n-100)&2 != 0 { - attr |= backgroundGreen - } - if (n-100)&4 != 0 { - attr |= backgroundBlue - } - } - procSetConsoleTextAttribute.Call(uintptr(w.handle), uintptr(attr)) - } - } - case 'h': - cs := buf.String() - if cs == "?25" { - var ci consoleCursorInfo - procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) - ci.visible = 1 - procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) - } - case 'l': - cs := buf.String() - if cs == "?25" { - var ci consoleCursorInfo - procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) - ci.visible = 0 - procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci))) - } - case 's': - procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) - w.oldpos = csbi.cursorPosition - case 'u': - procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&w.oldpos))) - } - } - return len(data) - w.lastbuf.Len(), nil -} - -type consoleColor struct { - rgb int - red bool - green bool - blue bool - intensity bool -} - -func (c consoleColor) foregroundAttr() (attr word) { - if c.red { - attr |= foregroundRed - } - if c.green { - attr |= foregroundGreen - } - if c.blue { - attr |= foregroundBlue - } - if c.intensity { - attr |= foregroundIntensity - } - return -} - -func (c consoleColor) backgroundAttr() (attr word) { - if c.red { - attr |= backgroundRed - } - if c.green { - attr |= backgroundGreen - } - if c.blue { - attr |= backgroundBlue - } - if c.intensity { - attr |= backgroundIntensity - } - return -} - -var color16 = []consoleColor{ - consoleColor{0x000000, false, false, false, false}, - consoleColor{0x000080, false, false, true, false}, - consoleColor{0x008000, false, true, false, false}, - consoleColor{0x008080, false, true, true, false}, - consoleColor{0x800000, true, false, false, false}, - consoleColor{0x800080, true, false, true, false}, - consoleColor{0x808000, true, true, false, false}, - consoleColor{0xc0c0c0, true, true, true, false}, - consoleColor{0x808080, false, false, false, true}, - consoleColor{0x0000ff, false, false, true, true}, - consoleColor{0x00ff00, false, true, false, true}, - consoleColor{0x00ffff, false, true, true, true}, - consoleColor{0xff0000, true, false, false, true}, - consoleColor{0xff00ff, true, false, true, true}, - consoleColor{0xffff00, true, true, false, true}, - consoleColor{0xffffff, true, true, true, true}, -} - -type hsv struct { - h, s, v float32 -} - -func (a hsv) dist(b hsv) float32 { - dh := a.h - b.h - switch { - case dh > 0.5: - dh = 1 - dh - case dh < -0.5: - dh = -1 - dh - } - ds := a.s - b.s - dv := a.v - b.v - return float32(math.Sqrt(float64(dh*dh + ds*ds + dv*dv))) -} - -func toHSV(rgb int) hsv { - r, g, b := float32((rgb&0xFF0000)>>16)/256.0, - float32((rgb&0x00FF00)>>8)/256.0, - float32(rgb&0x0000FF)/256.0 - min, max := minmax3f(r, g, b) - h := max - min - if h > 0 { - if max == r { - h = (g - b) / h - if h < 0 { - h += 6 - } - } else if max == g { - h = 2 + (b-r)/h - } else { - h = 4 + (r-g)/h - } - } - h /= 6.0 - s := max - min - if max != 0 { - s /= max - } - v := max - return hsv{h: h, s: s, v: v} -} - -type hsvTable []hsv - -func toHSVTable(rgbTable []consoleColor) hsvTable { - t := make(hsvTable, len(rgbTable)) - for i, c := range rgbTable { - t[i] = toHSV(c.rgb) - } - return t -} - -func (t hsvTable) find(rgb int) consoleColor { - hsv := toHSV(rgb) - n := 7 - l := float32(5.0) - for i, p := range t { - d := hsv.dist(p) - if d < l { - l, n = d, i - } - } - return color16[n] -} - -func minmax3f(a, b, c float32) (min, max float32) { - if a < b { - if b < c { - return a, c - } else if a < c { - return a, b - } else { - return c, b - } - } else { - if a < c { - return b, c - } else if b < c { - return b, a - } else { - return c, a - } - } -} - -var n256foreAttr []word -var n256backAttr []word - -func n256setup() { - n256foreAttr = make([]word, 256) - n256backAttr = make([]word, 256) - t := toHSVTable(color16) - for i, rgb := range color256 { - c := t.find(rgb) - n256foreAttr[i] = c.foregroundAttr() - n256backAttr[i] = c.backgroundAttr() - } -} diff --git a/vendor/github.com/mattn/go-colorable/noncolorable.go b/vendor/github.com/mattn/go-colorable/noncolorable.go deleted file mode 100644 index ca588c78a..000000000 --- a/vendor/github.com/mattn/go-colorable/noncolorable.go +++ /dev/null @@ -1,61 +0,0 @@ -package colorable - -import ( - "bytes" - "io" -) - -// NonColorable hold writer but remove escape sequence. -type NonColorable struct { - out io.Writer - lastbuf bytes.Buffer -} - -// NewNonColorable return new instance of Writer which remove escape sequence from Writer. -func NewNonColorable(w io.Writer) io.Writer { - return &NonColorable{out: w} -} - -// Write write data on console -func (w *NonColorable) Write(data []byte) (n int, err error) { - er := bytes.NewReader(data) - var bw [1]byte -loop: - for { - c1, err := er.ReadByte() - if err != nil { - break loop - } - if c1 != 0x1b { - bw[0] = c1 - w.out.Write(bw[:]) - continue - } - c2, err := er.ReadByte() - if err != nil { - w.lastbuf.WriteByte(c1) - break loop - } - if c2 != 0x5b { - w.lastbuf.WriteByte(c1) - w.lastbuf.WriteByte(c2) - continue - } - - var buf bytes.Buffer - for { - c, err := er.ReadByte() - if err != nil { - w.lastbuf.WriteByte(c1) - w.lastbuf.WriteByte(c2) - w.lastbuf.Write(buf.Bytes()) - break loop - } - if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { - break - } - buf.Write([]byte(string(c))) - } - } - return len(data) - w.lastbuf.Len(), nil -} diff --git a/vendor/github.com/mattn/go-isatty/LICENSE b/vendor/github.com/mattn/go-isatty/LICENSE deleted file mode 100644 index 65dc692b6..000000000 --- a/vendor/github.com/mattn/go-isatty/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -Copyright (c) Yasuhiro MATSUMOTO - -MIT License (Expat) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/mattn/go-isatty/doc.go b/vendor/github.com/mattn/go-isatty/doc.go deleted file mode 100644 index 17d4f90eb..000000000 --- a/vendor/github.com/mattn/go-isatty/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package isatty implements interface to isatty -package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_appengine.go b/vendor/github.com/mattn/go-isatty/isatty_appengine.go deleted file mode 100644 index 9584a9884..000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_appengine.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build appengine - -package isatty - -// IsTerminal returns true if the file descriptor is terminal which -// is always false on on appengine classic which is a sandboxed PaaS. -func IsTerminal(fd uintptr) bool { - return false -} - -// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 -// terminal. This is also always false on this environment. -func IsCygwinTerminal(fd uintptr) bool { - return false -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_bsd.go b/vendor/github.com/mattn/go-isatty/isatty_bsd.go deleted file mode 100644 index 42f2514d1..000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_bsd.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build darwin freebsd openbsd netbsd dragonfly -// +build !appengine - -package isatty - -import ( - "syscall" - "unsafe" -) - -const ioctlReadTermios = syscall.TIOCGETA - -// IsTerminal return true if the file descriptor is terminal. -func IsTerminal(fd uintptr) bool { - var termios syscall.Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_linux.go b/vendor/github.com/mattn/go-isatty/isatty_linux.go deleted file mode 100644 index 9d24bac1d..000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_linux.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build linux -// +build !appengine - -package isatty - -import ( - "syscall" - "unsafe" -) - -const ioctlReadTermios = syscall.TCGETS - -// IsTerminal return true if the file descriptor is terminal. -func IsTerminal(fd uintptr) bool { - var termios syscall.Termios - _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) - return err == 0 -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go deleted file mode 100644 index ff4de3d9a..000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_others.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build !windows -// +build !appengine - -package isatty - -// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 -// terminal. This is also always false on this environment. -func IsCygwinTerminal(fd uintptr) bool { - return false -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_solaris.go b/vendor/github.com/mattn/go-isatty/isatty_solaris.go deleted file mode 100644 index 1f0c6bf53..000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_solaris.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build solaris -// +build !appengine - -package isatty - -import ( - "golang.org/x/sys/unix" -) - -// IsTerminal returns true if the given file descriptor is a terminal. -// see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c -func IsTerminal(fd uintptr) bool { - var termio unix.Termio - err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) - return err == nil -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go deleted file mode 100644 index af51cbcaa..000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_windows.go +++ /dev/null @@ -1,94 +0,0 @@ -// +build windows -// +build !appengine - -package isatty - -import ( - "strings" - "syscall" - "unicode/utf16" - "unsafe" -) - -const ( - fileNameInfo uintptr = 2 - fileTypePipe = 3 -) - -var ( - kernel32 = syscall.NewLazyDLL("kernel32.dll") - procGetConsoleMode = kernel32.NewProc("GetConsoleMode") - procGetFileInformationByHandleEx = kernel32.NewProc("GetFileInformationByHandleEx") - procGetFileType = kernel32.NewProc("GetFileType") -) - -func init() { - // Check if GetFileInformationByHandleEx is available. - if procGetFileInformationByHandleEx.Find() != nil { - procGetFileInformationByHandleEx = nil - } -} - -// IsTerminal return true if the file descriptor is terminal. -func IsTerminal(fd uintptr) bool { - var st uint32 - r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) - return r != 0 && e == 0 -} - -// Check pipe name is used for cygwin/msys2 pty. -// Cygwin/MSYS2 PTY has a name like: -// \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master -func isCygwinPipeName(name string) bool { - token := strings.Split(name, "-") - if len(token) < 5 { - return false - } - - if token[0] != `\msys` && token[0] != `\cygwin` { - return false - } - - if token[1] == "" { - return false - } - - if !strings.HasPrefix(token[2], "pty") { - return false - } - - if token[3] != `from` && token[3] != `to` { - return false - } - - if token[4] != "master" { - return false - } - - return true -} - -// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 -// terminal. -func IsCygwinTerminal(fd uintptr) bool { - if procGetFileInformationByHandleEx == nil { - return false - } - - // Cygwin/msys's pty is a pipe. - ft, _, e := syscall.Syscall(procGetFileType.Addr(), 1, fd, 0, 0) - if ft != fileTypePipe || e != 0 { - return false - } - - var buf [2 + syscall.MAX_PATH]uint16 - r, _, e := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), - 4, fd, fileNameInfo, uintptr(unsafe.Pointer(&buf)), - uintptr(len(buf)*2), 0, 0) - if r == 0 || e != 0 { - return false - } - - l := *(*uint32)(unsafe.Pointer(&buf)) - return isCygwinPipeName(string(utf16.Decode(buf[2 : 2+l/2]))) -} diff --git a/vendor/github.com/mesos/mesos-go/LICENSE b/vendor/github.com/mesos/mesos-go/LICENSE deleted file mode 100644 index ad410e113..000000000 --- a/vendor/github.com/mesos/mesos-go/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/vendor/github.com/mesos/mesos-go/NOTICE b/vendor/github.com/mesos/mesos-go/NOTICE deleted file mode 100644 index 491bbe145..000000000 --- a/vendor/github.com/mesos/mesos-go/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2013-2015, Mesosphere, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/github.com/mesos/mesos-go/detector/doc.go b/vendor/github.com/mesos/mesos-go/detector/doc.go deleted file mode 100644 index c728a339f..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* -The detector package houses implementation of master detectors. -The default implementation is the zookeeper master detector. -It uses zookeeper to detect the lead Mesos master during startup/failover. -*/ -package detector diff --git a/vendor/github.com/mesos/mesos-go/detector/factory.go b/vendor/github.com/mesos/mesos-go/detector/factory.go deleted file mode 100644 index 2cbe78fdd..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/factory.go +++ /dev/null @@ -1,155 +0,0 @@ -package detector - -import ( - "encoding/binary" - "errors" - "fmt" - "io/ioutil" - "net" - "strconv" - "strings" - "sync" - - "github.com/gogo/protobuf/proto" - log "github.com/golang/glog" - mesos "github.com/mesos/mesos-go/mesosproto" - util "github.com/mesos/mesos-go/mesosutil" - "github.com/mesos/mesos-go/upid" -) - -var ( - pluginLock sync.Mutex - plugins = map[string]PluginFactory{} - EmptySpecError = errors.New("empty master specification") - - defaultFactory = PluginFactory(func(spec string) (Master, error) { - if len(spec) == 0 { - return nil, EmptySpecError - } - if strings.Index(spec, "@") < 0 { - spec = "master@" + spec - } - if pid, err := upid.Parse(spec); err == nil { - return NewStandalone(CreateMasterInfo(pid)), nil - } else { - return nil, err - } - }) -) - -type PluginFactory func(string) (Master, error) - -// associates a plugin implementation with a Master specification prefix. -// packages that provide plugins are expected to invoke this func within -// their init() implementation. schedulers that wish to support plugins may -// anonymously import ("_") a package the auto-registers said plugins. -func Register(prefix string, f PluginFactory) error { - if prefix == "" { - return fmt.Errorf("illegal prefix: '%v'", prefix) - } - if f == nil { - return fmt.Errorf("nil plugin factories are not allowed") - } - - pluginLock.Lock() - defer pluginLock.Unlock() - - if _, found := plugins[prefix]; found { - return fmt.Errorf("detection plugin already registered for prefix '%s'", prefix) - } - plugins[prefix] = f - return nil -} - -// Create a new detector given the provided specification. Examples are: -// -// - file://{path_to_local_file} -// - {ipaddress}:{port} -// - master@{ip_address}:{port} -// - master({id})@{ip_address}:{port} -// -// Support for the file:// prefix is intentionally hardcoded so that it may -// not be inadvertently overridden by a custom plugin implementation. Custom -// plugins are supported via the Register and MatchingPlugin funcs. -// -// Furthermore it is expected that master detectors returned from this func -// are not yet running and will only begin to spawn requisite background -// processing upon, or some time after, the first invocation of their Detect. -// -func New(spec string) (m Master, err error) { - if strings.HasPrefix(spec, "file://") { - var body []byte - path := spec[7:] - body, err = ioutil.ReadFile(path) - if err != nil { - log.V(1).Infof("failed to read from file at '%s'", path) - } else { - m, err = New(string(body)) - } - } else if f, ok := MatchingPlugin(spec); ok { - m, err = f(spec) - } else { - m, err = defaultFactory(spec) - } - - return -} - -func MatchingPlugin(spec string) (PluginFactory, bool) { - pluginLock.Lock() - defer pluginLock.Unlock() - - for prefix, f := range plugins { - if strings.HasPrefix(spec, prefix) { - return f, true - } - } - return nil, false -} - -// Super-useful utility func that attempts to build a mesos.MasterInfo from a -// upid.UPID specification. An attempt is made to determine the IP address of -// the UPID's Host and any errors during such resolution will result in a nil -// returned result. A nil result is also returned upon errors parsing the Port -// specification of the UPID. -// -// TODO(jdef) make this a func of upid.UPID so that callers can invoke somePid.MasterInfo()? -// -func CreateMasterInfo(pid *upid.UPID) *mesos.MasterInfo { - if pid == nil { - return nil - } - port, err := strconv.Atoi(pid.Port) - if err != nil { - log.Errorf("failed to parse port: %v", err) - return nil - } - //TODO(jdef) what about (future) ipv6 support? - var ipv4 net.IP - if ipv4 = net.ParseIP(pid.Host); ipv4 != nil { - // This is needed for the people cross-compiling from macos to linux. - // The cross-compiled version of net.LookupIP() fails to handle plain IPs. - // See https://github.com/mesos/mesos-go/pull/117 - } else if addrs, err := net.LookupIP(pid.Host); err == nil { - for _, ip := range addrs { - if ip = ip.To4(); ip != nil { - ipv4 = ip - break - } - } - if ipv4 == nil { - log.Errorf("host does not resolve to an IPv4 address: %v", pid.Host) - return nil - } - } else { - log.Errorf("failed to lookup IPs for host '%v': %v", pid.Host, err) - return nil - } - packedip := binary.BigEndian.Uint32(ipv4) // network byte order is big-endian - mi := util.NewMasterInfo(pid.ID, packedip, uint32(port)) - mi.Pid = proto.String(pid.String()) - if pid.Host != "" { - mi.Hostname = proto.String(pid.Host) - } - return mi -} diff --git a/vendor/github.com/mesos/mesos-go/detector/interface.go b/vendor/github.com/mesos/mesos-go/detector/interface.go deleted file mode 100644 index d9081bbca..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/interface.go +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package detector - -import ( - mesos "github.com/mesos/mesos-go/mesosproto" -) - -type MasterChanged interface { - // Invoked when the master changes - OnMasterChanged(*mesos.MasterInfo) -} - -// AllMasters defines an optional interface that, if implemented by the same -// struct as implements MasterChanged, will receive an additional callbacks -// independently of leadership changes. it's possible that, as a result of a -// leadership change, both the OnMasterChanged and UpdatedMasters callbacks -// would be invoked. -// -// **NOTE:** Detector implementations are not required to support this optional -// interface. Please RTFM of the detector implementation that you want to use. -type AllMasters interface { - // UpdatedMasters is invoked upon a change in the membership of mesos - // masters, and is useful to clients that wish to know the entire set - // of Mesos masters currently running. - UpdatedMasters([]*mesos.MasterInfo) -} - -// func/interface adapter -type OnMasterChanged func(*mesos.MasterInfo) - -func (f OnMasterChanged) OnMasterChanged(mi *mesos.MasterInfo) { - f(mi) -} - -// An abstraction of a Master detector which can be used to -// detect the leading master from a group. -type Master interface { - // Detect new master election. Every time a new master is elected, the - // detector will alert the observer. The first call to Detect is expected - // to kickstart any background detection processing (and not before then). - // If detection startup fails, or the listener cannot be added, then an - // error is returned. - Detect(MasterChanged) error - - // returns a chan that, when closed, indicates the detector has terminated - Done() <-chan struct{} - - // cancel the detector. it's ok to call this multiple times, or even if - // Detect() hasn't been invoked yet. - Cancel() -} diff --git a/vendor/github.com/mesos/mesos-go/detector/standalone.go b/vendor/github.com/mesos/mesos-go/detector/standalone.go deleted file mode 100644 index cad423bd7..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/standalone.go +++ /dev/null @@ -1,244 +0,0 @@ -package detector - -import ( - "encoding/binary" - "encoding/json" - "fmt" - "io/ioutil" - "net" - "net/http" - "strconv" - "sync" - "time" - - log "github.com/golang/glog" - mesos "github.com/mesos/mesos-go/mesosproto" - "github.com/mesos/mesos-go/upid" - "golang.org/x/net/context" -) - -const ( - defaultMesosHttpClientTimeout = 10 * time.Second //TODO(jdef) configurable via fiag? - defaultMesosLeaderSyncInterval = 30 * time.Second //TODO(jdef) configurable via fiag? - defaultMesosMasterPort = 5050 -) - -// enables easier unit testing -type fetcherFunc func(ctx context.Context, address string) (*upid.UPID, error) - -type Standalone struct { - ch chan *mesos.MasterInfo - client *http.Client - tr *http.Transport - pollOnce sync.Once - initial *mesos.MasterInfo - done chan struct{} - cancelOnce sync.Once - leaderSyncInterval time.Duration - httpClientTimeout time.Duration - assumedMasterPort int - poller func(pf fetcherFunc) - fetchPid fetcherFunc -} - -// Create a new stand alone master detector. -func NewStandalone(mi *mesos.MasterInfo) *Standalone { - log.V(2).Infof("creating new standalone detector for %+v", mi) - stand := &Standalone{ - ch: make(chan *mesos.MasterInfo), - tr: &http.Transport{}, - initial: mi, - done: make(chan struct{}), - leaderSyncInterval: defaultMesosLeaderSyncInterval, - httpClientTimeout: defaultMesosHttpClientTimeout, - assumedMasterPort: defaultMesosMasterPort, - } - stand.poller = stand._poller - stand.fetchPid = stand._fetchPid - return stand -} - -func (s *Standalone) String() string { - return fmt.Sprintf("{initial: %+v}", s.initial) -} - -// Detecting the new master. -func (s *Standalone) Detect(o MasterChanged) error { - log.V(2).Info("Detect()") - s.pollOnce.Do(func() { - log.V(1).Info("spinning up asyc master detector poller") - // delayed initialization allows unit tests to modify timeouts before detection starts - s.client = &http.Client{ - Transport: s.tr, - Timeout: s.httpClientTimeout, - } - go s.poller(s.fetchPid) - }) - if o != nil { - log.V(1).Info("spawning asyc master detector listener") - go func() { - log.V(2).Infof("waiting for polled to send updates") - pollWaiter: - for { - select { - case mi, ok := <-s.ch: - if !ok { - break pollWaiter - } - log.V(1).Infof("detected master change: %+v", mi) - o.OnMasterChanged(mi) - case <-s.done: - return - } - } - o.OnMasterChanged(nil) - }() - } else { - log.Warningf("detect called with a nil master change listener") - } - return nil -} - -func (s *Standalone) Done() <-chan struct{} { - return s.done -} - -func (s *Standalone) Cancel() { - s.cancelOnce.Do(func() { close(s.done) }) -} - -// poll for changes to master leadership via current leader's /state.json endpoint. -// we poll the `initial` leader, aborting if none was specified. -// -// TODO(jdef) follow the leader: change who we poll based on the prior leader -// TODO(jdef) somehow determine all masters in cluster from the state.json? -// -func (s *Standalone) _poller(pf fetcherFunc) { - defer func() { - defer s.Cancel() - log.Warning("shutting down standalone master detection") - }() - if s.initial == nil { - log.Errorf("aborting master poller since initial master info is nil") - return - } - addr := s.initial.GetHostname() - if len(addr) == 0 { - if s.initial.GetIp() == 0 { - log.Warningf("aborted mater poller since initial master info has no host") - return - } - ip := make([]byte, 4) - binary.BigEndian.PutUint32(ip, s.initial.GetIp()) - addr = net.IP(ip).To4().String() - } - port := uint32(s.assumedMasterPort) - if s.initial.Port != nil && *s.initial.Port != 0 { - port = *s.initial.Port - } - addr = net.JoinHostPort(addr, strconv.Itoa(int(port))) - log.V(1).Infof("polling for master leadership at '%v'", addr) - var lastpid *upid.UPID - for { - startedAt := time.Now() - ctx, cancel := context.WithTimeout(context.Background(), s.leaderSyncInterval) - if pid, err := pf(ctx, addr); err == nil { - if !pid.Equal(lastpid) { - log.V(2).Infof("detected leadership change from '%v' to '%v'", lastpid, pid) - lastpid = pid - elapsed := time.Now().Sub(startedAt) - mi := CreateMasterInfo(pid) - select { - case s.ch <- mi: // noop - case <-time.After(s.leaderSyncInterval - elapsed): - // no one heard the master change, oh well - poll again - goto continuePolling - case <-s.done: - cancel() - return - } - } else { - log.V(2).Infof("no change to master leadership: '%v'", lastpid) - } - } else if err == context.DeadlineExceeded { - if lastpid != nil { - lastpid = nil - select { - case s.ch <- nil: // lost master - case <-s.done: // no need to cancel ctx - return - } - } - goto continuePolling - } else { - select { - case <-s.done: - cancel() - return - default: - if err != context.Canceled { - log.Error(err) - } - } - } - if remaining := s.leaderSyncInterval - time.Now().Sub(startedAt); remaining > 0 { - log.V(3).Infof("master leader poller sleeping for %v", remaining) - time.Sleep(remaining) - } - continuePolling: - cancel() - } -} - -// assumes that address is in host:port format -func (s *Standalone) _fetchPid(ctx context.Context, address string) (*upid.UPID, error) { - //TODO(jdef) need SSL support - uri := fmt.Sprintf("http://%s/state.json", address) - req, err := http.NewRequest("GET", uri, nil) - if err != nil { - return nil, err - } - var pid *upid.UPID - err = s.httpDo(ctx, req, func(res *http.Response, err error) error { - if err != nil { - return err - } - defer res.Body.Close() - if res.StatusCode != 200 { - return fmt.Errorf("HTTP request failed with code %d: %v", res.StatusCode, res.Status) - } - blob, err1 := ioutil.ReadAll(res.Body) - if err1 != nil { - return err1 - } - log.V(3).Infof("Got mesos state, content length %v", len(blob)) - type State struct { - Leader string `json:"leader"` // ex: master(1)@10.22.211.18:5050 - } - state := &State{} - err = json.Unmarshal(blob, state) - if err != nil { - return err - } - pid, err = upid.Parse(state.Leader) - return err - }) - return pid, err -} - -type responseHandler func(*http.Response, error) error - -// hacked from https://blog.golang.org/context -func (s *Standalone) httpDo(ctx context.Context, req *http.Request, f responseHandler) error { - // Run the HTTP request in a goroutine and pass the response to f. - ch := make(chan error, 1) - go func() { ch <- f(s.client.Do(req)) }() - select { - case <-ctx.Done(): - s.tr.CancelRequest(req) - <-ch // Wait for f to return. - return ctx.Err() - case err := <-ch: - return err - } -} diff --git a/vendor/github.com/mesos/mesos-go/detector/zoo/client2.go b/vendor/github.com/mesos/mesos-go/detector/zoo/client2.go deleted file mode 100644 index 8d3799a08..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/zoo/client2.go +++ /dev/null @@ -1,88 +0,0 @@ -package zoo - -import ( - "sync" - "time" - - "github.com/samuel/go-zookeeper/zk" -) - -const ( - defaultSessionTimeout = 60 * time.Second - currentPath = "." -) - -var zkSessionTimeout = defaultSessionTimeout - -type client2 struct { - *zk.Conn - path string - done chan struct{} // signal chan, closes when the underlying connection terminates - stopOnce sync.Once -} - -func connect2(hosts []string, path string) (*client2, error) { - c, ev, err := zk.Connect(hosts, zkSessionTimeout) - if err != nil { - return nil, err - } - done := make(chan struct{}) - go func() { - // close the 'done' chan when the zk event chan closes (signals termination of zk connection) - defer close(done) - for { - if _, ok := <-ev; !ok { - return - } - } - }() - return &client2{ - Conn: c, - path: path, - done: done, - }, nil -} - -func (c *client2) stopped() <-chan struct{} { - return c.done -} - -func (c *client2) stop() { - c.stopOnce.Do(c.Close) -} - -func (c *client2) data(path string) (data []byte, err error) { - data, _, err = c.Get(path) - return -} - -func (c *client2) watchChildren(path string) (string, <-chan []string, <-chan error) { - errCh := make(chan error, 1) - snap := make(chan []string) - - watchPath := c.path - if path != "" && path != currentPath { - watchPath = watchPath + path - } - go func() { - defer close(errCh) - for { - children, _, ev, err := c.ChildrenW(watchPath) - if err != nil { - errCh <- err - return - } - select { - case snap <- children: - case <-c.done: - return - } - e := <-ev // wait for the next watch-related event - if e.Err != nil { - errCh <- e.Err - return - } - } - }() - return watchPath, snap, errCh -} diff --git a/vendor/github.com/mesos/mesos-go/detector/zoo/detect.go b/vendor/github.com/mesos/mesos-go/detector/zoo/detect.go deleted file mode 100644 index aca08fe4b..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/zoo/detect.go +++ /dev/null @@ -1,369 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package zoo - -import ( - "encoding/json" - "fmt" - "math" - "net/url" - "strconv" - "strings" - "sync" - "sync/atomic" - "time" - - "github.com/gogo/protobuf/proto" - log "github.com/golang/glog" - "github.com/mesos/mesos-go/detector" - mesos "github.com/mesos/mesos-go/mesosproto" -) - -const ( - // prefix for nodes listed at the ZK URL path - nodePrefix = "info_" - nodeJSONPrefix = "json.info_" - defaultMinDetectorCyclePeriod = 1 * time.Second -) - -// reasonable default for a noop change listener -var ignoreChanged = detector.OnMasterChanged(func(*mesos.MasterInfo) {}) - -type zkInterface interface { - stopped() <-chan struct{} - stop() - data(string) ([]byte, error) - watchChildren(string) (string, <-chan []string, <-chan error) -} - -type infoCodec func(path, node string) (*mesos.MasterInfo, error) - -// Detector uses ZooKeeper to detect new leading master. -type MasterDetector struct { - client zkInterface - leaderNode string - - bootstrapLock sync.RWMutex // guard against concurrent invocations of bootstrapFunc - bootstrapFunc func() error // for one-time zk client initiation - - // latch: only install, at most, one ignoreChanged listener; see MasterDetector.Detect - ignoreInstalled int32 - - // detection should not signal master change listeners more frequently than this - minDetectorCyclePeriod time.Duration - done chan struct{} - cancel func() -} - -// Internal constructor function -func NewMasterDetector(zkurls string) (*MasterDetector, error) { - zkHosts, zkPath, err := parseZk(zkurls) - if err != nil { - log.Fatalln("Failed to parse url", err) - return nil, err - } - - detector := &MasterDetector{ - minDetectorCyclePeriod: defaultMinDetectorCyclePeriod, - done: make(chan struct{}), - cancel: func() {}, - } - - detector.bootstrapFunc = func() (err error) { - if detector.client == nil { - detector.client, err = connect2(zkHosts, zkPath) - } - return - } - - log.V(2).Infoln("Created new detector to watch", zkHosts, zkPath) - return detector, nil -} - -func parseZk(zkurls string) ([]string, string, error) { - u, err := url.Parse(zkurls) - if err != nil { - log.V(1).Infof("failed to parse url: %v", err) - return nil, "", err - } - if u.Scheme != "zk" { - return nil, "", fmt.Errorf("invalid url scheme for zk url: '%v'", u.Scheme) - } - return strings.Split(u.Host, ","), u.Path, nil -} - -// returns a chan that, when closed, indicates termination of the detector -func (md *MasterDetector) Done() <-chan struct{} { - return md.done -} - -func (md *MasterDetector) Cancel() { - md.bootstrapLock.RLock() - defer md.bootstrapLock.RUnlock() - md.cancel() -} - -func (md *MasterDetector) childrenChanged(path string, list []string, obs detector.MasterChanged) { - md.notifyMasterChanged(path, list, obs) - md.notifyAllMasters(path, list, obs) -} - -func (md *MasterDetector) notifyMasterChanged(path string, list []string, obs detector.MasterChanged) { - // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf - topNode, codec := md.selectTopNode(list) - if md.leaderNode == topNode { - log.V(2).Infof("ignoring children-changed event, leader has not changed: %v", path) - return - } - - log.V(2).Infof("changing leader node from %q -> %q", md.leaderNode, topNode) - md.leaderNode = topNode - - var masterInfo *mesos.MasterInfo - if md.leaderNode != "" { - var err error - if masterInfo, err = codec(path, topNode); err != nil { - log.Errorln(err.Error()) - } - } - log.V(2).Infof("detected master info: %+v", masterInfo) - logPanic(func() { obs.OnMasterChanged(masterInfo) }) -} - -// logPanic safely executes the given func, recovering from and logging a panic if one occurs. -func logPanic(f func()) { - defer func() { - if r := recover(); r != nil { - log.Errorf("recovered from client panic: %v", r) - } - }() - f() -} - -func (md *MasterDetector) pullMasterInfo(path, node string) (*mesos.MasterInfo, error) { - data, err := md.client.data(fmt.Sprintf("%s/%s", path, node)) - if err != nil { - return nil, fmt.Errorf("failed to retrieve leader data: %v", err) - } - - masterInfo := &mesos.MasterInfo{} - err = proto.Unmarshal(data, masterInfo) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal protobuf MasterInfo data from zookeeper: %v", err) - } - return masterInfo, nil -} - -func (md *MasterDetector) pullMasterJsonInfo(path, node string) (*mesos.MasterInfo, error) { - data, err := md.client.data(fmt.Sprintf("%s/%s", path, node)) - if err != nil { - return nil, fmt.Errorf("failed to retrieve leader data: %v", err) - } - - masterInfo := &mesos.MasterInfo{} - err = json.Unmarshal(data, masterInfo) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal json MasterInfo data from zookeeper: %v", err) - } - return masterInfo, nil -} - -func (md *MasterDetector) notifyAllMasters(path string, list []string, obs detector.MasterChanged) { - all, ok := obs.(detector.AllMasters) - if !ok { - // not interested in entire master list - return - } - - // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf - masters := map[string]*mesos.MasterInfo{} - tryStore := func(node string, codec infoCodec) { - info, err := codec(path, node) - if err != nil { - log.Errorln(err.Error()) - } else { - masters[info.GetId()] = info - } - } - for _, node := range list { - // compare https://github.com/apache/mesos/blob/0.23.0/src/master/detector.cpp#L437 - if strings.HasPrefix(node, nodePrefix) { - tryStore(node, md.pullMasterInfo) - } else if strings.HasPrefix(node, nodeJSONPrefix) { - tryStore(node, md.pullMasterJsonInfo) - } else { - continue - } - } - masterList := make([]*mesos.MasterInfo, 0, len(masters)) - for _, v := range masters { - masterList = append(masterList, v) - } - - log.V(2).Infof("notifying of master membership change: %+v", masterList) - logPanic(func() { all.UpdatedMasters(masterList) }) -} - -func (md *MasterDetector) callBootstrap() (e error) { - log.V(2).Infoln("invoking detector boostrap") - md.bootstrapLock.Lock() - defer md.bootstrapLock.Unlock() - - clientConfigured := md.client != nil - if e = md.bootstrapFunc(); e == nil && !clientConfigured && md.client != nil { - // chain the lifetime of this detector to that of the newly created client impl - client := md.client - md.cancel = client.stop - go func() { - defer close(md.done) - <-client.stopped() - }() - } - return -} - -// the first call to Detect will kickstart a connection to zookeeper. a nil change listener may -// be spec'd, result of which is a detector that will still listen for master changes and record -// leaderhip changes internally but no listener would be notified. Detect may be called more than -// once, and each time the spec'd listener will be added to the list of those receiving notifications. -func (md *MasterDetector) Detect(f detector.MasterChanged) (err error) { - // kickstart zk client connectivity - if err := md.callBootstrap(); err != nil { - log.V(3).Infoln("failed to execute bootstrap function", err.Error()) - return err - } - - if f == nil { - // only ever install, at most, one ignoreChanged listener. multiple instances of it - // just consume resources and generate misleading log messages. - if !atomic.CompareAndSwapInt32(&md.ignoreInstalled, 0, 1) { - log.V(3).Infoln("ignoreChanged listener already installed") - return - } - f = ignoreChanged - } - - log.V(3).Infoln("spawning detect()") - go md.detect(f) - return nil -} - -func (md *MasterDetector) detect(f detector.MasterChanged) { - log.V(3).Infoln("detecting children at", currentPath) -detectLoop: - for { - select { - case <-md.Done(): - return - default: - } - log.V(3).Infoln("watching children at", currentPath) - path, childrenCh, errCh := md.client.watchChildren(currentPath) - rewatch := false - for { - started := time.Now() - select { - case children := <-childrenCh: - md.childrenChanged(path, children, f) - case err, ok := <-errCh: - // check for a tie first (required for predictability (tests)); the downside of - // doing this is that a listener might get two callbacks back-to-back ("new leader", - // followed by "no leader"). - select { - case children := <-childrenCh: - md.childrenChanged(path, children, f) - default: - } - if ok { - log.V(1).Infoln("child watch ended with error, master lost; error was:", err.Error()) - } else { - // detector shutdown likely... - log.V(1).Infoln("child watch ended, master lost") - } - select { - case <-md.Done(): - return - default: - if md.leaderNode != "" { - log.V(2).Infof("changing leader node from %q -> \"\"", md.leaderNode) - md.leaderNode = "" - f.OnMasterChanged(nil) - } - } - rewatch = true - } - // rate-limit master changes - if elapsed := time.Now().Sub(started); elapsed > 0 { - log.V(2).Infoln("resting before next detection cycle") - select { - case <-md.Done(): - return - case <-time.After(md.minDetectorCyclePeriod - elapsed): // noop - } - } - if rewatch { - continue detectLoop - } - } - } -} - -func (md *MasterDetector) selectTopNode(list []string) (topNode string, codec infoCodec) { - // mesos v0.24 writes JSON only, v0.23 writes json and protobuf, v0.22 and prior only write protobuf - topNode = selectTopNodePrefix(list, nodeJSONPrefix) - codec = md.pullMasterJsonInfo - if topNode == "" { - topNode = selectTopNodePrefix(list, nodePrefix) - codec = md.pullMasterInfo - - if topNode != "" { - log.Warningf("Leading master is using a Protobuf binary format when registering "+ - "with Zookeeper (%s): this will be deprecated as of Mesos 0.24 (see MESOS-2340).", - topNode) - } - } - return -} - -func selectTopNodePrefix(list []string, pre string) (node string) { - var leaderSeq uint64 = math.MaxUint64 - - for _, v := range list { - if !strings.HasPrefix(v, pre) { - continue // only care about participants - } - seqStr := strings.TrimPrefix(v, pre) - seq, err := strconv.ParseUint(seqStr, 10, 64) - if err != nil { - log.Warningf("unexpected zk node format '%s': %v", seqStr, err) - continue - } - if seq < leaderSeq { - leaderSeq = seq - node = v - } - } - - if node == "" { - log.V(3).Infoln("No top node found.") - } else { - log.V(3).Infof("Top node selected: '%s'", node) - } - return node -} diff --git a/vendor/github.com/mesos/mesos-go/detector/zoo/doc.go b/vendor/github.com/mesos/mesos-go/detector/zoo/doc.go deleted file mode 100644 index 010ba055d..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/zoo/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Zookeeper-based mesos-master leaderhip detection. -// Implements support for optional detector.AllMasters interface. -package zoo diff --git a/vendor/github.com/mesos/mesos-go/detector/zoo/mocked_conn.go b/vendor/github.com/mesos/mesos-go/detector/zoo/mocked_conn.go deleted file mode 100644 index 05e699c9a..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/zoo/mocked_conn.go +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package zoo - -import ( - "github.com/samuel/go-zookeeper/zk" - "github.com/stretchr/testify/mock" -) - -// Impersontates a zk.Connection -// It implements interface Connector -type MockConnector struct { - mock.Mock -} - -func NewMockConnector() *MockConnector { - return new(MockConnector) -} - -func (conn *MockConnector) Close() { - conn.Called() -} - -func (conn *MockConnector) ChildrenW(path string) ([]string, *zk.Stat, <-chan zk.Event, error) { - args := conn.Called(path) - var ( - arg0 []string - arg1 *zk.Stat - arg2 <-chan zk.Event - ) - if args.Get(0) != nil { - arg0 = args.Get(0).([]string) - } - if args.Get(1) != nil { - arg1 = args.Get(1).(*zk.Stat) - } - if args.Get(2) != nil { - arg2 = args.Get(2).(<-chan zk.Event) - } - return arg0, arg1, arg2, args.Error(3) -} - -func (conn *MockConnector) Children(path string) ([]string, *zk.Stat, error) { - args := conn.Called(path) - return args.Get(0).([]string), - args.Get(1).(*zk.Stat), - args.Error(2) -} - -func (conn *MockConnector) Get(path string) ([]byte, *zk.Stat, error) { - args := conn.Called(path) - return args.Get(0).([]byte), - args.Get(1).(*zk.Stat), - args.Error(2) -} diff --git a/vendor/github.com/mesos/mesos-go/detector/zoo/plugin.go b/vendor/github.com/mesos/mesos-go/detector/zoo/plugin.go deleted file mode 100644 index 7630a7e89..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/zoo/plugin.go +++ /dev/null @@ -1,11 +0,0 @@ -package zoo - -import ( - "github.com/mesos/mesos-go/detector" -) - -func init() { - detector.Register("zk://", detector.PluginFactory(func(spec string) (detector.Master, error) { - return NewMasterDetector(spec) - })) -} diff --git a/vendor/github.com/mesos/mesos-go/detector/zoo/types.go b/vendor/github.com/mesos/mesos-go/detector/zoo/types.go deleted file mode 100644 index 9b24b51b7..000000000 --- a/vendor/github.com/mesos/mesos-go/detector/zoo/types.go +++ /dev/null @@ -1,27 +0,0 @@ -package zoo - -import ( - "github.com/samuel/go-zookeeper/zk" -) - -// Connector Interface to facade zk.Conn type -// since github.com/samuel/go-zookeeper/zk does not provide an interface -// for the zk.Conn object, this allows for mocking and easier testing. -type Connector interface { - Close() - Children(string) ([]string, *zk.Stat, error) - ChildrenW(string) ([]string, *zk.Stat, <-chan zk.Event, error) - Get(string) ([]byte, *zk.Stat, error) -} - -//Factory is an adapter to trap the creation of zk.Conn instances -//since the official zk API does not expose an interface for zk.Conn. -type Factory interface { - create() (Connector, <-chan zk.Event, error) -} - -type asFactory func() (Connector, <-chan zk.Event, error) - -func (f asFactory) create() (Connector, <-chan zk.Event, error) { - return f() -} diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/authentication.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/authentication.pb.go deleted file mode 100644 index 2315ad110..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/authentication.pb.go +++ /dev/null @@ -1,1974 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: authentication.proto -// DO NOT EDIT! - -/* -Package mesosproto is a generated protocol buffer package. - -It is generated from these files: - authentication.proto - authorizer.proto - containerizer.proto - internal.proto - log.proto - mesos.proto - messages.proto - registry.proto - scheduler.proto - state.proto - -It has these top-level messages: - AuthenticateMessage - AuthenticationMechanismsMessage - AuthenticationStartMessage - AuthenticationStepMessage - AuthenticationCompletedMessage - AuthenticationFailedMessage - AuthenticationErrorMessage - ACL - ACLs - Launch - Update - Wait - Destroy - Usage - Termination - Containers - InternalMasterChangeDetected - InternalTryAuthentication - InternalAuthenticationResult - Promise - Action - Metadata - Record - PromiseRequest - PromiseResponse - WriteRequest - WriteResponse - LearnedMessage - RecoverRequest - RecoverResponse - FrameworkID - OfferID - SlaveID - TaskID - ExecutorID - ContainerID - Address - URL - FrameworkInfo - HealthCheck - CommandInfo - ExecutorInfo - MasterInfo - SlaveInfo - Value - Attribute - Resource - TrafficControlStatistics - ResourceStatistics - ResourceUsage - PerfStatistics - Request - Offer - TaskInfo - TaskStatus - Filters - Environment - Parameter - Parameters - Credential - Credentials - RateLimit - RateLimits - Image - Volume - ContainerInfo - Labels - Label - Port - Ports - DiscoveryInfo - AppcImageManifest - Task - StatusUpdate - StatusUpdateRecord - SubmitSchedulerRequest - SubmitSchedulerResponse - ExecutorToFrameworkMessage - FrameworkToExecutorMessage - RegisterFrameworkMessage - ReregisterFrameworkMessage - FrameworkRegisteredMessage - FrameworkReregisteredMessage - UnregisterFrameworkMessage - DeactivateFrameworkMessage - ResourceRequestMessage - ResourceOffersMessage - LaunchTasksMessage - RescindResourceOfferMessage - ReviveOffersMessage - RunTaskMessage - KillTaskMessage - StatusUpdateMessage - StatusUpdateAcknowledgementMessage - LostSlaveMessage - ReconcileTasksMessage - FrameworkErrorMessage - RegisterSlaveMessage - ReregisterSlaveMessage - SlaveRegisteredMessage - SlaveReregisteredMessage - UnregisterSlaveMessage - MasterSlaveConnection - PingSlaveMessage - PongSlaveMessage - ShutdownFrameworkMessage - ShutdownExecutorMessage - UpdateFrameworkMessage - CheckpointResourcesMessage - UpdateSlaveMessage - RegisterExecutorMessage - ExecutorRegisteredMessage - ExecutorReregisteredMessage - ExitedExecutorMessage - ReconnectExecutorMessage - ReregisterExecutorMessage - ShutdownMessage - Archive - TaskHealthStatus - HookExecuted - Registry - Event - Call - Entry - Operation -*/ -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type AuthenticateMessage struct { - Pid *string `protobuf:"bytes,1,req,name=pid" json:"pid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticateMessage) Reset() { *m = AuthenticateMessage{} } -func (*AuthenticateMessage) ProtoMessage() {} - -func (m *AuthenticateMessage) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} - -type AuthenticationMechanismsMessage struct { - Mechanisms []string `protobuf:"bytes,1,rep,name=mechanisms" json:"mechanisms,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationMechanismsMessage) Reset() { *m = AuthenticationMechanismsMessage{} } -func (*AuthenticationMechanismsMessage) ProtoMessage() {} - -func (m *AuthenticationMechanismsMessage) GetMechanisms() []string { - if m != nil { - return m.Mechanisms - } - return nil -} - -type AuthenticationStartMessage struct { - Mechanism *string `protobuf:"bytes,1,req,name=mechanism" json:"mechanism,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationStartMessage) Reset() { *m = AuthenticationStartMessage{} } -func (*AuthenticationStartMessage) ProtoMessage() {} - -func (m *AuthenticationStartMessage) GetMechanism() string { - if m != nil && m.Mechanism != nil { - return *m.Mechanism - } - return "" -} - -func (m *AuthenticationStartMessage) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -type AuthenticationStepMessage struct { - Data []byte `protobuf:"bytes,1,req,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationStepMessage) Reset() { *m = AuthenticationStepMessage{} } -func (*AuthenticationStepMessage) ProtoMessage() {} - -func (m *AuthenticationStepMessage) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -type AuthenticationCompletedMessage struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationCompletedMessage) Reset() { *m = AuthenticationCompletedMessage{} } -func (*AuthenticationCompletedMessage) ProtoMessage() {} - -type AuthenticationFailedMessage struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationFailedMessage) Reset() { *m = AuthenticationFailedMessage{} } -func (*AuthenticationFailedMessage) ProtoMessage() {} - -type AuthenticationErrorMessage struct { - Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AuthenticationErrorMessage) Reset() { *m = AuthenticationErrorMessage{} } -func (*AuthenticationErrorMessage) ProtoMessage() {} - -func (m *AuthenticationErrorMessage) GetError() string { - if m != nil && m.Error != nil { - return *m.Error - } - return "" -} - -func (this *AuthenticateMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AuthenticateMessage) - if !ok { - return fmt.Errorf("that is not of type *AuthenticateMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AuthenticateMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AuthenticateMessagebut is not nil && this == nil") - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) - } - } else if this.Pid != nil { - return fmt.Errorf("this.Pid == nil && that.Pid != nil") - } else if that1.Pid != nil { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AuthenticateMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AuthenticateMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return false - } - } else if this.Pid != nil { - return false - } else if that1.Pid != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AuthenticationMechanismsMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AuthenticationMechanismsMessage) - if !ok { - return fmt.Errorf("that is not of type *AuthenticationMechanismsMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AuthenticationMechanismsMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AuthenticationMechanismsMessagebut is not nil && this == nil") - } - if len(this.Mechanisms) != len(that1.Mechanisms) { - return fmt.Errorf("Mechanisms this(%v) Not Equal that(%v)", len(this.Mechanisms), len(that1.Mechanisms)) - } - for i := range this.Mechanisms { - if this.Mechanisms[i] != that1.Mechanisms[i] { - return fmt.Errorf("Mechanisms this[%v](%v) Not Equal that[%v](%v)", i, this.Mechanisms[i], i, that1.Mechanisms[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AuthenticationMechanismsMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AuthenticationMechanismsMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Mechanisms) != len(that1.Mechanisms) { - return false - } - for i := range this.Mechanisms { - if this.Mechanisms[i] != that1.Mechanisms[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AuthenticationStartMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AuthenticationStartMessage) - if !ok { - return fmt.Errorf("that is not of type *AuthenticationStartMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AuthenticationStartMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AuthenticationStartMessagebut is not nil && this == nil") - } - if this.Mechanism != nil && that1.Mechanism != nil { - if *this.Mechanism != *that1.Mechanism { - return fmt.Errorf("Mechanism this(%v) Not Equal that(%v)", *this.Mechanism, *that1.Mechanism) - } - } else if this.Mechanism != nil { - return fmt.Errorf("this.Mechanism == nil && that.Mechanism != nil") - } else if that1.Mechanism != nil { - return fmt.Errorf("Mechanism this(%v) Not Equal that(%v)", this.Mechanism, that1.Mechanism) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AuthenticationStartMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AuthenticationStartMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Mechanism != nil && that1.Mechanism != nil { - if *this.Mechanism != *that1.Mechanism { - return false - } - } else if this.Mechanism != nil { - return false - } else if that1.Mechanism != nil { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AuthenticationStepMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AuthenticationStepMessage) - if !ok { - return fmt.Errorf("that is not of type *AuthenticationStepMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AuthenticationStepMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AuthenticationStepMessagebut is not nil && this == nil") - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AuthenticationStepMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AuthenticationStepMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AuthenticationCompletedMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AuthenticationCompletedMessage) - if !ok { - return fmt.Errorf("that is not of type *AuthenticationCompletedMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AuthenticationCompletedMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AuthenticationCompletedMessagebut is not nil && this == nil") - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AuthenticationCompletedMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AuthenticationCompletedMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AuthenticationFailedMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AuthenticationFailedMessage) - if !ok { - return fmt.Errorf("that is not of type *AuthenticationFailedMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AuthenticationFailedMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AuthenticationFailedMessagebut is not nil && this == nil") - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AuthenticationFailedMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AuthenticationFailedMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AuthenticationErrorMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AuthenticationErrorMessage) - if !ok { - return fmt.Errorf("that is not of type *AuthenticationErrorMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AuthenticationErrorMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AuthenticationErrorMessagebut is not nil && this == nil") - } - if this.Error != nil && that1.Error != nil { - if *this.Error != *that1.Error { - return fmt.Errorf("Error this(%v) Not Equal that(%v)", *this.Error, *that1.Error) - } - } else if this.Error != nil { - return fmt.Errorf("this.Error == nil && that.Error != nil") - } else if that1.Error != nil { - return fmt.Errorf("Error this(%v) Not Equal that(%v)", this.Error, that1.Error) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AuthenticationErrorMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AuthenticationErrorMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Error != nil && that1.Error != nil { - if *this.Error != *that1.Error { - return false - } - } else if this.Error != nil { - return false - } else if that1.Error != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AuthenticateMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.AuthenticateMessage{") - if this.Pid != nil { - s = append(s, "Pid: "+valueToGoStringAuthentication(this.Pid, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AuthenticationMechanismsMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.AuthenticationMechanismsMessage{") - if this.Mechanisms != nil { - s = append(s, "Mechanisms: "+fmt.Sprintf("%#v", this.Mechanisms)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AuthenticationStartMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.AuthenticationStartMessage{") - if this.Mechanism != nil { - s = append(s, "Mechanism: "+valueToGoStringAuthentication(this.Mechanism, "string")+",\n") - } - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringAuthentication(this.Data, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AuthenticationStepMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.AuthenticationStepMessage{") - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringAuthentication(this.Data, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AuthenticationCompletedMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&mesosproto.AuthenticationCompletedMessage{") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AuthenticationFailedMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&mesosproto.AuthenticationFailedMessage{") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AuthenticationErrorMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.AuthenticationErrorMessage{") - if this.Error != nil { - s = append(s, "Error: "+valueToGoStringAuthentication(this.Error, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringAuthentication(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringAuthentication(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *AuthenticateMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AuthenticateMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Pid == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("pid") - } else { - data[i] = 0xa - i++ - i = encodeVarintAuthentication(data, i, uint64(len(*m.Pid))) - i += copy(data[i:], *m.Pid) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AuthenticationMechanismsMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AuthenticationMechanismsMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Mechanisms) > 0 { - for _, s := range m.Mechanisms { - data[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AuthenticationStartMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AuthenticationStartMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Mechanism == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("mechanism") - } else { - data[i] = 0xa - i++ - i = encodeVarintAuthentication(data, i, uint64(len(*m.Mechanism))) - i += copy(data[i:], *m.Mechanism) - } - if m.Data != nil { - data[i] = 0x12 - i++ - i = encodeVarintAuthentication(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AuthenticationStepMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AuthenticationStepMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Data == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } else { - data[i] = 0xa - i++ - i = encodeVarintAuthentication(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AuthenticationCompletedMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AuthenticationCompletedMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AuthenticationFailedMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AuthenticationFailedMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AuthenticationErrorMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AuthenticationErrorMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Error != nil { - data[i] = 0xa - i++ - i = encodeVarintAuthentication(data, i, uint64(len(*m.Error))) - i += copy(data[i:], *m.Error) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Authentication(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Authentication(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintAuthentication(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedAuthenticateMessage(r randyAuthentication, easy bool) *AuthenticateMessage { - this := &AuthenticateMessage{} - v1 := randStringAuthentication(r) - this.Pid = &v1 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthentication(r, 2) - } - return this -} - -func NewPopulatedAuthenticationMechanismsMessage(r randyAuthentication, easy bool) *AuthenticationMechanismsMessage { - this := &AuthenticationMechanismsMessage{} - if r.Intn(10) != 0 { - v2 := r.Intn(10) - this.Mechanisms = make([]string, v2) - for i := 0; i < v2; i++ { - this.Mechanisms[i] = randStringAuthentication(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthentication(r, 2) - } - return this -} - -func NewPopulatedAuthenticationStartMessage(r randyAuthentication, easy bool) *AuthenticationStartMessage { - this := &AuthenticationStartMessage{} - v3 := randStringAuthentication(r) - this.Mechanism = &v3 - if r.Intn(10) != 0 { - v4 := r.Intn(100) - this.Data = make([]byte, v4) - for i := 0; i < v4; i++ { - this.Data[i] = byte(r.Intn(256)) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthentication(r, 3) - } - return this -} - -func NewPopulatedAuthenticationStepMessage(r randyAuthentication, easy bool) *AuthenticationStepMessage { - this := &AuthenticationStepMessage{} - v5 := r.Intn(100) - this.Data = make([]byte, v5) - for i := 0; i < v5; i++ { - this.Data[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthentication(r, 2) - } - return this -} - -func NewPopulatedAuthenticationCompletedMessage(r randyAuthentication, easy bool) *AuthenticationCompletedMessage { - this := &AuthenticationCompletedMessage{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthentication(r, 1) - } - return this -} - -func NewPopulatedAuthenticationFailedMessage(r randyAuthentication, easy bool) *AuthenticationFailedMessage { - this := &AuthenticationFailedMessage{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthentication(r, 1) - } - return this -} - -func NewPopulatedAuthenticationErrorMessage(r randyAuthentication, easy bool) *AuthenticationErrorMessage { - this := &AuthenticationErrorMessage{} - if r.Intn(10) != 0 { - v6 := randStringAuthentication(r) - this.Error = &v6 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthentication(r, 2) - } - return this -} - -type randyAuthentication interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneAuthentication(r randyAuthentication) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringAuthentication(r randyAuthentication) string { - v7 := r.Intn(100) - tmps := make([]rune, v7) - for i := 0; i < v7; i++ { - tmps[i] = randUTF8RuneAuthentication(r) - } - return string(tmps) -} -func randUnrecognizedAuthentication(r randyAuthentication, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldAuthentication(data, r, fieldNumber, wire) - } - return data -} -func randFieldAuthentication(data []byte, r randyAuthentication, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateAuthentication(data, uint64(key)) - v8 := r.Int63() - if r.Intn(2) == 0 { - v8 *= -1 - } - data = encodeVarintPopulateAuthentication(data, uint64(v8)) - case 1: - data = encodeVarintPopulateAuthentication(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateAuthentication(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateAuthentication(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateAuthentication(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateAuthentication(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *AuthenticateMessage) Size() (n int) { - var l int - _ = l - if m.Pid != nil { - l = len(*m.Pid) - n += 1 + l + sovAuthentication(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthenticationMechanismsMessage) Size() (n int) { - var l int - _ = l - if len(m.Mechanisms) > 0 { - for _, s := range m.Mechanisms { - l = len(s) - n += 1 + l + sovAuthentication(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthenticationStartMessage) Size() (n int) { - var l int - _ = l - if m.Mechanism != nil { - l = len(*m.Mechanism) - n += 1 + l + sovAuthentication(uint64(l)) - } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovAuthentication(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthenticationStepMessage) Size() (n int) { - var l int - _ = l - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovAuthentication(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthenticationCompletedMessage) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthenticationFailedMessage) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AuthenticationErrorMessage) Size() (n int) { - var l int - _ = l - if m.Error != nil { - l = len(*m.Error) - n += 1 + l + sovAuthentication(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovAuthentication(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozAuthentication(x uint64) (n int) { - return sovAuthentication(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *AuthenticateMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuthenticateMessage{`, - `Pid:` + valueToStringAuthentication(this.Pid) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AuthenticationMechanismsMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuthenticationMechanismsMessage{`, - `Mechanisms:` + fmt.Sprintf("%v", this.Mechanisms) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AuthenticationStartMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuthenticationStartMessage{`, - `Mechanism:` + valueToStringAuthentication(this.Mechanism) + `,`, - `Data:` + valueToStringAuthentication(this.Data) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AuthenticationStepMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuthenticationStepMessage{`, - `Data:` + valueToStringAuthentication(this.Data) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AuthenticationCompletedMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuthenticationCompletedMessage{`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AuthenticationFailedMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuthenticationFailedMessage{`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AuthenticationErrorMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AuthenticationErrorMessage{`, - `Error:` + valueToStringAuthentication(this.Error) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringAuthentication(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *AuthenticateMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAuthentication - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Pid = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthentication(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthentication - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("pid") - } - - return nil -} -func (m *AuthenticationMechanismsMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mechanisms", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAuthentication - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Mechanisms = append(m.Mechanisms, string(data[iNdEx:postIndex])) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthentication(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthentication - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *AuthenticationStartMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mechanism", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAuthentication - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Mechanism = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuthentication - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthentication(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthentication - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("mechanism") - } - - return nil -} -func (m *AuthenticationStepMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuthentication - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthentication(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthentication - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } - - return nil -} -func (m *AuthenticationCompletedMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthentication(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthentication - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *AuthenticationFailedMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthentication(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthentication - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *AuthenticationErrorMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAuthentication - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Error = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthentication(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthentication - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func skipAuthentication(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthAuthentication - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipAuthentication(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthAuthentication = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/authorizer.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/authorizer.pb.go deleted file mode 100644 index 6e06b300d..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/authorizer.pb.go +++ /dev/null @@ -1,2183 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: authorizer.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type ACL_Entity_Type int32 - -const ( - ACL_Entity_SOME ACL_Entity_Type = 0 - ACL_Entity_ANY ACL_Entity_Type = 1 - ACL_Entity_NONE ACL_Entity_Type = 2 -) - -var ACL_Entity_Type_name = map[int32]string{ - 0: "SOME", - 1: "ANY", - 2: "NONE", -} -var ACL_Entity_Type_value = map[string]int32{ - "SOME": 0, - "ANY": 1, - "NONE": 2, -} - -func (x ACL_Entity_Type) Enum() *ACL_Entity_Type { - p := new(ACL_Entity_Type) - *p = x - return p -} -func (x ACL_Entity_Type) String() string { - return proto.EnumName(ACL_Entity_Type_name, int32(x)) -} -func (x *ACL_Entity_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ACL_Entity_Type_value, data, "ACL_Entity_Type") - if err != nil { - return err - } - *x = ACL_Entity_Type(value) - return nil -} - -// * -// ACLs used for local authorization (See authorization.md file in the -// docs). -type ACL struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *ACL) Reset() { *m = ACL{} } -func (*ACL) ProtoMessage() {} - -// Entity is used to describe a subject(s) or an object(s) of an ACL. -// NOTE: -// To allow everyone access to an Entity set its type to 'ANY'. -// To deny access to an Entity set its type to 'NONE'. -type ACL_Entity struct { - Type *ACL_Entity_Type `protobuf:"varint,1,opt,name=type,enum=mesosproto.ACL_Entity_Type,def=0" json:"type,omitempty"` - Values []string `protobuf:"bytes,2,rep,name=values" json:"values,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ACL_Entity) Reset() { *m = ACL_Entity{} } -func (*ACL_Entity) ProtoMessage() {} - -const Default_ACL_Entity_Type ACL_Entity_Type = ACL_Entity_SOME - -func (m *ACL_Entity) GetType() ACL_Entity_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Default_ACL_Entity_Type -} - -func (m *ACL_Entity) GetValues() []string { - if m != nil { - return m.Values - } - return nil -} - -// ACLs. -type ACL_RegisterFramework struct { - // Subjects. - Principals *ACL_Entity `protobuf:"bytes,1,req,name=principals" json:"principals,omitempty"` - // Objects. - Roles *ACL_Entity `protobuf:"bytes,2,req,name=roles" json:"roles,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ACL_RegisterFramework) Reset() { *m = ACL_RegisterFramework{} } -func (*ACL_RegisterFramework) ProtoMessage() {} - -func (m *ACL_RegisterFramework) GetPrincipals() *ACL_Entity { - if m != nil { - return m.Principals - } - return nil -} - -func (m *ACL_RegisterFramework) GetRoles() *ACL_Entity { - if m != nil { - return m.Roles - } - return nil -} - -type ACL_RunTask struct { - // Subjects. - Principals *ACL_Entity `protobuf:"bytes,1,req,name=principals" json:"principals,omitempty"` - // Objects. - Users *ACL_Entity `protobuf:"bytes,2,req,name=users" json:"users,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ACL_RunTask) Reset() { *m = ACL_RunTask{} } -func (*ACL_RunTask) ProtoMessage() {} - -func (m *ACL_RunTask) GetPrincipals() *ACL_Entity { - if m != nil { - return m.Principals - } - return nil -} - -func (m *ACL_RunTask) GetUsers() *ACL_Entity { - if m != nil { - return m.Users - } - return nil -} - -// Which principals are authorized to shutdown frameworks of other -// principals. -type ACL_ShutdownFramework struct { - // Subjects. - Principals *ACL_Entity `protobuf:"bytes,1,req,name=principals" json:"principals,omitempty"` - // Objects. - FrameworkPrincipals *ACL_Entity `protobuf:"bytes,2,req,name=framework_principals" json:"framework_principals,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ACL_ShutdownFramework) Reset() { *m = ACL_ShutdownFramework{} } -func (*ACL_ShutdownFramework) ProtoMessage() {} - -func (m *ACL_ShutdownFramework) GetPrincipals() *ACL_Entity { - if m != nil { - return m.Principals - } - return nil -} - -func (m *ACL_ShutdownFramework) GetFrameworkPrincipals() *ACL_Entity { - if m != nil { - return m.FrameworkPrincipals - } - return nil -} - -// * -// Collection of ACL. -// -// Each authorization request is evaluated against the ACLs in the order -// they are defined. -// -// For simplicity, the ACLs for a given action are not aggregated even -// when they have the same subjects or objects. The first ACL that -// matches the request determines whether that request should be -// permitted or not. An ACL matches iff both the subjects -// (e.g., clients, principals) and the objects (e.g., urls, users, -// roles) of the ACL match the request. -// -// If none of the ACLs match the request, the 'permissive' field -// determines whether the request should be permitted or not. -// -// TODO(vinod): Do aggregation of ACLs when possible. -// -type ACLs struct { - Permissive *bool `protobuf:"varint,1,opt,name=permissive,def=1" json:"permissive,omitempty"` - RegisterFrameworks []*ACL_RegisterFramework `protobuf:"bytes,2,rep,name=register_frameworks" json:"register_frameworks,omitempty"` - RunTasks []*ACL_RunTask `protobuf:"bytes,3,rep,name=run_tasks" json:"run_tasks,omitempty"` - ShutdownFrameworks []*ACL_ShutdownFramework `protobuf:"bytes,4,rep,name=shutdown_frameworks" json:"shutdown_frameworks,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ACLs) Reset() { *m = ACLs{} } -func (*ACLs) ProtoMessage() {} - -const Default_ACLs_Permissive bool = true - -func (m *ACLs) GetPermissive() bool { - if m != nil && m.Permissive != nil { - return *m.Permissive - } - return Default_ACLs_Permissive -} - -func (m *ACLs) GetRegisterFrameworks() []*ACL_RegisterFramework { - if m != nil { - return m.RegisterFrameworks - } - return nil -} - -func (m *ACLs) GetRunTasks() []*ACL_RunTask { - if m != nil { - return m.RunTasks - } - return nil -} - -func (m *ACLs) GetShutdownFrameworks() []*ACL_ShutdownFramework { - if m != nil { - return m.ShutdownFrameworks - } - return nil -} - -func init() { - proto.RegisterEnum("mesosproto.ACL_Entity_Type", ACL_Entity_Type_name, ACL_Entity_Type_value) -} -func (this *ACL) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL) - if !ok { - return fmt.Errorf("that is not of type *ACL") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ACL but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ACLbut is not nil && this == nil") - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ACL) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL_Entity) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL_Entity) - if !ok { - return fmt.Errorf("that is not of type *ACL_Entity") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ACL_Entity but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ACL_Entitybut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if len(this.Values) != len(that1.Values) { - return fmt.Errorf("Values this(%v) Not Equal that(%v)", len(this.Values), len(that1.Values)) - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return fmt.Errorf("Values this[%v](%v) Not Equal that[%v](%v)", i, this.Values[i], i, that1.Values[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ACL_Entity) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL_Entity) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL_RegisterFramework) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL_RegisterFramework) - if !ok { - return fmt.Errorf("that is not of type *ACL_RegisterFramework") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ACL_RegisterFramework but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ACL_RegisterFrameworkbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) - } - if !this.Roles.Equal(that1.Roles) { - return fmt.Errorf("Roles this(%v) Not Equal that(%v)", this.Roles, that1.Roles) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ACL_RegisterFramework) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL_RegisterFramework) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.Roles.Equal(that1.Roles) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL_RunTask) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL_RunTask) - if !ok { - return fmt.Errorf("that is not of type *ACL_RunTask") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ACL_RunTask but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ACL_RunTaskbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) - } - if !this.Users.Equal(that1.Users) { - return fmt.Errorf("Users this(%v) Not Equal that(%v)", this.Users, that1.Users) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ACL_RunTask) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL_RunTask) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.Users.Equal(that1.Users) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL_ShutdownFramework) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACL_ShutdownFramework) - if !ok { - return fmt.Errorf("that is not of type *ACL_ShutdownFramework") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ACL_ShutdownFramework but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ACL_ShutdownFrameworkbut is not nil && this == nil") - } - if !this.Principals.Equal(that1.Principals) { - return fmt.Errorf("Principals this(%v) Not Equal that(%v)", this.Principals, that1.Principals) - } - if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { - return fmt.Errorf("FrameworkPrincipals this(%v) Not Equal that(%v)", this.FrameworkPrincipals, that1.FrameworkPrincipals) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ACL_ShutdownFramework) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACL_ShutdownFramework) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Principals.Equal(that1.Principals) { - return false - } - if !this.FrameworkPrincipals.Equal(that1.FrameworkPrincipals) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACLs) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ACLs) - if !ok { - return fmt.Errorf("that is not of type *ACLs") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ACLs but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ACLsbut is not nil && this == nil") - } - if this.Permissive != nil && that1.Permissive != nil { - if *this.Permissive != *that1.Permissive { - return fmt.Errorf("Permissive this(%v) Not Equal that(%v)", *this.Permissive, *that1.Permissive) - } - } else if this.Permissive != nil { - return fmt.Errorf("this.Permissive == nil && that.Permissive != nil") - } else if that1.Permissive != nil { - return fmt.Errorf("Permissive this(%v) Not Equal that(%v)", this.Permissive, that1.Permissive) - } - if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { - return fmt.Errorf("RegisterFrameworks this(%v) Not Equal that(%v)", len(this.RegisterFrameworks), len(that1.RegisterFrameworks)) - } - for i := range this.RegisterFrameworks { - if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { - return fmt.Errorf("RegisterFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.RegisterFrameworks[i], i, that1.RegisterFrameworks[i]) - } - } - if len(this.RunTasks) != len(that1.RunTasks) { - return fmt.Errorf("RunTasks this(%v) Not Equal that(%v)", len(this.RunTasks), len(that1.RunTasks)) - } - for i := range this.RunTasks { - if !this.RunTasks[i].Equal(that1.RunTasks[i]) { - return fmt.Errorf("RunTasks this[%v](%v) Not Equal that[%v](%v)", i, this.RunTasks[i], i, that1.RunTasks[i]) - } - } - if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { - return fmt.Errorf("ShutdownFrameworks this(%v) Not Equal that(%v)", len(this.ShutdownFrameworks), len(that1.ShutdownFrameworks)) - } - for i := range this.ShutdownFrameworks { - if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { - return fmt.Errorf("ShutdownFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.ShutdownFrameworks[i], i, that1.ShutdownFrameworks[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ACLs) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ACLs) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Permissive != nil && that1.Permissive != nil { - if *this.Permissive != *that1.Permissive { - return false - } - } else if this.Permissive != nil { - return false - } else if that1.Permissive != nil { - return false - } - if len(this.RegisterFrameworks) != len(that1.RegisterFrameworks) { - return false - } - for i := range this.RegisterFrameworks { - if !this.RegisterFrameworks[i].Equal(that1.RegisterFrameworks[i]) { - return false - } - } - if len(this.RunTasks) != len(that1.RunTasks) { - return false - } - for i := range this.RunTasks { - if !this.RunTasks[i].Equal(that1.RunTasks[i]) { - return false - } - } - if len(this.ShutdownFrameworks) != len(that1.ShutdownFrameworks) { - return false - } - for i := range this.ShutdownFrameworks { - if !this.ShutdownFrameworks[i].Equal(that1.ShutdownFrameworks[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ACL) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&mesosproto.ACL{") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ACL_Entity) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ACL_Entity{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringAuthorizer(this.Type, "mesosproto.ACL_Entity_Type")+",\n") - } - if this.Values != nil { - s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ACL_RegisterFramework) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ACL_RegisterFramework{") - if this.Principals != nil { - s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") - } - if this.Roles != nil { - s = append(s, "Roles: "+fmt.Sprintf("%#v", this.Roles)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ACL_RunTask) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ACL_RunTask{") - if this.Principals != nil { - s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") - } - if this.Users != nil { - s = append(s, "Users: "+fmt.Sprintf("%#v", this.Users)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ACL_ShutdownFramework) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ACL_ShutdownFramework{") - if this.Principals != nil { - s = append(s, "Principals: "+fmt.Sprintf("%#v", this.Principals)+",\n") - } - if this.FrameworkPrincipals != nil { - s = append(s, "FrameworkPrincipals: "+fmt.Sprintf("%#v", this.FrameworkPrincipals)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ACLs) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.ACLs{") - if this.Permissive != nil { - s = append(s, "Permissive: "+valueToGoStringAuthorizer(this.Permissive, "bool")+",\n") - } - if this.RegisterFrameworks != nil { - s = append(s, "RegisterFrameworks: "+fmt.Sprintf("%#v", this.RegisterFrameworks)+",\n") - } - if this.RunTasks != nil { - s = append(s, "RunTasks: "+fmt.Sprintf("%#v", this.RunTasks)+",\n") - } - if this.ShutdownFrameworks != nil { - s = append(s, "ShutdownFrameworks: "+fmt.Sprintf("%#v", this.ShutdownFrameworks)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringAuthorizer(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringAuthorizer(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *ACL) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ACL) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ACL_Entity) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ACL_Entity) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type != nil { - data[i] = 0x8 - i++ - i = encodeVarintAuthorizer(data, i, uint64(*m.Type)) - } - if len(m.Values) > 0 { - for _, s := range m.Values { - data[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ACL_RegisterFramework) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ACL_RegisterFramework) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Principals == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") - } else { - data[i] = 0xa - i++ - i = encodeVarintAuthorizer(data, i, uint64(m.Principals.Size())) - n1, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.Roles == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("roles") - } else { - data[i] = 0x12 - i++ - i = encodeVarintAuthorizer(data, i, uint64(m.Roles.Size())) - n2, err := m.Roles.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ACL_RunTask) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ACL_RunTask) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Principals == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") - } else { - data[i] = 0xa - i++ - i = encodeVarintAuthorizer(data, i, uint64(m.Principals.Size())) - n3, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.Users == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("users") - } else { - data[i] = 0x12 - i++ - i = encodeVarintAuthorizer(data, i, uint64(m.Users.Size())) - n4, err := m.Users.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ACL_ShutdownFramework) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ACL_ShutdownFramework) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Principals == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") - } else { - data[i] = 0xa - i++ - i = encodeVarintAuthorizer(data, i, uint64(m.Principals.Size())) - n5, err := m.Principals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.FrameworkPrincipals == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_principals") - } else { - data[i] = 0x12 - i++ - i = encodeVarintAuthorizer(data, i, uint64(m.FrameworkPrincipals.Size())) - n6, err := m.FrameworkPrincipals.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ACLs) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ACLs) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Permissive != nil { - data[i] = 0x8 - i++ - if *m.Permissive { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if len(m.RegisterFrameworks) > 0 { - for _, msg := range m.RegisterFrameworks { - data[i] = 0x12 - i++ - i = encodeVarintAuthorizer(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.RunTasks) > 0 { - for _, msg := range m.RunTasks { - data[i] = 0x1a - i++ - i = encodeVarintAuthorizer(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.ShutdownFrameworks) > 0 { - for _, msg := range m.ShutdownFrameworks { - data[i] = 0x22 - i++ - i = encodeVarintAuthorizer(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Authorizer(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Authorizer(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintAuthorizer(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedACL(r randyAuthorizer, easy bool) *ACL { - this := &ACL{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthorizer(r, 1) - } - return this -} - -func NewPopulatedACL_Entity(r randyAuthorizer, easy bool) *ACL_Entity { - this := &ACL_Entity{} - if r.Intn(10) != 0 { - v1 := ACL_Entity_Type([]int32{0, 1, 2}[r.Intn(3)]) - this.Type = &v1 - } - if r.Intn(10) != 0 { - v2 := r.Intn(10) - this.Values = make([]string, v2) - for i := 0; i < v2; i++ { - this.Values[i] = randStringAuthorizer(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthorizer(r, 3) - } - return this -} - -func NewPopulatedACL_RegisterFramework(r randyAuthorizer, easy bool) *ACL_RegisterFramework { - this := &ACL_RegisterFramework{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.Roles = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthorizer(r, 3) - } - return this -} - -func NewPopulatedACL_RunTask(r randyAuthorizer, easy bool) *ACL_RunTask { - this := &ACL_RunTask{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.Users = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthorizer(r, 3) - } - return this -} - -func NewPopulatedACL_ShutdownFramework(r randyAuthorizer, easy bool) *ACL_ShutdownFramework { - this := &ACL_ShutdownFramework{} - this.Principals = NewPopulatedACL_Entity(r, easy) - this.FrameworkPrincipals = NewPopulatedACL_Entity(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthorizer(r, 3) - } - return this -} - -func NewPopulatedACLs(r randyAuthorizer, easy bool) *ACLs { - this := &ACLs{} - if r.Intn(10) != 0 { - v3 := bool(bool(r.Intn(2) == 0)) - this.Permissive = &v3 - } - if r.Intn(10) != 0 { - v4 := r.Intn(10) - this.RegisterFrameworks = make([]*ACL_RegisterFramework, v4) - for i := 0; i < v4; i++ { - this.RegisterFrameworks[i] = NewPopulatedACL_RegisterFramework(r, easy) - } - } - if r.Intn(10) != 0 { - v5 := r.Intn(10) - this.RunTasks = make([]*ACL_RunTask, v5) - for i := 0; i < v5; i++ { - this.RunTasks[i] = NewPopulatedACL_RunTask(r, easy) - } - } - if r.Intn(10) != 0 { - v6 := r.Intn(10) - this.ShutdownFrameworks = make([]*ACL_ShutdownFramework, v6) - for i := 0; i < v6; i++ { - this.ShutdownFrameworks[i] = NewPopulatedACL_ShutdownFramework(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAuthorizer(r, 5) - } - return this -} - -type randyAuthorizer interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneAuthorizer(r randyAuthorizer) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringAuthorizer(r randyAuthorizer) string { - v7 := r.Intn(100) - tmps := make([]rune, v7) - for i := 0; i < v7; i++ { - tmps[i] = randUTF8RuneAuthorizer(r) - } - return string(tmps) -} -func randUnrecognizedAuthorizer(r randyAuthorizer, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldAuthorizer(data, r, fieldNumber, wire) - } - return data -} -func randFieldAuthorizer(data []byte, r randyAuthorizer, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateAuthorizer(data, uint64(key)) - v8 := r.Int63() - if r.Intn(2) == 0 { - v8 *= -1 - } - data = encodeVarintPopulateAuthorizer(data, uint64(v8)) - case 1: - data = encodeVarintPopulateAuthorizer(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateAuthorizer(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateAuthorizer(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateAuthorizer(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateAuthorizer(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *ACL) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ACL_Entity) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovAuthorizer(uint64(*m.Type)) - } - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovAuthorizer(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ACL_RegisterFramework) Size() (n int) { - var l int - _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - if m.Roles != nil { - l = m.Roles.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ACL_RunTask) Size() (n int) { - var l int - _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - if m.Users != nil { - l = m.Users.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ACL_ShutdownFramework) Size() (n int) { - var l int - _ = l - if m.Principals != nil { - l = m.Principals.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - if m.FrameworkPrincipals != nil { - l = m.FrameworkPrincipals.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ACLs) Size() (n int) { - var l int - _ = l - if m.Permissive != nil { - n += 2 - } - if len(m.RegisterFrameworks) > 0 { - for _, e := range m.RegisterFrameworks { - l = e.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - } - if len(m.RunTasks) > 0 { - for _, e := range m.RunTasks { - l = e.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - } - if len(m.ShutdownFrameworks) > 0 { - for _, e := range m.ShutdownFrameworks { - l = e.Size() - n += 1 + l + sovAuthorizer(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovAuthorizer(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozAuthorizer(x uint64) (n int) { - return sovAuthorizer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ACL) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ACL{`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ACL_Entity) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ACL_Entity{`, - `Type:` + valueToStringAuthorizer(this.Type) + `,`, - `Values:` + fmt.Sprintf("%v", this.Values) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ACL_RegisterFramework) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ACL_RegisterFramework{`, - `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `Roles:` + strings.Replace(fmt.Sprintf("%v", this.Roles), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ACL_RunTask) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ACL_RunTask{`, - `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `Users:` + strings.Replace(fmt.Sprintf("%v", this.Users), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ACL_ShutdownFramework) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ACL_ShutdownFramework{`, - `Principals:` + strings.Replace(fmt.Sprintf("%v", this.Principals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `FrameworkPrincipals:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkPrincipals), "ACL_Entity", "ACL_Entity", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ACLs) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ACLs{`, - `Permissive:` + valueToStringAuthorizer(this.Permissive) + `,`, - `RegisterFrameworks:` + strings.Replace(fmt.Sprintf("%v", this.RegisterFrameworks), "ACL_RegisterFramework", "ACL_RegisterFramework", 1) + `,`, - `RunTasks:` + strings.Replace(fmt.Sprintf("%v", this.RunTasks), "ACL_RunTask", "ACL_RunTask", 1) + `,`, - `ShutdownFrameworks:` + strings.Replace(fmt.Sprintf("%v", this.ShutdownFrameworks), "ACL_ShutdownFramework", "ACL_ShutdownFramework", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringAuthorizer(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ACL) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthorizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthorizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *ACL_Entity) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v ACL_Entity_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (ACL_Entity_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(data[iNdEx:postIndex])) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthorizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthorizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *ACL_RegisterFramework) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Roles == nil { - m.Roles = &ACL_Entity{} - } - if err := m.Roles.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthorizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthorizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("roles") - } - - return nil -} -func (m *ACL_RunTask) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Users == nil { - m.Users = &ACL_Entity{} - } - if err := m.Users.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthorizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthorizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("users") - } - - return nil -} -func (m *ACL_ShutdownFramework) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Principals == nil { - m.Principals = &ACL_Entity{} - } - if err := m.Principals.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkPrincipals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkPrincipals == nil { - m.FrameworkPrincipals = &ACL_Entity{} - } - if err := m.FrameworkPrincipals.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthorizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthorizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principals") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_principals") - } - - return nil -} -func (m *ACLs) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Permissive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Permissive = &b - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RegisterFrameworks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RegisterFrameworks = append(m.RegisterFrameworks, &ACL_RegisterFramework{}) - if err := m.RegisterFrameworks[len(m.RegisterFrameworks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunTasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RunTasks = append(m.RunTasks, &ACL_RunTask{}) - if err := m.RunTasks[len(m.RunTasks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShutdownFrameworks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthorizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShutdownFrameworks = append(m.ShutdownFrameworks, &ACL_ShutdownFramework{}) - if err := m.ShutdownFrameworks[len(m.ShutdownFrameworks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipAuthorizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthAuthorizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func skipAuthorizer(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthAuthorizer - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipAuthorizer(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthAuthorizer = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go deleted file mode 100644 index 3bb913a1d..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/containerizer.pb.go +++ /dev/null @@ -1,2622 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: containerizer.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// * -// Encodes the launch command sent to the external containerizer -// program. -type Launch struct { - ContainerId *ContainerID `protobuf:"bytes,1,req,name=container_id" json:"container_id,omitempty"` - TaskInfo *TaskInfo `protobuf:"bytes,2,opt,name=task_info" json:"task_info,omitempty"` - ExecutorInfo *ExecutorInfo `protobuf:"bytes,3,opt,name=executor_info" json:"executor_info,omitempty"` - Directory *string `protobuf:"bytes,4,opt,name=directory" json:"directory,omitempty"` - User *string `protobuf:"bytes,5,opt,name=user" json:"user,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,6,opt,name=slave_id" json:"slave_id,omitempty"` - SlavePid *string `protobuf:"bytes,7,opt,name=slave_pid" json:"slave_pid,omitempty"` - Checkpoint *bool `protobuf:"varint,8,opt,name=checkpoint" json:"checkpoint,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Launch) Reset() { *m = Launch{} } -func (*Launch) ProtoMessage() {} - -func (m *Launch) GetContainerId() *ContainerID { - if m != nil { - return m.ContainerId - } - return nil -} - -func (m *Launch) GetTaskInfo() *TaskInfo { - if m != nil { - return m.TaskInfo - } - return nil -} - -func (m *Launch) GetExecutorInfo() *ExecutorInfo { - if m != nil { - return m.ExecutorInfo - } - return nil -} - -func (m *Launch) GetDirectory() string { - if m != nil && m.Directory != nil { - return *m.Directory - } - return "" -} - -func (m *Launch) GetUser() string { - if m != nil && m.User != nil { - return *m.User - } - return "" -} - -func (m *Launch) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *Launch) GetSlavePid() string { - if m != nil && m.SlavePid != nil { - return *m.SlavePid - } - return "" -} - -func (m *Launch) GetCheckpoint() bool { - if m != nil && m.Checkpoint != nil { - return *m.Checkpoint - } - return false -} - -// * -// Encodes the update command sent to the external containerizer -// program. -type Update struct { - ContainerId *ContainerID `protobuf:"bytes,1,req,name=container_id" json:"container_id,omitempty"` - Resources []*Resource `protobuf:"bytes,2,rep,name=resources" json:"resources,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Update) Reset() { *m = Update{} } -func (*Update) ProtoMessage() {} - -func (m *Update) GetContainerId() *ContainerID { - if m != nil { - return m.ContainerId - } - return nil -} - -func (m *Update) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -// * -// Encodes the wait command sent to the external containerizer -// program. -type Wait struct { - ContainerId *ContainerID `protobuf:"bytes,1,req,name=container_id" json:"container_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Wait) Reset() { *m = Wait{} } -func (*Wait) ProtoMessage() {} - -func (m *Wait) GetContainerId() *ContainerID { - if m != nil { - return m.ContainerId - } - return nil -} - -// * -// Encodes the destroy command sent to the external containerizer -// program. -type Destroy struct { - ContainerId *ContainerID `protobuf:"bytes,1,req,name=container_id" json:"container_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Destroy) Reset() { *m = Destroy{} } -func (*Destroy) ProtoMessage() {} - -func (m *Destroy) GetContainerId() *ContainerID { - if m != nil { - return m.ContainerId - } - return nil -} - -// * -// Encodes the usage command sent to the external containerizer -// program. -type Usage struct { - ContainerId *ContainerID `protobuf:"bytes,1,req,name=container_id" json:"container_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Usage) Reset() { *m = Usage{} } -func (*Usage) ProtoMessage() {} - -func (m *Usage) GetContainerId() *ContainerID { - if m != nil { - return m.ContainerId - } - return nil -} - -// * -// Information about a container termination, returned by the -// containerizer to the slave. -type Termination struct { - // A container may be killed if it exceeds its resources; this will - // be indicated by killed=true and described by the message string. - // TODO(jaybuff): As part of MESOS-2035 we should remove killed and - // replace it with a TaskStatus::Reason. - Killed *bool `protobuf:"varint,1,req,name=killed" json:"killed,omitempty"` - Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"` - // Exit status of the process. - Status *int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Termination) Reset() { *m = Termination{} } -func (*Termination) ProtoMessage() {} - -func (m *Termination) GetKilled() bool { - if m != nil && m.Killed != nil { - return *m.Killed - } - return false -} - -func (m *Termination) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *Termination) GetStatus() int32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -// * -// Information on all active containers returned by the containerizer -// to the slave. -type Containers struct { - Containers []*ContainerID `protobuf:"bytes,1,rep,name=containers" json:"containers,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Containers) Reset() { *m = Containers{} } -func (*Containers) ProtoMessage() {} - -func (m *Containers) GetContainers() []*ContainerID { - if m != nil { - return m.Containers - } - return nil -} - -func (this *Launch) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Launch) - if !ok { - return fmt.Errorf("that is not of type *Launch") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Launch but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Launchbut is not nil && this == nil") - } - if !this.ContainerId.Equal(that1.ContainerId) { - return fmt.Errorf("ContainerId this(%v) Not Equal that(%v)", this.ContainerId, that1.ContainerId) - } - if !this.TaskInfo.Equal(that1.TaskInfo) { - return fmt.Errorf("TaskInfo this(%v) Not Equal that(%v)", this.TaskInfo, that1.TaskInfo) - } - if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { - return fmt.Errorf("ExecutorInfo this(%v) Not Equal that(%v)", this.ExecutorInfo, that1.ExecutorInfo) - } - if this.Directory != nil && that1.Directory != nil { - if *this.Directory != *that1.Directory { - return fmt.Errorf("Directory this(%v) Not Equal that(%v)", *this.Directory, *that1.Directory) - } - } else if this.Directory != nil { - return fmt.Errorf("this.Directory == nil && that.Directory != nil") - } else if that1.Directory != nil { - return fmt.Errorf("Directory this(%v) Not Equal that(%v)", this.Directory, that1.Directory) - } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return fmt.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) - } - } else if this.User != nil { - return fmt.Errorf("this.User == nil && that.User != nil") - } else if that1.User != nil { - return fmt.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if this.SlavePid != nil && that1.SlavePid != nil { - if *this.SlavePid != *that1.SlavePid { - return fmt.Errorf("SlavePid this(%v) Not Equal that(%v)", *this.SlavePid, *that1.SlavePid) - } - } else if this.SlavePid != nil { - return fmt.Errorf("this.SlavePid == nil && that.SlavePid != nil") - } else if that1.SlavePid != nil { - return fmt.Errorf("SlavePid this(%v) Not Equal that(%v)", this.SlavePid, that1.SlavePid) - } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) - } - } else if this.Checkpoint != nil { - return fmt.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") - } else if that1.Checkpoint != nil { - return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Launch) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Launch) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ContainerId.Equal(that1.ContainerId) { - return false - } - if !this.TaskInfo.Equal(that1.TaskInfo) { - return false - } - if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { - return false - } - if this.Directory != nil && that1.Directory != nil { - if *this.Directory != *that1.Directory { - return false - } - } else if this.Directory != nil { - return false - } else if that1.Directory != nil { - return false - } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return false - } - } else if this.User != nil { - return false - } else if that1.User != nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if this.SlavePid != nil && that1.SlavePid != nil { - if *this.SlavePid != *that1.SlavePid { - return false - } - } else if this.SlavePid != nil { - return false - } else if that1.SlavePid != nil { - return false - } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return false - } - } else if this.Checkpoint != nil { - return false - } else if that1.Checkpoint != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Update) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Update) - if !ok { - return fmt.Errorf("that is not of type *Update") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Update but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Updatebut is not nil && this == nil") - } - if !this.ContainerId.Equal(that1.ContainerId) { - return fmt.Errorf("ContainerId this(%v) Not Equal that(%v)", this.ContainerId, that1.ContainerId) - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Update) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Update) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ContainerId.Equal(that1.ContainerId) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Wait) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Wait) - if !ok { - return fmt.Errorf("that is not of type *Wait") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Wait but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Waitbut is not nil && this == nil") - } - if !this.ContainerId.Equal(that1.ContainerId) { - return fmt.Errorf("ContainerId this(%v) Not Equal that(%v)", this.ContainerId, that1.ContainerId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Wait) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Wait) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ContainerId.Equal(that1.ContainerId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Destroy) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Destroy) - if !ok { - return fmt.Errorf("that is not of type *Destroy") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Destroy but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Destroybut is not nil && this == nil") - } - if !this.ContainerId.Equal(that1.ContainerId) { - return fmt.Errorf("ContainerId this(%v) Not Equal that(%v)", this.ContainerId, that1.ContainerId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Destroy) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Destroy) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ContainerId.Equal(that1.ContainerId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Usage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Usage) - if !ok { - return fmt.Errorf("that is not of type *Usage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Usage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Usagebut is not nil && this == nil") - } - if !this.ContainerId.Equal(that1.ContainerId) { - return fmt.Errorf("ContainerId this(%v) Not Equal that(%v)", this.ContainerId, that1.ContainerId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Usage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Usage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ContainerId.Equal(that1.ContainerId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Termination) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Termination) - if !ok { - return fmt.Errorf("that is not of type *Termination") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Termination but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Terminationbut is not nil && this == nil") - } - if this.Killed != nil && that1.Killed != nil { - if *this.Killed != *that1.Killed { - return fmt.Errorf("Killed this(%v) Not Equal that(%v)", *this.Killed, *that1.Killed) - } - } else if this.Killed != nil { - return fmt.Errorf("this.Killed == nil && that.Killed != nil") - } else if that1.Killed != nil { - return fmt.Errorf("Killed this(%v) Not Equal that(%v)", this.Killed, that1.Killed) - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) - } - } else if this.Message != nil { - return fmt.Errorf("this.Message == nil && that.Message != nil") - } else if that1.Message != nil { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Termination) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Termination) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Killed != nil && that1.Killed != nil { - if *this.Killed != *that1.Killed { - return false - } - } else if this.Killed != nil { - return false - } else if that1.Killed != nil { - return false - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return false - } - } else if this.Message != nil { - return false - } else if that1.Message != nil { - return false - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false - } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Containers) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Containers) - if !ok { - return fmt.Errorf("that is not of type *Containers") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Containers but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Containersbut is not nil && this == nil") - } - if len(this.Containers) != len(that1.Containers) { - return fmt.Errorf("Containers this(%v) Not Equal that(%v)", len(this.Containers), len(that1.Containers)) - } - for i := range this.Containers { - if !this.Containers[i].Equal(that1.Containers[i]) { - return fmt.Errorf("Containers this[%v](%v) Not Equal that[%v](%v)", i, this.Containers[i], i, that1.Containers[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Containers) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Containers) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Containers) != len(that1.Containers) { - return false - } - for i := range this.Containers { - if !this.Containers[i].Equal(that1.Containers[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Launch) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&mesosproto.Launch{") - if this.ContainerId != nil { - s = append(s, "ContainerId: "+fmt.Sprintf("%#v", this.ContainerId)+",\n") - } - if this.TaskInfo != nil { - s = append(s, "TaskInfo: "+fmt.Sprintf("%#v", this.TaskInfo)+",\n") - } - if this.ExecutorInfo != nil { - s = append(s, "ExecutorInfo: "+fmt.Sprintf("%#v", this.ExecutorInfo)+",\n") - } - if this.Directory != nil { - s = append(s, "Directory: "+valueToGoStringContainerizer(this.Directory, "string")+",\n") - } - if this.User != nil { - s = append(s, "User: "+valueToGoStringContainerizer(this.User, "string")+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.SlavePid != nil { - s = append(s, "SlavePid: "+valueToGoStringContainerizer(this.SlavePid, "string")+",\n") - } - if this.Checkpoint != nil { - s = append(s, "Checkpoint: "+valueToGoStringContainerizer(this.Checkpoint, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Update) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Update{") - if this.ContainerId != nil { - s = append(s, "ContainerId: "+fmt.Sprintf("%#v", this.ContainerId)+",\n") - } - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Wait) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Wait{") - if this.ContainerId != nil { - s = append(s, "ContainerId: "+fmt.Sprintf("%#v", this.ContainerId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Destroy) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Destroy{") - if this.ContainerId != nil { - s = append(s, "ContainerId: "+fmt.Sprintf("%#v", this.ContainerId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Usage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Usage{") - if this.ContainerId != nil { - s = append(s, "ContainerId: "+fmt.Sprintf("%#v", this.ContainerId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Termination) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Termination{") - if this.Killed != nil { - s = append(s, "Killed: "+valueToGoStringContainerizer(this.Killed, "bool")+",\n") - } - if this.Message != nil { - s = append(s, "Message: "+valueToGoStringContainerizer(this.Message, "string")+",\n") - } - if this.Status != nil { - s = append(s, "Status: "+valueToGoStringContainerizer(this.Status, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Containers) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Containers{") - if this.Containers != nil { - s = append(s, "Containers: "+fmt.Sprintf("%#v", this.Containers)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringContainerizer(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringContainerizer(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *Launch) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Launch) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ContainerId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintContainerizer(data, i, uint64(m.ContainerId.Size())) - n1, err := m.ContainerId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.TaskInfo != nil { - data[i] = 0x12 - i++ - i = encodeVarintContainerizer(data, i, uint64(m.TaskInfo.Size())) - n2, err := m.TaskInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.ExecutorInfo != nil { - data[i] = 0x1a - i++ - i = encodeVarintContainerizer(data, i, uint64(m.ExecutorInfo.Size())) - n3, err := m.ExecutorInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.Directory != nil { - data[i] = 0x22 - i++ - i = encodeVarintContainerizer(data, i, uint64(len(*m.Directory))) - i += copy(data[i:], *m.Directory) - } - if m.User != nil { - data[i] = 0x2a - i++ - i = encodeVarintContainerizer(data, i, uint64(len(*m.User))) - i += copy(data[i:], *m.User) - } - if m.SlaveId != nil { - data[i] = 0x32 - i++ - i = encodeVarintContainerizer(data, i, uint64(m.SlaveId.Size())) - n4, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.SlavePid != nil { - data[i] = 0x3a - i++ - i = encodeVarintContainerizer(data, i, uint64(len(*m.SlavePid))) - i += copy(data[i:], *m.SlavePid) - } - if m.Checkpoint != nil { - data[i] = 0x40 - i++ - if *m.Checkpoint { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Update) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Update) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ContainerId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintContainerizer(data, i, uint64(m.ContainerId.Size())) - n5, err := m.ContainerId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x12 - i++ - i = encodeVarintContainerizer(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Wait) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Wait) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ContainerId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintContainerizer(data, i, uint64(m.ContainerId.Size())) - n6, err := m.ContainerId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Destroy) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Destroy) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ContainerId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintContainerizer(data, i, uint64(m.ContainerId.Size())) - n7, err := m.ContainerId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Usage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Usage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ContainerId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintContainerizer(data, i, uint64(m.ContainerId.Size())) - n8, err := m.ContainerId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Termination) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Termination) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Killed == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("killed") - } else { - data[i] = 0x8 - i++ - if *m.Killed { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Message == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") - } else { - data[i] = 0x12 - i++ - i = encodeVarintContainerizer(data, i, uint64(len(*m.Message))) - i += copy(data[i:], *m.Message) - } - if m.Status != nil { - data[i] = 0x18 - i++ - i = encodeVarintContainerizer(data, i, uint64(*m.Status)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Containers) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Containers) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Containers) > 0 { - for _, msg := range m.Containers { - data[i] = 0xa - i++ - i = encodeVarintContainerizer(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Containerizer(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Containerizer(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintContainerizer(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedLaunch(r randyContainerizer, easy bool) *Launch { - this := &Launch{} - this.ContainerId = NewPopulatedContainerID(r, easy) - if r.Intn(10) != 0 { - this.TaskInfo = NewPopulatedTaskInfo(r, easy) - } - if r.Intn(10) != 0 { - this.ExecutorInfo = NewPopulatedExecutorInfo(r, easy) - } - if r.Intn(10) != 0 { - v1 := randStringContainerizer(r) - this.Directory = &v1 - } - if r.Intn(10) != 0 { - v2 := randStringContainerizer(r) - this.User = &v2 - } - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) - } - if r.Intn(10) != 0 { - v3 := randStringContainerizer(r) - this.SlavePid = &v3 - } - if r.Intn(10) != 0 { - v4 := bool(bool(r.Intn(2) == 0)) - this.Checkpoint = &v4 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedContainerizer(r, 9) - } - return this -} - -func NewPopulatedUpdate(r randyContainerizer, easy bool) *Update { - this := &Update{} - this.ContainerId = NewPopulatedContainerID(r, easy) - if r.Intn(10) != 0 { - v5 := r.Intn(10) - this.Resources = make([]*Resource, v5) - for i := 0; i < v5; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedContainerizer(r, 3) - } - return this -} - -func NewPopulatedWait(r randyContainerizer, easy bool) *Wait { - this := &Wait{} - this.ContainerId = NewPopulatedContainerID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedContainerizer(r, 2) - } - return this -} - -func NewPopulatedDestroy(r randyContainerizer, easy bool) *Destroy { - this := &Destroy{} - this.ContainerId = NewPopulatedContainerID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedContainerizer(r, 2) - } - return this -} - -func NewPopulatedUsage(r randyContainerizer, easy bool) *Usage { - this := &Usage{} - this.ContainerId = NewPopulatedContainerID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedContainerizer(r, 2) - } - return this -} - -func NewPopulatedTermination(r randyContainerizer, easy bool) *Termination { - this := &Termination{} - v6 := bool(bool(r.Intn(2) == 0)) - this.Killed = &v6 - v7 := randStringContainerizer(r) - this.Message = &v7 - if r.Intn(10) != 0 { - v8 := int32(r.Int31()) - if r.Intn(2) == 0 { - v8 *= -1 - } - this.Status = &v8 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedContainerizer(r, 4) - } - return this -} - -func NewPopulatedContainers(r randyContainerizer, easy bool) *Containers { - this := &Containers{} - if r.Intn(10) != 0 { - v9 := r.Intn(10) - this.Containers = make([]*ContainerID, v9) - for i := 0; i < v9; i++ { - this.Containers[i] = NewPopulatedContainerID(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedContainerizer(r, 2) - } - return this -} - -type randyContainerizer interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneContainerizer(r randyContainerizer) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringContainerizer(r randyContainerizer) string { - v10 := r.Intn(100) - tmps := make([]rune, v10) - for i := 0; i < v10; i++ { - tmps[i] = randUTF8RuneContainerizer(r) - } - return string(tmps) -} -func randUnrecognizedContainerizer(r randyContainerizer, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldContainerizer(data, r, fieldNumber, wire) - } - return data -} -func randFieldContainerizer(data []byte, r randyContainerizer, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateContainerizer(data, uint64(key)) - v11 := r.Int63() - if r.Intn(2) == 0 { - v11 *= -1 - } - data = encodeVarintPopulateContainerizer(data, uint64(v11)) - case 1: - data = encodeVarintPopulateContainerizer(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateContainerizer(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateContainerizer(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateContainerizer(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateContainerizer(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *Launch) Size() (n int) { - var l int - _ = l - if m.ContainerId != nil { - l = m.ContainerId.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.TaskInfo != nil { - l = m.TaskInfo.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.ExecutorInfo != nil { - l = m.ExecutorInfo.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.Directory != nil { - l = len(*m.Directory) - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.User != nil { - l = len(*m.User) - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.SlavePid != nil { - l = len(*m.SlavePid) - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.Checkpoint != nil { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Update) Size() (n int) { - var l int - _ = l - if m.ContainerId != nil { - l = m.ContainerId.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Wait) Size() (n int) { - var l int - _ = l - if m.ContainerId != nil { - l = m.ContainerId.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Destroy) Size() (n int) { - var l int - _ = l - if m.ContainerId != nil { - l = m.ContainerId.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Usage) Size() (n int) { - var l int - _ = l - if m.ContainerId != nil { - l = m.ContainerId.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Termination) Size() (n int) { - var l int - _ = l - if m.Killed != nil { - n += 2 - } - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovContainerizer(uint64(l)) - } - if m.Status != nil { - n += 1 + sovContainerizer(uint64(*m.Status)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Containers) Size() (n int) { - var l int - _ = l - if len(m.Containers) > 0 { - for _, e := range m.Containers { - l = e.Size() - n += 1 + l + sovContainerizer(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovContainerizer(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozContainerizer(x uint64) (n int) { - return sovContainerizer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Launch) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Launch{`, - `ContainerId:` + strings.Replace(fmt.Sprintf("%v", this.ContainerId), "ContainerID", "ContainerID", 1) + `,`, - `TaskInfo:` + strings.Replace(fmt.Sprintf("%v", this.TaskInfo), "TaskInfo", "TaskInfo", 1) + `,`, - `ExecutorInfo:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorInfo), "ExecutorInfo", "ExecutorInfo", 1) + `,`, - `Directory:` + valueToStringContainerizer(this.Directory) + `,`, - `User:` + valueToStringContainerizer(this.User) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `SlavePid:` + valueToStringContainerizer(this.SlavePid) + `,`, - `Checkpoint:` + valueToStringContainerizer(this.Checkpoint) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Update) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Update{`, - `ContainerId:` + strings.Replace(fmt.Sprintf("%v", this.ContainerId), "ContainerID", "ContainerID", 1) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Wait) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Wait{`, - `ContainerId:` + strings.Replace(fmt.Sprintf("%v", this.ContainerId), "ContainerID", "ContainerID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Destroy) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Destroy{`, - `ContainerId:` + strings.Replace(fmt.Sprintf("%v", this.ContainerId), "ContainerID", "ContainerID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Usage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Usage{`, - `ContainerId:` + strings.Replace(fmt.Sprintf("%v", this.ContainerId), "ContainerID", "ContainerID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Termination) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Termination{`, - `Killed:` + valueToStringContainerizer(this.Killed) + `,`, - `Message:` + valueToStringContainerizer(this.Message) + `,`, - `Status:` + valueToStringContainerizer(this.Status) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Containers) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Containers{`, - `Containers:` + strings.Replace(fmt.Sprintf("%v", this.Containers), "ContainerID", "ContainerID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringContainerizer(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Launch) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ContainerId == nil { - m.ContainerId = &ContainerID{} - } - if err := m.ContainerId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskInfo == nil { - m.TaskInfo = &TaskInfo{} - } - if err := m.TaskInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorInfo == nil { - m.ExecutorInfo = &ExecutorInfo{} - } - if err := m.ExecutorInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Directory", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Directory = &s - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.User = &s - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlavePid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.SlavePid = &s - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Checkpoint = &b - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipContainerizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthContainerizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } - - return nil -} -func (m *Update) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ContainerId == nil { - m.ContainerId = &ContainerID{} - } - if err := m.ContainerId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipContainerizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthContainerizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } - - return nil -} -func (m *Wait) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ContainerId == nil { - m.ContainerId = &ContainerID{} - } - if err := m.ContainerId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipContainerizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthContainerizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } - - return nil -} -func (m *Destroy) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ContainerId == nil { - m.ContainerId = &ContainerID{} - } - if err := m.ContainerId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipContainerizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthContainerizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } - - return nil -} -func (m *Usage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ContainerId == nil { - m.ContainerId = &ContainerID{} - } - if err := m.ContainerId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipContainerizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthContainerizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_id") - } - - return nil -} -func (m *Termination) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Killed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Killed = &b - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipContainerizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthContainerizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("killed") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") - } - - return nil -} -func (m *Containers) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthContainerizer - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Containers = append(m.Containers, &ContainerID{}) - if err := m.Containers[len(m.Containers)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipContainerizer(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthContainerizer - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func skipContainerizer(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthContainerizer - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipContainerizer(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthContainerizer = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/internal.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/internal.pb.go deleted file mode 100644 index 8988e8997..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/internal.pb.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: internal.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// For use with detector callbacks -type InternalMasterChangeDetected struct { - // will be present if there's a new master, otherwise nil - Master *MasterInfo `protobuf:"bytes,1,opt,name=master" json:"master,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *InternalMasterChangeDetected) Reset() { *m = InternalMasterChangeDetected{} } -func (m *InternalMasterChangeDetected) String() string { return proto.CompactTextString(m) } -func (*InternalMasterChangeDetected) ProtoMessage() {} - -func (m *InternalMasterChangeDetected) GetMaster() *MasterInfo { - if m != nil { - return m.Master - } - return nil -} - -type InternalTryAuthentication struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *InternalTryAuthentication) Reset() { *m = InternalTryAuthentication{} } -func (m *InternalTryAuthentication) String() string { return proto.CompactTextString(m) } -func (*InternalTryAuthentication) ProtoMessage() {} - -type InternalAuthenticationResult struct { - // true only if the authentication process completed and login was successful - Success *bool `protobuf:"varint,1,req,name=success" json:"success,omitempty"` - // true if the authentication process completed, successfully or not - Completed *bool `protobuf:"varint,2,req,name=completed" json:"completed,omitempty"` - // master pid that this result pertains to - Pid *string `protobuf:"bytes,3,req,name=pid" json:"pid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *InternalAuthenticationResult) Reset() { *m = InternalAuthenticationResult{} } -func (m *InternalAuthenticationResult) String() string { return proto.CompactTextString(m) } -func (*InternalAuthenticationResult) ProtoMessage() {} - -func (m *InternalAuthenticationResult) GetSuccess() bool { - if m != nil && m.Success != nil { - return *m.Success - } - return false -} - -func (m *InternalAuthenticationResult) GetCompleted() bool { - if m != nil && m.Completed != nil { - return *m.Completed - } - return false -} - -func (m *InternalAuthenticationResult) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/log.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/log.pb.go deleted file mode 100644 index 2b62f81d6..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/log.pb.go +++ /dev/null @@ -1,5146 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: log.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type Action_Type int32 - -const ( - Action_NOP Action_Type = 1 - Action_APPEND Action_Type = 2 - Action_TRUNCATE Action_Type = 3 -) - -var Action_Type_name = map[int32]string{ - 1: "NOP", - 2: "APPEND", - 3: "TRUNCATE", -} -var Action_Type_value = map[string]int32{ - "NOP": 1, - "APPEND": 2, - "TRUNCATE": 3, -} - -func (x Action_Type) Enum() *Action_Type { - p := new(Action_Type) - *p = x - return p -} -func (x Action_Type) String() string { - return proto.EnumName(Action_Type_name, int32(x)) -} -func (x *Action_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Action_Type_value, data, "Action_Type") - if err != nil { - return err - } - *x = Action_Type(value) - return nil -} - -type Metadata_Status int32 - -const ( - Metadata_VOTING Metadata_Status = 1 - Metadata_RECOVERING Metadata_Status = 2 - Metadata_STARTING Metadata_Status = 3 - Metadata_EMPTY Metadata_Status = 4 -) - -var Metadata_Status_name = map[int32]string{ - 1: "VOTING", - 2: "RECOVERING", - 3: "STARTING", - 4: "EMPTY", -} -var Metadata_Status_value = map[string]int32{ - "VOTING": 1, - "RECOVERING": 2, - "STARTING": 3, - "EMPTY": 4, -} - -func (x Metadata_Status) Enum() *Metadata_Status { - p := new(Metadata_Status) - *p = x - return p -} -func (x Metadata_Status) String() string { - return proto.EnumName(Metadata_Status_name, int32(x)) -} -func (x *Metadata_Status) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Metadata_Status_value, data, "Metadata_Status") - if err != nil { - return err - } - *x = Metadata_Status(value) - return nil -} - -type Record_Type int32 - -const ( - Record_PROMISE Record_Type = 1 - Record_ACTION Record_Type = 2 - Record_METADATA Record_Type = 3 -) - -var Record_Type_name = map[int32]string{ - 1: "PROMISE", - 2: "ACTION", - 3: "METADATA", -} -var Record_Type_value = map[string]int32{ - "PROMISE": 1, - "ACTION": 2, - "METADATA": 3, -} - -func (x Record_Type) Enum() *Record_Type { - p := new(Record_Type) - *p = x - return p -} -func (x Record_Type) String() string { - return proto.EnumName(Record_Type_name, int32(x)) -} -func (x *Record_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Record_Type_value, data, "Record_Type") - if err != nil { - return err - } - *x = Record_Type(value) - return nil -} - -// Represents a "promise" that a replica has made. A promise is -// *implicitly* valid for _all_ future actions that get performed on -// the replicated log (provided the action comes from the same -// proposer), until a new promise is made to a proposer with a higher -// proposal number. Each replica writes every promise it makes as a -// log record so that it can recover this information after a failure. -// TODO(benh): Does the promise actually need to be written to stable -// storage? Can we get away with looking at the last written action -// and using it's promised value? In this case, what happens if we -// make a promise but don't receive an action from that coordinator? -type Promise struct { - Proposal *uint64 `protobuf:"varint,1,req,name=proposal" json:"proposal,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Promise) Reset() { *m = Promise{} } -func (*Promise) ProtoMessage() {} - -func (m *Promise) GetProposal() uint64 { - if m != nil && m.Proposal != nil { - return *m.Proposal - } - return 0 -} - -// Represents an "action" performed on the log. Each action has an -// associated position in the log. In addition, each action (i.e., -// position) will have been "promised" to a specific proposer -// (implicitly or explicitly) and may have been "performed" from a -// specific proposer. An action may also be "learned" to have reached -// consensus. There are three types of possible actions that can be -// performed on the log: nop (no action), append, and truncate. -type Action struct { - Position *uint64 `protobuf:"varint,1,req,name=position" json:"position,omitempty"` - Promised *uint64 `protobuf:"varint,2,req,name=promised" json:"promised,omitempty"` - Performed *uint64 `protobuf:"varint,3,opt,name=performed" json:"performed,omitempty"` - Learned *bool `protobuf:"varint,4,opt,name=learned" json:"learned,omitempty"` - Type *Action_Type `protobuf:"varint,5,opt,name=type,enum=mesosproto.Action_Type" json:"type,omitempty"` - Nop *Action_Nop `protobuf:"bytes,6,opt,name=nop" json:"nop,omitempty"` - Append *Action_Append `protobuf:"bytes,7,opt,name=append" json:"append,omitempty"` - Truncate *Action_Truncate `protobuf:"bytes,8,opt,name=truncate" json:"truncate,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Action) Reset() { *m = Action{} } -func (*Action) ProtoMessage() {} - -func (m *Action) GetPosition() uint64 { - if m != nil && m.Position != nil { - return *m.Position - } - return 0 -} - -func (m *Action) GetPromised() uint64 { - if m != nil && m.Promised != nil { - return *m.Promised - } - return 0 -} - -func (m *Action) GetPerformed() uint64 { - if m != nil && m.Performed != nil { - return *m.Performed - } - return 0 -} - -func (m *Action) GetLearned() bool { - if m != nil && m.Learned != nil { - return *m.Learned - } - return false -} - -func (m *Action) GetType() Action_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Action_NOP -} - -func (m *Action) GetNop() *Action_Nop { - if m != nil { - return m.Nop - } - return nil -} - -func (m *Action) GetAppend() *Action_Append { - if m != nil { - return m.Append - } - return nil -} - -func (m *Action) GetTruncate() *Action_Truncate { - if m != nil { - return m.Truncate - } - return nil -} - -type Action_Nop struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *Action_Nop) Reset() { *m = Action_Nop{} } -func (*Action_Nop) ProtoMessage() {} - -type Action_Append struct { - Bytes []byte `protobuf:"bytes,1,req,name=bytes" json:"bytes,omitempty"` - Cksum []byte `protobuf:"bytes,2,opt,name=cksum" json:"cksum,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Action_Append) Reset() { *m = Action_Append{} } -func (*Action_Append) ProtoMessage() {} - -func (m *Action_Append) GetBytes() []byte { - if m != nil { - return m.Bytes - } - return nil -} - -func (m *Action_Append) GetCksum() []byte { - if m != nil { - return m.Cksum - } - return nil -} - -type Action_Truncate struct { - To *uint64 `protobuf:"varint,1,req,name=to" json:"to,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Action_Truncate) Reset() { *m = Action_Truncate{} } -func (*Action_Truncate) ProtoMessage() {} - -func (m *Action_Truncate) GetTo() uint64 { - if m != nil && m.To != nil { - return *m.To - } - return 0 -} - -// The metadata of a replica. It has to be persisted on the disk. We -// store the current status of the replica as well as the implicit -// promise that a replica has made. This message is intended to -// replace the old Promise message to support catch-up. -type Metadata struct { - Status *Metadata_Status `protobuf:"varint,1,req,name=status,enum=mesosproto.Metadata_Status,def=4" json:"status,omitempty"` - Promised *uint64 `protobuf:"varint,2,req,name=promised,def=0" json:"promised,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Metadata) Reset() { *m = Metadata{} } -func (*Metadata) ProtoMessage() {} - -const Default_Metadata_Status Metadata_Status = Metadata_EMPTY -const Default_Metadata_Promised uint64 = 0 - -func (m *Metadata) GetStatus() Metadata_Status { - if m != nil && m.Status != nil { - return *m.Status - } - return Default_Metadata_Status -} - -func (m *Metadata) GetPromised() uint64 { - if m != nil && m.Promised != nil { - return *m.Promised - } - return Default_Metadata_Promised -} - -// Represents a log record written to the local filesystem by a -// replica. A log record may store a promise (DEPRECATED), an action -// or metadata (defined above). -type Record struct { - Type *Record_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Record_Type" json:"type,omitempty"` - Promise *Promise `protobuf:"bytes,2,opt,name=promise" json:"promise,omitempty"` - Action *Action `protobuf:"bytes,3,opt,name=action" json:"action,omitempty"` - Metadata *Metadata `protobuf:"bytes,4,opt,name=metadata" json:"metadata,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Record) Reset() { *m = Record{} } -func (*Record) ProtoMessage() {} - -func (m *Record) GetType() Record_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Record_PROMISE -} - -func (m *Record) GetPromise() *Promise { - if m != nil { - return m.Promise - } - return nil -} - -func (m *Record) GetAction() *Action { - if m != nil { - return m.Action - } - return nil -} - -func (m *Record) GetMetadata() *Metadata { - if m != nil { - return m.Metadata - } - return nil -} - -// Represents a "promise" request from a proposer with the specified -// 'proposal' to a replica. If the proposer is a coordinator, most -// such requests will occur after a coordinator has failed and a new -// coordinator is elected. In such a case, the position that the -// coordinator is asking the replica to promise is implicitly *all* -// positions that the replica has made no promises (thus the position -// field is not be used). In other instances, however, a proposer -// might be explicitly trying to request that a replica promise a -// specific position in the log (such as when trying to fill holes -// discovered during a client read), and then the 'position' field -// will be present. -type PromiseRequest struct { - Proposal *uint64 `protobuf:"varint,1,req,name=proposal" json:"proposal,omitempty"` - Position *uint64 `protobuf:"varint,2,opt,name=position" json:"position,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PromiseRequest) Reset() { *m = PromiseRequest{} } -func (*PromiseRequest) ProtoMessage() {} - -func (m *PromiseRequest) GetProposal() uint64 { - if m != nil && m.Proposal != nil { - return *m.Proposal - } - return 0 -} - -func (m *PromiseRequest) GetPosition() uint64 { - if m != nil && m.Position != nil { - return *m.Position - } - return 0 -} - -// Represents a "promise" response from a replica back to a proposer. -// A replica represents a NACK (because it has promised a proposer -// with a higher proposal number) by setting the okay field to false. -// The 'proposal' is either the aforementioned higher proposal number -// when the response is a NACK, or the corresponding request's -// proposal number if it is an ACK. The replica either sends back the -// highest position it has recorded in the log (using the 'position' -// field) or the specific action (if any) it has at the position -// requested in PromiseRequest (using the 'action' field). -type PromiseResponse struct { - Okay *bool `protobuf:"varint,1,req,name=okay" json:"okay,omitempty"` - Proposal *uint64 `protobuf:"varint,2,req,name=proposal" json:"proposal,omitempty"` - Position *uint64 `protobuf:"varint,4,opt,name=position" json:"position,omitempty"` - Action *Action `protobuf:"bytes,3,opt,name=action" json:"action,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PromiseResponse) Reset() { *m = PromiseResponse{} } -func (*PromiseResponse) ProtoMessage() {} - -func (m *PromiseResponse) GetOkay() bool { - if m != nil && m.Okay != nil { - return *m.Okay - } - return false -} - -func (m *PromiseResponse) GetProposal() uint64 { - if m != nil && m.Proposal != nil { - return *m.Proposal - } - return 0 -} - -func (m *PromiseResponse) GetPosition() uint64 { - if m != nil && m.Position != nil { - return *m.Position - } - return 0 -} - -func (m *PromiseResponse) GetAction() *Action { - if m != nil { - return m.Action - } - return nil -} - -// Represents a write request for a specific type of action. Note that -// we deliberately do not include the entire Action as it contains -// fields that are not relevant to a write request (e.g., promised, -// performed) and rather than ignore them we exclude them for safety. -type WriteRequest struct { - Proposal *uint64 `protobuf:"varint,1,req,name=proposal" json:"proposal,omitempty"` - Position *uint64 `protobuf:"varint,2,req,name=position" json:"position,omitempty"` - Learned *bool `protobuf:"varint,3,opt,name=learned" json:"learned,omitempty"` - Type *Action_Type `protobuf:"varint,4,req,name=type,enum=mesosproto.Action_Type" json:"type,omitempty"` - Nop *Action_Nop `protobuf:"bytes,5,opt,name=nop" json:"nop,omitempty"` - Append *Action_Append `protobuf:"bytes,6,opt,name=append" json:"append,omitempty"` - Truncate *Action_Truncate `protobuf:"bytes,7,opt,name=truncate" json:"truncate,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *WriteRequest) Reset() { *m = WriteRequest{} } -func (*WriteRequest) ProtoMessage() {} - -func (m *WriteRequest) GetProposal() uint64 { - if m != nil && m.Proposal != nil { - return *m.Proposal - } - return 0 -} - -func (m *WriteRequest) GetPosition() uint64 { - if m != nil && m.Position != nil { - return *m.Position - } - return 0 -} - -func (m *WriteRequest) GetLearned() bool { - if m != nil && m.Learned != nil { - return *m.Learned - } - return false -} - -func (m *WriteRequest) GetType() Action_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Action_NOP -} - -func (m *WriteRequest) GetNop() *Action_Nop { - if m != nil { - return m.Nop - } - return nil -} - -func (m *WriteRequest) GetAppend() *Action_Append { - if m != nil { - return m.Append - } - return nil -} - -func (m *WriteRequest) GetTruncate() *Action_Truncate { - if m != nil { - return m.Truncate - } - return nil -} - -// Represents a write response corresponding to a write request. A -// replica represents a NACK (because it has promised a proposer with -// a higher proposal number) by setting the okay field to false. If -// the proposer is a coordinator, then it has been demoted. The -// 'position' should always correspond to the position set in the -// request. The 'proposal' is either the same proposal number set in -// the request in the case of an ACK, or the higher proposal number -// this position has been promised to in the case of a NACK. -type WriteResponse struct { - Okay *bool `protobuf:"varint,1,req,name=okay" json:"okay,omitempty"` - Proposal *uint64 `protobuf:"varint,2,req,name=proposal" json:"proposal,omitempty"` - Position *uint64 `protobuf:"varint,3,req,name=position" json:"position,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *WriteResponse) Reset() { *m = WriteResponse{} } -func (*WriteResponse) ProtoMessage() {} - -func (m *WriteResponse) GetOkay() bool { - if m != nil && m.Okay != nil { - return *m.Okay - } - return false -} - -func (m *WriteResponse) GetProposal() uint64 { - if m != nil && m.Proposal != nil { - return *m.Proposal - } - return 0 -} - -func (m *WriteResponse) GetPosition() uint64 { - if m != nil && m.Position != nil { - return *m.Position - } - return 0 -} - -// Represents a "learned" event, that is, when a particular action has -// been agreed upon (reached consensus). -type LearnedMessage struct { - Action *Action `protobuf:"bytes,1,req,name=action" json:"action,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *LearnedMessage) Reset() { *m = LearnedMessage{} } -func (*LearnedMessage) ProtoMessage() {} - -func (m *LearnedMessage) GetAction() *Action { - if m != nil { - return m.Action - } - return nil -} - -// Represents a recover request. A recover request is used to initiate -// the recovery (by broadcasting it). -type RecoverRequest struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *RecoverRequest) Reset() { *m = RecoverRequest{} } -func (*RecoverRequest) ProtoMessage() {} - -// When a replica receives a RecoverRequest, it will reply with its -// current status, and the begin and the end of its current log. -type RecoverResponse struct { - Status *Metadata_Status `protobuf:"varint,1,req,name=status,enum=mesosproto.Metadata_Status" json:"status,omitempty"` - Begin *uint64 `protobuf:"varint,2,opt,name=begin" json:"begin,omitempty"` - End *uint64 `protobuf:"varint,3,opt,name=end" json:"end,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RecoverResponse) Reset() { *m = RecoverResponse{} } -func (*RecoverResponse) ProtoMessage() {} - -func (m *RecoverResponse) GetStatus() Metadata_Status { - if m != nil && m.Status != nil { - return *m.Status - } - return Metadata_VOTING -} - -func (m *RecoverResponse) GetBegin() uint64 { - if m != nil && m.Begin != nil { - return *m.Begin - } - return 0 -} - -func (m *RecoverResponse) GetEnd() uint64 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -func init() { - proto.RegisterEnum("mesosproto.Action_Type", Action_Type_name, Action_Type_value) - proto.RegisterEnum("mesosproto.Metadata_Status", Metadata_Status_name, Metadata_Status_value) - proto.RegisterEnum("mesosproto.Record_Type", Record_Type_name, Record_Type_value) -} -func (this *Promise) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Promise) - if !ok { - return fmt.Errorf("that is not of type *Promise") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Promise but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Promisebut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Promise) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Promise) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Action) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Action) - if !ok { - return fmt.Errorf("that is not of type *Action") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Action but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Actionbut is not nil && this == nil") - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return fmt.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) - } - } else if this.Promised != nil { - return fmt.Errorf("this.Promised == nil && that.Promised != nil") - } else if that1.Promised != nil { - return fmt.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) - } - if this.Performed != nil && that1.Performed != nil { - if *this.Performed != *that1.Performed { - return fmt.Errorf("Performed this(%v) Not Equal that(%v)", *this.Performed, *that1.Performed) - } - } else if this.Performed != nil { - return fmt.Errorf("this.Performed == nil && that.Performed != nil") - } else if that1.Performed != nil { - return fmt.Errorf("Performed this(%v) Not Equal that(%v)", this.Performed, that1.Performed) - } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return fmt.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) - } - } else if this.Learned != nil { - return fmt.Errorf("this.Learned == nil && that.Learned != nil") - } else if that1.Learned != nil { - return fmt.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Nop.Equal(that1.Nop) { - return fmt.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) - } - if !this.Append.Equal(that1.Append) { - return fmt.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) - } - if !this.Truncate.Equal(that1.Truncate) { - return fmt.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Action) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Action) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return false - } - } else if this.Promised != nil { - return false - } else if that1.Promised != nil { - return false - } - if this.Performed != nil && that1.Performed != nil { - if *this.Performed != *that1.Performed { - return false - } - } else if this.Performed != nil { - return false - } else if that1.Performed != nil { - return false - } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return false - } - } else if this.Learned != nil { - return false - } else if that1.Learned != nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Nop.Equal(that1.Nop) { - return false - } - if !this.Append.Equal(that1.Append) { - return false - } - if !this.Truncate.Equal(that1.Truncate) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Action_Nop) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Action_Nop) - if !ok { - return fmt.Errorf("that is not of type *Action_Nop") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Action_Nop but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Action_Nopbut is not nil && this == nil") - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Action_Nop) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Action_Nop) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Action_Append) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Action_Append) - if !ok { - return fmt.Errorf("that is not of type *Action_Append") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Action_Append but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Action_Appendbut is not nil && this == nil") - } - if !bytes.Equal(this.Bytes, that1.Bytes) { - return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", this.Bytes, that1.Bytes) - } - if !bytes.Equal(this.Cksum, that1.Cksum) { - return fmt.Errorf("Cksum this(%v) Not Equal that(%v)", this.Cksum, that1.Cksum) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Action_Append) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Action_Append) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.Bytes, that1.Bytes) { - return false - } - if !bytes.Equal(this.Cksum, that1.Cksum) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Action_Truncate) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Action_Truncate) - if !ok { - return fmt.Errorf("that is not of type *Action_Truncate") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Action_Truncate but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Action_Truncatebut is not nil && this == nil") - } - if this.To != nil && that1.To != nil { - if *this.To != *that1.To { - return fmt.Errorf("To this(%v) Not Equal that(%v)", *this.To, *that1.To) - } - } else if this.To != nil { - return fmt.Errorf("this.To == nil && that.To != nil") - } else if that1.To != nil { - return fmt.Errorf("To this(%v) Not Equal that(%v)", this.To, that1.To) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Action_Truncate) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Action_Truncate) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.To != nil && that1.To != nil { - if *this.To != *that1.To { - return false - } - } else if this.To != nil { - return false - } else if that1.To != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Metadata) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Metadata) - if !ok { - return fmt.Errorf("that is not of type *Metadata") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Metadata but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Metadatabut is not nil && this == nil") - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) - } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return fmt.Errorf("Promised this(%v) Not Equal that(%v)", *this.Promised, *that1.Promised) - } - } else if this.Promised != nil { - return fmt.Errorf("this.Promised == nil && that.Promised != nil") - } else if that1.Promised != nil { - return fmt.Errorf("Promised this(%v) Not Equal that(%v)", this.Promised, that1.Promised) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Metadata) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Metadata) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false - } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false - } - if this.Promised != nil && that1.Promised != nil { - if *this.Promised != *that1.Promised { - return false - } - } else if this.Promised != nil { - return false - } else if that1.Promised != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Record) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Record) - if !ok { - return fmt.Errorf("that is not of type *Record") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Record but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Recordbut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Promise.Equal(that1.Promise) { - return fmt.Errorf("Promise this(%v) Not Equal that(%v)", this.Promise, that1.Promise) - } - if !this.Action.Equal(that1.Action) { - return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) - } - if !this.Metadata.Equal(that1.Metadata) { - return fmt.Errorf("Metadata this(%v) Not Equal that(%v)", this.Metadata, that1.Metadata) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Record) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Record) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Promise.Equal(that1.Promise) { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if !this.Metadata.Equal(that1.Metadata) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *PromiseRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*PromiseRequest) - if !ok { - return fmt.Errorf("that is not of type *PromiseRequest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *PromiseRequest but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *PromiseRequestbut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *PromiseRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PromiseRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *PromiseResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*PromiseResponse) - if !ok { - return fmt.Errorf("that is not of type *PromiseResponse") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *PromiseResponse but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *PromiseResponsebut is not nil && this == nil") - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return fmt.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) - } - } else if this.Okay != nil { - return fmt.Errorf("this.Okay == nil && that.Okay != nil") - } else if that1.Okay != nil { - return fmt.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !this.Action.Equal(that1.Action) { - return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *PromiseResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PromiseResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return false - } - } else if this.Okay != nil { - return false - } else if that1.Okay != nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *WriteRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*WriteRequest) - if !ok { - return fmt.Errorf("that is not of type *WriteRequest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *WriteRequest but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *WriteRequestbut is not nil && this == nil") - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return fmt.Errorf("Learned this(%v) Not Equal that(%v)", *this.Learned, *that1.Learned) - } - } else if this.Learned != nil { - return fmt.Errorf("this.Learned == nil && that.Learned != nil") - } else if that1.Learned != nil { - return fmt.Errorf("Learned this(%v) Not Equal that(%v)", this.Learned, that1.Learned) - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Nop.Equal(that1.Nop) { - return fmt.Errorf("Nop this(%v) Not Equal that(%v)", this.Nop, that1.Nop) - } - if !this.Append.Equal(that1.Append) { - return fmt.Errorf("Append this(%v) Not Equal that(%v)", this.Append, that1.Append) - } - if !this.Truncate.Equal(that1.Truncate) { - return fmt.Errorf("Truncate this(%v) Not Equal that(%v)", this.Truncate, that1.Truncate) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *WriteRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*WriteRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if this.Learned != nil && that1.Learned != nil { - if *this.Learned != *that1.Learned { - return false - } - } else if this.Learned != nil { - return false - } else if that1.Learned != nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Nop.Equal(that1.Nop) { - return false - } - if !this.Append.Equal(that1.Append) { - return false - } - if !this.Truncate.Equal(that1.Truncate) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *WriteResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*WriteResponse) - if !ok { - return fmt.Errorf("that is not of type *WriteResponse") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *WriteResponse but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *WriteResponsebut is not nil && this == nil") - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return fmt.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) - } - } else if this.Okay != nil { - return fmt.Errorf("this.Okay == nil && that.Okay != nil") - } else if that1.Okay != nil { - return fmt.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", *this.Proposal, *that1.Proposal) - } - } else if this.Proposal != nil { - return fmt.Errorf("this.Proposal == nil && that.Proposal != nil") - } else if that1.Proposal != nil { - return fmt.Errorf("Proposal this(%v) Not Equal that(%v)", this.Proposal, that1.Proposal) - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", *this.Position, *that1.Position) - } - } else if this.Position != nil { - return fmt.Errorf("this.Position == nil && that.Position != nil") - } else if that1.Position != nil { - return fmt.Errorf("Position this(%v) Not Equal that(%v)", this.Position, that1.Position) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *WriteResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*WriteResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return false - } - } else if this.Okay != nil { - return false - } else if that1.Okay != nil { - return false - } - if this.Proposal != nil && that1.Proposal != nil { - if *this.Proposal != *that1.Proposal { - return false - } - } else if this.Proposal != nil { - return false - } else if that1.Proposal != nil { - return false - } - if this.Position != nil && that1.Position != nil { - if *this.Position != *that1.Position { - return false - } - } else if this.Position != nil { - return false - } else if that1.Position != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LearnedMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*LearnedMessage) - if !ok { - return fmt.Errorf("that is not of type *LearnedMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *LearnedMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *LearnedMessagebut is not nil && this == nil") - } - if !this.Action.Equal(that1.Action) { - return fmt.Errorf("Action this(%v) Not Equal that(%v)", this.Action, that1.Action) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *LearnedMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*LearnedMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Action.Equal(that1.Action) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RecoverRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RecoverRequest) - if !ok { - return fmt.Errorf("that is not of type *RecoverRequest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RecoverRequest but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RecoverRequestbut is not nil && this == nil") - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RecoverRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RecoverRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RecoverResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RecoverResponse) - if !ok { - return fmt.Errorf("that is not of type *RecoverResponse") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RecoverResponse but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RecoverResponsebut is not nil && this == nil") - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) - } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return fmt.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) - } - } else if this.Begin != nil { - return fmt.Errorf("this.Begin == nil && that.Begin != nil") - } else if that1.Begin != nil { - return fmt.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) - } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return fmt.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) - } - } else if this.End != nil { - return fmt.Errorf("this.End == nil && that.End != nil") - } else if that1.End != nil { - return fmt.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RecoverResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RecoverResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false - } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false - } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return false - } - } else if this.Begin != nil { - return false - } else if that1.Begin != nil { - return false - } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return false - } - } else if this.End != nil { - return false - } else if that1.End != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Promise) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Promise{") - if this.Proposal != nil { - s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Action) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&mesosproto.Action{") - if this.Position != nil { - s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") - } - if this.Promised != nil { - s = append(s, "Promised: "+valueToGoStringLog(this.Promised, "uint64")+",\n") - } - if this.Performed != nil { - s = append(s, "Performed: "+valueToGoStringLog(this.Performed, "uint64")+",\n") - } - if this.Learned != nil { - s = append(s, "Learned: "+valueToGoStringLog(this.Learned, "bool")+",\n") - } - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Action_Type")+",\n") - } - if this.Nop != nil { - s = append(s, "Nop: "+fmt.Sprintf("%#v", this.Nop)+",\n") - } - if this.Append != nil { - s = append(s, "Append: "+fmt.Sprintf("%#v", this.Append)+",\n") - } - if this.Truncate != nil { - s = append(s, "Truncate: "+fmt.Sprintf("%#v", this.Truncate)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Action_Nop) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&mesosproto.Action_Nop{") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Action_Append) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Action_Append{") - if this.Bytes != nil { - s = append(s, "Bytes: "+valueToGoStringLog(this.Bytes, "byte")+",\n") - } - if this.Cksum != nil { - s = append(s, "Cksum: "+valueToGoStringLog(this.Cksum, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Action_Truncate) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Action_Truncate{") - if this.To != nil { - s = append(s, "To: "+valueToGoStringLog(this.To, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Metadata) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Metadata{") - if this.Status != nil { - s = append(s, "Status: "+valueToGoStringLog(this.Status, "mesosproto.Metadata_Status")+",\n") - } - if this.Promised != nil { - s = append(s, "Promised: "+valueToGoStringLog(this.Promised, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Record) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.Record{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Record_Type")+",\n") - } - if this.Promise != nil { - s = append(s, "Promise: "+fmt.Sprintf("%#v", this.Promise)+",\n") - } - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - if this.Metadata != nil { - s = append(s, "Metadata: "+fmt.Sprintf("%#v", this.Metadata)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PromiseRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.PromiseRequest{") - if this.Proposal != nil { - s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") - } - if this.Position != nil { - s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PromiseResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.PromiseResponse{") - if this.Okay != nil { - s = append(s, "Okay: "+valueToGoStringLog(this.Okay, "bool")+",\n") - } - if this.Proposal != nil { - s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") - } - if this.Position != nil { - s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") - } - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *WriteRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&mesosproto.WriteRequest{") - if this.Proposal != nil { - s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") - } - if this.Position != nil { - s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") - } - if this.Learned != nil { - s = append(s, "Learned: "+valueToGoStringLog(this.Learned, "bool")+",\n") - } - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringLog(this.Type, "mesosproto.Action_Type")+",\n") - } - if this.Nop != nil { - s = append(s, "Nop: "+fmt.Sprintf("%#v", this.Nop)+",\n") - } - if this.Append != nil { - s = append(s, "Append: "+fmt.Sprintf("%#v", this.Append)+",\n") - } - if this.Truncate != nil { - s = append(s, "Truncate: "+fmt.Sprintf("%#v", this.Truncate)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *WriteResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.WriteResponse{") - if this.Okay != nil { - s = append(s, "Okay: "+valueToGoStringLog(this.Okay, "bool")+",\n") - } - if this.Proposal != nil { - s = append(s, "Proposal: "+valueToGoStringLog(this.Proposal, "uint64")+",\n") - } - if this.Position != nil { - s = append(s, "Position: "+valueToGoStringLog(this.Position, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LearnedMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.LearnedMessage{") - if this.Action != nil { - s = append(s, "Action: "+fmt.Sprintf("%#v", this.Action)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RecoverRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&mesosproto.RecoverRequest{") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RecoverResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.RecoverResponse{") - if this.Status != nil { - s = append(s, "Status: "+valueToGoStringLog(this.Status, "mesosproto.Metadata_Status")+",\n") - } - if this.Begin != nil { - s = append(s, "Begin: "+valueToGoStringLog(this.Begin, "uint64")+",\n") - } - if this.End != nil { - s = append(s, "End: "+valueToGoStringLog(this.End, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringLog(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringLog(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *Promise) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Promise) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Proposal == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } else { - data[i] = 0x8 - i++ - i = encodeVarintLog(data, i, uint64(*m.Proposal)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Action) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Action) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Position == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") - } else { - data[i] = 0x8 - i++ - i = encodeVarintLog(data, i, uint64(*m.Position)) - } - if m.Promised == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") - } else { - data[i] = 0x10 - i++ - i = encodeVarintLog(data, i, uint64(*m.Promised)) - } - if m.Performed != nil { - data[i] = 0x18 - i++ - i = encodeVarintLog(data, i, uint64(*m.Performed)) - } - if m.Learned != nil { - data[i] = 0x20 - i++ - if *m.Learned { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Type != nil { - data[i] = 0x28 - i++ - i = encodeVarintLog(data, i, uint64(*m.Type)) - } - if m.Nop != nil { - data[i] = 0x32 - i++ - i = encodeVarintLog(data, i, uint64(m.Nop.Size())) - n1, err := m.Nop.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.Append != nil { - data[i] = 0x3a - i++ - i = encodeVarintLog(data, i, uint64(m.Append.Size())) - n2, err := m.Append.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.Truncate != nil { - data[i] = 0x42 - i++ - i = encodeVarintLog(data, i, uint64(m.Truncate.Size())) - n3, err := m.Truncate.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Action_Nop) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Action_Nop) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Action_Append) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Action_Append) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Bytes == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("bytes") - } else { - data[i] = 0xa - i++ - i = encodeVarintLog(data, i, uint64(len(m.Bytes))) - i += copy(data[i:], m.Bytes) - } - if m.Cksum != nil { - data[i] = 0x12 - i++ - i = encodeVarintLog(data, i, uint64(len(m.Cksum))) - i += copy(data[i:], m.Cksum) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Action_Truncate) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Action_Truncate) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.To == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("to") - } else { - data[i] = 0x8 - i++ - i = encodeVarintLog(data, i, uint64(*m.To)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Metadata) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Metadata) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Status == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } else { - data[i] = 0x8 - i++ - i = encodeVarintLog(data, i, uint64(*m.Status)) - } - if m.Promised == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") - } else { - data[i] = 0x10 - i++ - i = encodeVarintLog(data, i, uint64(*m.Promised)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Record) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Record) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintLog(data, i, uint64(*m.Type)) - } - if m.Promise != nil { - data[i] = 0x12 - i++ - i = encodeVarintLog(data, i, uint64(m.Promise.Size())) - n4, err := m.Promise.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.Action != nil { - data[i] = 0x1a - i++ - i = encodeVarintLog(data, i, uint64(m.Action.Size())) - n5, err := m.Action.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.Metadata != nil { - data[i] = 0x22 - i++ - i = encodeVarintLog(data, i, uint64(m.Metadata.Size())) - n6, err := m.Metadata.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *PromiseRequest) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *PromiseRequest) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Proposal == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } else { - data[i] = 0x8 - i++ - i = encodeVarintLog(data, i, uint64(*m.Proposal)) - } - if m.Position != nil { - data[i] = 0x10 - i++ - i = encodeVarintLog(data, i, uint64(*m.Position)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *PromiseResponse) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *PromiseResponse) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Okay == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") - } else { - data[i] = 0x8 - i++ - if *m.Okay { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Proposal == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } else { - data[i] = 0x10 - i++ - i = encodeVarintLog(data, i, uint64(*m.Proposal)) - } - if m.Action != nil { - data[i] = 0x1a - i++ - i = encodeVarintLog(data, i, uint64(m.Action.Size())) - n7, err := m.Action.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.Position != nil { - data[i] = 0x20 - i++ - i = encodeVarintLog(data, i, uint64(*m.Position)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *WriteRequest) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *WriteRequest) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Proposal == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } else { - data[i] = 0x8 - i++ - i = encodeVarintLog(data, i, uint64(*m.Proposal)) - } - if m.Position == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") - } else { - data[i] = 0x10 - i++ - i = encodeVarintLog(data, i, uint64(*m.Position)) - } - if m.Learned != nil { - data[i] = 0x18 - i++ - if *m.Learned { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x20 - i++ - i = encodeVarintLog(data, i, uint64(*m.Type)) - } - if m.Nop != nil { - data[i] = 0x2a - i++ - i = encodeVarintLog(data, i, uint64(m.Nop.Size())) - n8, err := m.Nop.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.Append != nil { - data[i] = 0x32 - i++ - i = encodeVarintLog(data, i, uint64(m.Append.Size())) - n9, err := m.Append.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n9 - } - if m.Truncate != nil { - data[i] = 0x3a - i++ - i = encodeVarintLog(data, i, uint64(m.Truncate.Size())) - n10, err := m.Truncate.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n10 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *WriteResponse) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *WriteResponse) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Okay == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") - } else { - data[i] = 0x8 - i++ - if *m.Okay { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Proposal == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } else { - data[i] = 0x10 - i++ - i = encodeVarintLog(data, i, uint64(*m.Proposal)) - } - if m.Position == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") - } else { - data[i] = 0x18 - i++ - i = encodeVarintLog(data, i, uint64(*m.Position)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *LearnedMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *LearnedMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Action == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("action") - } else { - data[i] = 0xa - i++ - i = encodeVarintLog(data, i, uint64(m.Action.Size())) - n11, err := m.Action.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n11 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RecoverRequest) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RecoverRequest) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RecoverResponse) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RecoverResponse) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Status == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } else { - data[i] = 0x8 - i++ - i = encodeVarintLog(data, i, uint64(*m.Status)) - } - if m.Begin != nil { - data[i] = 0x10 - i++ - i = encodeVarintLog(data, i, uint64(*m.Begin)) - } - if m.End != nil { - data[i] = 0x18 - i++ - i = encodeVarintLog(data, i, uint64(*m.End)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Log(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Log(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintLog(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedPromise(r randyLog, easy bool) *Promise { - this := &Promise{} - v1 := uint64(uint64(r.Uint32())) - this.Proposal = &v1 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) - } - return this -} - -func NewPopulatedAction(r randyLog, easy bool) *Action { - this := &Action{} - v2 := uint64(uint64(r.Uint32())) - this.Position = &v2 - v3 := uint64(uint64(r.Uint32())) - this.Promised = &v3 - if r.Intn(10) != 0 { - v4 := uint64(uint64(r.Uint32())) - this.Performed = &v4 - } - if r.Intn(10) != 0 { - v5 := bool(bool(r.Intn(2) == 0)) - this.Learned = &v5 - } - if r.Intn(10) != 0 { - v6 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v6 - } - if r.Intn(10) != 0 { - this.Nop = NewPopulatedAction_Nop(r, easy) - } - if r.Intn(10) != 0 { - this.Append = NewPopulatedAction_Append(r, easy) - } - if r.Intn(10) != 0 { - this.Truncate = NewPopulatedAction_Truncate(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 9) - } - return this -} - -func NewPopulatedAction_Nop(r randyLog, easy bool) *Action_Nop { - this := &Action_Nop{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 1) - } - return this -} - -func NewPopulatedAction_Append(r randyLog, easy bool) *Action_Append { - this := &Action_Append{} - v7 := r.Intn(100) - this.Bytes = make([]byte, v7) - for i := 0; i < v7; i++ { - this.Bytes[i] = byte(r.Intn(256)) - } - if r.Intn(10) != 0 { - v8 := r.Intn(100) - this.Cksum = make([]byte, v8) - for i := 0; i < v8; i++ { - this.Cksum[i] = byte(r.Intn(256)) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) - } - return this -} - -func NewPopulatedAction_Truncate(r randyLog, easy bool) *Action_Truncate { - this := &Action_Truncate{} - v9 := uint64(uint64(r.Uint32())) - this.To = &v9 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) - } - return this -} - -func NewPopulatedMetadata(r randyLog, easy bool) *Metadata { - this := &Metadata{} - v10 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) - this.Status = &v10 - v11 := uint64(uint64(r.Uint32())) - this.Promised = &v11 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) - } - return this -} - -func NewPopulatedRecord(r randyLog, easy bool) *Record { - this := &Record{} - v12 := Record_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v12 - if r.Intn(10) != 0 { - this.Promise = NewPopulatedPromise(r, easy) - } - if r.Intn(10) != 0 { - this.Action = NewPopulatedAction(r, easy) - } - if r.Intn(10) != 0 { - this.Metadata = NewPopulatedMetadata(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 5) - } - return this -} - -func NewPopulatedPromiseRequest(r randyLog, easy bool) *PromiseRequest { - this := &PromiseRequest{} - v13 := uint64(uint64(r.Uint32())) - this.Proposal = &v13 - if r.Intn(10) != 0 { - v14 := uint64(uint64(r.Uint32())) - this.Position = &v14 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 3) - } - return this -} - -func NewPopulatedPromiseResponse(r randyLog, easy bool) *PromiseResponse { - this := &PromiseResponse{} - v15 := bool(bool(r.Intn(2) == 0)) - this.Okay = &v15 - v16 := uint64(uint64(r.Uint32())) - this.Proposal = &v16 - if r.Intn(10) != 0 { - this.Action = NewPopulatedAction(r, easy) - } - if r.Intn(10) != 0 { - v17 := uint64(uint64(r.Uint32())) - this.Position = &v17 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 5) - } - return this -} - -func NewPopulatedWriteRequest(r randyLog, easy bool) *WriteRequest { - this := &WriteRequest{} - v18 := uint64(uint64(r.Uint32())) - this.Proposal = &v18 - v19 := uint64(uint64(r.Uint32())) - this.Position = &v19 - if r.Intn(10) != 0 { - v20 := bool(bool(r.Intn(2) == 0)) - this.Learned = &v20 - } - v21 := Action_Type([]int32{1, 2, 3}[r.Intn(3)]) - this.Type = &v21 - if r.Intn(10) != 0 { - this.Nop = NewPopulatedAction_Nop(r, easy) - } - if r.Intn(10) != 0 { - this.Append = NewPopulatedAction_Append(r, easy) - } - if r.Intn(10) != 0 { - this.Truncate = NewPopulatedAction_Truncate(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 8) - } - return this -} - -func NewPopulatedWriteResponse(r randyLog, easy bool) *WriteResponse { - this := &WriteResponse{} - v22 := bool(bool(r.Intn(2) == 0)) - this.Okay = &v22 - v23 := uint64(uint64(r.Uint32())) - this.Proposal = &v23 - v24 := uint64(uint64(r.Uint32())) - this.Position = &v24 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 4) - } - return this -} - -func NewPopulatedLearnedMessage(r randyLog, easy bool) *LearnedMessage { - this := &LearnedMessage{} - this.Action = NewPopulatedAction(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 2) - } - return this -} - -func NewPopulatedRecoverRequest(r randyLog, easy bool) *RecoverRequest { - this := &RecoverRequest{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 1) - } - return this -} - -func NewPopulatedRecoverResponse(r randyLog, easy bool) *RecoverResponse { - this := &RecoverResponse{} - v25 := Metadata_Status([]int32{1, 2, 3, 4}[r.Intn(4)]) - this.Status = &v25 - if r.Intn(10) != 0 { - v26 := uint64(uint64(r.Uint32())) - this.Begin = &v26 - } - if r.Intn(10) != 0 { - v27 := uint64(uint64(r.Uint32())) - this.End = &v27 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedLog(r, 4) - } - return this -} - -type randyLog interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneLog(r randyLog) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringLog(r randyLog) string { - v28 := r.Intn(100) - tmps := make([]rune, v28) - for i := 0; i < v28; i++ { - tmps[i] = randUTF8RuneLog(r) - } - return string(tmps) -} -func randUnrecognizedLog(r randyLog, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldLog(data, r, fieldNumber, wire) - } - return data -} -func randFieldLog(data []byte, r randyLog, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateLog(data, uint64(key)) - v29 := r.Int63() - if r.Intn(2) == 0 { - v29 *= -1 - } - data = encodeVarintPopulateLog(data, uint64(v29)) - case 1: - data = encodeVarintPopulateLog(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateLog(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateLog(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateLog(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateLog(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *Promise) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Action) Size() (n int) { - var l int - _ = l - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) - } - if m.Promised != nil { - n += 1 + sovLog(uint64(*m.Promised)) - } - if m.Performed != nil { - n += 1 + sovLog(uint64(*m.Performed)) - } - if m.Learned != nil { - n += 2 - } - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) - } - if m.Nop != nil { - l = m.Nop.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.Append != nil { - l = m.Append.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.Truncate != nil { - l = m.Truncate.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Action_Nop) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Action_Append) Size() (n int) { - var l int - _ = l - if m.Bytes != nil { - l = len(m.Bytes) - n += 1 + l + sovLog(uint64(l)) - } - if m.Cksum != nil { - l = len(m.Cksum) - n += 1 + l + sovLog(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Action_Truncate) Size() (n int) { - var l int - _ = l - if m.To != nil { - n += 1 + sovLog(uint64(*m.To)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Metadata) Size() (n int) { - var l int - _ = l - if m.Status != nil { - n += 1 + sovLog(uint64(*m.Status)) - } - if m.Promised != nil { - n += 1 + sovLog(uint64(*m.Promised)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Record) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) - } - if m.Promise != nil { - l = m.Promise.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PromiseRequest) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) - } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PromiseResponse) Size() (n int) { - var l int - _ = l - if m.Okay != nil { - n += 2 - } - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) - } - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WriteRequest) Size() (n int) { - var l int - _ = l - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) - } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) - } - if m.Learned != nil { - n += 2 - } - if m.Type != nil { - n += 1 + sovLog(uint64(*m.Type)) - } - if m.Nop != nil { - l = m.Nop.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.Append != nil { - l = m.Append.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.Truncate != nil { - l = m.Truncate.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *WriteResponse) Size() (n int) { - var l int - _ = l - if m.Okay != nil { - n += 2 - } - if m.Proposal != nil { - n += 1 + sovLog(uint64(*m.Proposal)) - } - if m.Position != nil { - n += 1 + sovLog(uint64(*m.Position)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LearnedMessage) Size() (n int) { - var l int - _ = l - if m.Action != nil { - l = m.Action.Size() - n += 1 + l + sovLog(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RecoverRequest) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RecoverResponse) Size() (n int) { - var l int - _ = l - if m.Status != nil { - n += 1 + sovLog(uint64(*m.Status)) - } - if m.Begin != nil { - n += 1 + sovLog(uint64(*m.Begin)) - } - if m.End != nil { - n += 1 + sovLog(uint64(*m.End)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovLog(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozLog(x uint64) (n int) { - return sovLog(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Promise) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Promise{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Action{`, - `Position:` + valueToStringLog(this.Position) + `,`, - `Promised:` + valueToStringLog(this.Promised) + `,`, - `Performed:` + valueToStringLog(this.Performed) + `,`, - `Learned:` + valueToStringLog(this.Learned) + `,`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Nop:` + strings.Replace(fmt.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, - `Append:` + strings.Replace(fmt.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, - `Truncate:` + strings.Replace(fmt.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action_Nop) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Action_Nop{`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action_Append) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Action_Append{`, - `Bytes:` + valueToStringLog(this.Bytes) + `,`, - `Cksum:` + valueToStringLog(this.Cksum) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Action_Truncate) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Action_Truncate{`, - `To:` + valueToStringLog(this.To) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Metadata) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Metadata{`, - `Status:` + valueToStringLog(this.Status) + `,`, - `Promised:` + valueToStringLog(this.Promised) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Record) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Record{`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Promise:` + strings.Replace(fmt.Sprintf("%v", this.Promise), "Promise", "Promise", 1) + `,`, - `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "Metadata", "Metadata", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PromiseRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PromiseRequest{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PromiseResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PromiseResponse{`, - `Okay:` + valueToStringLog(this.Okay) + `,`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *WriteRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WriteRequest{`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `Learned:` + valueToStringLog(this.Learned) + `,`, - `Type:` + valueToStringLog(this.Type) + `,`, - `Nop:` + strings.Replace(fmt.Sprintf("%v", this.Nop), "Action_Nop", "Action_Nop", 1) + `,`, - `Append:` + strings.Replace(fmt.Sprintf("%v", this.Append), "Action_Append", "Action_Append", 1) + `,`, - `Truncate:` + strings.Replace(fmt.Sprintf("%v", this.Truncate), "Action_Truncate", "Action_Truncate", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *WriteResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WriteResponse{`, - `Okay:` + valueToStringLog(this.Okay) + `,`, - `Proposal:` + valueToStringLog(this.Proposal) + `,`, - `Position:` + valueToStringLog(this.Position) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *LearnedMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LearnedMessage{`, - `Action:` + strings.Replace(fmt.Sprintf("%v", this.Action), "Action", "Action", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RecoverRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RecoverRequest{`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RecoverResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RecoverResponse{`, - `Status:` + valueToStringLog(this.Status) + `,`, - `Begin:` + valueToStringLog(this.Begin) + `,`, - `End:` + valueToStringLog(this.End) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringLog(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Promise) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } - - return nil -} -func (m *Action) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Promised", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Promised = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Performed", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Performed = &v - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Learned", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Learned = &b - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Action_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Action_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nop", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Nop == nil { - m.Nop = &Action_Nop{} - } - if err := m.Nop.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Append", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Append == nil { - m.Append = &Action_Append{} - } - if err := m.Append.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Truncate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Truncate == nil { - m.Truncate = &Action_Truncate{} - } - if err := m.Truncate.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") - } - - return nil -} -func (m *Action_Nop) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Action_Append) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bytes = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cksum", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cksum = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("bytes") - } - - return nil -} -func (m *Action_Truncate) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.To = &v - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("to") - } - - return nil -} -func (m *Metadata) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v Metadata_Status - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Metadata_Status(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Promised", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Promised = &v - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("promised") - } - - return nil -} -func (m *Record) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Record_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Record_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Promise", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Promise == nil { - m.Promise = &Promise{} - } - if err := m.Promise.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &Metadata{} - } - if err := m.Metadata.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *PromiseRequest) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } - - return nil -} -func (m *PromiseResponse) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Okay", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Okay = &b - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } - - return nil -} -func (m *WriteRequest) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Learned", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Learned = &b - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Action_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Action_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000004) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Nop", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Nop == nil { - m.Nop = &Action_Nop{} - } - if err := m.Nop.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Append", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Append == nil { - m.Append = &Action_Append{} - } - if err := m.Append.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Truncate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Truncate == nil { - m.Truncate = &Action_Truncate{} - } - if err := m.Truncate.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *WriteResponse) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Okay", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Okay = &b - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Proposal = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Position = &v - hasFields[0] |= uint64(0x00000004) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("proposal") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("position") - } - - return nil -} -func (m *LearnedMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLog - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Action == nil { - m.Action = &Action{} - } - if err := m.Action.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("action") - } - - return nil -} -func (m *RecoverRequest) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *RecoverResponse) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v Metadata_Status - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Metadata_Status(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Begin = &v - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.End = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipLog(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthLog - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } - - return nil -} -func skipLog(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthLog - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipLog(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthLog = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/mesos.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/mesos.pb.go deleted file mode 100644 index 0165ccafa..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/mesos.pb.go +++ /dev/null @@ -1,34168 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: mesos.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// * -// Status is used to indicate the state of the scheduler and executor -// driver after function calls. -type Status int32 - -const ( - Status_DRIVER_NOT_STARTED Status = 1 - Status_DRIVER_RUNNING Status = 2 - Status_DRIVER_ABORTED Status = 3 - Status_DRIVER_STOPPED Status = 4 -) - -var Status_name = map[int32]string{ - 1: "DRIVER_NOT_STARTED", - 2: "DRIVER_RUNNING", - 3: "DRIVER_ABORTED", - 4: "DRIVER_STOPPED", -} -var Status_value = map[string]int32{ - "DRIVER_NOT_STARTED": 1, - "DRIVER_RUNNING": 2, - "DRIVER_ABORTED": 3, - "DRIVER_STOPPED": 4, -} - -func (x Status) Enum() *Status { - p := new(Status) - *p = x - return p -} -func (x Status) String() string { - return proto.EnumName(Status_name, int32(x)) -} -func (x *Status) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Status_value, data, "Status") - if err != nil { - return err - } - *x = Status(value) - return nil -} - -// * -// Describes possible task states. IMPORTANT: Mesos assumes tasks that -// enter terminal states (see below) imply the task is no longer -// running and thus clean up any thing associated with the task -// (ultimately offering any resources being consumed by that task to -// another task). -type TaskState int32 - -const ( - TaskState_TASK_STAGING TaskState = 6 - TaskState_TASK_STARTING TaskState = 0 - TaskState_TASK_RUNNING TaskState = 1 - TaskState_TASK_FINISHED TaskState = 2 - TaskState_TASK_FAILED TaskState = 3 - TaskState_TASK_KILLED TaskState = 4 - TaskState_TASK_LOST TaskState = 5 - TaskState_TASK_ERROR TaskState = 7 -) - -var TaskState_name = map[int32]string{ - 6: "TASK_STAGING", - 0: "TASK_STARTING", - 1: "TASK_RUNNING", - 2: "TASK_FINISHED", - 3: "TASK_FAILED", - 4: "TASK_KILLED", - 5: "TASK_LOST", - 7: "TASK_ERROR", -} -var TaskState_value = map[string]int32{ - "TASK_STAGING": 6, - "TASK_STARTING": 0, - "TASK_RUNNING": 1, - "TASK_FINISHED": 2, - "TASK_FAILED": 3, - "TASK_KILLED": 4, - "TASK_LOST": 5, - "TASK_ERROR": 7, -} - -func (x TaskState) Enum() *TaskState { - p := new(TaskState) - *p = x - return p -} -func (x TaskState) String() string { - return proto.EnumName(TaskState_name, int32(x)) -} -func (x *TaskState) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TaskState_value, data, "TaskState") - if err != nil { - return err - } - *x = TaskState(value) - return nil -} - -type FrameworkInfo_Capability_Type int32 - -const ( - // Receive offers with revocable resources. See 'Resource' - // message for details. - // TODO(vinod): This is currently a no-op. - FrameworkInfo_Capability_REVOCABLE_RESOURCES FrameworkInfo_Capability_Type = 1 -) - -var FrameworkInfo_Capability_Type_name = map[int32]string{ - 1: "REVOCABLE_RESOURCES", -} -var FrameworkInfo_Capability_Type_value = map[string]int32{ - "REVOCABLE_RESOURCES": 1, -} - -func (x FrameworkInfo_Capability_Type) Enum() *FrameworkInfo_Capability_Type { - p := new(FrameworkInfo_Capability_Type) - *p = x - return p -} -func (x FrameworkInfo_Capability_Type) String() string { - return proto.EnumName(FrameworkInfo_Capability_Type_name, int32(x)) -} -func (x *FrameworkInfo_Capability_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(FrameworkInfo_Capability_Type_value, data, "FrameworkInfo_Capability_Type") - if err != nil { - return err - } - *x = FrameworkInfo_Capability_Type(value) - return nil -} - -type Value_Type int32 - -const ( - Value_SCALAR Value_Type = 0 - Value_RANGES Value_Type = 1 - Value_SET Value_Type = 2 - Value_TEXT Value_Type = 3 -) - -var Value_Type_name = map[int32]string{ - 0: "SCALAR", - 1: "RANGES", - 2: "SET", - 3: "TEXT", -} -var Value_Type_value = map[string]int32{ - "SCALAR": 0, - "RANGES": 1, - "SET": 2, - "TEXT": 3, -} - -func (x Value_Type) Enum() *Value_Type { - p := new(Value_Type) - *p = x - return p -} -func (x Value_Type) String() string { - return proto.EnumName(Value_Type_name, int32(x)) -} -func (x *Value_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Value_Type_value, data, "Value_Type") - if err != nil { - return err - } - *x = Value_Type(value) - return nil -} - -type Offer_Operation_Type int32 - -const ( - Offer_Operation_LAUNCH Offer_Operation_Type = 1 - Offer_Operation_RESERVE Offer_Operation_Type = 2 - Offer_Operation_UNRESERVE Offer_Operation_Type = 3 - Offer_Operation_CREATE Offer_Operation_Type = 4 - Offer_Operation_DESTROY Offer_Operation_Type = 5 -) - -var Offer_Operation_Type_name = map[int32]string{ - 1: "LAUNCH", - 2: "RESERVE", - 3: "UNRESERVE", - 4: "CREATE", - 5: "DESTROY", -} -var Offer_Operation_Type_value = map[string]int32{ - "LAUNCH": 1, - "RESERVE": 2, - "UNRESERVE": 3, - "CREATE": 4, - "DESTROY": 5, -} - -func (x Offer_Operation_Type) Enum() *Offer_Operation_Type { - p := new(Offer_Operation_Type) - *p = x - return p -} -func (x Offer_Operation_Type) String() string { - return proto.EnumName(Offer_Operation_Type_name, int32(x)) -} -func (x *Offer_Operation_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Offer_Operation_Type_value, data, "Offer_Operation_Type") - if err != nil { - return err - } - *x = Offer_Operation_Type(value) - return nil -} - -// Describes the source of the task status update. -type TaskStatus_Source int32 - -const ( - TaskStatus_SOURCE_MASTER TaskStatus_Source = 0 - TaskStatus_SOURCE_SLAVE TaskStatus_Source = 1 - TaskStatus_SOURCE_EXECUTOR TaskStatus_Source = 2 -) - -var TaskStatus_Source_name = map[int32]string{ - 0: "SOURCE_MASTER", - 1: "SOURCE_SLAVE", - 2: "SOURCE_EXECUTOR", -} -var TaskStatus_Source_value = map[string]int32{ - "SOURCE_MASTER": 0, - "SOURCE_SLAVE": 1, - "SOURCE_EXECUTOR": 2, -} - -func (x TaskStatus_Source) Enum() *TaskStatus_Source { - p := new(TaskStatus_Source) - *p = x - return p -} -func (x TaskStatus_Source) String() string { - return proto.EnumName(TaskStatus_Source_name, int32(x)) -} -func (x *TaskStatus_Source) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TaskStatus_Source_value, data, "TaskStatus_Source") - if err != nil { - return err - } - *x = TaskStatus_Source(value) - return nil -} - -// Detailed reason for the task status update. -// -// TODO(bmahler): Differentiate between slave removal reasons -// (e.g. unhealthy vs. unregistered for maintenance). -type TaskStatus_Reason int32 - -const ( - TaskStatus_REASON_COMMAND_EXECUTOR_FAILED TaskStatus_Reason = 0 - TaskStatus_REASON_EXECUTOR_PREEMPTED TaskStatus_Reason = 17 - TaskStatus_REASON_EXECUTOR_TERMINATED TaskStatus_Reason = 1 - TaskStatus_REASON_EXECUTOR_UNREGISTERED TaskStatus_Reason = 2 - TaskStatus_REASON_FRAMEWORK_REMOVED TaskStatus_Reason = 3 - TaskStatus_REASON_GC_ERROR TaskStatus_Reason = 4 - TaskStatus_REASON_INVALID_FRAMEWORKID TaskStatus_Reason = 5 - TaskStatus_REASON_INVALID_OFFERS TaskStatus_Reason = 6 - TaskStatus_REASON_MASTER_DISCONNECTED TaskStatus_Reason = 7 - TaskStatus_REASON_MEMORY_LIMIT TaskStatus_Reason = 8 - TaskStatus_REASON_RECONCILIATION TaskStatus_Reason = 9 - TaskStatus_REASON_RESOURCES_UNKNOWN TaskStatus_Reason = 18 - TaskStatus_REASON_SLAVE_DISCONNECTED TaskStatus_Reason = 10 - TaskStatus_REASON_SLAVE_REMOVED TaskStatus_Reason = 11 - TaskStatus_REASON_SLAVE_RESTARTED TaskStatus_Reason = 12 - TaskStatus_REASON_SLAVE_UNKNOWN TaskStatus_Reason = 13 - TaskStatus_REASON_TASK_INVALID TaskStatus_Reason = 14 - TaskStatus_REASON_TASK_UNAUTHORIZED TaskStatus_Reason = 15 - TaskStatus_REASON_TASK_UNKNOWN TaskStatus_Reason = 16 -) - -var TaskStatus_Reason_name = map[int32]string{ - 0: "REASON_COMMAND_EXECUTOR_FAILED", - 17: "REASON_EXECUTOR_PREEMPTED", - 1: "REASON_EXECUTOR_TERMINATED", - 2: "REASON_EXECUTOR_UNREGISTERED", - 3: "REASON_FRAMEWORK_REMOVED", - 4: "REASON_GC_ERROR", - 5: "REASON_INVALID_FRAMEWORKID", - 6: "REASON_INVALID_OFFERS", - 7: "REASON_MASTER_DISCONNECTED", - 8: "REASON_MEMORY_LIMIT", - 9: "REASON_RECONCILIATION", - 18: "REASON_RESOURCES_UNKNOWN", - 10: "REASON_SLAVE_DISCONNECTED", - 11: "REASON_SLAVE_REMOVED", - 12: "REASON_SLAVE_RESTARTED", - 13: "REASON_SLAVE_UNKNOWN", - 14: "REASON_TASK_INVALID", - 15: "REASON_TASK_UNAUTHORIZED", - 16: "REASON_TASK_UNKNOWN", -} -var TaskStatus_Reason_value = map[string]int32{ - "REASON_COMMAND_EXECUTOR_FAILED": 0, - "REASON_EXECUTOR_PREEMPTED": 17, - "REASON_EXECUTOR_TERMINATED": 1, - "REASON_EXECUTOR_UNREGISTERED": 2, - "REASON_FRAMEWORK_REMOVED": 3, - "REASON_GC_ERROR": 4, - "REASON_INVALID_FRAMEWORKID": 5, - "REASON_INVALID_OFFERS": 6, - "REASON_MASTER_DISCONNECTED": 7, - "REASON_MEMORY_LIMIT": 8, - "REASON_RECONCILIATION": 9, - "REASON_RESOURCES_UNKNOWN": 18, - "REASON_SLAVE_DISCONNECTED": 10, - "REASON_SLAVE_REMOVED": 11, - "REASON_SLAVE_RESTARTED": 12, - "REASON_SLAVE_UNKNOWN": 13, - "REASON_TASK_INVALID": 14, - "REASON_TASK_UNAUTHORIZED": 15, - "REASON_TASK_UNKNOWN": 16, -} - -func (x TaskStatus_Reason) Enum() *TaskStatus_Reason { - p := new(TaskStatus_Reason) - *p = x - return p -} -func (x TaskStatus_Reason) String() string { - return proto.EnumName(TaskStatus_Reason_name, int32(x)) -} -func (x *TaskStatus_Reason) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(TaskStatus_Reason_value, data, "TaskStatus_Reason") - if err != nil { - return err - } - *x = TaskStatus_Reason(value) - return nil -} - -type Image_Type int32 - -const ( - Image_APPC Image_Type = 1 - Image_DOCKER Image_Type = 2 -) - -var Image_Type_name = map[int32]string{ - 1: "APPC", - 2: "DOCKER", -} -var Image_Type_value = map[string]int32{ - "APPC": 1, - "DOCKER": 2, -} - -func (x Image_Type) Enum() *Image_Type { - p := new(Image_Type) - *p = x - return p -} -func (x Image_Type) String() string { - return proto.EnumName(Image_Type_name, int32(x)) -} -func (x *Image_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Image_Type_value, data, "Image_Type") - if err != nil { - return err - } - *x = Image_Type(value) - return nil -} - -type Volume_Mode int32 - -const ( - Volume_RW Volume_Mode = 1 - Volume_RO Volume_Mode = 2 -) - -var Volume_Mode_name = map[int32]string{ - 1: "RW", - 2: "RO", -} -var Volume_Mode_value = map[string]int32{ - "RW": 1, - "RO": 2, -} - -func (x Volume_Mode) Enum() *Volume_Mode { - p := new(Volume_Mode) - *p = x - return p -} -func (x Volume_Mode) String() string { - return proto.EnumName(Volume_Mode_name, int32(x)) -} -func (x *Volume_Mode) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Volume_Mode_value, data, "Volume_Mode") - if err != nil { - return err - } - *x = Volume_Mode(value) - return nil -} - -// All container implementation types. -type ContainerInfo_Type int32 - -const ( - ContainerInfo_DOCKER ContainerInfo_Type = 1 - ContainerInfo_MESOS ContainerInfo_Type = 2 -) - -var ContainerInfo_Type_name = map[int32]string{ - 1: "DOCKER", - 2: "MESOS", -} -var ContainerInfo_Type_value = map[string]int32{ - "DOCKER": 1, - "MESOS": 2, -} - -func (x ContainerInfo_Type) Enum() *ContainerInfo_Type { - p := new(ContainerInfo_Type) - *p = x - return p -} -func (x ContainerInfo_Type) String() string { - return proto.EnumName(ContainerInfo_Type_name, int32(x)) -} -func (x *ContainerInfo_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ContainerInfo_Type_value, data, "ContainerInfo_Type") - if err != nil { - return err - } - *x = ContainerInfo_Type(value) - return nil -} - -// Network options. -type ContainerInfo_DockerInfo_Network int32 - -const ( - ContainerInfo_DockerInfo_HOST ContainerInfo_DockerInfo_Network = 1 - ContainerInfo_DockerInfo_BRIDGE ContainerInfo_DockerInfo_Network = 2 - ContainerInfo_DockerInfo_NONE ContainerInfo_DockerInfo_Network = 3 -) - -var ContainerInfo_DockerInfo_Network_name = map[int32]string{ - 1: "HOST", - 2: "BRIDGE", - 3: "NONE", -} -var ContainerInfo_DockerInfo_Network_value = map[string]int32{ - "HOST": 1, - "BRIDGE": 2, - "NONE": 3, -} - -func (x ContainerInfo_DockerInfo_Network) Enum() *ContainerInfo_DockerInfo_Network { - p := new(ContainerInfo_DockerInfo_Network) - *p = x - return p -} -func (x ContainerInfo_DockerInfo_Network) String() string { - return proto.EnumName(ContainerInfo_DockerInfo_Network_name, int32(x)) -} -func (x *ContainerInfo_DockerInfo_Network) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(ContainerInfo_DockerInfo_Network_value, data, "ContainerInfo_DockerInfo_Network") - if err != nil { - return err - } - *x = ContainerInfo_DockerInfo_Network(value) - return nil -} - -type DiscoveryInfo_Visibility int32 - -const ( - DiscoveryInfo_FRAMEWORK DiscoveryInfo_Visibility = 0 - DiscoveryInfo_CLUSTER DiscoveryInfo_Visibility = 1 - DiscoveryInfo_EXTERNAL DiscoveryInfo_Visibility = 2 -) - -var DiscoveryInfo_Visibility_name = map[int32]string{ - 0: "FRAMEWORK", - 1: "CLUSTER", - 2: "EXTERNAL", -} -var DiscoveryInfo_Visibility_value = map[string]int32{ - "FRAMEWORK": 0, - "CLUSTER": 1, - "EXTERNAL": 2, -} - -func (x DiscoveryInfo_Visibility) Enum() *DiscoveryInfo_Visibility { - p := new(DiscoveryInfo_Visibility) - *p = x - return p -} -func (x DiscoveryInfo_Visibility) String() string { - return proto.EnumName(DiscoveryInfo_Visibility_name, int32(x)) -} -func (x *DiscoveryInfo_Visibility) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(DiscoveryInfo_Visibility_value, data, "DiscoveryInfo_Visibility") - if err != nil { - return err - } - *x = DiscoveryInfo_Visibility(value) - return nil -} - -// * -// A unique ID assigned to a framework. A framework can reuse this ID -// in order to do failover (see MesosSchedulerDriver). -type FrameworkID struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FrameworkID) Reset() { *m = FrameworkID{} } -func (*FrameworkID) ProtoMessage() {} - -func (m *FrameworkID) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// A unique ID assigned to an offer. -type OfferID struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *OfferID) Reset() { *m = OfferID{} } -func (*OfferID) ProtoMessage() {} - -func (m *OfferID) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// A unique ID assigned to a slave. Currently, a slave gets a new ID -// whenever it (re)registers with Mesos. Framework writers shouldn't -// assume any binding between a slave ID and and a hostname. -type SlaveID struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SlaveID) Reset() { *m = SlaveID{} } -func (*SlaveID) ProtoMessage() {} - -func (m *SlaveID) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// A framework generated ID to distinguish a task. The ID must remain -// unique while the task is active. However, a framework can reuse an -// ID _only_ if a previous task with the same ID has reached a -// terminal state (e.g., TASK_FINISHED, TASK_LOST, TASK_KILLED, etc.). -type TaskID struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskID) Reset() { *m = TaskID{} } -func (*TaskID) ProtoMessage() {} - -func (m *TaskID) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// A framework generated ID to distinguish an executor. Only one -// executor with the same ID can be active on the same slave at a -// time. -type ExecutorID struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ExecutorID) Reset() { *m = ExecutorID{} } -func (*ExecutorID) ProtoMessage() {} - -func (m *ExecutorID) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// A slave generated ID to distinguish a container. The ID must be unique -// between any active or completed containers on the slave. In particular, -// containers for different runs of the same (framework, executor) pair must be -// unique. -type ContainerID struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ContainerID) Reset() { *m = ContainerID{} } -func (*ContainerID) ProtoMessage() {} - -func (m *ContainerID) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// A network address. -// -// TODO(bmahler): Use this more widely. -type Address struct { - // May contain a hostname, IP address, or both. - Hostname *string `protobuf:"bytes,1,opt,name=hostname" json:"hostname,omitempty"` - Ip *string `protobuf:"bytes,2,opt,name=ip" json:"ip,omitempty"` - Port *int32 `protobuf:"varint,3,req,name=port" json:"port,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Address) Reset() { *m = Address{} } -func (*Address) ProtoMessage() {} - -func (m *Address) GetHostname() string { - if m != nil && m.Hostname != nil { - return *m.Hostname - } - return "" -} - -func (m *Address) GetIp() string { - if m != nil && m.Ip != nil { - return *m.Ip - } - return "" -} - -func (m *Address) GetPort() int32 { - if m != nil && m.Port != nil { - return *m.Port - } - return 0 -} - -// * -// Represents a URL. -type URL struct { - Scheme *string `protobuf:"bytes,1,req,name=scheme" json:"scheme,omitempty"` - Address *Address `protobuf:"bytes,2,req,name=address" json:"address,omitempty"` - Path *string `protobuf:"bytes,3,opt,name=path" json:"path,omitempty"` - Query []*Parameter `protobuf:"bytes,4,rep,name=query" json:"query,omitempty"` - Fragment *string `protobuf:"bytes,5,opt,name=fragment" json:"fragment,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *URL) Reset() { *m = URL{} } -func (*URL) ProtoMessage() {} - -func (m *URL) GetScheme() string { - if m != nil && m.Scheme != nil { - return *m.Scheme - } - return "" -} - -func (m *URL) GetAddress() *Address { - if m != nil { - return m.Address - } - return nil -} - -func (m *URL) GetPath() string { - if m != nil && m.Path != nil { - return *m.Path - } - return "" -} - -func (m *URL) GetQuery() []*Parameter { - if m != nil { - return m.Query - } - return nil -} - -func (m *URL) GetFragment() string { - if m != nil && m.Fragment != nil { - return *m.Fragment - } - return "" -} - -// * -// Describes a framework. -type FrameworkInfo struct { - // Used to determine the Unix user that an executor or task should - // be launched as. If the user field is set to an empty string Mesos - // will automagically set it to the current user. - User *string `protobuf:"bytes,1,req,name=user" json:"user,omitempty"` - // Name of the framework that shows up in the Mesos Web UI. - Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` - // Note that 'id' is only available after a framework has - // registered, however, it is included here in order to facilitate - // scheduler failover (i.e., if it is set then the - // MesosSchedulerDriver expects the scheduler is performing - // failover). - Id *FrameworkID `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` - // The amount of time that the master will wait for the scheduler to - // failover before it tears down the framework by killing all its - // tasks/executors. This should be non-zero if a framework expects - // to reconnect after a failover and not lose its tasks/executors. - FailoverTimeout *float64 `protobuf:"fixed64,4,opt,name=failover_timeout,def=0" json:"failover_timeout,omitempty"` - // If set, framework pid, executor pids and status updates are - // checkpointed to disk by the slaves. Checkpointing allows a - // restarted slave to reconnect with old executors and recover - // status updates, at the cost of disk I/O. - Checkpoint *bool `protobuf:"varint,5,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` - // Used to group frameworks for allocation decisions, depending on - // the allocation policy being used. - Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` - // Used to indicate the current host from which the scheduler is - // registered in the Mesos Web UI. If set to an empty string Mesos - // will automagically set it to the current hostname if one is - // available. - Hostname *string `protobuf:"bytes,7,opt,name=hostname" json:"hostname,omitempty"` - // This field should match the credential's principal the framework - // uses for authentication. This field is used for framework API - // rate limiting and dynamic reservations. It should be set even - // if authentication is not enabled if these features are desired. - Principal *string `protobuf:"bytes,8,opt,name=principal" json:"principal,omitempty"` - // This field allows a framework to advertise its web UI, so that - // the Mesos web UI can link to it. It is expected to be a full URL, - // for example http://my-scheduler.example.com:8080/. - WebuiUrl *string `protobuf:"bytes,9,opt,name=webui_url" json:"webui_url,omitempty"` - // This field allows a framework to advertise its set of - // capabilities (e.g., ability to receive offers for revocable - // resources). - Capabilities []*FrameworkInfo_Capability `protobuf:"bytes,10,rep,name=capabilities" json:"capabilities,omitempty"` - // Labels are free-form key value pairs supplied by the framework - // scheduler (e.g., to describe additional functionality offered by - // the framework). These labels are not interpreted by Mesos itself. - Labels *Labels `protobuf:"bytes,11,opt,name=labels" json:"labels,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FrameworkInfo) Reset() { *m = FrameworkInfo{} } -func (*FrameworkInfo) ProtoMessage() {} - -const Default_FrameworkInfo_FailoverTimeout float64 = 0 -const Default_FrameworkInfo_Checkpoint bool = false -const Default_FrameworkInfo_Role string = "*" - -func (m *FrameworkInfo) GetUser() string { - if m != nil && m.User != nil { - return *m.User - } - return "" -} - -func (m *FrameworkInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *FrameworkInfo) GetId() *FrameworkID { - if m != nil { - return m.Id - } - return nil -} - -func (m *FrameworkInfo) GetFailoverTimeout() float64 { - if m != nil && m.FailoverTimeout != nil { - return *m.FailoverTimeout - } - return Default_FrameworkInfo_FailoverTimeout -} - -func (m *FrameworkInfo) GetCheckpoint() bool { - if m != nil && m.Checkpoint != nil { - return *m.Checkpoint - } - return Default_FrameworkInfo_Checkpoint -} - -func (m *FrameworkInfo) GetRole() string { - if m != nil && m.Role != nil { - return *m.Role - } - return Default_FrameworkInfo_Role -} - -func (m *FrameworkInfo) GetHostname() string { - if m != nil && m.Hostname != nil { - return *m.Hostname - } - return "" -} - -func (m *FrameworkInfo) GetPrincipal() string { - if m != nil && m.Principal != nil { - return *m.Principal - } - return "" -} - -func (m *FrameworkInfo) GetWebuiUrl() string { - if m != nil && m.WebuiUrl != nil { - return *m.WebuiUrl - } - return "" -} - -func (m *FrameworkInfo) GetCapabilities() []*FrameworkInfo_Capability { - if m != nil { - return m.Capabilities - } - return nil -} - -func (m *FrameworkInfo) GetLabels() *Labels { - if m != nil { - return m.Labels - } - return nil -} - -type FrameworkInfo_Capability struct { - Type *FrameworkInfo_Capability_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.FrameworkInfo_Capability_Type" json:"type,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FrameworkInfo_Capability) Reset() { *m = FrameworkInfo_Capability{} } -func (*FrameworkInfo_Capability) ProtoMessage() {} - -func (m *FrameworkInfo_Capability) GetType() FrameworkInfo_Capability_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return FrameworkInfo_Capability_REVOCABLE_RESOURCES -} - -// * -// Describes a health check for a task or executor (or any arbitrary -// process/command). A "strategy" is picked by specifying one of the -// optional fields; currently only 'command' is supported. -// Specifying more than one strategy is an error. -type HealthCheck struct { - // HTTP health check - not yet recommended for use, see MESOS-2533. - Http *HealthCheck_HTTP `protobuf:"bytes,1,opt,name=http" json:"http,omitempty"` - // Amount of time to wait until starting the health checks. - DelaySeconds *float64 `protobuf:"fixed64,2,opt,name=delay_seconds,def=15" json:"delay_seconds,omitempty"` - // Interval between health checks. - IntervalSeconds *float64 `protobuf:"fixed64,3,opt,name=interval_seconds,def=10" json:"interval_seconds,omitempty"` - // Amount of time to wait for the health check to complete. - TimeoutSeconds *float64 `protobuf:"fixed64,4,opt,name=timeout_seconds,def=20" json:"timeout_seconds,omitempty"` - // Number of consecutive failures until considered unhealthy. - ConsecutiveFailures *uint32 `protobuf:"varint,5,opt,name=consecutive_failures,def=3" json:"consecutive_failures,omitempty"` - // Amount of time to allow failed health checks since launch. - GracePeriodSeconds *float64 `protobuf:"fixed64,6,opt,name=grace_period_seconds,def=10" json:"grace_period_seconds,omitempty"` - // Command health check. - Command *CommandInfo `protobuf:"bytes,7,opt,name=command" json:"command,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *HealthCheck) Reset() { *m = HealthCheck{} } -func (*HealthCheck) ProtoMessage() {} - -const Default_HealthCheck_DelaySeconds float64 = 15 -const Default_HealthCheck_IntervalSeconds float64 = 10 -const Default_HealthCheck_TimeoutSeconds float64 = 20 -const Default_HealthCheck_ConsecutiveFailures uint32 = 3 -const Default_HealthCheck_GracePeriodSeconds float64 = 10 - -func (m *HealthCheck) GetHttp() *HealthCheck_HTTP { - if m != nil { - return m.Http - } - return nil -} - -func (m *HealthCheck) GetDelaySeconds() float64 { - if m != nil && m.DelaySeconds != nil { - return *m.DelaySeconds - } - return Default_HealthCheck_DelaySeconds -} - -func (m *HealthCheck) GetIntervalSeconds() float64 { - if m != nil && m.IntervalSeconds != nil { - return *m.IntervalSeconds - } - return Default_HealthCheck_IntervalSeconds -} - -func (m *HealthCheck) GetTimeoutSeconds() float64 { - if m != nil && m.TimeoutSeconds != nil { - return *m.TimeoutSeconds - } - return Default_HealthCheck_TimeoutSeconds -} - -func (m *HealthCheck) GetConsecutiveFailures() uint32 { - if m != nil && m.ConsecutiveFailures != nil { - return *m.ConsecutiveFailures - } - return Default_HealthCheck_ConsecutiveFailures -} - -func (m *HealthCheck) GetGracePeriodSeconds() float64 { - if m != nil && m.GracePeriodSeconds != nil { - return *m.GracePeriodSeconds - } - return Default_HealthCheck_GracePeriodSeconds -} - -func (m *HealthCheck) GetCommand() *CommandInfo { - if m != nil { - return m.Command - } - return nil -} - -// Describes an HTTP health check. This is not fully implemented and not -// recommended for use - see MESOS-2533. -type HealthCheck_HTTP struct { - // Port to send the HTTP request. - Port *uint32 `protobuf:"varint,1,req,name=port" json:"port,omitempty"` - // HTTP request path. - Path *string `protobuf:"bytes,2,opt,name=path,def=/" json:"path,omitempty"` - // Expected response statuses. Not specifying any statuses implies - // that any returned status is acceptable. - Statuses []uint32 `protobuf:"varint,4,rep,name=statuses" json:"statuses,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *HealthCheck_HTTP) Reset() { *m = HealthCheck_HTTP{} } -func (*HealthCheck_HTTP) ProtoMessage() {} - -const Default_HealthCheck_HTTP_Path string = "/" - -func (m *HealthCheck_HTTP) GetPort() uint32 { - if m != nil && m.Port != nil { - return *m.Port - } - return 0 -} - -func (m *HealthCheck_HTTP) GetPath() string { - if m != nil && m.Path != nil { - return *m.Path - } - return Default_HealthCheck_HTTP_Path -} - -func (m *HealthCheck_HTTP) GetStatuses() []uint32 { - if m != nil { - return m.Statuses - } - return nil -} - -// * -// Describes a command, executed via: '/bin/sh -c value'. Any URIs specified -// are fetched before executing the command. If the executable field for an -// uri is set, executable file permission is set on the downloaded file. -// Otherwise, if the downloaded file has a recognized archive extension -// (currently [compressed] tar and zip) it is extracted into the executor's -// working directory. This extraction can be disabled by setting `extract` to -// false. In addition, any environment variables are set before executing -// the command (so they can be used to "parameterize" your command). -type CommandInfo struct { - // NOTE: MesosContainerizer does currently not support this - // attribute and tasks supplying a 'container' will fail. - Container *CommandInfo_ContainerInfo `protobuf:"bytes,4,opt,name=container" json:"container,omitempty"` - Uris []*CommandInfo_URI `protobuf:"bytes,1,rep,name=uris" json:"uris,omitempty"` - Environment *Environment `protobuf:"bytes,2,opt,name=environment" json:"environment,omitempty"` - // There are two ways to specify the command: - // 1) If 'shell == true', the command will be launched via shell - // (i.e., /bin/sh -c 'value'). The 'value' specified will be - // treated as the shell command. The 'arguments' will be ignored. - // 2) If 'shell == false', the command will be launched by passing - // arguments to an executable. The 'value' specified will be - // treated as the filename of the executable. The 'arguments' - // will be treated as the arguments to the executable. This is - // similar to how POSIX exec families launch processes (i.e., - // execlp(value, arguments(0), arguments(1), ...)). - // NOTE: The field 'value' is changed from 'required' to 'optional' - // in 0.20.0. It will only cause issues if a new framework is - // connecting to an old master. - Shell *bool `protobuf:"varint,6,opt,name=shell,def=1" json:"shell,omitempty"` - Value *string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` - Arguments []string `protobuf:"bytes,7,rep,name=arguments" json:"arguments,omitempty"` - // Enables executor and tasks to run as a specific user. If the user - // field is present both in FrameworkInfo and here, the CommandInfo - // user value takes precedence. - User *string `protobuf:"bytes,5,opt,name=user" json:"user,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CommandInfo) Reset() { *m = CommandInfo{} } -func (*CommandInfo) ProtoMessage() {} - -const Default_CommandInfo_Shell bool = true - -func (m *CommandInfo) GetContainer() *CommandInfo_ContainerInfo { - if m != nil { - return m.Container - } - return nil -} - -func (m *CommandInfo) GetUris() []*CommandInfo_URI { - if m != nil { - return m.Uris - } - return nil -} - -func (m *CommandInfo) GetEnvironment() *Environment { - if m != nil { - return m.Environment - } - return nil -} - -func (m *CommandInfo) GetShell() bool { - if m != nil && m.Shell != nil { - return *m.Shell - } - return Default_CommandInfo_Shell -} - -func (m *CommandInfo) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -func (m *CommandInfo) GetArguments() []string { - if m != nil { - return m.Arguments - } - return nil -} - -func (m *CommandInfo) GetUser() string { - if m != nil && m.User != nil { - return *m.User - } - return "" -} - -type CommandInfo_URI struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - Executable *bool `protobuf:"varint,2,opt,name=executable" json:"executable,omitempty"` - // In case the fetched file is recognized as an archive, extract - // its contents into the sandbox. Note that a cached archive is - // not copied from the cache to the sandbox in case extraction - // originates from an archive in the cache. - Extract *bool `protobuf:"varint,3,opt,name=extract,def=1" json:"extract,omitempty"` - // If this field is "true", the fetcher cache will be used. If not, - // fetching bypasses the cache and downloads directly into the - // sandbox directory, no matter whether a suitable cache file is - // available or not. The former directs the fetcher to download to - // the file cache, then copy from there to the sandbox. Subsequent - // fetch attempts with the same URI will omit downloading and copy - // from the cache as long as the file is resident there. Cache files - // may get evicted at any time, which then leads to renewed - // downloading. See also "docs/fetcher.md" and - // "docs/fetcher-cache-internals.md". - Cache *bool `protobuf:"varint,4,opt,name=cache" json:"cache,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CommandInfo_URI) Reset() { *m = CommandInfo_URI{} } -func (*CommandInfo_URI) ProtoMessage() {} - -const Default_CommandInfo_URI_Extract bool = true - -func (m *CommandInfo_URI) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -func (m *CommandInfo_URI) GetExecutable() bool { - if m != nil && m.Executable != nil { - return *m.Executable - } - return false -} - -func (m *CommandInfo_URI) GetExtract() bool { - if m != nil && m.Extract != nil { - return *m.Extract - } - return Default_CommandInfo_URI_Extract -} - -func (m *CommandInfo_URI) GetCache() bool { - if m != nil && m.Cache != nil { - return *m.Cache - } - return false -} - -// Describes a container. -// Not all containerizers currently implement ContainerInfo, so it -// is possible that a launched task will fail due to supplying this -// attribute. -// NOTE: The containerizer API is currently in an early beta or -// even alpha state. Some details, like the exact semantics of an -// "image" or "options" are not yet hardened. -// TODO(tillt): Describe the exact scheme and semantics of "image" -// and "options". -type CommandInfo_ContainerInfo struct { - // URI describing the container image name. - Image *string `protobuf:"bytes,1,req,name=image" json:"image,omitempty"` - // Describes additional options passed to the containerizer. - Options []string `protobuf:"bytes,2,rep,name=options" json:"options,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CommandInfo_ContainerInfo) Reset() { *m = CommandInfo_ContainerInfo{} } -func (*CommandInfo_ContainerInfo) ProtoMessage() {} - -func (m *CommandInfo_ContainerInfo) GetImage() string { - if m != nil && m.Image != nil { - return *m.Image - } - return "" -} - -func (m *CommandInfo_ContainerInfo) GetOptions() []string { - if m != nil { - return m.Options - } - return nil -} - -// * -// Describes information about an executor. The 'data' field can be -// used to pass arbitrary bytes to an executor. -type ExecutorInfo struct { - ExecutorId *ExecutorID `protobuf:"bytes,1,req,name=executor_id" json:"executor_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,8,opt,name=framework_id" json:"framework_id,omitempty"` - Command *CommandInfo `protobuf:"bytes,7,req,name=command" json:"command,omitempty"` - // Executor provided with a container will launch the container - // with the executor's CommandInfo and we expect the container to - // act as a Mesos executor. - Container *ContainerInfo `protobuf:"bytes,11,opt,name=container" json:"container,omitempty"` - Resources []*Resource `protobuf:"bytes,5,rep,name=resources" json:"resources,omitempty"` - Name *string `protobuf:"bytes,9,opt,name=name" json:"name,omitempty"` - // Source is an identifier style string used by frameworks to track - // the source of an executor. This is useful when it's possible for - // different executor ids to be related semantically. - // NOTE: Source is exposed alongside the resource usage of the - // executor via JSON on the slave. This allows users to import - // usage information into a time series database for monitoring. - Source *string `protobuf:"bytes,10,opt,name=source" json:"source,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` - // Service discovery information for the executor. It is not - // interpreted or acted upon by Mesos. It is up to a service - // discovery system to use this information as needed and to handle - // executors without service discovery information. - Discovery *DiscoveryInfo `protobuf:"bytes,12,opt,name=discovery" json:"discovery,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ExecutorInfo) Reset() { *m = ExecutorInfo{} } -func (*ExecutorInfo) ProtoMessage() {} - -func (m *ExecutorInfo) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *ExecutorInfo) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *ExecutorInfo) GetCommand() *CommandInfo { - if m != nil { - return m.Command - } - return nil -} - -func (m *ExecutorInfo) GetContainer() *ContainerInfo { - if m != nil { - return m.Container - } - return nil -} - -func (m *ExecutorInfo) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -func (m *ExecutorInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *ExecutorInfo) GetSource() string { - if m != nil && m.Source != nil { - return *m.Source - } - return "" -} - -func (m *ExecutorInfo) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *ExecutorInfo) GetDiscovery() *DiscoveryInfo { - if m != nil { - return m.Discovery - } - return nil -} - -// * -// Describes a master. This will probably have more fields in the -// future which might be used, for example, to link a framework webui -// to a master webui. -type MasterInfo struct { - Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` - // The IP address (only IPv4) as a packed 4-bytes integer, - // stored in network order. Deprecated, use `address.ip` instead. - Ip *uint32 `protobuf:"varint,2,req,name=ip" json:"ip,omitempty"` - // The TCP port the Master is listening on for incoming - // HTTP requests; deprecated, use `address.port` instead. - Port *uint32 `protobuf:"varint,3,req,name=port,def=5050" json:"port,omitempty"` - // In the default implementation, this will contain information - // about both the IP address, port and Master name; it should really - // not be relied upon by external tooling/frameworks and be - // considered an "internal" implementation field. - Pid *string `protobuf:"bytes,4,opt,name=pid" json:"pid,omitempty"` - // The server's hostname, if available; it may be unreliable - // in environments where the DNS configuration does not resolve - // internal hostnames (eg, some public cloud providers). - // Deprecated, use `address.hostname` instead. - Hostname *string `protobuf:"bytes,5,opt,name=hostname" json:"hostname,omitempty"` - // The running Master version, as a string; taken from the - // generated "master/version.hpp". - Version *string `protobuf:"bytes,6,opt,name=version" json:"version,omitempty"` - // The full IP address (supports both IPv4 and IPv6 formats) - // and supersedes the use of `ip`, `port` and `hostname`. - // Since Mesos 0.24. - Address *Address `protobuf:"bytes,7,opt,name=address" json:"address,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MasterInfo) Reset() { *m = MasterInfo{} } -func (*MasterInfo) ProtoMessage() {} - -const Default_MasterInfo_Port uint32 = 5050 - -func (m *MasterInfo) GetId() string { - if m != nil && m.Id != nil { - return *m.Id - } - return "" -} - -func (m *MasterInfo) GetIp() uint32 { - if m != nil && m.Ip != nil { - return *m.Ip - } - return 0 -} - -func (m *MasterInfo) GetPort() uint32 { - if m != nil && m.Port != nil { - return *m.Port - } - return Default_MasterInfo_Port -} - -func (m *MasterInfo) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} - -func (m *MasterInfo) GetHostname() string { - if m != nil && m.Hostname != nil { - return *m.Hostname - } - return "" -} - -func (m *MasterInfo) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -func (m *MasterInfo) GetAddress() *Address { - if m != nil { - return m.Address - } - return nil -} - -// * -// Describes a slave. Note that the 'id' field is only available after -// a slave is registered with the master, and is made available here -// to facilitate re-registration. If checkpoint is set, the slave is -// checkpointing its own information and potentially frameworks' -// information (if a framework has checkpointing enabled). -type SlaveInfo struct { - Hostname *string `protobuf:"bytes,1,req,name=hostname" json:"hostname,omitempty"` - Port *int32 `protobuf:"varint,8,opt,name=port,def=5051" json:"port,omitempty"` - Resources []*Resource `protobuf:"bytes,3,rep,name=resources" json:"resources,omitempty"` - Attributes []*Attribute `protobuf:"bytes,5,rep,name=attributes" json:"attributes,omitempty"` - Id *SlaveID `protobuf:"bytes,6,opt,name=id" json:"id,omitempty"` - // TODO(joerg84): Remove checkpoint field as with 0.22.0 - // slave checkpointing is enabled for all slaves (MESOS-2317). - Checkpoint *bool `protobuf:"varint,7,opt,name=checkpoint,def=0" json:"checkpoint,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SlaveInfo) Reset() { *m = SlaveInfo{} } -func (*SlaveInfo) ProtoMessage() {} - -const Default_SlaveInfo_Port int32 = 5051 -const Default_SlaveInfo_Checkpoint bool = false - -func (m *SlaveInfo) GetHostname() string { - if m != nil && m.Hostname != nil { - return *m.Hostname - } - return "" -} - -func (m *SlaveInfo) GetPort() int32 { - if m != nil && m.Port != nil { - return *m.Port - } - return Default_SlaveInfo_Port -} - -func (m *SlaveInfo) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -func (m *SlaveInfo) GetAttributes() []*Attribute { - if m != nil { - return m.Attributes - } - return nil -} - -func (m *SlaveInfo) GetId() *SlaveID { - if m != nil { - return m.Id - } - return nil -} - -func (m *SlaveInfo) GetCheckpoint() bool { - if m != nil && m.Checkpoint != nil { - return *m.Checkpoint - } - return Default_SlaveInfo_Checkpoint -} - -// * -// Describes an Attribute or Resource "value". A value is described -// using the standard protocol buffer "union" trick. -type Value struct { - Type *Value_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Value_Type" json:"type,omitempty"` - Scalar *Value_Scalar `protobuf:"bytes,2,opt,name=scalar" json:"scalar,omitempty"` - Ranges *Value_Ranges `protobuf:"bytes,3,opt,name=ranges" json:"ranges,omitempty"` - Set *Value_Set `protobuf:"bytes,4,opt,name=set" json:"set,omitempty"` - Text *Value_Text `protobuf:"bytes,5,opt,name=text" json:"text,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Value) Reset() { *m = Value{} } -func (*Value) ProtoMessage() {} - -func (m *Value) GetType() Value_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Value_SCALAR -} - -func (m *Value) GetScalar() *Value_Scalar { - if m != nil { - return m.Scalar - } - return nil -} - -func (m *Value) GetRanges() *Value_Ranges { - if m != nil { - return m.Ranges - } - return nil -} - -func (m *Value) GetSet() *Value_Set { - if m != nil { - return m.Set - } - return nil -} - -func (m *Value) GetText() *Value_Text { - if m != nil { - return m.Text - } - return nil -} - -type Value_Scalar struct { - Value *float64 `protobuf:"fixed64,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Value_Scalar) Reset() { *m = Value_Scalar{} } -func (*Value_Scalar) ProtoMessage() {} - -func (m *Value_Scalar) GetValue() float64 { - if m != nil && m.Value != nil { - return *m.Value - } - return 0 -} - -type Value_Range struct { - Begin *uint64 `protobuf:"varint,1,req,name=begin" json:"begin,omitempty"` - End *uint64 `protobuf:"varint,2,req,name=end" json:"end,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Value_Range) Reset() { *m = Value_Range{} } -func (*Value_Range) ProtoMessage() {} - -func (m *Value_Range) GetBegin() uint64 { - if m != nil && m.Begin != nil { - return *m.Begin - } - return 0 -} - -func (m *Value_Range) GetEnd() uint64 { - if m != nil && m.End != nil { - return *m.End - } - return 0 -} - -type Value_Ranges struct { - Range []*Value_Range `protobuf:"bytes,1,rep,name=range" json:"range,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Value_Ranges) Reset() { *m = Value_Ranges{} } -func (*Value_Ranges) ProtoMessage() {} - -func (m *Value_Ranges) GetRange() []*Value_Range { - if m != nil { - return m.Range - } - return nil -} - -type Value_Set struct { - Item []string `protobuf:"bytes,1,rep,name=item" json:"item,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Value_Set) Reset() { *m = Value_Set{} } -func (*Value_Set) ProtoMessage() {} - -func (m *Value_Set) GetItem() []string { - if m != nil { - return m.Item - } - return nil -} - -type Value_Text struct { - Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Value_Text) Reset() { *m = Value_Text{} } -func (*Value_Text) ProtoMessage() {} - -func (m *Value_Text) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// Describes an attribute that can be set on a machine. For now, -// attributes and resources share the same "value" type, but this may -// change in the future and attributes may only be string based. -type Attribute struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Type *Value_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Value_Type" json:"type,omitempty"` - Scalar *Value_Scalar `protobuf:"bytes,3,opt,name=scalar" json:"scalar,omitempty"` - Ranges *Value_Ranges `protobuf:"bytes,4,opt,name=ranges" json:"ranges,omitempty"` - Set *Value_Set `protobuf:"bytes,6,opt,name=set" json:"set,omitempty"` - Text *Value_Text `protobuf:"bytes,5,opt,name=text" json:"text,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Attribute) Reset() { *m = Attribute{} } -func (*Attribute) ProtoMessage() {} - -func (m *Attribute) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Attribute) GetType() Value_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Value_SCALAR -} - -func (m *Attribute) GetScalar() *Value_Scalar { - if m != nil { - return m.Scalar - } - return nil -} - -func (m *Attribute) GetRanges() *Value_Ranges { - if m != nil { - return m.Ranges - } - return nil -} - -func (m *Attribute) GetSet() *Value_Set { - if m != nil { - return m.Set - } - return nil -} - -func (m *Attribute) GetText() *Value_Text { - if m != nil { - return m.Text - } - return nil -} - -// * -// Describes a resource on a machine. A resource can take on one of -// three types: scalar (double), a list of finite and discrete ranges -// (e.g., [1-10, 20-30]), or a set of items. A resource is described -// using the standard protocol buffer "union" trick. -// -// TODO(benh): Add better support for "expected" resources (e.g., -// cpus, memory, disk, network). -type Resource struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Type *Value_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Value_Type" json:"type,omitempty"` - Scalar *Value_Scalar `protobuf:"bytes,3,opt,name=scalar" json:"scalar,omitempty"` - Ranges *Value_Ranges `protobuf:"bytes,4,opt,name=ranges" json:"ranges,omitempty"` - Set *Value_Set `protobuf:"bytes,5,opt,name=set" json:"set,omitempty"` - Role *string `protobuf:"bytes,6,opt,name=role,def=*" json:"role,omitempty"` - // If this is set, this resource was dynamically reserved by an - // operator or a framework. Otherwise, this resource is either unreserved - // or statically reserved by an operator via the --resources flag. - Reservation *Resource_ReservationInfo `protobuf:"bytes,8,opt,name=reservation" json:"reservation,omitempty"` - Disk *Resource_DiskInfo `protobuf:"bytes,7,opt,name=disk" json:"disk,omitempty"` - // If this is set, the resources are revocable, i.e., any tasks or - // executors launched using these resources could get preempted or - // throttled at any time. This could be used by frameworks to run - // best effort tasks that do not need strict uptime or performance - // guarantees. Note that if this is set, 'disk' or 'reservation' - // cannot be set. - Revocable *Resource_RevocableInfo `protobuf:"bytes,9,opt,name=revocable" json:"revocable,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Resource) Reset() { *m = Resource{} } -func (*Resource) ProtoMessage() {} - -const Default_Resource_Role string = "*" - -func (m *Resource) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Resource) GetType() Value_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Value_SCALAR -} - -func (m *Resource) GetScalar() *Value_Scalar { - if m != nil { - return m.Scalar - } - return nil -} - -func (m *Resource) GetRanges() *Value_Ranges { - if m != nil { - return m.Ranges - } - return nil -} - -func (m *Resource) GetSet() *Value_Set { - if m != nil { - return m.Set - } - return nil -} - -func (m *Resource) GetRole() string { - if m != nil && m.Role != nil { - return *m.Role - } - return Default_Resource_Role -} - -func (m *Resource) GetReservation() *Resource_ReservationInfo { - if m != nil { - return m.Reservation - } - return nil -} - -func (m *Resource) GetDisk() *Resource_DiskInfo { - if m != nil { - return m.Disk - } - return nil -} - -func (m *Resource) GetRevocable() *Resource_RevocableInfo { - if m != nil { - return m.Revocable - } - return nil -} - -type Resource_ReservationInfo struct { - // This field indicates the principal of the operator or framework - // that reserved this resource. It is used in conjunction with the - // "unreserve" ACL to determine whether the entity attempting to - // unreserve this resource is permitted to do so. - // NOTE: This field should match the FrameworkInfo.principal of - // the framework that reserved this resource. - Principal *string `protobuf:"bytes,1,req,name=principal" json:"principal,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Resource_ReservationInfo) Reset() { *m = Resource_ReservationInfo{} } -func (*Resource_ReservationInfo) ProtoMessage() {} - -func (m *Resource_ReservationInfo) GetPrincipal() string { - if m != nil && m.Principal != nil { - return *m.Principal - } - return "" -} - -type Resource_DiskInfo struct { - Persistence *Resource_DiskInfo_Persistence `protobuf:"bytes,1,opt,name=persistence" json:"persistence,omitempty"` - // Describes how this disk resource will be mounted in the - // container. If not set, the disk resource will be used as the - // sandbox. Otherwise, it will be mounted according to the - // 'container_path' inside 'volume'. The 'host_path' inside - // 'volume' is ignored. - // NOTE: If 'volume' is set but 'persistence' is not set, the - // volume will be automatically garbage collected after - // task/executor terminates. Currently, if 'persistence' is set, - // 'volume' must be set. - Volume *Volume `protobuf:"bytes,2,opt,name=volume" json:"volume,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Resource_DiskInfo) Reset() { *m = Resource_DiskInfo{} } -func (*Resource_DiskInfo) ProtoMessage() {} - -func (m *Resource_DiskInfo) GetPersistence() *Resource_DiskInfo_Persistence { - if m != nil { - return m.Persistence - } - return nil -} - -func (m *Resource_DiskInfo) GetVolume() *Volume { - if m != nil { - return m.Volume - } - return nil -} - -// Describes a persistent disk volume. -// A persistent disk volume will not be automatically garbage -// collected if the task/executor/slave terminates, but is -// re-offered to the framework(s) belonging to the 'role'. -// A framework can set the ID (if it is not set yet) to express -// the intention to create a new persistent disk volume from a -// regular disk resource. To reuse a previously created volume, a -// framework can launch a task/executor when it receives an offer -// with a persistent volume, i.e., ID is set. -// NOTE: Currently, we do not allow a persistent disk volume -// without a reservation (i.e., 'role' should not be '*'). -type Resource_DiskInfo_Persistence struct { - // A unique ID for the persistent disk volume. - // NOTE: The ID needs to be unique per role on each slave. - Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Resource_DiskInfo_Persistence) Reset() { *m = Resource_DiskInfo_Persistence{} } -func (*Resource_DiskInfo_Persistence) ProtoMessage() {} - -func (m *Resource_DiskInfo_Persistence) GetId() string { - if m != nil && m.Id != nil { - return *m.Id - } - return "" -} - -type Resource_RevocableInfo struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *Resource_RevocableInfo) Reset() { *m = Resource_RevocableInfo{} } -func (*Resource_RevocableInfo) ProtoMessage() {} - -// * -// When the network bandwidth caps are enabled and the container -// is over its limit, outbound packets may be either delayed or -// dropped completely either because it exceeds the maximum bandwidth -// allocation for a single container (the cap) or because the combined -// network traffic of multiple containers on the host exceeds the -// transmit capacity of the host (the share). We can report the -// following statistics for each of these conditions exported directly -// from the Linux Traffic Control Queueing Discipline. -// -// id : name of the limiter, e.g. 'tx_bw_cap' -// backlog : number of packets currently delayed -// bytes : total bytes seen -// drops : number of packets dropped in total -// overlimits : number of packets which exceeded allocation -// packets : total packets seen -// qlen : number of packets currently queued -// rate_bps : throughput in bytes/sec -// rate_pps : throughput in packets/sec -// requeues : number of times a packet has been delayed due to -// locking or device contention issues -// -// More information on the operation of Linux Traffic Control can be -// found at http://www.lartc.org/lartc.html. -type TrafficControlStatistics struct { - Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` - Backlog *uint64 `protobuf:"varint,2,opt,name=backlog" json:"backlog,omitempty"` - Bytes *uint64 `protobuf:"varint,3,opt,name=bytes" json:"bytes,omitempty"` - Drops *uint64 `protobuf:"varint,4,opt,name=drops" json:"drops,omitempty"` - Overlimits *uint64 `protobuf:"varint,5,opt,name=overlimits" json:"overlimits,omitempty"` - Packets *uint64 `protobuf:"varint,6,opt,name=packets" json:"packets,omitempty"` - Qlen *uint64 `protobuf:"varint,7,opt,name=qlen" json:"qlen,omitempty"` - Ratebps *uint64 `protobuf:"varint,8,opt,name=ratebps" json:"ratebps,omitempty"` - Ratepps *uint64 `protobuf:"varint,9,opt,name=ratepps" json:"ratepps,omitempty"` - Requeues *uint64 `protobuf:"varint,10,opt,name=requeues" json:"requeues,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TrafficControlStatistics) Reset() { *m = TrafficControlStatistics{} } -func (*TrafficControlStatistics) ProtoMessage() {} - -func (m *TrafficControlStatistics) GetId() string { - if m != nil && m.Id != nil { - return *m.Id - } - return "" -} - -func (m *TrafficControlStatistics) GetBacklog() uint64 { - if m != nil && m.Backlog != nil { - return *m.Backlog - } - return 0 -} - -func (m *TrafficControlStatistics) GetBytes() uint64 { - if m != nil && m.Bytes != nil { - return *m.Bytes - } - return 0 -} - -func (m *TrafficControlStatistics) GetDrops() uint64 { - if m != nil && m.Drops != nil { - return *m.Drops - } - return 0 -} - -func (m *TrafficControlStatistics) GetOverlimits() uint64 { - if m != nil && m.Overlimits != nil { - return *m.Overlimits - } - return 0 -} - -func (m *TrafficControlStatistics) GetPackets() uint64 { - if m != nil && m.Packets != nil { - return *m.Packets - } - return 0 -} - -func (m *TrafficControlStatistics) GetQlen() uint64 { - if m != nil && m.Qlen != nil { - return *m.Qlen - } - return 0 -} - -func (m *TrafficControlStatistics) GetRatebps() uint64 { - if m != nil && m.Ratebps != nil { - return *m.Ratebps - } - return 0 -} - -func (m *TrafficControlStatistics) GetRatepps() uint64 { - if m != nil && m.Ratepps != nil { - return *m.Ratepps - } - return 0 -} - -func (m *TrafficControlStatistics) GetRequeues() uint64 { - if m != nil && m.Requeues != nil { - return *m.Requeues - } - return 0 -} - -// * -// A snapshot of resource usage statistics. -type ResourceStatistics struct { - Timestamp *float64 `protobuf:"fixed64,1,req,name=timestamp" json:"timestamp,omitempty"` - Processes *uint32 `protobuf:"varint,30,opt,name=processes" json:"processes,omitempty"` - Threads *uint32 `protobuf:"varint,31,opt,name=threads" json:"threads,omitempty"` - // CPU Usage Information: - // Total CPU time spent in user mode, and kernel mode. - CpusUserTimeSecs *float64 `protobuf:"fixed64,2,opt,name=cpus_user_time_secs" json:"cpus_user_time_secs,omitempty"` - CpusSystemTimeSecs *float64 `protobuf:"fixed64,3,opt,name=cpus_system_time_secs" json:"cpus_system_time_secs,omitempty"` - // Number of CPUs allocated. - CpusLimit *float64 `protobuf:"fixed64,4,opt,name=cpus_limit" json:"cpus_limit,omitempty"` - // cpu.stat on process throttling (for contention issues). - CpusNrPeriods *uint32 `protobuf:"varint,7,opt,name=cpus_nr_periods" json:"cpus_nr_periods,omitempty"` - CpusNrThrottled *uint32 `protobuf:"varint,8,opt,name=cpus_nr_throttled" json:"cpus_nr_throttled,omitempty"` - CpusThrottledTimeSecs *float64 `protobuf:"fixed64,9,opt,name=cpus_throttled_time_secs" json:"cpus_throttled_time_secs,omitempty"` - // mem_total_bytes was added in 0.23.0 to represent the total memory - // of a process in RAM (as opposed to in Swap). This was previously - // reported as mem_rss_bytes, which was also changed in 0.23.0 to - // represent only the anonymous memory usage, to keep in sync with - // Linux kernel's (arguably erroneous) use of terminology. - MemTotalBytes *uint64 `protobuf:"varint,36,opt,name=mem_total_bytes" json:"mem_total_bytes,omitempty"` - // Total memory + swap usage. This is set if swap is enabled. - MemTotalMemswBytes *uint64 `protobuf:"varint,37,opt,name=mem_total_memsw_bytes" json:"mem_total_memsw_bytes,omitempty"` - // Hard memory limit for a container. - MemLimitBytes *uint64 `protobuf:"varint,6,opt,name=mem_limit_bytes" json:"mem_limit_bytes,omitempty"` - // Soft memory limit for a container. - MemSoftLimitBytes *uint64 `protobuf:"varint,38,opt,name=mem_soft_limit_bytes" json:"mem_soft_limit_bytes,omitempty"` - // TODO(chzhcn) mem_file_bytes and mem_anon_bytes are deprecated in - // 0.23.0 and will be removed in 0.24.0. - MemFileBytes *uint64 `protobuf:"varint,10,opt,name=mem_file_bytes" json:"mem_file_bytes,omitempty"` - MemAnonBytes *uint64 `protobuf:"varint,11,opt,name=mem_anon_bytes" json:"mem_anon_bytes,omitempty"` - // mem_cache_bytes is added in 0.23.0 to represent page cache usage. - MemCacheBytes *uint64 `protobuf:"varint,39,opt,name=mem_cache_bytes" json:"mem_cache_bytes,omitempty"` - // Since 0.23.0, mem_rss_bytes is changed to represent only - // anonymous memory usage. Note that neither its requiredness, type, - // name nor numeric tag has been changed. - MemRssBytes *uint64 `protobuf:"varint,5,opt,name=mem_rss_bytes" json:"mem_rss_bytes,omitempty"` - MemMappedFileBytes *uint64 `protobuf:"varint,12,opt,name=mem_mapped_file_bytes" json:"mem_mapped_file_bytes,omitempty"` - // This is only set if swap is enabled. - MemSwapBytes *uint64 `protobuf:"varint,40,opt,name=mem_swap_bytes" json:"mem_swap_bytes,omitempty"` - MemUnevictableBytes *uint64 `protobuf:"varint,41,opt,name=mem_unevictable_bytes" json:"mem_unevictable_bytes,omitempty"` - // Number of occurrences of different levels of memory pressure - // events reported by memory cgroup. Pressure listening (re)starts - // with these values set to 0 when slave (re)starts. See - // https://www.kernel.org/doc/Documentation/cgroups/memory.txt for - // more details. - MemLowPressureCounter *uint64 `protobuf:"varint,32,opt,name=mem_low_pressure_counter" json:"mem_low_pressure_counter,omitempty"` - MemMediumPressureCounter *uint64 `protobuf:"varint,33,opt,name=mem_medium_pressure_counter" json:"mem_medium_pressure_counter,omitempty"` - MemCriticalPressureCounter *uint64 `protobuf:"varint,34,opt,name=mem_critical_pressure_counter" json:"mem_critical_pressure_counter,omitempty"` - // Disk Usage Information for executor working directory. - DiskLimitBytes *uint64 `protobuf:"varint,26,opt,name=disk_limit_bytes" json:"disk_limit_bytes,omitempty"` - DiskUsedBytes *uint64 `protobuf:"varint,27,opt,name=disk_used_bytes" json:"disk_used_bytes,omitempty"` - // Perf statistics. - Perf *PerfStatistics `protobuf:"bytes,13,opt,name=perf" json:"perf,omitempty"` - // Network Usage Information: - NetRxPackets *uint64 `protobuf:"varint,14,opt,name=net_rx_packets" json:"net_rx_packets,omitempty"` - NetRxBytes *uint64 `protobuf:"varint,15,opt,name=net_rx_bytes" json:"net_rx_bytes,omitempty"` - NetRxErrors *uint64 `protobuf:"varint,16,opt,name=net_rx_errors" json:"net_rx_errors,omitempty"` - NetRxDropped *uint64 `protobuf:"varint,17,opt,name=net_rx_dropped" json:"net_rx_dropped,omitempty"` - NetTxPackets *uint64 `protobuf:"varint,18,opt,name=net_tx_packets" json:"net_tx_packets,omitempty"` - NetTxBytes *uint64 `protobuf:"varint,19,opt,name=net_tx_bytes" json:"net_tx_bytes,omitempty"` - NetTxErrors *uint64 `protobuf:"varint,20,opt,name=net_tx_errors" json:"net_tx_errors,omitempty"` - NetTxDropped *uint64 `protobuf:"varint,21,opt,name=net_tx_dropped" json:"net_tx_dropped,omitempty"` - // The kernel keeps track of RTT (round-trip time) for its TCP - // sockets. RTT is a way to tell the latency of a container. - NetTcpRttMicrosecsP50 *float64 `protobuf:"fixed64,22,opt,name=net_tcp_rtt_microsecs_p50" json:"net_tcp_rtt_microsecs_p50,omitempty"` - NetTcpRttMicrosecsP90 *float64 `protobuf:"fixed64,23,opt,name=net_tcp_rtt_microsecs_p90" json:"net_tcp_rtt_microsecs_p90,omitempty"` - NetTcpRttMicrosecsP95 *float64 `protobuf:"fixed64,24,opt,name=net_tcp_rtt_microsecs_p95" json:"net_tcp_rtt_microsecs_p95,omitempty"` - NetTcpRttMicrosecsP99 *float64 `protobuf:"fixed64,25,opt,name=net_tcp_rtt_microsecs_p99" json:"net_tcp_rtt_microsecs_p99,omitempty"` - NetTcpActiveConnections *float64 `protobuf:"fixed64,28,opt,name=net_tcp_active_connections" json:"net_tcp_active_connections,omitempty"` - NetTcpTimeWaitConnections *float64 `protobuf:"fixed64,29,opt,name=net_tcp_time_wait_connections" json:"net_tcp_time_wait_connections,omitempty"` - // Network traffic flowing into or out of a container can be delayed - // or dropped due to congestion or policy inside and outside the - // container. - NetTrafficControlStatistics []*TrafficControlStatistics `protobuf:"bytes,35,rep,name=net_traffic_control_statistics" json:"net_traffic_control_statistics,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ResourceStatistics) Reset() { *m = ResourceStatistics{} } -func (*ResourceStatistics) ProtoMessage() {} - -func (m *ResourceStatistics) GetTimestamp() float64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *ResourceStatistics) GetProcesses() uint32 { - if m != nil && m.Processes != nil { - return *m.Processes - } - return 0 -} - -func (m *ResourceStatistics) GetThreads() uint32 { - if m != nil && m.Threads != nil { - return *m.Threads - } - return 0 -} - -func (m *ResourceStatistics) GetCpusUserTimeSecs() float64 { - if m != nil && m.CpusUserTimeSecs != nil { - return *m.CpusUserTimeSecs - } - return 0 -} - -func (m *ResourceStatistics) GetCpusSystemTimeSecs() float64 { - if m != nil && m.CpusSystemTimeSecs != nil { - return *m.CpusSystemTimeSecs - } - return 0 -} - -func (m *ResourceStatistics) GetCpusLimit() float64 { - if m != nil && m.CpusLimit != nil { - return *m.CpusLimit - } - return 0 -} - -func (m *ResourceStatistics) GetCpusNrPeriods() uint32 { - if m != nil && m.CpusNrPeriods != nil { - return *m.CpusNrPeriods - } - return 0 -} - -func (m *ResourceStatistics) GetCpusNrThrottled() uint32 { - if m != nil && m.CpusNrThrottled != nil { - return *m.CpusNrThrottled - } - return 0 -} - -func (m *ResourceStatistics) GetCpusThrottledTimeSecs() float64 { - if m != nil && m.CpusThrottledTimeSecs != nil { - return *m.CpusThrottledTimeSecs - } - return 0 -} - -func (m *ResourceStatistics) GetMemTotalBytes() uint64 { - if m != nil && m.MemTotalBytes != nil { - return *m.MemTotalBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemTotalMemswBytes() uint64 { - if m != nil && m.MemTotalMemswBytes != nil { - return *m.MemTotalMemswBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemLimitBytes() uint64 { - if m != nil && m.MemLimitBytes != nil { - return *m.MemLimitBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemSoftLimitBytes() uint64 { - if m != nil && m.MemSoftLimitBytes != nil { - return *m.MemSoftLimitBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemFileBytes() uint64 { - if m != nil && m.MemFileBytes != nil { - return *m.MemFileBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemAnonBytes() uint64 { - if m != nil && m.MemAnonBytes != nil { - return *m.MemAnonBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemCacheBytes() uint64 { - if m != nil && m.MemCacheBytes != nil { - return *m.MemCacheBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemRssBytes() uint64 { - if m != nil && m.MemRssBytes != nil { - return *m.MemRssBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemMappedFileBytes() uint64 { - if m != nil && m.MemMappedFileBytes != nil { - return *m.MemMappedFileBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemSwapBytes() uint64 { - if m != nil && m.MemSwapBytes != nil { - return *m.MemSwapBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemUnevictableBytes() uint64 { - if m != nil && m.MemUnevictableBytes != nil { - return *m.MemUnevictableBytes - } - return 0 -} - -func (m *ResourceStatistics) GetMemLowPressureCounter() uint64 { - if m != nil && m.MemLowPressureCounter != nil { - return *m.MemLowPressureCounter - } - return 0 -} - -func (m *ResourceStatistics) GetMemMediumPressureCounter() uint64 { - if m != nil && m.MemMediumPressureCounter != nil { - return *m.MemMediumPressureCounter - } - return 0 -} - -func (m *ResourceStatistics) GetMemCriticalPressureCounter() uint64 { - if m != nil && m.MemCriticalPressureCounter != nil { - return *m.MemCriticalPressureCounter - } - return 0 -} - -func (m *ResourceStatistics) GetDiskLimitBytes() uint64 { - if m != nil && m.DiskLimitBytes != nil { - return *m.DiskLimitBytes - } - return 0 -} - -func (m *ResourceStatistics) GetDiskUsedBytes() uint64 { - if m != nil && m.DiskUsedBytes != nil { - return *m.DiskUsedBytes - } - return 0 -} - -func (m *ResourceStatistics) GetPerf() *PerfStatistics { - if m != nil { - return m.Perf - } - return nil -} - -func (m *ResourceStatistics) GetNetRxPackets() uint64 { - if m != nil && m.NetRxPackets != nil { - return *m.NetRxPackets - } - return 0 -} - -func (m *ResourceStatistics) GetNetRxBytes() uint64 { - if m != nil && m.NetRxBytes != nil { - return *m.NetRxBytes - } - return 0 -} - -func (m *ResourceStatistics) GetNetRxErrors() uint64 { - if m != nil && m.NetRxErrors != nil { - return *m.NetRxErrors - } - return 0 -} - -func (m *ResourceStatistics) GetNetRxDropped() uint64 { - if m != nil && m.NetRxDropped != nil { - return *m.NetRxDropped - } - return 0 -} - -func (m *ResourceStatistics) GetNetTxPackets() uint64 { - if m != nil && m.NetTxPackets != nil { - return *m.NetTxPackets - } - return 0 -} - -func (m *ResourceStatistics) GetNetTxBytes() uint64 { - if m != nil && m.NetTxBytes != nil { - return *m.NetTxBytes - } - return 0 -} - -func (m *ResourceStatistics) GetNetTxErrors() uint64 { - if m != nil && m.NetTxErrors != nil { - return *m.NetTxErrors - } - return 0 -} - -func (m *ResourceStatistics) GetNetTxDropped() uint64 { - if m != nil && m.NetTxDropped != nil { - return *m.NetTxDropped - } - return 0 -} - -func (m *ResourceStatistics) GetNetTcpRttMicrosecsP50() float64 { - if m != nil && m.NetTcpRttMicrosecsP50 != nil { - return *m.NetTcpRttMicrosecsP50 - } - return 0 -} - -func (m *ResourceStatistics) GetNetTcpRttMicrosecsP90() float64 { - if m != nil && m.NetTcpRttMicrosecsP90 != nil { - return *m.NetTcpRttMicrosecsP90 - } - return 0 -} - -func (m *ResourceStatistics) GetNetTcpRttMicrosecsP95() float64 { - if m != nil && m.NetTcpRttMicrosecsP95 != nil { - return *m.NetTcpRttMicrosecsP95 - } - return 0 -} - -func (m *ResourceStatistics) GetNetTcpRttMicrosecsP99() float64 { - if m != nil && m.NetTcpRttMicrosecsP99 != nil { - return *m.NetTcpRttMicrosecsP99 - } - return 0 -} - -func (m *ResourceStatistics) GetNetTcpActiveConnections() float64 { - if m != nil && m.NetTcpActiveConnections != nil { - return *m.NetTcpActiveConnections - } - return 0 -} - -func (m *ResourceStatistics) GetNetTcpTimeWaitConnections() float64 { - if m != nil && m.NetTcpTimeWaitConnections != nil { - return *m.NetTcpTimeWaitConnections - } - return 0 -} - -func (m *ResourceStatistics) GetNetTrafficControlStatistics() []*TrafficControlStatistics { - if m != nil { - return m.NetTrafficControlStatistics - } - return nil -} - -// * -// Describes a snapshot of the resource usage for executors. -type ResourceUsage struct { - Executors []*ResourceUsage_Executor `protobuf:"bytes,1,rep,name=executors" json:"executors,omitempty"` - // Slave's total resources including checkpointed dynamic - // reservations and persistent volumes. - Total []*Resource `protobuf:"bytes,2,rep,name=total" json:"total,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ResourceUsage) Reset() { *m = ResourceUsage{} } -func (*ResourceUsage) ProtoMessage() {} - -func (m *ResourceUsage) GetExecutors() []*ResourceUsage_Executor { - if m != nil { - return m.Executors - } - return nil -} - -func (m *ResourceUsage) GetTotal() []*Resource { - if m != nil { - return m.Total - } - return nil -} - -type ResourceUsage_Executor struct { - ExecutorInfo *ExecutorInfo `protobuf:"bytes,1,req,name=executor_info" json:"executor_info,omitempty"` - // This includes resources used by the executor itself - // as well as its active tasks. - Allocated []*Resource `protobuf:"bytes,2,rep,name=allocated" json:"allocated,omitempty"` - // Current resource usage. If absent, the containerizer - // cannot provide resource usage. - Statistics *ResourceStatistics `protobuf:"bytes,3,opt,name=statistics" json:"statistics,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ResourceUsage_Executor) Reset() { *m = ResourceUsage_Executor{} } -func (*ResourceUsage_Executor) ProtoMessage() {} - -func (m *ResourceUsage_Executor) GetExecutorInfo() *ExecutorInfo { - if m != nil { - return m.ExecutorInfo - } - return nil -} - -func (m *ResourceUsage_Executor) GetAllocated() []*Resource { - if m != nil { - return m.Allocated - } - return nil -} - -func (m *ResourceUsage_Executor) GetStatistics() *ResourceStatistics { - if m != nil { - return m.Statistics - } - return nil -} - -// * -// Describes a sample of events from "perf stat". Only available on -// Linux. -// -// NOTE: Each optional field matches the name of a perf event (see -// "perf list") with the following changes: -// 1. Names are downcased. -// 2. Hyphens ('-') are replaced with underscores ('_'). -// 3. Events with alternate names use the name "perf stat" returns, -// e.g., for the event "cycles OR cpu-cycles" perf always returns -// cycles. -type PerfStatistics struct { - Timestamp *float64 `protobuf:"fixed64,1,req,name=timestamp" json:"timestamp,omitempty"` - Duration *float64 `protobuf:"fixed64,2,req,name=duration" json:"duration,omitempty"` - // Hardware event. - Cycles *uint64 `protobuf:"varint,3,opt,name=cycles" json:"cycles,omitempty"` - StalledCyclesFrontend *uint64 `protobuf:"varint,4,opt,name=stalled_cycles_frontend" json:"stalled_cycles_frontend,omitempty"` - StalledCyclesBackend *uint64 `protobuf:"varint,5,opt,name=stalled_cycles_backend" json:"stalled_cycles_backend,omitempty"` - Instructions *uint64 `protobuf:"varint,6,opt,name=instructions" json:"instructions,omitempty"` - CacheReferences *uint64 `protobuf:"varint,7,opt,name=cache_references" json:"cache_references,omitempty"` - CacheMisses *uint64 `protobuf:"varint,8,opt,name=cache_misses" json:"cache_misses,omitempty"` - Branches *uint64 `protobuf:"varint,9,opt,name=branches" json:"branches,omitempty"` - BranchMisses *uint64 `protobuf:"varint,10,opt,name=branch_misses" json:"branch_misses,omitempty"` - BusCycles *uint64 `protobuf:"varint,11,opt,name=bus_cycles" json:"bus_cycles,omitempty"` - RefCycles *uint64 `protobuf:"varint,12,opt,name=ref_cycles" json:"ref_cycles,omitempty"` - // Software event. - CpuClock *float64 `protobuf:"fixed64,13,opt,name=cpu_clock" json:"cpu_clock,omitempty"` - TaskClock *float64 `protobuf:"fixed64,14,opt,name=task_clock" json:"task_clock,omitempty"` - PageFaults *uint64 `protobuf:"varint,15,opt,name=page_faults" json:"page_faults,omitempty"` - MinorFaults *uint64 `protobuf:"varint,16,opt,name=minor_faults" json:"minor_faults,omitempty"` - MajorFaults *uint64 `protobuf:"varint,17,opt,name=major_faults" json:"major_faults,omitempty"` - ContextSwitches *uint64 `protobuf:"varint,18,opt,name=context_switches" json:"context_switches,omitempty"` - CpuMigrations *uint64 `protobuf:"varint,19,opt,name=cpu_migrations" json:"cpu_migrations,omitempty"` - AlignmentFaults *uint64 `protobuf:"varint,20,opt,name=alignment_faults" json:"alignment_faults,omitempty"` - EmulationFaults *uint64 `protobuf:"varint,21,opt,name=emulation_faults" json:"emulation_faults,omitempty"` - // Hardware cache event. - L1DcacheLoads *uint64 `protobuf:"varint,22,opt,name=l1_dcache_loads" json:"l1_dcache_loads,omitempty"` - L1DcacheLoadMisses *uint64 `protobuf:"varint,23,opt,name=l1_dcache_load_misses" json:"l1_dcache_load_misses,omitempty"` - L1DcacheStores *uint64 `protobuf:"varint,24,opt,name=l1_dcache_stores" json:"l1_dcache_stores,omitempty"` - L1DcacheStoreMisses *uint64 `protobuf:"varint,25,opt,name=l1_dcache_store_misses" json:"l1_dcache_store_misses,omitempty"` - L1DcachePrefetches *uint64 `protobuf:"varint,26,opt,name=l1_dcache_prefetches" json:"l1_dcache_prefetches,omitempty"` - L1DcachePrefetchMisses *uint64 `protobuf:"varint,27,opt,name=l1_dcache_prefetch_misses" json:"l1_dcache_prefetch_misses,omitempty"` - L1IcacheLoads *uint64 `protobuf:"varint,28,opt,name=l1_icache_loads" json:"l1_icache_loads,omitempty"` - L1IcacheLoadMisses *uint64 `protobuf:"varint,29,opt,name=l1_icache_load_misses" json:"l1_icache_load_misses,omitempty"` - L1IcachePrefetches *uint64 `protobuf:"varint,30,opt,name=l1_icache_prefetches" json:"l1_icache_prefetches,omitempty"` - L1IcachePrefetchMisses *uint64 `protobuf:"varint,31,opt,name=l1_icache_prefetch_misses" json:"l1_icache_prefetch_misses,omitempty"` - LlcLoads *uint64 `protobuf:"varint,32,opt,name=llc_loads" json:"llc_loads,omitempty"` - LlcLoadMisses *uint64 `protobuf:"varint,33,opt,name=llc_load_misses" json:"llc_load_misses,omitempty"` - LlcStores *uint64 `protobuf:"varint,34,opt,name=llc_stores" json:"llc_stores,omitempty"` - LlcStoreMisses *uint64 `protobuf:"varint,35,opt,name=llc_store_misses" json:"llc_store_misses,omitempty"` - LlcPrefetches *uint64 `protobuf:"varint,36,opt,name=llc_prefetches" json:"llc_prefetches,omitempty"` - LlcPrefetchMisses *uint64 `protobuf:"varint,37,opt,name=llc_prefetch_misses" json:"llc_prefetch_misses,omitempty"` - DtlbLoads *uint64 `protobuf:"varint,38,opt,name=dtlb_loads" json:"dtlb_loads,omitempty"` - DtlbLoadMisses *uint64 `protobuf:"varint,39,opt,name=dtlb_load_misses" json:"dtlb_load_misses,omitempty"` - DtlbStores *uint64 `protobuf:"varint,40,opt,name=dtlb_stores" json:"dtlb_stores,omitempty"` - DtlbStoreMisses *uint64 `protobuf:"varint,41,opt,name=dtlb_store_misses" json:"dtlb_store_misses,omitempty"` - DtlbPrefetches *uint64 `protobuf:"varint,42,opt,name=dtlb_prefetches" json:"dtlb_prefetches,omitempty"` - DtlbPrefetchMisses *uint64 `protobuf:"varint,43,opt,name=dtlb_prefetch_misses" json:"dtlb_prefetch_misses,omitempty"` - ItlbLoads *uint64 `protobuf:"varint,44,opt,name=itlb_loads" json:"itlb_loads,omitempty"` - ItlbLoadMisses *uint64 `protobuf:"varint,45,opt,name=itlb_load_misses" json:"itlb_load_misses,omitempty"` - BranchLoads *uint64 `protobuf:"varint,46,opt,name=branch_loads" json:"branch_loads,omitempty"` - BranchLoadMisses *uint64 `protobuf:"varint,47,opt,name=branch_load_misses" json:"branch_load_misses,omitempty"` - NodeLoads *uint64 `protobuf:"varint,48,opt,name=node_loads" json:"node_loads,omitempty"` - NodeLoadMisses *uint64 `protobuf:"varint,49,opt,name=node_load_misses" json:"node_load_misses,omitempty"` - NodeStores *uint64 `protobuf:"varint,50,opt,name=node_stores" json:"node_stores,omitempty"` - NodeStoreMisses *uint64 `protobuf:"varint,51,opt,name=node_store_misses" json:"node_store_misses,omitempty"` - NodePrefetches *uint64 `protobuf:"varint,52,opt,name=node_prefetches" json:"node_prefetches,omitempty"` - NodePrefetchMisses *uint64 `protobuf:"varint,53,opt,name=node_prefetch_misses" json:"node_prefetch_misses,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PerfStatistics) Reset() { *m = PerfStatistics{} } -func (*PerfStatistics) ProtoMessage() {} - -func (m *PerfStatistics) GetTimestamp() float64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *PerfStatistics) GetDuration() float64 { - if m != nil && m.Duration != nil { - return *m.Duration - } - return 0 -} - -func (m *PerfStatistics) GetCycles() uint64 { - if m != nil && m.Cycles != nil { - return *m.Cycles - } - return 0 -} - -func (m *PerfStatistics) GetStalledCyclesFrontend() uint64 { - if m != nil && m.StalledCyclesFrontend != nil { - return *m.StalledCyclesFrontend - } - return 0 -} - -func (m *PerfStatistics) GetStalledCyclesBackend() uint64 { - if m != nil && m.StalledCyclesBackend != nil { - return *m.StalledCyclesBackend - } - return 0 -} - -func (m *PerfStatistics) GetInstructions() uint64 { - if m != nil && m.Instructions != nil { - return *m.Instructions - } - return 0 -} - -func (m *PerfStatistics) GetCacheReferences() uint64 { - if m != nil && m.CacheReferences != nil { - return *m.CacheReferences - } - return 0 -} - -func (m *PerfStatistics) GetCacheMisses() uint64 { - if m != nil && m.CacheMisses != nil { - return *m.CacheMisses - } - return 0 -} - -func (m *PerfStatistics) GetBranches() uint64 { - if m != nil && m.Branches != nil { - return *m.Branches - } - return 0 -} - -func (m *PerfStatistics) GetBranchMisses() uint64 { - if m != nil && m.BranchMisses != nil { - return *m.BranchMisses - } - return 0 -} - -func (m *PerfStatistics) GetBusCycles() uint64 { - if m != nil && m.BusCycles != nil { - return *m.BusCycles - } - return 0 -} - -func (m *PerfStatistics) GetRefCycles() uint64 { - if m != nil && m.RefCycles != nil { - return *m.RefCycles - } - return 0 -} - -func (m *PerfStatistics) GetCpuClock() float64 { - if m != nil && m.CpuClock != nil { - return *m.CpuClock - } - return 0 -} - -func (m *PerfStatistics) GetTaskClock() float64 { - if m != nil && m.TaskClock != nil { - return *m.TaskClock - } - return 0 -} - -func (m *PerfStatistics) GetPageFaults() uint64 { - if m != nil && m.PageFaults != nil { - return *m.PageFaults - } - return 0 -} - -func (m *PerfStatistics) GetMinorFaults() uint64 { - if m != nil && m.MinorFaults != nil { - return *m.MinorFaults - } - return 0 -} - -func (m *PerfStatistics) GetMajorFaults() uint64 { - if m != nil && m.MajorFaults != nil { - return *m.MajorFaults - } - return 0 -} - -func (m *PerfStatistics) GetContextSwitches() uint64 { - if m != nil && m.ContextSwitches != nil { - return *m.ContextSwitches - } - return 0 -} - -func (m *PerfStatistics) GetCpuMigrations() uint64 { - if m != nil && m.CpuMigrations != nil { - return *m.CpuMigrations - } - return 0 -} - -func (m *PerfStatistics) GetAlignmentFaults() uint64 { - if m != nil && m.AlignmentFaults != nil { - return *m.AlignmentFaults - } - return 0 -} - -func (m *PerfStatistics) GetEmulationFaults() uint64 { - if m != nil && m.EmulationFaults != nil { - return *m.EmulationFaults - } - return 0 -} - -func (m *PerfStatistics) GetL1DcacheLoads() uint64 { - if m != nil && m.L1DcacheLoads != nil { - return *m.L1DcacheLoads - } - return 0 -} - -func (m *PerfStatistics) GetL1DcacheLoadMisses() uint64 { - if m != nil && m.L1DcacheLoadMisses != nil { - return *m.L1DcacheLoadMisses - } - return 0 -} - -func (m *PerfStatistics) GetL1DcacheStores() uint64 { - if m != nil && m.L1DcacheStores != nil { - return *m.L1DcacheStores - } - return 0 -} - -func (m *PerfStatistics) GetL1DcacheStoreMisses() uint64 { - if m != nil && m.L1DcacheStoreMisses != nil { - return *m.L1DcacheStoreMisses - } - return 0 -} - -func (m *PerfStatistics) GetL1DcachePrefetches() uint64 { - if m != nil && m.L1DcachePrefetches != nil { - return *m.L1DcachePrefetches - } - return 0 -} - -func (m *PerfStatistics) GetL1DcachePrefetchMisses() uint64 { - if m != nil && m.L1DcachePrefetchMisses != nil { - return *m.L1DcachePrefetchMisses - } - return 0 -} - -func (m *PerfStatistics) GetL1IcacheLoads() uint64 { - if m != nil && m.L1IcacheLoads != nil { - return *m.L1IcacheLoads - } - return 0 -} - -func (m *PerfStatistics) GetL1IcacheLoadMisses() uint64 { - if m != nil && m.L1IcacheLoadMisses != nil { - return *m.L1IcacheLoadMisses - } - return 0 -} - -func (m *PerfStatistics) GetL1IcachePrefetches() uint64 { - if m != nil && m.L1IcachePrefetches != nil { - return *m.L1IcachePrefetches - } - return 0 -} - -func (m *PerfStatistics) GetL1IcachePrefetchMisses() uint64 { - if m != nil && m.L1IcachePrefetchMisses != nil { - return *m.L1IcachePrefetchMisses - } - return 0 -} - -func (m *PerfStatistics) GetLlcLoads() uint64 { - if m != nil && m.LlcLoads != nil { - return *m.LlcLoads - } - return 0 -} - -func (m *PerfStatistics) GetLlcLoadMisses() uint64 { - if m != nil && m.LlcLoadMisses != nil { - return *m.LlcLoadMisses - } - return 0 -} - -func (m *PerfStatistics) GetLlcStores() uint64 { - if m != nil && m.LlcStores != nil { - return *m.LlcStores - } - return 0 -} - -func (m *PerfStatistics) GetLlcStoreMisses() uint64 { - if m != nil && m.LlcStoreMisses != nil { - return *m.LlcStoreMisses - } - return 0 -} - -func (m *PerfStatistics) GetLlcPrefetches() uint64 { - if m != nil && m.LlcPrefetches != nil { - return *m.LlcPrefetches - } - return 0 -} - -func (m *PerfStatistics) GetLlcPrefetchMisses() uint64 { - if m != nil && m.LlcPrefetchMisses != nil { - return *m.LlcPrefetchMisses - } - return 0 -} - -func (m *PerfStatistics) GetDtlbLoads() uint64 { - if m != nil && m.DtlbLoads != nil { - return *m.DtlbLoads - } - return 0 -} - -func (m *PerfStatistics) GetDtlbLoadMisses() uint64 { - if m != nil && m.DtlbLoadMisses != nil { - return *m.DtlbLoadMisses - } - return 0 -} - -func (m *PerfStatistics) GetDtlbStores() uint64 { - if m != nil && m.DtlbStores != nil { - return *m.DtlbStores - } - return 0 -} - -func (m *PerfStatistics) GetDtlbStoreMisses() uint64 { - if m != nil && m.DtlbStoreMisses != nil { - return *m.DtlbStoreMisses - } - return 0 -} - -func (m *PerfStatistics) GetDtlbPrefetches() uint64 { - if m != nil && m.DtlbPrefetches != nil { - return *m.DtlbPrefetches - } - return 0 -} - -func (m *PerfStatistics) GetDtlbPrefetchMisses() uint64 { - if m != nil && m.DtlbPrefetchMisses != nil { - return *m.DtlbPrefetchMisses - } - return 0 -} - -func (m *PerfStatistics) GetItlbLoads() uint64 { - if m != nil && m.ItlbLoads != nil { - return *m.ItlbLoads - } - return 0 -} - -func (m *PerfStatistics) GetItlbLoadMisses() uint64 { - if m != nil && m.ItlbLoadMisses != nil { - return *m.ItlbLoadMisses - } - return 0 -} - -func (m *PerfStatistics) GetBranchLoads() uint64 { - if m != nil && m.BranchLoads != nil { - return *m.BranchLoads - } - return 0 -} - -func (m *PerfStatistics) GetBranchLoadMisses() uint64 { - if m != nil && m.BranchLoadMisses != nil { - return *m.BranchLoadMisses - } - return 0 -} - -func (m *PerfStatistics) GetNodeLoads() uint64 { - if m != nil && m.NodeLoads != nil { - return *m.NodeLoads - } - return 0 -} - -func (m *PerfStatistics) GetNodeLoadMisses() uint64 { - if m != nil && m.NodeLoadMisses != nil { - return *m.NodeLoadMisses - } - return 0 -} - -func (m *PerfStatistics) GetNodeStores() uint64 { - if m != nil && m.NodeStores != nil { - return *m.NodeStores - } - return 0 -} - -func (m *PerfStatistics) GetNodeStoreMisses() uint64 { - if m != nil && m.NodeStoreMisses != nil { - return *m.NodeStoreMisses - } - return 0 -} - -func (m *PerfStatistics) GetNodePrefetches() uint64 { - if m != nil && m.NodePrefetches != nil { - return *m.NodePrefetches - } - return 0 -} - -func (m *PerfStatistics) GetNodePrefetchMisses() uint64 { - if m != nil && m.NodePrefetchMisses != nil { - return *m.NodePrefetchMisses - } - return 0 -} - -// * -// Describes a request for resources that can be used by a framework -// to proactively influence the allocator. If 'slave_id' is provided -// then this request is assumed to only apply to resources on that -// slave. -type Request struct { - SlaveId *SlaveID `protobuf:"bytes,1,opt,name=slave_id" json:"slave_id,omitempty"` - Resources []*Resource `protobuf:"bytes,2,rep,name=resources" json:"resources,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (*Request) ProtoMessage() {} - -func (m *Request) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *Request) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -// * -// Describes some resources available on a slave. An offer only -// contains resources from a single slave. -type Offer struct { - Id *OfferID `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,req,name=framework_id" json:"framework_id,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,3,req,name=slave_id" json:"slave_id,omitempty"` - Hostname *string `protobuf:"bytes,4,req,name=hostname" json:"hostname,omitempty"` - // URL for reaching the slave running on the host. - Url *URL `protobuf:"bytes,8,opt,name=url" json:"url,omitempty"` - Resources []*Resource `protobuf:"bytes,5,rep,name=resources" json:"resources,omitempty"` - Attributes []*Attribute `protobuf:"bytes,7,rep,name=attributes" json:"attributes,omitempty"` - ExecutorIds []*ExecutorID `protobuf:"bytes,6,rep,name=executor_ids" json:"executor_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Offer) Reset() { *m = Offer{} } -func (*Offer) ProtoMessage() {} - -func (m *Offer) GetId() *OfferID { - if m != nil { - return m.Id - } - return nil -} - -func (m *Offer) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *Offer) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *Offer) GetHostname() string { - if m != nil && m.Hostname != nil { - return *m.Hostname - } - return "" -} - -func (m *Offer) GetUrl() *URL { - if m != nil { - return m.Url - } - return nil -} - -func (m *Offer) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -func (m *Offer) GetAttributes() []*Attribute { - if m != nil { - return m.Attributes - } - return nil -} - -func (m *Offer) GetExecutorIds() []*ExecutorID { - if m != nil { - return m.ExecutorIds - } - return nil -} - -// Defines an operation that can be performed against offers. -type Offer_Operation struct { - Type *Offer_Operation_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Offer_Operation_Type" json:"type,omitempty"` - Launch *Offer_Operation_Launch `protobuf:"bytes,2,opt,name=launch" json:"launch,omitempty"` - Reserve *Offer_Operation_Reserve `protobuf:"bytes,3,opt,name=reserve" json:"reserve,omitempty"` - Unreserve *Offer_Operation_Unreserve `protobuf:"bytes,4,opt,name=unreserve" json:"unreserve,omitempty"` - Create *Offer_Operation_Create `protobuf:"bytes,5,opt,name=create" json:"create,omitempty"` - Destroy *Offer_Operation_Destroy `protobuf:"bytes,6,opt,name=destroy" json:"destroy,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Offer_Operation) Reset() { *m = Offer_Operation{} } -func (*Offer_Operation) ProtoMessage() {} - -func (m *Offer_Operation) GetType() Offer_Operation_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Offer_Operation_LAUNCH -} - -func (m *Offer_Operation) GetLaunch() *Offer_Operation_Launch { - if m != nil { - return m.Launch - } - return nil -} - -func (m *Offer_Operation) GetReserve() *Offer_Operation_Reserve { - if m != nil { - return m.Reserve - } - return nil -} - -func (m *Offer_Operation) GetUnreserve() *Offer_Operation_Unreserve { - if m != nil { - return m.Unreserve - } - return nil -} - -func (m *Offer_Operation) GetCreate() *Offer_Operation_Create { - if m != nil { - return m.Create - } - return nil -} - -func (m *Offer_Operation) GetDestroy() *Offer_Operation_Destroy { - if m != nil { - return m.Destroy - } - return nil -} - -type Offer_Operation_Launch struct { - TaskInfos []*TaskInfo `protobuf:"bytes,1,rep,name=task_infos" json:"task_infos,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Offer_Operation_Launch) Reset() { *m = Offer_Operation_Launch{} } -func (*Offer_Operation_Launch) ProtoMessage() {} - -func (m *Offer_Operation_Launch) GetTaskInfos() []*TaskInfo { - if m != nil { - return m.TaskInfos - } - return nil -} - -type Offer_Operation_Reserve struct { - Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Offer_Operation_Reserve) Reset() { *m = Offer_Operation_Reserve{} } -func (*Offer_Operation_Reserve) ProtoMessage() {} - -func (m *Offer_Operation_Reserve) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -type Offer_Operation_Unreserve struct { - Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Offer_Operation_Unreserve) Reset() { *m = Offer_Operation_Unreserve{} } -func (*Offer_Operation_Unreserve) ProtoMessage() {} - -func (m *Offer_Operation_Unreserve) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -type Offer_Operation_Create struct { - Volumes []*Resource `protobuf:"bytes,1,rep,name=volumes" json:"volumes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Offer_Operation_Create) Reset() { *m = Offer_Operation_Create{} } -func (*Offer_Operation_Create) ProtoMessage() {} - -func (m *Offer_Operation_Create) GetVolumes() []*Resource { - if m != nil { - return m.Volumes - } - return nil -} - -type Offer_Operation_Destroy struct { - Volumes []*Resource `protobuf:"bytes,1,rep,name=volumes" json:"volumes,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Offer_Operation_Destroy) Reset() { *m = Offer_Operation_Destroy{} } -func (*Offer_Operation_Destroy) ProtoMessage() {} - -func (m *Offer_Operation_Destroy) GetVolumes() []*Resource { - if m != nil { - return m.Volumes - } - return nil -} - -// * -// Describes a task. Passed from the scheduler all the way to an -// executor (see SchedulerDriver::launchTasks and -// Executor::launchTask). Either ExecutorInfo or CommandInfo should be set. -// A different executor can be used to launch this task, and subsequent tasks -// meant for the same executor can reuse the same ExecutorInfo struct. -type TaskInfo struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - TaskId *TaskID `protobuf:"bytes,2,req,name=task_id" json:"task_id,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,3,req,name=slave_id" json:"slave_id,omitempty"` - Resources []*Resource `protobuf:"bytes,4,rep,name=resources" json:"resources,omitempty"` - Executor *ExecutorInfo `protobuf:"bytes,5,opt,name=executor" json:"executor,omitempty"` - Command *CommandInfo `protobuf:"bytes,7,opt,name=command" json:"command,omitempty"` - // Task provided with a container will launch the container as part - // of this task paired with the task's CommandInfo. - Container *ContainerInfo `protobuf:"bytes,9,opt,name=container" json:"container,omitempty"` - Data []byte `protobuf:"bytes,6,opt,name=data" json:"data,omitempty"` - // A health check for the task (currently in *alpha* and initial - // support will only be for TaskInfo's that have a CommandInfo). - HealthCheck *HealthCheck `protobuf:"bytes,8,opt,name=health_check" json:"health_check,omitempty"` - // Labels are free-form key value pairs which are exposed through - // master and slave endpoints. Labels will not be interpreted or - // acted upon by Mesos itself. As opposed to the data field, labels - // will be kept in memory on master and slave processes. Therefore, - // labels should be used to tag tasks with light-weight meta-data. - Labels *Labels `protobuf:"bytes,10,opt,name=labels" json:"labels,omitempty"` - // Service discovery information for the task. It is not interpreted - // or acted upon by Mesos. It is up to a service discovery system - // to use this information as needed and to handle tasks without - // service discovery information. - Discovery *DiscoveryInfo `protobuf:"bytes,11,opt,name=discovery" json:"discovery,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskInfo) Reset() { *m = TaskInfo{} } -func (*TaskInfo) ProtoMessage() {} - -func (m *TaskInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *TaskInfo) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *TaskInfo) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *TaskInfo) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -func (m *TaskInfo) GetExecutor() *ExecutorInfo { - if m != nil { - return m.Executor - } - return nil -} - -func (m *TaskInfo) GetCommand() *CommandInfo { - if m != nil { - return m.Command - } - return nil -} - -func (m *TaskInfo) GetContainer() *ContainerInfo { - if m != nil { - return m.Container - } - return nil -} - -func (m *TaskInfo) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *TaskInfo) GetHealthCheck() *HealthCheck { - if m != nil { - return m.HealthCheck - } - return nil -} - -func (m *TaskInfo) GetLabels() *Labels { - if m != nil { - return m.Labels - } - return nil -} - -func (m *TaskInfo) GetDiscovery() *DiscoveryInfo { - if m != nil { - return m.Discovery - } - return nil -} - -// * -// Describes the current status of a task. -type TaskStatus struct { - TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` - State *TaskState `protobuf:"varint,2,req,name=state,enum=mesosproto.TaskState" json:"state,omitempty"` - Message *string `protobuf:"bytes,4,opt,name=message" json:"message,omitempty"` - Source *TaskStatus_Source `protobuf:"varint,9,opt,name=source,enum=mesosproto.TaskStatus_Source" json:"source,omitempty"` - Reason *TaskStatus_Reason `protobuf:"varint,10,opt,name=reason,enum=mesosproto.TaskStatus_Reason" json:"reason,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,5,opt,name=slave_id" json:"slave_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,7,opt,name=executor_id" json:"executor_id,omitempty"` - Timestamp *float64 `protobuf:"fixed64,6,opt,name=timestamp" json:"timestamp,omitempty"` - // Statuses that are delivered reliably to the scheduler will - // include a 'uuid'. The status is considered delivered once - // it is acknowledged by the scheduler. Schedulers can choose - // to either explicitly acknowledge statuses or let the scheduler - // driver implicitly acknowledge (default). - // - // TODO(bmahler): This is currently overwritten in the scheduler - // driver and executor driver, but executors will need to set this - // to a valid RFC-4122 UUID if using the HTTP API. - Uuid []byte `protobuf:"bytes,11,opt,name=uuid" json:"uuid,omitempty"` - // Describes whether the task has been determined to be healthy - // (true) or unhealthy (false) according to the HealthCheck field in - // the command info. - Healthy *bool `protobuf:"varint,8,opt,name=healthy" json:"healthy,omitempty"` - // Labels are free-form key value pairs which are exposed through - // master and slave endpoints. Labels will not be interpreted or - // acted upon by Mesos itself. As opposed to the data field, labels - // will be kept in memory on master and slave processes. Therefore, - // labels should be used to tag TaskStatus message with light-weight - // meta-data. - Labels *Labels `protobuf:"bytes,12,opt,name=labels" json:"labels,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskStatus) Reset() { *m = TaskStatus{} } -func (*TaskStatus) ProtoMessage() {} - -func (m *TaskStatus) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *TaskStatus) GetState() TaskState { - if m != nil && m.State != nil { - return *m.State - } - return TaskState_TASK_STAGING -} - -func (m *TaskStatus) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -func (m *TaskStatus) GetSource() TaskStatus_Source { - if m != nil && m.Source != nil { - return *m.Source - } - return TaskStatus_SOURCE_MASTER -} - -func (m *TaskStatus) GetReason() TaskStatus_Reason { - if m != nil && m.Reason != nil { - return *m.Reason - } - return TaskStatus_REASON_COMMAND_EXECUTOR_FAILED -} - -func (m *TaskStatus) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *TaskStatus) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *TaskStatus) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *TaskStatus) GetTimestamp() float64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *TaskStatus) GetUuid() []byte { - if m != nil { - return m.Uuid - } - return nil -} - -func (m *TaskStatus) GetHealthy() bool { - if m != nil && m.Healthy != nil { - return *m.Healthy - } - return false -} - -func (m *TaskStatus) GetLabels() *Labels { - if m != nil { - return m.Labels - } - return nil -} - -// * -// Describes possible filters that can be applied to unused resources -// (see SchedulerDriver::launchTasks) to influence the allocator. -type Filters struct { - // Time to consider unused resources refused. Note that all unused - // resources will be considered refused and use the default value - // (below) regardless of whether Filters was passed to - // SchedulerDriver::launchTasks. You MUST pass Filters with this - // field set to change this behavior (i.e., get another offer which - // includes unused resources sooner or later than the default). - RefuseSeconds *float64 `protobuf:"fixed64,1,opt,name=refuse_seconds,def=5" json:"refuse_seconds,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Filters) Reset() { *m = Filters{} } -func (*Filters) ProtoMessage() {} - -const Default_Filters_RefuseSeconds float64 = 5 - -func (m *Filters) GetRefuseSeconds() float64 { - if m != nil && m.RefuseSeconds != nil { - return *m.RefuseSeconds - } - return Default_Filters_RefuseSeconds -} - -// * -// Describes a collection of environment variables. This is used with -// CommandInfo in order to set environment variables before running a -// command. -type Environment struct { - Variables []*Environment_Variable `protobuf:"bytes,1,rep,name=variables" json:"variables,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Environment) Reset() { *m = Environment{} } -func (*Environment) ProtoMessage() {} - -func (m *Environment) GetVariables() []*Environment_Variable { - if m != nil { - return m.Variables - } - return nil -} - -type Environment_Variable struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Environment_Variable) Reset() { *m = Environment_Variable{} } -func (*Environment_Variable) ProtoMessage() {} - -func (m *Environment_Variable) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Environment_Variable) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// A generic (key, value) pair used in various places for parameters. -type Parameter struct { - Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` - Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Parameter) Reset() { *m = Parameter{} } -func (*Parameter) ProtoMessage() {} - -func (m *Parameter) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *Parameter) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// Collection of Parameter. -type Parameters struct { - Parameter []*Parameter `protobuf:"bytes,1,rep,name=parameter" json:"parameter,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Parameters) Reset() { *m = Parameters{} } -func (*Parameters) ProtoMessage() {} - -func (m *Parameters) GetParameter() []*Parameter { - if m != nil { - return m.Parameter - } - return nil -} - -// * -// Credential used in various places for authentication and -// authorization. -// -// NOTE: A 'principal' is different from 'FrameworkInfo.user'. The -// former is used for authentication and authorization while the -// latter is used to determine the default user under which the -// framework's executors/tasks are run. -type Credential struct { - Principal *string `protobuf:"bytes,1,req,name=principal" json:"principal,omitempty"` - Secret []byte `protobuf:"bytes,2,opt,name=secret" json:"secret,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Credential) Reset() { *m = Credential{} } -func (*Credential) ProtoMessage() {} - -func (m *Credential) GetPrincipal() string { - if m != nil && m.Principal != nil { - return *m.Principal - } - return "" -} - -func (m *Credential) GetSecret() []byte { - if m != nil { - return m.Secret - } - return nil -} - -// * -// Credentials used for framework authentication, HTTP authentication -// (where the common 'username' and 'password' are captured as -// 'principal' and 'secret' respectively), etc. -type Credentials struct { - Credentials []*Credential `protobuf:"bytes,1,rep,name=credentials" json:"credentials,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Credentials) Reset() { *m = Credentials{} } -func (*Credentials) ProtoMessage() {} - -func (m *Credentials) GetCredentials() []*Credential { - if m != nil { - return m.Credentials - } - return nil -} - -// * -// Rate (queries per second, QPS) limit for messages from a framework to master. -// Strictly speaking they are the combined rate from all frameworks of the same -// principal. -type RateLimit struct { - // Leaving QPS unset gives it unlimited rate (i.e., not throttled), - // which also implies unlimited capacity. - Qps *float64 `protobuf:"fixed64,1,opt,name=qps" json:"qps,omitempty"` - // Principal of framework(s) to be throttled. Should match - // FrameworkInfo.princpal and Credential.principal (if using authentication). - Principal *string `protobuf:"bytes,2,req,name=principal" json:"principal,omitempty"` - // Max number of outstanding messages from frameworks of this principal - // allowed by master before the next message is dropped and an error is sent - // back to the sender. Messages received before the capacity is reached are - // still going to be processed after the error is sent. - // If unspecified, this principal is assigned unlimited capacity. - // NOTE: This value is ignored if 'qps' is not set. - Capacity *uint64 `protobuf:"varint,3,opt,name=capacity" json:"capacity,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RateLimit) Reset() { *m = RateLimit{} } -func (*RateLimit) ProtoMessage() {} - -func (m *RateLimit) GetQps() float64 { - if m != nil && m.Qps != nil { - return *m.Qps - } - return 0 -} - -func (m *RateLimit) GetPrincipal() string { - if m != nil && m.Principal != nil { - return *m.Principal - } - return "" -} - -func (m *RateLimit) GetCapacity() uint64 { - if m != nil && m.Capacity != nil { - return *m.Capacity - } - return 0 -} - -// * -// Collection of RateLimit. -// Frameworks without rate limits defined here are not throttled unless -// 'aggregate_default_qps' is specified. -type RateLimits struct { - // Items should have unique principals. - Limits []*RateLimit `protobuf:"bytes,1,rep,name=limits" json:"limits,omitempty"` - // All the frameworks not specified in 'limits' get this default rate. - // This rate is an aggregate rate for all of them, i.e., their combined - // traffic is throttled together at this rate. - AggregateDefaultQps *float64 `protobuf:"fixed64,2,opt,name=aggregate_default_qps" json:"aggregate_default_qps,omitempty"` - // All the frameworks not specified in 'limits' get this default capacity. - // This is an aggregate value similar to 'aggregate_default_qps'. - AggregateDefaultCapacity *uint64 `protobuf:"varint,3,opt,name=aggregate_default_capacity" json:"aggregate_default_capacity,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RateLimits) Reset() { *m = RateLimits{} } -func (*RateLimits) ProtoMessage() {} - -func (m *RateLimits) GetLimits() []*RateLimit { - if m != nil { - return m.Limits - } - return nil -} - -func (m *RateLimits) GetAggregateDefaultQps() float64 { - if m != nil && m.AggregateDefaultQps != nil { - return *m.AggregateDefaultQps - } - return 0 -} - -func (m *RateLimits) GetAggregateDefaultCapacity() uint64 { - if m != nil && m.AggregateDefaultCapacity != nil { - return *m.AggregateDefaultCapacity - } - return 0 -} - -// * -// Describe an image used by tasks or executors. Note that it's only -// for tasks or executors launched by MesosContainerizer currently. -// TODO(jieyu): This feature not fully supported in 0.24.0. Please do -// not use it until this feature is announced. -type Image struct { - Type *Image_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Image_Type" json:"type,omitempty"` - // Only one of the following image messages should be set to match - // the type. - Appc *Image_AppC `protobuf:"bytes,2,opt,name=appc" json:"appc,omitempty"` - Docker *Image_Docker `protobuf:"bytes,3,opt,name=docker" json:"docker,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Image) Reset() { *m = Image{} } -func (*Image) ProtoMessage() {} - -func (m *Image) GetType() Image_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Image_APPC -} - -func (m *Image) GetAppc() *Image_AppC { - if m != nil { - return m.Appc - } - return nil -} - -func (m *Image) GetDocker() *Image_Docker { - if m != nil { - return m.Docker - } - return nil -} - -// Protobuf for specifying an Appc container image. See: -// https://github.com/appc/spec/blob/master/spec/aci.md -type Image_AppC struct { - // The name of the image. - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - // An image ID is a string of the format "hash-value", where - // "hash" is the hash algorithm used and "value" is the hex - // encoded string of the digest. Currently the only permitted - // hash algorithm is sha512. - Id *string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` - // Optional labels. Suggested labels: "version", "os", and "arch". - Labels *Labels `protobuf:"bytes,3,opt,name=labels" json:"labels,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Image_AppC) Reset() { *m = Image_AppC{} } -func (*Image_AppC) ProtoMessage() {} - -func (m *Image_AppC) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Image_AppC) GetId() string { - if m != nil && m.Id != nil { - return *m.Id - } - return "" -} - -func (m *Image_AppC) GetLabels() *Labels { - if m != nil { - return m.Labels - } - return nil -} - -type Image_Docker struct { - // The name of the image. Expected in format repository[:tag]. - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Image_Docker) Reset() { *m = Image_Docker{} } -func (*Image_Docker) ProtoMessage() {} - -func (m *Image_Docker) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -// * -// Describes a volume mapping either from host to container or vice -// versa. Both paths can either refer to a directory or a file. -type Volume struct { - Mode *Volume_Mode `protobuf:"varint,3,req,name=mode,enum=mesosproto.Volume_Mode" json:"mode,omitempty"` - // Path pointing to a directory or file in the container. If the - // path is a relative path, it is relative to the container work - // directory. If the path is an absolute path, that path must - // already exist. - ContainerPath *string `protobuf:"bytes,1,req,name=container_path" json:"container_path,omitempty"` - // Absolute path pointing to a directory or file on the host or a - // path relative to the container work directory. - HostPath *string `protobuf:"bytes,2,opt,name=host_path" json:"host_path,omitempty"` - // The source of the volume is an Image which describes a root - // filesystem which will be provisioned by Mesos. - Image *Image `protobuf:"bytes,4,opt,name=image" json:"image,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Volume) Reset() { *m = Volume{} } -func (*Volume) ProtoMessage() {} - -func (m *Volume) GetMode() Volume_Mode { - if m != nil && m.Mode != nil { - return *m.Mode - } - return Volume_RW -} - -func (m *Volume) GetContainerPath() string { - if m != nil && m.ContainerPath != nil { - return *m.ContainerPath - } - return "" -} - -func (m *Volume) GetHostPath() string { - if m != nil && m.HostPath != nil { - return *m.HostPath - } - return "" -} - -func (m *Volume) GetImage() *Image { - if m != nil { - return m.Image - } - return nil -} - -// * -// Describes a container configuration and allows extensible -// configurations for different container implementations. -type ContainerInfo struct { - Type *ContainerInfo_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.ContainerInfo_Type" json:"type,omitempty"` - Volumes []*Volume `protobuf:"bytes,2,rep,name=volumes" json:"volumes,omitempty"` - Hostname *string `protobuf:"bytes,4,opt,name=hostname" json:"hostname,omitempty"` - // Only one of the following *Info messages should be set to match - // the type. - Docker *ContainerInfo_DockerInfo `protobuf:"bytes,3,opt,name=docker" json:"docker,omitempty"` - Mesos *ContainerInfo_MesosInfo `protobuf:"bytes,5,opt,name=mesos" json:"mesos,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ContainerInfo) Reset() { *m = ContainerInfo{} } -func (*ContainerInfo) ProtoMessage() {} - -func (m *ContainerInfo) GetType() ContainerInfo_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return ContainerInfo_DOCKER -} - -func (m *ContainerInfo) GetVolumes() []*Volume { - if m != nil { - return m.Volumes - } - return nil -} - -func (m *ContainerInfo) GetHostname() string { - if m != nil && m.Hostname != nil { - return *m.Hostname - } - return "" -} - -func (m *ContainerInfo) GetDocker() *ContainerInfo_DockerInfo { - if m != nil { - return m.Docker - } - return nil -} - -func (m *ContainerInfo) GetMesos() *ContainerInfo_MesosInfo { - if m != nil { - return m.Mesos - } - return nil -} - -type ContainerInfo_DockerInfo struct { - // The docker image that is going to be passed to the registry. - Image *string `protobuf:"bytes,1,req,name=image" json:"image,omitempty"` - Network *ContainerInfo_DockerInfo_Network `protobuf:"varint,2,opt,name=network,enum=mesosproto.ContainerInfo_DockerInfo_Network,def=1" json:"network,omitempty"` - PortMappings []*ContainerInfo_DockerInfo_PortMapping `protobuf:"bytes,3,rep,name=port_mappings" json:"port_mappings,omitempty"` - Privileged *bool `protobuf:"varint,4,opt,name=privileged,def=0" json:"privileged,omitempty"` - // Allowing arbitrary parameters to be passed to docker CLI. - // Note that anything passed to this field is not guaranteed - // to be supported moving forward, as we might move away from - // the docker CLI. - Parameters []*Parameter `protobuf:"bytes,5,rep,name=parameters" json:"parameters,omitempty"` - // With this flag set to true, the docker containerizer will - // pull the docker image from the registry even if the image - // is already downloaded on the slave. - ForcePullImage *bool `protobuf:"varint,6,opt,name=force_pull_image" json:"force_pull_image,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ContainerInfo_DockerInfo) Reset() { *m = ContainerInfo_DockerInfo{} } -func (*ContainerInfo_DockerInfo) ProtoMessage() {} - -const Default_ContainerInfo_DockerInfo_Network ContainerInfo_DockerInfo_Network = ContainerInfo_DockerInfo_HOST -const Default_ContainerInfo_DockerInfo_Privileged bool = false - -func (m *ContainerInfo_DockerInfo) GetImage() string { - if m != nil && m.Image != nil { - return *m.Image - } - return "" -} - -func (m *ContainerInfo_DockerInfo) GetNetwork() ContainerInfo_DockerInfo_Network { - if m != nil && m.Network != nil { - return *m.Network - } - return Default_ContainerInfo_DockerInfo_Network -} - -func (m *ContainerInfo_DockerInfo) GetPortMappings() []*ContainerInfo_DockerInfo_PortMapping { - if m != nil { - return m.PortMappings - } - return nil -} - -func (m *ContainerInfo_DockerInfo) GetPrivileged() bool { - if m != nil && m.Privileged != nil { - return *m.Privileged - } - return Default_ContainerInfo_DockerInfo_Privileged -} - -func (m *ContainerInfo_DockerInfo) GetParameters() []*Parameter { - if m != nil { - return m.Parameters - } - return nil -} - -func (m *ContainerInfo_DockerInfo) GetForcePullImage() bool { - if m != nil && m.ForcePullImage != nil { - return *m.ForcePullImage - } - return false -} - -type ContainerInfo_DockerInfo_PortMapping struct { - HostPort *uint32 `protobuf:"varint,1,req,name=host_port" json:"host_port,omitempty"` - ContainerPort *uint32 `protobuf:"varint,2,req,name=container_port" json:"container_port,omitempty"` - // Protocol to expose as (ie: tcp, udp). - Protocol *string `protobuf:"bytes,3,opt,name=protocol" json:"protocol,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ContainerInfo_DockerInfo_PortMapping) Reset() { *m = ContainerInfo_DockerInfo_PortMapping{} } -func (*ContainerInfo_DockerInfo_PortMapping) ProtoMessage() {} - -func (m *ContainerInfo_DockerInfo_PortMapping) GetHostPort() uint32 { - if m != nil && m.HostPort != nil { - return *m.HostPort - } - return 0 -} - -func (m *ContainerInfo_DockerInfo_PortMapping) GetContainerPort() uint32 { - if m != nil && m.ContainerPort != nil { - return *m.ContainerPort - } - return 0 -} - -func (m *ContainerInfo_DockerInfo_PortMapping) GetProtocol() string { - if m != nil && m.Protocol != nil { - return *m.Protocol - } - return "" -} - -type ContainerInfo_MesosInfo struct { - Image *Image `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ContainerInfo_MesosInfo) Reset() { *m = ContainerInfo_MesosInfo{} } -func (*ContainerInfo_MesosInfo) ProtoMessage() {} - -func (m *ContainerInfo_MesosInfo) GetImage() *Image { - if m != nil { - return m.Image - } - return nil -} - -// * -// Collection of labels. -type Labels struct { - Labels []*Label `protobuf:"bytes,1,rep,name=labels" json:"labels,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Labels) Reset() { *m = Labels{} } -func (*Labels) ProtoMessage() {} - -func (m *Labels) GetLabels() []*Label { - if m != nil { - return m.Labels - } - return nil -} - -// * -// Key, value pair used to store free form user-data. -type Label struct { - Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` - Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Label) Reset() { *m = Label{} } -func (*Label) ProtoMessage() {} - -func (m *Label) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key - } - return "" -} - -func (m *Label) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -// * -// Named port used for service discovery. -type Port struct { - Number *uint32 `protobuf:"varint,1,req,name=number" json:"number,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Protocol *string `protobuf:"bytes,3,opt,name=protocol" json:"protocol,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Port) Reset() { *m = Port{} } -func (*Port) ProtoMessage() {} - -func (m *Port) GetNumber() uint32 { - if m != nil && m.Number != nil { - return *m.Number - } - return 0 -} - -func (m *Port) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Port) GetProtocol() string { - if m != nil && m.Protocol != nil { - return *m.Protocol - } - return "" -} - -// * -// Collection of ports. -type Ports struct { - Ports []*Port `protobuf:"bytes,1,rep,name=ports" json:"ports,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Ports) Reset() { *m = Ports{} } -func (*Ports) ProtoMessage() {} - -func (m *Ports) GetPorts() []*Port { - if m != nil { - return m.Ports - } - return nil -} - -// * -// Service discovery information. -// The visibility field restricts discovery within a framework -// (FRAMEWORK), within a Mesos cluster (CLUSTER), or places no -// restrictions (EXTERNAL). -// The environment, location, and version fields provide first class -// support for common attributes used to differentiate between -// similar services. The environment may receive values such as -// PROD/QA/DEV, the location field may receive values like -// EAST-US/WEST-US/EUROPE/AMEA, and the version field may receive -// values like v2.0/v0.9. The exact use of these fields is up to each -// service discovery system. -type DiscoveryInfo struct { - Visibility *DiscoveryInfo_Visibility `protobuf:"varint,1,req,name=visibility,enum=mesosproto.DiscoveryInfo_Visibility" json:"visibility,omitempty"` - Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Environment *string `protobuf:"bytes,3,opt,name=environment" json:"environment,omitempty"` - Location *string `protobuf:"bytes,4,opt,name=location" json:"location,omitempty"` - Version *string `protobuf:"bytes,5,opt,name=version" json:"version,omitempty"` - Ports *Ports `protobuf:"bytes,6,opt,name=ports" json:"ports,omitempty"` - Labels *Labels `protobuf:"bytes,7,opt,name=labels" json:"labels,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DiscoveryInfo) Reset() { *m = DiscoveryInfo{} } -func (*DiscoveryInfo) ProtoMessage() {} - -func (m *DiscoveryInfo) GetVisibility() DiscoveryInfo_Visibility { - if m != nil && m.Visibility != nil { - return *m.Visibility - } - return DiscoveryInfo_FRAMEWORK -} - -func (m *DiscoveryInfo) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *DiscoveryInfo) GetEnvironment() string { - if m != nil && m.Environment != nil { - return *m.Environment - } - return "" -} - -func (m *DiscoveryInfo) GetLocation() string { - if m != nil && m.Location != nil { - return *m.Location - } - return "" -} - -func (m *DiscoveryInfo) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -func (m *DiscoveryInfo) GetPorts() *Ports { - if m != nil { - return m.Ports - } - return nil -} - -func (m *DiscoveryInfo) GetLabels() *Labels { - if m != nil { - return m.Labels - } - return nil -} - -// * -// Protobuf for the Appc image manifest JSON schema: -// https://github.com/appc/spec/blob/master/spec/aci.md#image-manifest-schema -// Where possible, any field required in the schema is required in the protobuf -// but some cannot be expressed, e.g., a repeated string that has at least one -// element. Further validation should be performed after parsing the JSON into -// the protobuf. -// This version of Appc protobuf is based on Appc spec version 0.6.1. -// TODO(xujyan): This protobuf currently defines a subset of fields in the spec -// that Mesos makes use of to avoid confusion. New fields are going to be added -// when Mesos starts to support them. -type AppcImageManifest struct { - AcKind *string `protobuf:"bytes,1,req,name=acKind" json:"acKind,omitempty"` - AcVersion *string `protobuf:"bytes,2,req,name=acVersion" json:"acVersion,omitempty"` - Name *string `protobuf:"bytes,3,req,name=name" json:"name,omitempty"` - Labels []*AppcImageManifest_Label `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty"` - Annotations []*AppcImageManifest_Annotation `protobuf:"bytes,5,rep,name=annotations" json:"annotations,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AppcImageManifest) Reset() { *m = AppcImageManifest{} } -func (*AppcImageManifest) ProtoMessage() {} - -func (m *AppcImageManifest) GetAcKind() string { - if m != nil && m.AcKind != nil { - return *m.AcKind - } - return "" -} - -func (m *AppcImageManifest) GetAcVersion() string { - if m != nil && m.AcVersion != nil { - return *m.AcVersion - } - return "" -} - -func (m *AppcImageManifest) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *AppcImageManifest) GetLabels() []*AppcImageManifest_Label { - if m != nil { - return m.Labels - } - return nil -} - -func (m *AppcImageManifest) GetAnnotations() []*AppcImageManifest_Annotation { - if m != nil { - return m.Annotations - } - return nil -} - -type AppcImageManifest_Label struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AppcImageManifest_Label) Reset() { *m = AppcImageManifest_Label{} } -func (*AppcImageManifest_Label) ProtoMessage() {} - -func (m *AppcImageManifest_Label) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *AppcImageManifest_Label) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -type AppcImageManifest_Annotation struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *AppcImageManifest_Annotation) Reset() { *m = AppcImageManifest_Annotation{} } -func (*AppcImageManifest_Annotation) ProtoMessage() {} - -func (m *AppcImageManifest_Annotation) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *AppcImageManifest_Annotation) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value - } - return "" -} - -func init() { - proto.RegisterEnum("mesosproto.Status", Status_name, Status_value) - proto.RegisterEnum("mesosproto.TaskState", TaskState_name, TaskState_value) - proto.RegisterEnum("mesosproto.FrameworkInfo_Capability_Type", FrameworkInfo_Capability_Type_name, FrameworkInfo_Capability_Type_value) - proto.RegisterEnum("mesosproto.Value_Type", Value_Type_name, Value_Type_value) - proto.RegisterEnum("mesosproto.Offer_Operation_Type", Offer_Operation_Type_name, Offer_Operation_Type_value) - proto.RegisterEnum("mesosproto.TaskStatus_Source", TaskStatus_Source_name, TaskStatus_Source_value) - proto.RegisterEnum("mesosproto.TaskStatus_Reason", TaskStatus_Reason_name, TaskStatus_Reason_value) - proto.RegisterEnum("mesosproto.Image_Type", Image_Type_name, Image_Type_value) - proto.RegisterEnum("mesosproto.Volume_Mode", Volume_Mode_name, Volume_Mode_value) - proto.RegisterEnum("mesosproto.ContainerInfo_Type", ContainerInfo_Type_name, ContainerInfo_Type_value) - proto.RegisterEnum("mesosproto.ContainerInfo_DockerInfo_Network", ContainerInfo_DockerInfo_Network_name, ContainerInfo_DockerInfo_Network_value) - proto.RegisterEnum("mesosproto.DiscoveryInfo_Visibility", DiscoveryInfo_Visibility_name, DiscoveryInfo_Visibility_value) -} -func (this *FrameworkID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*FrameworkID) - if !ok { - return fmt.Errorf("that is not of type *FrameworkID") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *FrameworkID but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *FrameworkIDbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *FrameworkID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*FrameworkID) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *OfferID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*OfferID) - if !ok { - return fmt.Errorf("that is not of type *OfferID") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *OfferID but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *OfferIDbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *OfferID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*OfferID) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SlaveID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*SlaveID) - if !ok { - return fmt.Errorf("that is not of type *SlaveID") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *SlaveID but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *SlaveIDbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *SlaveID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*SlaveID) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *TaskID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*TaskID) - if !ok { - return fmt.Errorf("that is not of type *TaskID") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *TaskID but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *TaskIDbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *TaskID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TaskID) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ExecutorID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ExecutorID) - if !ok { - return fmt.Errorf("that is not of type *ExecutorID") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ExecutorID but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ExecutorIDbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ExecutorID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ExecutorID) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ContainerID) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ContainerID) - if !ok { - return fmt.Errorf("that is not of type *ContainerID") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ContainerID but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ContainerIDbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ContainerID) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerID) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Address) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Address) - if !ok { - return fmt.Errorf("that is not of type *Address") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Address but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Addressbut is not nil && this == nil") - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if this.Ip != nil && that1.Ip != nil { - if *this.Ip != *that1.Ip { - return fmt.Errorf("Ip this(%v) Not Equal that(%v)", *this.Ip, *that1.Ip) - } - } else if this.Ip != nil { - return fmt.Errorf("this.Ip == nil && that.Ip != nil") - } else if that1.Ip != nil { - return fmt.Errorf("Ip this(%v) Not Equal that(%v)", this.Ip, that1.Ip) - } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Address) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Address) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false - } - if this.Ip != nil && that1.Ip != nil { - if *this.Ip != *that1.Ip { - return false - } - } else if this.Ip != nil { - return false - } else if that1.Ip != nil { - return false - } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *URL) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*URL) - if !ok { - return fmt.Errorf("that is not of type *URL") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *URL but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *URLbut is not nil && this == nil") - } - if this.Scheme != nil && that1.Scheme != nil { - if *this.Scheme != *that1.Scheme { - return fmt.Errorf("Scheme this(%v) Not Equal that(%v)", *this.Scheme, *that1.Scheme) - } - } else if this.Scheme != nil { - return fmt.Errorf("this.Scheme == nil && that.Scheme != nil") - } else if that1.Scheme != nil { - return fmt.Errorf("Scheme this(%v) Not Equal that(%v)", this.Scheme, that1.Scheme) - } - if !this.Address.Equal(that1.Address) { - return fmt.Errorf("Address this(%v) Not Equal that(%v)", this.Address, that1.Address) - } - if this.Path != nil && that1.Path != nil { - if *this.Path != *that1.Path { - return fmt.Errorf("Path this(%v) Not Equal that(%v)", *this.Path, *that1.Path) - } - } else if this.Path != nil { - return fmt.Errorf("this.Path == nil && that.Path != nil") - } else if that1.Path != nil { - return fmt.Errorf("Path this(%v) Not Equal that(%v)", this.Path, that1.Path) - } - if len(this.Query) != len(that1.Query) { - return fmt.Errorf("Query this(%v) Not Equal that(%v)", len(this.Query), len(that1.Query)) - } - for i := range this.Query { - if !this.Query[i].Equal(that1.Query[i]) { - return fmt.Errorf("Query this[%v](%v) Not Equal that[%v](%v)", i, this.Query[i], i, that1.Query[i]) - } - } - if this.Fragment != nil && that1.Fragment != nil { - if *this.Fragment != *that1.Fragment { - return fmt.Errorf("Fragment this(%v) Not Equal that(%v)", *this.Fragment, *that1.Fragment) - } - } else if this.Fragment != nil { - return fmt.Errorf("this.Fragment == nil && that.Fragment != nil") - } else if that1.Fragment != nil { - return fmt.Errorf("Fragment this(%v) Not Equal that(%v)", this.Fragment, that1.Fragment) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *URL) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*URL) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Scheme != nil && that1.Scheme != nil { - if *this.Scheme != *that1.Scheme { - return false - } - } else if this.Scheme != nil { - return false - } else if that1.Scheme != nil { - return false - } - if !this.Address.Equal(that1.Address) { - return false - } - if this.Path != nil && that1.Path != nil { - if *this.Path != *that1.Path { - return false - } - } else if this.Path != nil { - return false - } else if that1.Path != nil { - return false - } - if len(this.Query) != len(that1.Query) { - return false - } - for i := range this.Query { - if !this.Query[i].Equal(that1.Query[i]) { - return false - } - } - if this.Fragment != nil && that1.Fragment != nil { - if *this.Fragment != *that1.Fragment { - return false - } - } else if this.Fragment != nil { - return false - } else if that1.Fragment != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FrameworkInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*FrameworkInfo) - if !ok { - return fmt.Errorf("that is not of type *FrameworkInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *FrameworkInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *FrameworkInfobut is not nil && this == nil") - } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return fmt.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) - } - } else if this.User != nil { - return fmt.Errorf("this.User == nil && that.User != nil") - } else if that1.User != nil { - return fmt.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !this.Id.Equal(that1.Id) { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { - if *this.FailoverTimeout != *that1.FailoverTimeout { - return fmt.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", *this.FailoverTimeout, *that1.FailoverTimeout) - } - } else if this.FailoverTimeout != nil { - return fmt.Errorf("this.FailoverTimeout == nil && that.FailoverTimeout != nil") - } else if that1.FailoverTimeout != nil { - return fmt.Errorf("FailoverTimeout this(%v) Not Equal that(%v)", this.FailoverTimeout, that1.FailoverTimeout) - } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) - } - } else if this.Checkpoint != nil { - return fmt.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") - } else if that1.Checkpoint != nil { - return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) - } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return fmt.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) - } - } else if this.Role != nil { - return fmt.Errorf("this.Role == nil && that.Role != nil") - } else if that1.Role != nil { - return fmt.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) - } - } else if this.Principal != nil { - return fmt.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) - } - if this.WebuiUrl != nil && that1.WebuiUrl != nil { - if *this.WebuiUrl != *that1.WebuiUrl { - return fmt.Errorf("WebuiUrl this(%v) Not Equal that(%v)", *this.WebuiUrl, *that1.WebuiUrl) - } - } else if this.WebuiUrl != nil { - return fmt.Errorf("this.WebuiUrl == nil && that.WebuiUrl != nil") - } else if that1.WebuiUrl != nil { - return fmt.Errorf("WebuiUrl this(%v) Not Equal that(%v)", this.WebuiUrl, that1.WebuiUrl) - } - if len(this.Capabilities) != len(that1.Capabilities) { - return fmt.Errorf("Capabilities this(%v) Not Equal that(%v)", len(this.Capabilities), len(that1.Capabilities)) - } - for i := range this.Capabilities { - if !this.Capabilities[i].Equal(that1.Capabilities[i]) { - return fmt.Errorf("Capabilities this[%v](%v) Not Equal that[%v](%v)", i, this.Capabilities[i], i, that1.Capabilities[i]) - } - } - if !this.Labels.Equal(that1.Labels) { - return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *FrameworkInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*FrameworkInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return false - } - } else if this.User != nil { - return false - } else if that1.User != nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !this.Id.Equal(that1.Id) { - return false - } - if this.FailoverTimeout != nil && that1.FailoverTimeout != nil { - if *this.FailoverTimeout != *that1.FailoverTimeout { - return false - } - } else if this.FailoverTimeout != nil { - return false - } else if that1.FailoverTimeout != nil { - return false - } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return false - } - } else if this.Checkpoint != nil { - return false - } else if that1.Checkpoint != nil { - return false - } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return false - } - } else if this.Role != nil { - return false - } else if that1.Role != nil { - return false - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false - } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false - } - if this.WebuiUrl != nil && that1.WebuiUrl != nil { - if *this.WebuiUrl != *that1.WebuiUrl { - return false - } - } else if this.WebuiUrl != nil { - return false - } else if that1.WebuiUrl != nil { - return false - } - if len(this.Capabilities) != len(that1.Capabilities) { - return false - } - for i := range this.Capabilities { - if !this.Capabilities[i].Equal(that1.Capabilities[i]) { - return false - } - } - if !this.Labels.Equal(that1.Labels) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FrameworkInfo_Capability) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*FrameworkInfo_Capability) - if !ok { - return fmt.Errorf("that is not of type *FrameworkInfo_Capability") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *FrameworkInfo_Capability but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *FrameworkInfo_Capabilitybut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *FrameworkInfo_Capability) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*FrameworkInfo_Capability) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *HealthCheck) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*HealthCheck) - if !ok { - return fmt.Errorf("that is not of type *HealthCheck") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *HealthCheck but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *HealthCheckbut is not nil && this == nil") - } - if !this.Http.Equal(that1.Http) { - return fmt.Errorf("Http this(%v) Not Equal that(%v)", this.Http, that1.Http) - } - if this.DelaySeconds != nil && that1.DelaySeconds != nil { - if *this.DelaySeconds != *that1.DelaySeconds { - return fmt.Errorf("DelaySeconds this(%v) Not Equal that(%v)", *this.DelaySeconds, *that1.DelaySeconds) - } - } else if this.DelaySeconds != nil { - return fmt.Errorf("this.DelaySeconds == nil && that.DelaySeconds != nil") - } else if that1.DelaySeconds != nil { - return fmt.Errorf("DelaySeconds this(%v) Not Equal that(%v)", this.DelaySeconds, that1.DelaySeconds) - } - if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { - if *this.IntervalSeconds != *that1.IntervalSeconds { - return fmt.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", *this.IntervalSeconds, *that1.IntervalSeconds) - } - } else if this.IntervalSeconds != nil { - return fmt.Errorf("this.IntervalSeconds == nil && that.IntervalSeconds != nil") - } else if that1.IntervalSeconds != nil { - return fmt.Errorf("IntervalSeconds this(%v) Not Equal that(%v)", this.IntervalSeconds, that1.IntervalSeconds) - } - if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { - if *this.TimeoutSeconds != *that1.TimeoutSeconds { - return fmt.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", *this.TimeoutSeconds, *that1.TimeoutSeconds) - } - } else if this.TimeoutSeconds != nil { - return fmt.Errorf("this.TimeoutSeconds == nil && that.TimeoutSeconds != nil") - } else if that1.TimeoutSeconds != nil { - return fmt.Errorf("TimeoutSeconds this(%v) Not Equal that(%v)", this.TimeoutSeconds, that1.TimeoutSeconds) - } - if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { - if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { - return fmt.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", *this.ConsecutiveFailures, *that1.ConsecutiveFailures) - } - } else if this.ConsecutiveFailures != nil { - return fmt.Errorf("this.ConsecutiveFailures == nil && that.ConsecutiveFailures != nil") - } else if that1.ConsecutiveFailures != nil { - return fmt.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", this.ConsecutiveFailures, that1.ConsecutiveFailures) - } - if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { - if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { - return fmt.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", *this.GracePeriodSeconds, *that1.GracePeriodSeconds) - } - } else if this.GracePeriodSeconds != nil { - return fmt.Errorf("this.GracePeriodSeconds == nil && that.GracePeriodSeconds != nil") - } else if that1.GracePeriodSeconds != nil { - return fmt.Errorf("GracePeriodSeconds this(%v) Not Equal that(%v)", this.GracePeriodSeconds, that1.GracePeriodSeconds) - } - if !this.Command.Equal(that1.Command) { - return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *HealthCheck) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*HealthCheck) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Http.Equal(that1.Http) { - return false - } - if this.DelaySeconds != nil && that1.DelaySeconds != nil { - if *this.DelaySeconds != *that1.DelaySeconds { - return false - } - } else if this.DelaySeconds != nil { - return false - } else if that1.DelaySeconds != nil { - return false - } - if this.IntervalSeconds != nil && that1.IntervalSeconds != nil { - if *this.IntervalSeconds != *that1.IntervalSeconds { - return false - } - } else if this.IntervalSeconds != nil { - return false - } else if that1.IntervalSeconds != nil { - return false - } - if this.TimeoutSeconds != nil && that1.TimeoutSeconds != nil { - if *this.TimeoutSeconds != *that1.TimeoutSeconds { - return false - } - } else if this.TimeoutSeconds != nil { - return false - } else if that1.TimeoutSeconds != nil { - return false - } - if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { - if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { - return false - } - } else if this.ConsecutiveFailures != nil { - return false - } else if that1.ConsecutiveFailures != nil { - return false - } - if this.GracePeriodSeconds != nil && that1.GracePeriodSeconds != nil { - if *this.GracePeriodSeconds != *that1.GracePeriodSeconds { - return false - } - } else if this.GracePeriodSeconds != nil { - return false - } else if that1.GracePeriodSeconds != nil { - return false - } - if !this.Command.Equal(that1.Command) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *HealthCheck_HTTP) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*HealthCheck_HTTP) - if !ok { - return fmt.Errorf("that is not of type *HealthCheck_HTTP") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *HealthCheck_HTTP but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *HealthCheck_HTTPbut is not nil && this == nil") - } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) - } - if this.Path != nil && that1.Path != nil { - if *this.Path != *that1.Path { - return fmt.Errorf("Path this(%v) Not Equal that(%v)", *this.Path, *that1.Path) - } - } else if this.Path != nil { - return fmt.Errorf("this.Path == nil && that.Path != nil") - } else if that1.Path != nil { - return fmt.Errorf("Path this(%v) Not Equal that(%v)", this.Path, that1.Path) - } - if len(this.Statuses) != len(that1.Statuses) { - return fmt.Errorf("Statuses this(%v) Not Equal that(%v)", len(this.Statuses), len(that1.Statuses)) - } - for i := range this.Statuses { - if this.Statuses[i] != that1.Statuses[i] { - return fmt.Errorf("Statuses this[%v](%v) Not Equal that[%v](%v)", i, this.Statuses[i], i, that1.Statuses[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *HealthCheck_HTTP) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*HealthCheck_HTTP) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false - } - if this.Path != nil && that1.Path != nil { - if *this.Path != *that1.Path { - return false - } - } else if this.Path != nil { - return false - } else if that1.Path != nil { - return false - } - if len(this.Statuses) != len(that1.Statuses) { - return false - } - for i := range this.Statuses { - if this.Statuses[i] != that1.Statuses[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *CommandInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*CommandInfo) - if !ok { - return fmt.Errorf("that is not of type *CommandInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *CommandInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *CommandInfobut is not nil && this == nil") - } - if !this.Container.Equal(that1.Container) { - return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) - } - if len(this.Uris) != len(that1.Uris) { - return fmt.Errorf("Uris this(%v) Not Equal that(%v)", len(this.Uris), len(that1.Uris)) - } - for i := range this.Uris { - if !this.Uris[i].Equal(that1.Uris[i]) { - return fmt.Errorf("Uris this[%v](%v) Not Equal that[%v](%v)", i, this.Uris[i], i, that1.Uris[i]) - } - } - if !this.Environment.Equal(that1.Environment) { - return fmt.Errorf("Environment this(%v) Not Equal that(%v)", this.Environment, that1.Environment) - } - if this.Shell != nil && that1.Shell != nil { - if *this.Shell != *that1.Shell { - return fmt.Errorf("Shell this(%v) Not Equal that(%v)", *this.Shell, *that1.Shell) - } - } else if this.Shell != nil { - return fmt.Errorf("this.Shell == nil && that.Shell != nil") - } else if that1.Shell != nil { - return fmt.Errorf("Shell this(%v) Not Equal that(%v)", this.Shell, that1.Shell) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if len(this.Arguments) != len(that1.Arguments) { - return fmt.Errorf("Arguments this(%v) Not Equal that(%v)", len(this.Arguments), len(that1.Arguments)) - } - for i := range this.Arguments { - if this.Arguments[i] != that1.Arguments[i] { - return fmt.Errorf("Arguments this[%v](%v) Not Equal that[%v](%v)", i, this.Arguments[i], i, that1.Arguments[i]) - } - } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return fmt.Errorf("User this(%v) Not Equal that(%v)", *this.User, *that1.User) - } - } else if this.User != nil { - return fmt.Errorf("this.User == nil && that.User != nil") - } else if that1.User != nil { - return fmt.Errorf("User this(%v) Not Equal that(%v)", this.User, that1.User) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *CommandInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*CommandInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Container.Equal(that1.Container) { - return false - } - if len(this.Uris) != len(that1.Uris) { - return false - } - for i := range this.Uris { - if !this.Uris[i].Equal(that1.Uris[i]) { - return false - } - } - if !this.Environment.Equal(that1.Environment) { - return false - } - if this.Shell != nil && that1.Shell != nil { - if *this.Shell != *that1.Shell { - return false - } - } else if this.Shell != nil { - return false - } else if that1.Shell != nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if len(this.Arguments) != len(that1.Arguments) { - return false - } - for i := range this.Arguments { - if this.Arguments[i] != that1.Arguments[i] { - return false - } - } - if this.User != nil && that1.User != nil { - if *this.User != *that1.User { - return false - } - } else if this.User != nil { - return false - } else if that1.User != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *CommandInfo_URI) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*CommandInfo_URI) - if !ok { - return fmt.Errorf("that is not of type *CommandInfo_URI") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *CommandInfo_URI but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *CommandInfo_URIbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if this.Executable != nil && that1.Executable != nil { - if *this.Executable != *that1.Executable { - return fmt.Errorf("Executable this(%v) Not Equal that(%v)", *this.Executable, *that1.Executable) - } - } else if this.Executable != nil { - return fmt.Errorf("this.Executable == nil && that.Executable != nil") - } else if that1.Executable != nil { - return fmt.Errorf("Executable this(%v) Not Equal that(%v)", this.Executable, that1.Executable) - } - if this.Extract != nil && that1.Extract != nil { - if *this.Extract != *that1.Extract { - return fmt.Errorf("Extract this(%v) Not Equal that(%v)", *this.Extract, *that1.Extract) - } - } else if this.Extract != nil { - return fmt.Errorf("this.Extract == nil && that.Extract != nil") - } else if that1.Extract != nil { - return fmt.Errorf("Extract this(%v) Not Equal that(%v)", this.Extract, that1.Extract) - } - if this.Cache != nil && that1.Cache != nil { - if *this.Cache != *that1.Cache { - return fmt.Errorf("Cache this(%v) Not Equal that(%v)", *this.Cache, *that1.Cache) - } - } else if this.Cache != nil { - return fmt.Errorf("this.Cache == nil && that.Cache != nil") - } else if that1.Cache != nil { - return fmt.Errorf("Cache this(%v) Not Equal that(%v)", this.Cache, that1.Cache) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *CommandInfo_URI) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*CommandInfo_URI) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if this.Executable != nil && that1.Executable != nil { - if *this.Executable != *that1.Executable { - return false - } - } else if this.Executable != nil { - return false - } else if that1.Executable != nil { - return false - } - if this.Extract != nil && that1.Extract != nil { - if *this.Extract != *that1.Extract { - return false - } - } else if this.Extract != nil { - return false - } else if that1.Extract != nil { - return false - } - if this.Cache != nil && that1.Cache != nil { - if *this.Cache != *that1.Cache { - return false - } - } else if this.Cache != nil { - return false - } else if that1.Cache != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *CommandInfo_ContainerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*CommandInfo_ContainerInfo) - if !ok { - return fmt.Errorf("that is not of type *CommandInfo_ContainerInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *CommandInfo_ContainerInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *CommandInfo_ContainerInfobut is not nil && this == nil") - } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return fmt.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) - } - } else if this.Image != nil { - return fmt.Errorf("this.Image == nil && that.Image != nil") - } else if that1.Image != nil { - return fmt.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) - } - if len(this.Options) != len(that1.Options) { - return fmt.Errorf("Options this(%v) Not Equal that(%v)", len(this.Options), len(that1.Options)) - } - for i := range this.Options { - if this.Options[i] != that1.Options[i] { - return fmt.Errorf("Options this[%v](%v) Not Equal that[%v](%v)", i, this.Options[i], i, that1.Options[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *CommandInfo_ContainerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*CommandInfo_ContainerInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return false - } - } else if this.Image != nil { - return false - } else if that1.Image != nil { - return false - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if this.Options[i] != that1.Options[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ExecutorInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ExecutorInfo) - if !ok { - return fmt.Errorf("that is not of type *ExecutorInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ExecutorInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ExecutorInfobut is not nil && this == nil") - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.Command.Equal(that1.Command) { - return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) - } - if !this.Container.Equal(that1.Container) { - return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return fmt.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) - } - } else if this.Source != nil { - return fmt.Errorf("this.Source == nil && that.Source != nil") - } else if that1.Source != nil { - return fmt.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !this.Discovery.Equal(that1.Discovery) { - return fmt.Errorf("Discovery this(%v) Not Equal that(%v)", this.Discovery, that1.Discovery) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ExecutorInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ExecutorInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.Command.Equal(that1.Command) { - return false - } - if !this.Container.Equal(that1.Container) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return false - } - } else if this.Source != nil { - return false - } else if that1.Source != nil { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !this.Discovery.Equal(that1.Discovery) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *MasterInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*MasterInfo) - if !ok { - return fmt.Errorf("that is not of type *MasterInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *MasterInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *MasterInfobut is not nil && this == nil") - } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) - } - } else if this.Id != nil { - return fmt.Errorf("this.Id == nil && that.Id != nil") - } else if that1.Id != nil { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if this.Ip != nil && that1.Ip != nil { - if *this.Ip != *that1.Ip { - return fmt.Errorf("Ip this(%v) Not Equal that(%v)", *this.Ip, *that1.Ip) - } - } else if this.Ip != nil { - return fmt.Errorf("this.Ip == nil && that.Ip != nil") - } else if that1.Ip != nil { - return fmt.Errorf("Ip this(%v) Not Equal that(%v)", this.Ip, that1.Ip) - } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) - } - } else if this.Pid != nil { - return fmt.Errorf("this.Pid == nil && that.Pid != nil") - } else if that1.Pid != nil { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if this.Version != nil && that1.Version != nil { - if *this.Version != *that1.Version { - return fmt.Errorf("Version this(%v) Not Equal that(%v)", *this.Version, *that1.Version) - } - } else if this.Version != nil { - return fmt.Errorf("this.Version == nil && that.Version != nil") - } else if that1.Version != nil { - return fmt.Errorf("Version this(%v) Not Equal that(%v)", this.Version, that1.Version) - } - if !this.Address.Equal(that1.Address) { - return fmt.Errorf("Address this(%v) Not Equal that(%v)", this.Address, that1.Address) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *MasterInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*MasterInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return false - } - } else if this.Id != nil { - return false - } else if that1.Id != nil { - return false - } - if this.Ip != nil && that1.Ip != nil { - if *this.Ip != *that1.Ip { - return false - } - } else if this.Ip != nil { - return false - } else if that1.Ip != nil { - return false - } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return false - } - } else if this.Pid != nil { - return false - } else if that1.Pid != nil { - return false - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false - } - if this.Version != nil && that1.Version != nil { - if *this.Version != *that1.Version { - return false - } - } else if this.Version != nil { - return false - } else if that1.Version != nil { - return false - } - if !this.Address.Equal(that1.Address) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SlaveInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*SlaveInfo) - if !ok { - return fmt.Errorf("that is not of type *SlaveInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *SlaveInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *SlaveInfobut is not nil && this == nil") - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return fmt.Errorf("Port this(%v) Not Equal that(%v)", *this.Port, *that1.Port) - } - } else if this.Port != nil { - return fmt.Errorf("this.Port == nil && that.Port != nil") - } else if that1.Port != nil { - return fmt.Errorf("Port this(%v) Not Equal that(%v)", this.Port, that1.Port) - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if len(this.Attributes) != len(that1.Attributes) { - return fmt.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) - } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return fmt.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) - } - } - if !this.Id.Equal(that1.Id) { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", *this.Checkpoint, *that1.Checkpoint) - } - } else if this.Checkpoint != nil { - return fmt.Errorf("this.Checkpoint == nil && that.Checkpoint != nil") - } else if that1.Checkpoint != nil { - return fmt.Errorf("Checkpoint this(%v) Not Equal that(%v)", this.Checkpoint, that1.Checkpoint) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *SlaveInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*SlaveInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false - } - if this.Port != nil && that1.Port != nil { - if *this.Port != *that1.Port { - return false - } - } else if this.Port != nil { - return false - } else if that1.Port != nil { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if len(this.Attributes) != len(that1.Attributes) { - return false - } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return false - } - } - if !this.Id.Equal(that1.Id) { - return false - } - if this.Checkpoint != nil && that1.Checkpoint != nil { - if *this.Checkpoint != *that1.Checkpoint { - return false - } - } else if this.Checkpoint != nil { - return false - } else if that1.Checkpoint != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Value) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Value) - if !ok { - return fmt.Errorf("that is not of type *Value") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Value but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Valuebut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Scalar.Equal(that1.Scalar) { - return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) - } - if !this.Ranges.Equal(that1.Ranges) { - return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) - } - if !this.Set.Equal(that1.Set) { - return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) - } - if !this.Text.Equal(that1.Text) { - return fmt.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Value) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Value) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Scalar.Equal(that1.Scalar) { - return false - } - if !this.Ranges.Equal(that1.Ranges) { - return false - } - if !this.Set.Equal(that1.Set) { - return false - } - if !this.Text.Equal(that1.Text) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Value_Scalar) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Value_Scalar) - if !ok { - return fmt.Errorf("that is not of type *Value_Scalar") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Value_Scalar but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Value_Scalarbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Value_Scalar) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Value_Scalar) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Value_Range) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Value_Range) - if !ok { - return fmt.Errorf("that is not of type *Value_Range") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Value_Range but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Value_Rangebut is not nil && this == nil") - } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return fmt.Errorf("Begin this(%v) Not Equal that(%v)", *this.Begin, *that1.Begin) - } - } else if this.Begin != nil { - return fmt.Errorf("this.Begin == nil && that.Begin != nil") - } else if that1.Begin != nil { - return fmt.Errorf("Begin this(%v) Not Equal that(%v)", this.Begin, that1.Begin) - } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return fmt.Errorf("End this(%v) Not Equal that(%v)", *this.End, *that1.End) - } - } else if this.End != nil { - return fmt.Errorf("this.End == nil && that.End != nil") - } else if that1.End != nil { - return fmt.Errorf("End this(%v) Not Equal that(%v)", this.End, that1.End) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Value_Range) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Value_Range) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Begin != nil && that1.Begin != nil { - if *this.Begin != *that1.Begin { - return false - } - } else if this.Begin != nil { - return false - } else if that1.Begin != nil { - return false - } - if this.End != nil && that1.End != nil { - if *this.End != *that1.End { - return false - } - } else if this.End != nil { - return false - } else if that1.End != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Value_Ranges) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Value_Ranges) - if !ok { - return fmt.Errorf("that is not of type *Value_Ranges") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Value_Ranges but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Value_Rangesbut is not nil && this == nil") - } - if len(this.Range) != len(that1.Range) { - return fmt.Errorf("Range this(%v) Not Equal that(%v)", len(this.Range), len(that1.Range)) - } - for i := range this.Range { - if !this.Range[i].Equal(that1.Range[i]) { - return fmt.Errorf("Range this[%v](%v) Not Equal that[%v](%v)", i, this.Range[i], i, that1.Range[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Value_Ranges) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Value_Ranges) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Range) != len(that1.Range) { - return false - } - for i := range this.Range { - if !this.Range[i].Equal(that1.Range[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Value_Set) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Value_Set) - if !ok { - return fmt.Errorf("that is not of type *Value_Set") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Value_Set but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Value_Setbut is not nil && this == nil") - } - if len(this.Item) != len(that1.Item) { - return fmt.Errorf("Item this(%v) Not Equal that(%v)", len(this.Item), len(that1.Item)) - } - for i := range this.Item { - if this.Item[i] != that1.Item[i] { - return fmt.Errorf("Item this[%v](%v) Not Equal that[%v](%v)", i, this.Item[i], i, that1.Item[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Value_Set) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Value_Set) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Item) != len(that1.Item) { - return false - } - for i := range this.Item { - if this.Item[i] != that1.Item[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Value_Text) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Value_Text) - if !ok { - return fmt.Errorf("that is not of type *Value_Text") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Value_Text but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Value_Textbut is not nil && this == nil") - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Value_Text) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Value_Text) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Attribute) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Attribute) - if !ok { - return fmt.Errorf("that is not of type *Attribute") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Attribute but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Attributebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Scalar.Equal(that1.Scalar) { - return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) - } - if !this.Ranges.Equal(that1.Ranges) { - return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) - } - if !this.Set.Equal(that1.Set) { - return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) - } - if !this.Text.Equal(that1.Text) { - return fmt.Errorf("Text this(%v) Not Equal that(%v)", this.Text, that1.Text) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Attribute) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Attribute) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Scalar.Equal(that1.Scalar) { - return false - } - if !this.Ranges.Equal(that1.Ranges) { - return false - } - if !this.Set.Equal(that1.Set) { - return false - } - if !this.Text.Equal(that1.Text) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Resource) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Resource) - if !ok { - return fmt.Errorf("that is not of type *Resource") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Resource but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Resourcebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Scalar.Equal(that1.Scalar) { - return fmt.Errorf("Scalar this(%v) Not Equal that(%v)", this.Scalar, that1.Scalar) - } - if !this.Ranges.Equal(that1.Ranges) { - return fmt.Errorf("Ranges this(%v) Not Equal that(%v)", this.Ranges, that1.Ranges) - } - if !this.Set.Equal(that1.Set) { - return fmt.Errorf("Set this(%v) Not Equal that(%v)", this.Set, that1.Set) - } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return fmt.Errorf("Role this(%v) Not Equal that(%v)", *this.Role, *that1.Role) - } - } else if this.Role != nil { - return fmt.Errorf("this.Role == nil && that.Role != nil") - } else if that1.Role != nil { - return fmt.Errorf("Role this(%v) Not Equal that(%v)", this.Role, that1.Role) - } - if !this.Reservation.Equal(that1.Reservation) { - return fmt.Errorf("Reservation this(%v) Not Equal that(%v)", this.Reservation, that1.Reservation) - } - if !this.Disk.Equal(that1.Disk) { - return fmt.Errorf("Disk this(%v) Not Equal that(%v)", this.Disk, that1.Disk) - } - if !this.Revocable.Equal(that1.Revocable) { - return fmt.Errorf("Revocable this(%v) Not Equal that(%v)", this.Revocable, that1.Revocable) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Resource) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Resource) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Scalar.Equal(that1.Scalar) { - return false - } - if !this.Ranges.Equal(that1.Ranges) { - return false - } - if !this.Set.Equal(that1.Set) { - return false - } - if this.Role != nil && that1.Role != nil { - if *this.Role != *that1.Role { - return false - } - } else if this.Role != nil { - return false - } else if that1.Role != nil { - return false - } - if !this.Reservation.Equal(that1.Reservation) { - return false - } - if !this.Disk.Equal(that1.Disk) { - return false - } - if !this.Revocable.Equal(that1.Revocable) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Resource_ReservationInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Resource_ReservationInfo) - if !ok { - return fmt.Errorf("that is not of type *Resource_ReservationInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Resource_ReservationInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Resource_ReservationInfobut is not nil && this == nil") - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) - } - } else if this.Principal != nil { - return fmt.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Resource_ReservationInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Resource_ReservationInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false - } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Resource_DiskInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Resource_DiskInfo) - if !ok { - return fmt.Errorf("that is not of type *Resource_DiskInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Resource_DiskInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Resource_DiskInfobut is not nil && this == nil") - } - if !this.Persistence.Equal(that1.Persistence) { - return fmt.Errorf("Persistence this(%v) Not Equal that(%v)", this.Persistence, that1.Persistence) - } - if !this.Volume.Equal(that1.Volume) { - return fmt.Errorf("Volume this(%v) Not Equal that(%v)", this.Volume, that1.Volume) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Resource_DiskInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Resource_DiskInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Persistence.Equal(that1.Persistence) { - return false - } - if !this.Volume.Equal(that1.Volume) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Resource_DiskInfo_Persistence) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Resource_DiskInfo_Persistence) - if !ok { - return fmt.Errorf("that is not of type *Resource_DiskInfo_Persistence") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Resource_DiskInfo_Persistence but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Resource_DiskInfo_Persistencebut is not nil && this == nil") - } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) - } - } else if this.Id != nil { - return fmt.Errorf("this.Id == nil && that.Id != nil") - } else if that1.Id != nil { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Resource_DiskInfo_Persistence) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Resource_DiskInfo_Persistence) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return false - } - } else if this.Id != nil { - return false - } else if that1.Id != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Resource_RevocableInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Resource_RevocableInfo) - if !ok { - return fmt.Errorf("that is not of type *Resource_RevocableInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Resource_RevocableInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Resource_RevocableInfobut is not nil && this == nil") - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Resource_RevocableInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Resource_RevocableInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *TrafficControlStatistics) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*TrafficControlStatistics) - if !ok { - return fmt.Errorf("that is not of type *TrafficControlStatistics") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *TrafficControlStatistics but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *TrafficControlStatisticsbut is not nil && this == nil") - } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) - } - } else if this.Id != nil { - return fmt.Errorf("this.Id == nil && that.Id != nil") - } else if that1.Id != nil { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if this.Backlog != nil && that1.Backlog != nil { - if *this.Backlog != *that1.Backlog { - return fmt.Errorf("Backlog this(%v) Not Equal that(%v)", *this.Backlog, *that1.Backlog) - } - } else if this.Backlog != nil { - return fmt.Errorf("this.Backlog == nil && that.Backlog != nil") - } else if that1.Backlog != nil { - return fmt.Errorf("Backlog this(%v) Not Equal that(%v)", this.Backlog, that1.Backlog) - } - if this.Bytes != nil && that1.Bytes != nil { - if *this.Bytes != *that1.Bytes { - return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", *this.Bytes, *that1.Bytes) - } - } else if this.Bytes != nil { - return fmt.Errorf("this.Bytes == nil && that.Bytes != nil") - } else if that1.Bytes != nil { - return fmt.Errorf("Bytes this(%v) Not Equal that(%v)", this.Bytes, that1.Bytes) - } - if this.Drops != nil && that1.Drops != nil { - if *this.Drops != *that1.Drops { - return fmt.Errorf("Drops this(%v) Not Equal that(%v)", *this.Drops, *that1.Drops) - } - } else if this.Drops != nil { - return fmt.Errorf("this.Drops == nil && that.Drops != nil") - } else if that1.Drops != nil { - return fmt.Errorf("Drops this(%v) Not Equal that(%v)", this.Drops, that1.Drops) - } - if this.Overlimits != nil && that1.Overlimits != nil { - if *this.Overlimits != *that1.Overlimits { - return fmt.Errorf("Overlimits this(%v) Not Equal that(%v)", *this.Overlimits, *that1.Overlimits) - } - } else if this.Overlimits != nil { - return fmt.Errorf("this.Overlimits == nil && that.Overlimits != nil") - } else if that1.Overlimits != nil { - return fmt.Errorf("Overlimits this(%v) Not Equal that(%v)", this.Overlimits, that1.Overlimits) - } - if this.Packets != nil && that1.Packets != nil { - if *this.Packets != *that1.Packets { - return fmt.Errorf("Packets this(%v) Not Equal that(%v)", *this.Packets, *that1.Packets) - } - } else if this.Packets != nil { - return fmt.Errorf("this.Packets == nil && that.Packets != nil") - } else if that1.Packets != nil { - return fmt.Errorf("Packets this(%v) Not Equal that(%v)", this.Packets, that1.Packets) - } - if this.Qlen != nil && that1.Qlen != nil { - if *this.Qlen != *that1.Qlen { - return fmt.Errorf("Qlen this(%v) Not Equal that(%v)", *this.Qlen, *that1.Qlen) - } - } else if this.Qlen != nil { - return fmt.Errorf("this.Qlen == nil && that.Qlen != nil") - } else if that1.Qlen != nil { - return fmt.Errorf("Qlen this(%v) Not Equal that(%v)", this.Qlen, that1.Qlen) - } - if this.Ratebps != nil && that1.Ratebps != nil { - if *this.Ratebps != *that1.Ratebps { - return fmt.Errorf("Ratebps this(%v) Not Equal that(%v)", *this.Ratebps, *that1.Ratebps) - } - } else if this.Ratebps != nil { - return fmt.Errorf("this.Ratebps == nil && that.Ratebps != nil") - } else if that1.Ratebps != nil { - return fmt.Errorf("Ratebps this(%v) Not Equal that(%v)", this.Ratebps, that1.Ratebps) - } - if this.Ratepps != nil && that1.Ratepps != nil { - if *this.Ratepps != *that1.Ratepps { - return fmt.Errorf("Ratepps this(%v) Not Equal that(%v)", *this.Ratepps, *that1.Ratepps) - } - } else if this.Ratepps != nil { - return fmt.Errorf("this.Ratepps == nil && that.Ratepps != nil") - } else if that1.Ratepps != nil { - return fmt.Errorf("Ratepps this(%v) Not Equal that(%v)", this.Ratepps, that1.Ratepps) - } - if this.Requeues != nil && that1.Requeues != nil { - if *this.Requeues != *that1.Requeues { - return fmt.Errorf("Requeues this(%v) Not Equal that(%v)", *this.Requeues, *that1.Requeues) - } - } else if this.Requeues != nil { - return fmt.Errorf("this.Requeues == nil && that.Requeues != nil") - } else if that1.Requeues != nil { - return fmt.Errorf("Requeues this(%v) Not Equal that(%v)", this.Requeues, that1.Requeues) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *TrafficControlStatistics) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TrafficControlStatistics) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return false - } - } else if this.Id != nil { - return false - } else if that1.Id != nil { - return false - } - if this.Backlog != nil && that1.Backlog != nil { - if *this.Backlog != *that1.Backlog { - return false - } - } else if this.Backlog != nil { - return false - } else if that1.Backlog != nil { - return false - } - if this.Bytes != nil && that1.Bytes != nil { - if *this.Bytes != *that1.Bytes { - return false - } - } else if this.Bytes != nil { - return false - } else if that1.Bytes != nil { - return false - } - if this.Drops != nil && that1.Drops != nil { - if *this.Drops != *that1.Drops { - return false - } - } else if this.Drops != nil { - return false - } else if that1.Drops != nil { - return false - } - if this.Overlimits != nil && that1.Overlimits != nil { - if *this.Overlimits != *that1.Overlimits { - return false - } - } else if this.Overlimits != nil { - return false - } else if that1.Overlimits != nil { - return false - } - if this.Packets != nil && that1.Packets != nil { - if *this.Packets != *that1.Packets { - return false - } - } else if this.Packets != nil { - return false - } else if that1.Packets != nil { - return false - } - if this.Qlen != nil && that1.Qlen != nil { - if *this.Qlen != *that1.Qlen { - return false - } - } else if this.Qlen != nil { - return false - } else if that1.Qlen != nil { - return false - } - if this.Ratebps != nil && that1.Ratebps != nil { - if *this.Ratebps != *that1.Ratebps { - return false - } - } else if this.Ratebps != nil { - return false - } else if that1.Ratebps != nil { - return false - } - if this.Ratepps != nil && that1.Ratepps != nil { - if *this.Ratepps != *that1.Ratepps { - return false - } - } else if this.Ratepps != nil { - return false - } else if that1.Ratepps != nil { - return false - } - if this.Requeues != nil && that1.Requeues != nil { - if *this.Requeues != *that1.Requeues { - return false - } - } else if this.Requeues != nil { - return false - } else if that1.Requeues != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ResourceStatistics) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ResourceStatistics) - if !ok { - return fmt.Errorf("that is not of type *ResourceStatistics") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ResourceStatistics but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ResourceStatisticsbut is not nil && this == nil") - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) - } - } else if this.Timestamp != nil { - return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) - } - if this.Processes != nil && that1.Processes != nil { - if *this.Processes != *that1.Processes { - return fmt.Errorf("Processes this(%v) Not Equal that(%v)", *this.Processes, *that1.Processes) - } - } else if this.Processes != nil { - return fmt.Errorf("this.Processes == nil && that.Processes != nil") - } else if that1.Processes != nil { - return fmt.Errorf("Processes this(%v) Not Equal that(%v)", this.Processes, that1.Processes) - } - if this.Threads != nil && that1.Threads != nil { - if *this.Threads != *that1.Threads { - return fmt.Errorf("Threads this(%v) Not Equal that(%v)", *this.Threads, *that1.Threads) - } - } else if this.Threads != nil { - return fmt.Errorf("this.Threads == nil && that.Threads != nil") - } else if that1.Threads != nil { - return fmt.Errorf("Threads this(%v) Not Equal that(%v)", this.Threads, that1.Threads) - } - if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { - if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { - return fmt.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", *this.CpusUserTimeSecs, *that1.CpusUserTimeSecs) - } - } else if this.CpusUserTimeSecs != nil { - return fmt.Errorf("this.CpusUserTimeSecs == nil && that.CpusUserTimeSecs != nil") - } else if that1.CpusUserTimeSecs != nil { - return fmt.Errorf("CpusUserTimeSecs this(%v) Not Equal that(%v)", this.CpusUserTimeSecs, that1.CpusUserTimeSecs) - } - if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { - if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { - return fmt.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", *this.CpusSystemTimeSecs, *that1.CpusSystemTimeSecs) - } - } else if this.CpusSystemTimeSecs != nil { - return fmt.Errorf("this.CpusSystemTimeSecs == nil && that.CpusSystemTimeSecs != nil") - } else if that1.CpusSystemTimeSecs != nil { - return fmt.Errorf("CpusSystemTimeSecs this(%v) Not Equal that(%v)", this.CpusSystemTimeSecs, that1.CpusSystemTimeSecs) - } - if this.CpusLimit != nil && that1.CpusLimit != nil { - if *this.CpusLimit != *that1.CpusLimit { - return fmt.Errorf("CpusLimit this(%v) Not Equal that(%v)", *this.CpusLimit, *that1.CpusLimit) - } - } else if this.CpusLimit != nil { - return fmt.Errorf("this.CpusLimit == nil && that.CpusLimit != nil") - } else if that1.CpusLimit != nil { - return fmt.Errorf("CpusLimit this(%v) Not Equal that(%v)", this.CpusLimit, that1.CpusLimit) - } - if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { - if *this.CpusNrPeriods != *that1.CpusNrPeriods { - return fmt.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", *this.CpusNrPeriods, *that1.CpusNrPeriods) - } - } else if this.CpusNrPeriods != nil { - return fmt.Errorf("this.CpusNrPeriods == nil && that.CpusNrPeriods != nil") - } else if that1.CpusNrPeriods != nil { - return fmt.Errorf("CpusNrPeriods this(%v) Not Equal that(%v)", this.CpusNrPeriods, that1.CpusNrPeriods) - } - if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { - if *this.CpusNrThrottled != *that1.CpusNrThrottled { - return fmt.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", *this.CpusNrThrottled, *that1.CpusNrThrottled) - } - } else if this.CpusNrThrottled != nil { - return fmt.Errorf("this.CpusNrThrottled == nil && that.CpusNrThrottled != nil") - } else if that1.CpusNrThrottled != nil { - return fmt.Errorf("CpusNrThrottled this(%v) Not Equal that(%v)", this.CpusNrThrottled, that1.CpusNrThrottled) - } - if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { - if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { - return fmt.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", *this.CpusThrottledTimeSecs, *that1.CpusThrottledTimeSecs) - } - } else if this.CpusThrottledTimeSecs != nil { - return fmt.Errorf("this.CpusThrottledTimeSecs == nil && that.CpusThrottledTimeSecs != nil") - } else if that1.CpusThrottledTimeSecs != nil { - return fmt.Errorf("CpusThrottledTimeSecs this(%v) Not Equal that(%v)", this.CpusThrottledTimeSecs, that1.CpusThrottledTimeSecs) - } - if this.MemTotalBytes != nil && that1.MemTotalBytes != nil { - if *this.MemTotalBytes != *that1.MemTotalBytes { - return fmt.Errorf("MemTotalBytes this(%v) Not Equal that(%v)", *this.MemTotalBytes, *that1.MemTotalBytes) - } - } else if this.MemTotalBytes != nil { - return fmt.Errorf("this.MemTotalBytes == nil && that.MemTotalBytes != nil") - } else if that1.MemTotalBytes != nil { - return fmt.Errorf("MemTotalBytes this(%v) Not Equal that(%v)", this.MemTotalBytes, that1.MemTotalBytes) - } - if this.MemTotalMemswBytes != nil && that1.MemTotalMemswBytes != nil { - if *this.MemTotalMemswBytes != *that1.MemTotalMemswBytes { - return fmt.Errorf("MemTotalMemswBytes this(%v) Not Equal that(%v)", *this.MemTotalMemswBytes, *that1.MemTotalMemswBytes) - } - } else if this.MemTotalMemswBytes != nil { - return fmt.Errorf("this.MemTotalMemswBytes == nil && that.MemTotalMemswBytes != nil") - } else if that1.MemTotalMemswBytes != nil { - return fmt.Errorf("MemTotalMemswBytes this(%v) Not Equal that(%v)", this.MemTotalMemswBytes, that1.MemTotalMemswBytes) - } - if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { - if *this.MemLimitBytes != *that1.MemLimitBytes { - return fmt.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", *this.MemLimitBytes, *that1.MemLimitBytes) - } - } else if this.MemLimitBytes != nil { - return fmt.Errorf("this.MemLimitBytes == nil && that.MemLimitBytes != nil") - } else if that1.MemLimitBytes != nil { - return fmt.Errorf("MemLimitBytes this(%v) Not Equal that(%v)", this.MemLimitBytes, that1.MemLimitBytes) - } - if this.MemSoftLimitBytes != nil && that1.MemSoftLimitBytes != nil { - if *this.MemSoftLimitBytes != *that1.MemSoftLimitBytes { - return fmt.Errorf("MemSoftLimitBytes this(%v) Not Equal that(%v)", *this.MemSoftLimitBytes, *that1.MemSoftLimitBytes) - } - } else if this.MemSoftLimitBytes != nil { - return fmt.Errorf("this.MemSoftLimitBytes == nil && that.MemSoftLimitBytes != nil") - } else if that1.MemSoftLimitBytes != nil { - return fmt.Errorf("MemSoftLimitBytes this(%v) Not Equal that(%v)", this.MemSoftLimitBytes, that1.MemSoftLimitBytes) - } - if this.MemFileBytes != nil && that1.MemFileBytes != nil { - if *this.MemFileBytes != *that1.MemFileBytes { - return fmt.Errorf("MemFileBytes this(%v) Not Equal that(%v)", *this.MemFileBytes, *that1.MemFileBytes) - } - } else if this.MemFileBytes != nil { - return fmt.Errorf("this.MemFileBytes == nil && that.MemFileBytes != nil") - } else if that1.MemFileBytes != nil { - return fmt.Errorf("MemFileBytes this(%v) Not Equal that(%v)", this.MemFileBytes, that1.MemFileBytes) - } - if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { - if *this.MemAnonBytes != *that1.MemAnonBytes { - return fmt.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", *this.MemAnonBytes, *that1.MemAnonBytes) - } - } else if this.MemAnonBytes != nil { - return fmt.Errorf("this.MemAnonBytes == nil && that.MemAnonBytes != nil") - } else if that1.MemAnonBytes != nil { - return fmt.Errorf("MemAnonBytes this(%v) Not Equal that(%v)", this.MemAnonBytes, that1.MemAnonBytes) - } - if this.MemCacheBytes != nil && that1.MemCacheBytes != nil { - if *this.MemCacheBytes != *that1.MemCacheBytes { - return fmt.Errorf("MemCacheBytes this(%v) Not Equal that(%v)", *this.MemCacheBytes, *that1.MemCacheBytes) - } - } else if this.MemCacheBytes != nil { - return fmt.Errorf("this.MemCacheBytes == nil && that.MemCacheBytes != nil") - } else if that1.MemCacheBytes != nil { - return fmt.Errorf("MemCacheBytes this(%v) Not Equal that(%v)", this.MemCacheBytes, that1.MemCacheBytes) - } - if this.MemRssBytes != nil && that1.MemRssBytes != nil { - if *this.MemRssBytes != *that1.MemRssBytes { - return fmt.Errorf("MemRssBytes this(%v) Not Equal that(%v)", *this.MemRssBytes, *that1.MemRssBytes) - } - } else if this.MemRssBytes != nil { - return fmt.Errorf("this.MemRssBytes == nil && that.MemRssBytes != nil") - } else if that1.MemRssBytes != nil { - return fmt.Errorf("MemRssBytes this(%v) Not Equal that(%v)", this.MemRssBytes, that1.MemRssBytes) - } - if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { - if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { - return fmt.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", *this.MemMappedFileBytes, *that1.MemMappedFileBytes) - } - } else if this.MemMappedFileBytes != nil { - return fmt.Errorf("this.MemMappedFileBytes == nil && that.MemMappedFileBytes != nil") - } else if that1.MemMappedFileBytes != nil { - return fmt.Errorf("MemMappedFileBytes this(%v) Not Equal that(%v)", this.MemMappedFileBytes, that1.MemMappedFileBytes) - } - if this.MemSwapBytes != nil && that1.MemSwapBytes != nil { - if *this.MemSwapBytes != *that1.MemSwapBytes { - return fmt.Errorf("MemSwapBytes this(%v) Not Equal that(%v)", *this.MemSwapBytes, *that1.MemSwapBytes) - } - } else if this.MemSwapBytes != nil { - return fmt.Errorf("this.MemSwapBytes == nil && that.MemSwapBytes != nil") - } else if that1.MemSwapBytes != nil { - return fmt.Errorf("MemSwapBytes this(%v) Not Equal that(%v)", this.MemSwapBytes, that1.MemSwapBytes) - } - if this.MemUnevictableBytes != nil && that1.MemUnevictableBytes != nil { - if *this.MemUnevictableBytes != *that1.MemUnevictableBytes { - return fmt.Errorf("MemUnevictableBytes this(%v) Not Equal that(%v)", *this.MemUnevictableBytes, *that1.MemUnevictableBytes) - } - } else if this.MemUnevictableBytes != nil { - return fmt.Errorf("this.MemUnevictableBytes == nil && that.MemUnevictableBytes != nil") - } else if that1.MemUnevictableBytes != nil { - return fmt.Errorf("MemUnevictableBytes this(%v) Not Equal that(%v)", this.MemUnevictableBytes, that1.MemUnevictableBytes) - } - if this.MemLowPressureCounter != nil && that1.MemLowPressureCounter != nil { - if *this.MemLowPressureCounter != *that1.MemLowPressureCounter { - return fmt.Errorf("MemLowPressureCounter this(%v) Not Equal that(%v)", *this.MemLowPressureCounter, *that1.MemLowPressureCounter) - } - } else if this.MemLowPressureCounter != nil { - return fmt.Errorf("this.MemLowPressureCounter == nil && that.MemLowPressureCounter != nil") - } else if that1.MemLowPressureCounter != nil { - return fmt.Errorf("MemLowPressureCounter this(%v) Not Equal that(%v)", this.MemLowPressureCounter, that1.MemLowPressureCounter) - } - if this.MemMediumPressureCounter != nil && that1.MemMediumPressureCounter != nil { - if *this.MemMediumPressureCounter != *that1.MemMediumPressureCounter { - return fmt.Errorf("MemMediumPressureCounter this(%v) Not Equal that(%v)", *this.MemMediumPressureCounter, *that1.MemMediumPressureCounter) - } - } else if this.MemMediumPressureCounter != nil { - return fmt.Errorf("this.MemMediumPressureCounter == nil && that.MemMediumPressureCounter != nil") - } else if that1.MemMediumPressureCounter != nil { - return fmt.Errorf("MemMediumPressureCounter this(%v) Not Equal that(%v)", this.MemMediumPressureCounter, that1.MemMediumPressureCounter) - } - if this.MemCriticalPressureCounter != nil && that1.MemCriticalPressureCounter != nil { - if *this.MemCriticalPressureCounter != *that1.MemCriticalPressureCounter { - return fmt.Errorf("MemCriticalPressureCounter this(%v) Not Equal that(%v)", *this.MemCriticalPressureCounter, *that1.MemCriticalPressureCounter) - } - } else if this.MemCriticalPressureCounter != nil { - return fmt.Errorf("this.MemCriticalPressureCounter == nil && that.MemCriticalPressureCounter != nil") - } else if that1.MemCriticalPressureCounter != nil { - return fmt.Errorf("MemCriticalPressureCounter this(%v) Not Equal that(%v)", this.MemCriticalPressureCounter, that1.MemCriticalPressureCounter) - } - if this.DiskLimitBytes != nil && that1.DiskLimitBytes != nil { - if *this.DiskLimitBytes != *that1.DiskLimitBytes { - return fmt.Errorf("DiskLimitBytes this(%v) Not Equal that(%v)", *this.DiskLimitBytes, *that1.DiskLimitBytes) - } - } else if this.DiskLimitBytes != nil { - return fmt.Errorf("this.DiskLimitBytes == nil && that.DiskLimitBytes != nil") - } else if that1.DiskLimitBytes != nil { - return fmt.Errorf("DiskLimitBytes this(%v) Not Equal that(%v)", this.DiskLimitBytes, that1.DiskLimitBytes) - } - if this.DiskUsedBytes != nil && that1.DiskUsedBytes != nil { - if *this.DiskUsedBytes != *that1.DiskUsedBytes { - return fmt.Errorf("DiskUsedBytes this(%v) Not Equal that(%v)", *this.DiskUsedBytes, *that1.DiskUsedBytes) - } - } else if this.DiskUsedBytes != nil { - return fmt.Errorf("this.DiskUsedBytes == nil && that.DiskUsedBytes != nil") - } else if that1.DiskUsedBytes != nil { - return fmt.Errorf("DiskUsedBytes this(%v) Not Equal that(%v)", this.DiskUsedBytes, that1.DiskUsedBytes) - } - if !this.Perf.Equal(that1.Perf) { - return fmt.Errorf("Perf this(%v) Not Equal that(%v)", this.Perf, that1.Perf) - } - if this.NetRxPackets != nil && that1.NetRxPackets != nil { - if *this.NetRxPackets != *that1.NetRxPackets { - return fmt.Errorf("NetRxPackets this(%v) Not Equal that(%v)", *this.NetRxPackets, *that1.NetRxPackets) - } - } else if this.NetRxPackets != nil { - return fmt.Errorf("this.NetRxPackets == nil && that.NetRxPackets != nil") - } else if that1.NetRxPackets != nil { - return fmt.Errorf("NetRxPackets this(%v) Not Equal that(%v)", this.NetRxPackets, that1.NetRxPackets) - } - if this.NetRxBytes != nil && that1.NetRxBytes != nil { - if *this.NetRxBytes != *that1.NetRxBytes { - return fmt.Errorf("NetRxBytes this(%v) Not Equal that(%v)", *this.NetRxBytes, *that1.NetRxBytes) - } - } else if this.NetRxBytes != nil { - return fmt.Errorf("this.NetRxBytes == nil && that.NetRxBytes != nil") - } else if that1.NetRxBytes != nil { - return fmt.Errorf("NetRxBytes this(%v) Not Equal that(%v)", this.NetRxBytes, that1.NetRxBytes) - } - if this.NetRxErrors != nil && that1.NetRxErrors != nil { - if *this.NetRxErrors != *that1.NetRxErrors { - return fmt.Errorf("NetRxErrors this(%v) Not Equal that(%v)", *this.NetRxErrors, *that1.NetRxErrors) - } - } else if this.NetRxErrors != nil { - return fmt.Errorf("this.NetRxErrors == nil && that.NetRxErrors != nil") - } else if that1.NetRxErrors != nil { - return fmt.Errorf("NetRxErrors this(%v) Not Equal that(%v)", this.NetRxErrors, that1.NetRxErrors) - } - if this.NetRxDropped != nil && that1.NetRxDropped != nil { - if *this.NetRxDropped != *that1.NetRxDropped { - return fmt.Errorf("NetRxDropped this(%v) Not Equal that(%v)", *this.NetRxDropped, *that1.NetRxDropped) - } - } else if this.NetRxDropped != nil { - return fmt.Errorf("this.NetRxDropped == nil && that.NetRxDropped != nil") - } else if that1.NetRxDropped != nil { - return fmt.Errorf("NetRxDropped this(%v) Not Equal that(%v)", this.NetRxDropped, that1.NetRxDropped) - } - if this.NetTxPackets != nil && that1.NetTxPackets != nil { - if *this.NetTxPackets != *that1.NetTxPackets { - return fmt.Errorf("NetTxPackets this(%v) Not Equal that(%v)", *this.NetTxPackets, *that1.NetTxPackets) - } - } else if this.NetTxPackets != nil { - return fmt.Errorf("this.NetTxPackets == nil && that.NetTxPackets != nil") - } else if that1.NetTxPackets != nil { - return fmt.Errorf("NetTxPackets this(%v) Not Equal that(%v)", this.NetTxPackets, that1.NetTxPackets) - } - if this.NetTxBytes != nil && that1.NetTxBytes != nil { - if *this.NetTxBytes != *that1.NetTxBytes { - return fmt.Errorf("NetTxBytes this(%v) Not Equal that(%v)", *this.NetTxBytes, *that1.NetTxBytes) - } - } else if this.NetTxBytes != nil { - return fmt.Errorf("this.NetTxBytes == nil && that.NetTxBytes != nil") - } else if that1.NetTxBytes != nil { - return fmt.Errorf("NetTxBytes this(%v) Not Equal that(%v)", this.NetTxBytes, that1.NetTxBytes) - } - if this.NetTxErrors != nil && that1.NetTxErrors != nil { - if *this.NetTxErrors != *that1.NetTxErrors { - return fmt.Errorf("NetTxErrors this(%v) Not Equal that(%v)", *this.NetTxErrors, *that1.NetTxErrors) - } - } else if this.NetTxErrors != nil { - return fmt.Errorf("this.NetTxErrors == nil && that.NetTxErrors != nil") - } else if that1.NetTxErrors != nil { - return fmt.Errorf("NetTxErrors this(%v) Not Equal that(%v)", this.NetTxErrors, that1.NetTxErrors) - } - if this.NetTxDropped != nil && that1.NetTxDropped != nil { - if *this.NetTxDropped != *that1.NetTxDropped { - return fmt.Errorf("NetTxDropped this(%v) Not Equal that(%v)", *this.NetTxDropped, *that1.NetTxDropped) - } - } else if this.NetTxDropped != nil { - return fmt.Errorf("this.NetTxDropped == nil && that.NetTxDropped != nil") - } else if that1.NetTxDropped != nil { - return fmt.Errorf("NetTxDropped this(%v) Not Equal that(%v)", this.NetTxDropped, that1.NetTxDropped) - } - if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { - if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { - return fmt.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP50, *that1.NetTcpRttMicrosecsP50) - } - } else if this.NetTcpRttMicrosecsP50 != nil { - return fmt.Errorf("this.NetTcpRttMicrosecsP50 == nil && that.NetTcpRttMicrosecsP50 != nil") - } else if that1.NetTcpRttMicrosecsP50 != nil { - return fmt.Errorf("NetTcpRttMicrosecsP50 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP50, that1.NetTcpRttMicrosecsP50) - } - if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { - if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { - return fmt.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP90, *that1.NetTcpRttMicrosecsP90) - } - } else if this.NetTcpRttMicrosecsP90 != nil { - return fmt.Errorf("this.NetTcpRttMicrosecsP90 == nil && that.NetTcpRttMicrosecsP90 != nil") - } else if that1.NetTcpRttMicrosecsP90 != nil { - return fmt.Errorf("NetTcpRttMicrosecsP90 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP90, that1.NetTcpRttMicrosecsP90) - } - if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { - if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { - return fmt.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP95, *that1.NetTcpRttMicrosecsP95) - } - } else if this.NetTcpRttMicrosecsP95 != nil { - return fmt.Errorf("this.NetTcpRttMicrosecsP95 == nil && that.NetTcpRttMicrosecsP95 != nil") - } else if that1.NetTcpRttMicrosecsP95 != nil { - return fmt.Errorf("NetTcpRttMicrosecsP95 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP95, that1.NetTcpRttMicrosecsP95) - } - if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { - if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { - return fmt.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", *this.NetTcpRttMicrosecsP99, *that1.NetTcpRttMicrosecsP99) - } - } else if this.NetTcpRttMicrosecsP99 != nil { - return fmt.Errorf("this.NetTcpRttMicrosecsP99 == nil && that.NetTcpRttMicrosecsP99 != nil") - } else if that1.NetTcpRttMicrosecsP99 != nil { - return fmt.Errorf("NetTcpRttMicrosecsP99 this(%v) Not Equal that(%v)", this.NetTcpRttMicrosecsP99, that1.NetTcpRttMicrosecsP99) - } - if this.NetTcpActiveConnections != nil && that1.NetTcpActiveConnections != nil { - if *this.NetTcpActiveConnections != *that1.NetTcpActiveConnections { - return fmt.Errorf("NetTcpActiveConnections this(%v) Not Equal that(%v)", *this.NetTcpActiveConnections, *that1.NetTcpActiveConnections) - } - } else if this.NetTcpActiveConnections != nil { - return fmt.Errorf("this.NetTcpActiveConnections == nil && that.NetTcpActiveConnections != nil") - } else if that1.NetTcpActiveConnections != nil { - return fmt.Errorf("NetTcpActiveConnections this(%v) Not Equal that(%v)", this.NetTcpActiveConnections, that1.NetTcpActiveConnections) - } - if this.NetTcpTimeWaitConnections != nil && that1.NetTcpTimeWaitConnections != nil { - if *this.NetTcpTimeWaitConnections != *that1.NetTcpTimeWaitConnections { - return fmt.Errorf("NetTcpTimeWaitConnections this(%v) Not Equal that(%v)", *this.NetTcpTimeWaitConnections, *that1.NetTcpTimeWaitConnections) - } - } else if this.NetTcpTimeWaitConnections != nil { - return fmt.Errorf("this.NetTcpTimeWaitConnections == nil && that.NetTcpTimeWaitConnections != nil") - } else if that1.NetTcpTimeWaitConnections != nil { - return fmt.Errorf("NetTcpTimeWaitConnections this(%v) Not Equal that(%v)", this.NetTcpTimeWaitConnections, that1.NetTcpTimeWaitConnections) - } - if len(this.NetTrafficControlStatistics) != len(that1.NetTrafficControlStatistics) { - return fmt.Errorf("NetTrafficControlStatistics this(%v) Not Equal that(%v)", len(this.NetTrafficControlStatistics), len(that1.NetTrafficControlStatistics)) - } - for i := range this.NetTrafficControlStatistics { - if !this.NetTrafficControlStatistics[i].Equal(that1.NetTrafficControlStatistics[i]) { - return fmt.Errorf("NetTrafficControlStatistics this[%v](%v) Not Equal that[%v](%v)", i, this.NetTrafficControlStatistics[i], i, that1.NetTrafficControlStatistics[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ResourceStatistics) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ResourceStatistics) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false - } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false - } - if this.Processes != nil && that1.Processes != nil { - if *this.Processes != *that1.Processes { - return false - } - } else if this.Processes != nil { - return false - } else if that1.Processes != nil { - return false - } - if this.Threads != nil && that1.Threads != nil { - if *this.Threads != *that1.Threads { - return false - } - } else if this.Threads != nil { - return false - } else if that1.Threads != nil { - return false - } - if this.CpusUserTimeSecs != nil && that1.CpusUserTimeSecs != nil { - if *this.CpusUserTimeSecs != *that1.CpusUserTimeSecs { - return false - } - } else if this.CpusUserTimeSecs != nil { - return false - } else if that1.CpusUserTimeSecs != nil { - return false - } - if this.CpusSystemTimeSecs != nil && that1.CpusSystemTimeSecs != nil { - if *this.CpusSystemTimeSecs != *that1.CpusSystemTimeSecs { - return false - } - } else if this.CpusSystemTimeSecs != nil { - return false - } else if that1.CpusSystemTimeSecs != nil { - return false - } - if this.CpusLimit != nil && that1.CpusLimit != nil { - if *this.CpusLimit != *that1.CpusLimit { - return false - } - } else if this.CpusLimit != nil { - return false - } else if that1.CpusLimit != nil { - return false - } - if this.CpusNrPeriods != nil && that1.CpusNrPeriods != nil { - if *this.CpusNrPeriods != *that1.CpusNrPeriods { - return false - } - } else if this.CpusNrPeriods != nil { - return false - } else if that1.CpusNrPeriods != nil { - return false - } - if this.CpusNrThrottled != nil && that1.CpusNrThrottled != nil { - if *this.CpusNrThrottled != *that1.CpusNrThrottled { - return false - } - } else if this.CpusNrThrottled != nil { - return false - } else if that1.CpusNrThrottled != nil { - return false - } - if this.CpusThrottledTimeSecs != nil && that1.CpusThrottledTimeSecs != nil { - if *this.CpusThrottledTimeSecs != *that1.CpusThrottledTimeSecs { - return false - } - } else if this.CpusThrottledTimeSecs != nil { - return false - } else if that1.CpusThrottledTimeSecs != nil { - return false - } - if this.MemTotalBytes != nil && that1.MemTotalBytes != nil { - if *this.MemTotalBytes != *that1.MemTotalBytes { - return false - } - } else if this.MemTotalBytes != nil { - return false - } else if that1.MemTotalBytes != nil { - return false - } - if this.MemTotalMemswBytes != nil && that1.MemTotalMemswBytes != nil { - if *this.MemTotalMemswBytes != *that1.MemTotalMemswBytes { - return false - } - } else if this.MemTotalMemswBytes != nil { - return false - } else if that1.MemTotalMemswBytes != nil { - return false - } - if this.MemLimitBytes != nil && that1.MemLimitBytes != nil { - if *this.MemLimitBytes != *that1.MemLimitBytes { - return false - } - } else if this.MemLimitBytes != nil { - return false - } else if that1.MemLimitBytes != nil { - return false - } - if this.MemSoftLimitBytes != nil && that1.MemSoftLimitBytes != nil { - if *this.MemSoftLimitBytes != *that1.MemSoftLimitBytes { - return false - } - } else if this.MemSoftLimitBytes != nil { - return false - } else if that1.MemSoftLimitBytes != nil { - return false - } - if this.MemFileBytes != nil && that1.MemFileBytes != nil { - if *this.MemFileBytes != *that1.MemFileBytes { - return false - } - } else if this.MemFileBytes != nil { - return false - } else if that1.MemFileBytes != nil { - return false - } - if this.MemAnonBytes != nil && that1.MemAnonBytes != nil { - if *this.MemAnonBytes != *that1.MemAnonBytes { - return false - } - } else if this.MemAnonBytes != nil { - return false - } else if that1.MemAnonBytes != nil { - return false - } - if this.MemCacheBytes != nil && that1.MemCacheBytes != nil { - if *this.MemCacheBytes != *that1.MemCacheBytes { - return false - } - } else if this.MemCacheBytes != nil { - return false - } else if that1.MemCacheBytes != nil { - return false - } - if this.MemRssBytes != nil && that1.MemRssBytes != nil { - if *this.MemRssBytes != *that1.MemRssBytes { - return false - } - } else if this.MemRssBytes != nil { - return false - } else if that1.MemRssBytes != nil { - return false - } - if this.MemMappedFileBytes != nil && that1.MemMappedFileBytes != nil { - if *this.MemMappedFileBytes != *that1.MemMappedFileBytes { - return false - } - } else if this.MemMappedFileBytes != nil { - return false - } else if that1.MemMappedFileBytes != nil { - return false - } - if this.MemSwapBytes != nil && that1.MemSwapBytes != nil { - if *this.MemSwapBytes != *that1.MemSwapBytes { - return false - } - } else if this.MemSwapBytes != nil { - return false - } else if that1.MemSwapBytes != nil { - return false - } - if this.MemUnevictableBytes != nil && that1.MemUnevictableBytes != nil { - if *this.MemUnevictableBytes != *that1.MemUnevictableBytes { - return false - } - } else if this.MemUnevictableBytes != nil { - return false - } else if that1.MemUnevictableBytes != nil { - return false - } - if this.MemLowPressureCounter != nil && that1.MemLowPressureCounter != nil { - if *this.MemLowPressureCounter != *that1.MemLowPressureCounter { - return false - } - } else if this.MemLowPressureCounter != nil { - return false - } else if that1.MemLowPressureCounter != nil { - return false - } - if this.MemMediumPressureCounter != nil && that1.MemMediumPressureCounter != nil { - if *this.MemMediumPressureCounter != *that1.MemMediumPressureCounter { - return false - } - } else if this.MemMediumPressureCounter != nil { - return false - } else if that1.MemMediumPressureCounter != nil { - return false - } - if this.MemCriticalPressureCounter != nil && that1.MemCriticalPressureCounter != nil { - if *this.MemCriticalPressureCounter != *that1.MemCriticalPressureCounter { - return false - } - } else if this.MemCriticalPressureCounter != nil { - return false - } else if that1.MemCriticalPressureCounter != nil { - return false - } - if this.DiskLimitBytes != nil && that1.DiskLimitBytes != nil { - if *this.DiskLimitBytes != *that1.DiskLimitBytes { - return false - } - } else if this.DiskLimitBytes != nil { - return false - } else if that1.DiskLimitBytes != nil { - return false - } - if this.DiskUsedBytes != nil && that1.DiskUsedBytes != nil { - if *this.DiskUsedBytes != *that1.DiskUsedBytes { - return false - } - } else if this.DiskUsedBytes != nil { - return false - } else if that1.DiskUsedBytes != nil { - return false - } - if !this.Perf.Equal(that1.Perf) { - return false - } - if this.NetRxPackets != nil && that1.NetRxPackets != nil { - if *this.NetRxPackets != *that1.NetRxPackets { - return false - } - } else if this.NetRxPackets != nil { - return false - } else if that1.NetRxPackets != nil { - return false - } - if this.NetRxBytes != nil && that1.NetRxBytes != nil { - if *this.NetRxBytes != *that1.NetRxBytes { - return false - } - } else if this.NetRxBytes != nil { - return false - } else if that1.NetRxBytes != nil { - return false - } - if this.NetRxErrors != nil && that1.NetRxErrors != nil { - if *this.NetRxErrors != *that1.NetRxErrors { - return false - } - } else if this.NetRxErrors != nil { - return false - } else if that1.NetRxErrors != nil { - return false - } - if this.NetRxDropped != nil && that1.NetRxDropped != nil { - if *this.NetRxDropped != *that1.NetRxDropped { - return false - } - } else if this.NetRxDropped != nil { - return false - } else if that1.NetRxDropped != nil { - return false - } - if this.NetTxPackets != nil && that1.NetTxPackets != nil { - if *this.NetTxPackets != *that1.NetTxPackets { - return false - } - } else if this.NetTxPackets != nil { - return false - } else if that1.NetTxPackets != nil { - return false - } - if this.NetTxBytes != nil && that1.NetTxBytes != nil { - if *this.NetTxBytes != *that1.NetTxBytes { - return false - } - } else if this.NetTxBytes != nil { - return false - } else if that1.NetTxBytes != nil { - return false - } - if this.NetTxErrors != nil && that1.NetTxErrors != nil { - if *this.NetTxErrors != *that1.NetTxErrors { - return false - } - } else if this.NetTxErrors != nil { - return false - } else if that1.NetTxErrors != nil { - return false - } - if this.NetTxDropped != nil && that1.NetTxDropped != nil { - if *this.NetTxDropped != *that1.NetTxDropped { - return false - } - } else if this.NetTxDropped != nil { - return false - } else if that1.NetTxDropped != nil { - return false - } - if this.NetTcpRttMicrosecsP50 != nil && that1.NetTcpRttMicrosecsP50 != nil { - if *this.NetTcpRttMicrosecsP50 != *that1.NetTcpRttMicrosecsP50 { - return false - } - } else if this.NetTcpRttMicrosecsP50 != nil { - return false - } else if that1.NetTcpRttMicrosecsP50 != nil { - return false - } - if this.NetTcpRttMicrosecsP90 != nil && that1.NetTcpRttMicrosecsP90 != nil { - if *this.NetTcpRttMicrosecsP90 != *that1.NetTcpRttMicrosecsP90 { - return false - } - } else if this.NetTcpRttMicrosecsP90 != nil { - return false - } else if that1.NetTcpRttMicrosecsP90 != nil { - return false - } - if this.NetTcpRttMicrosecsP95 != nil && that1.NetTcpRttMicrosecsP95 != nil { - if *this.NetTcpRttMicrosecsP95 != *that1.NetTcpRttMicrosecsP95 { - return false - } - } else if this.NetTcpRttMicrosecsP95 != nil { - return false - } else if that1.NetTcpRttMicrosecsP95 != nil { - return false - } - if this.NetTcpRttMicrosecsP99 != nil && that1.NetTcpRttMicrosecsP99 != nil { - if *this.NetTcpRttMicrosecsP99 != *that1.NetTcpRttMicrosecsP99 { - return false - } - } else if this.NetTcpRttMicrosecsP99 != nil { - return false - } else if that1.NetTcpRttMicrosecsP99 != nil { - return false - } - if this.NetTcpActiveConnections != nil && that1.NetTcpActiveConnections != nil { - if *this.NetTcpActiveConnections != *that1.NetTcpActiveConnections { - return false - } - } else if this.NetTcpActiveConnections != nil { - return false - } else if that1.NetTcpActiveConnections != nil { - return false - } - if this.NetTcpTimeWaitConnections != nil && that1.NetTcpTimeWaitConnections != nil { - if *this.NetTcpTimeWaitConnections != *that1.NetTcpTimeWaitConnections { - return false - } - } else if this.NetTcpTimeWaitConnections != nil { - return false - } else if that1.NetTcpTimeWaitConnections != nil { - return false - } - if len(this.NetTrafficControlStatistics) != len(that1.NetTrafficControlStatistics) { - return false - } - for i := range this.NetTrafficControlStatistics { - if !this.NetTrafficControlStatistics[i].Equal(that1.NetTrafficControlStatistics[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ResourceUsage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ResourceUsage) - if !ok { - return fmt.Errorf("that is not of type *ResourceUsage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ResourceUsage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ResourceUsagebut is not nil && this == nil") - } - if len(this.Executors) != len(that1.Executors) { - return fmt.Errorf("Executors this(%v) Not Equal that(%v)", len(this.Executors), len(that1.Executors)) - } - for i := range this.Executors { - if !this.Executors[i].Equal(that1.Executors[i]) { - return fmt.Errorf("Executors this[%v](%v) Not Equal that[%v](%v)", i, this.Executors[i], i, that1.Executors[i]) - } - } - if len(this.Total) != len(that1.Total) { - return fmt.Errorf("Total this(%v) Not Equal that(%v)", len(this.Total), len(that1.Total)) - } - for i := range this.Total { - if !this.Total[i].Equal(that1.Total[i]) { - return fmt.Errorf("Total this[%v](%v) Not Equal that[%v](%v)", i, this.Total[i], i, that1.Total[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ResourceUsage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ResourceUsage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Executors) != len(that1.Executors) { - return false - } - for i := range this.Executors { - if !this.Executors[i].Equal(that1.Executors[i]) { - return false - } - } - if len(this.Total) != len(that1.Total) { - return false - } - for i := range this.Total { - if !this.Total[i].Equal(that1.Total[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ResourceUsage_Executor) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ResourceUsage_Executor) - if !ok { - return fmt.Errorf("that is not of type *ResourceUsage_Executor") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ResourceUsage_Executor but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ResourceUsage_Executorbut is not nil && this == nil") - } - if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { - return fmt.Errorf("ExecutorInfo this(%v) Not Equal that(%v)", this.ExecutorInfo, that1.ExecutorInfo) - } - if len(this.Allocated) != len(that1.Allocated) { - return fmt.Errorf("Allocated this(%v) Not Equal that(%v)", len(this.Allocated), len(that1.Allocated)) - } - for i := range this.Allocated { - if !this.Allocated[i].Equal(that1.Allocated[i]) { - return fmt.Errorf("Allocated this[%v](%v) Not Equal that[%v](%v)", i, this.Allocated[i], i, that1.Allocated[i]) - } - } - if !this.Statistics.Equal(that1.Statistics) { - return fmt.Errorf("Statistics this(%v) Not Equal that(%v)", this.Statistics, that1.Statistics) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ResourceUsage_Executor) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ResourceUsage_Executor) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { - return false - } - if len(this.Allocated) != len(that1.Allocated) { - return false - } - for i := range this.Allocated { - if !this.Allocated[i].Equal(that1.Allocated[i]) { - return false - } - } - if !this.Statistics.Equal(that1.Statistics) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *PerfStatistics) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*PerfStatistics) - if !ok { - return fmt.Errorf("that is not of type *PerfStatistics") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *PerfStatistics but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *PerfStatisticsbut is not nil && this == nil") - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) - } - } else if this.Timestamp != nil { - return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) - } - if this.Duration != nil && that1.Duration != nil { - if *this.Duration != *that1.Duration { - return fmt.Errorf("Duration this(%v) Not Equal that(%v)", *this.Duration, *that1.Duration) - } - } else if this.Duration != nil { - return fmt.Errorf("this.Duration == nil && that.Duration != nil") - } else if that1.Duration != nil { - return fmt.Errorf("Duration this(%v) Not Equal that(%v)", this.Duration, that1.Duration) - } - if this.Cycles != nil && that1.Cycles != nil { - if *this.Cycles != *that1.Cycles { - return fmt.Errorf("Cycles this(%v) Not Equal that(%v)", *this.Cycles, *that1.Cycles) - } - } else if this.Cycles != nil { - return fmt.Errorf("this.Cycles == nil && that.Cycles != nil") - } else if that1.Cycles != nil { - return fmt.Errorf("Cycles this(%v) Not Equal that(%v)", this.Cycles, that1.Cycles) - } - if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { - if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { - return fmt.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", *this.StalledCyclesFrontend, *that1.StalledCyclesFrontend) - } - } else if this.StalledCyclesFrontend != nil { - return fmt.Errorf("this.StalledCyclesFrontend == nil && that.StalledCyclesFrontend != nil") - } else if that1.StalledCyclesFrontend != nil { - return fmt.Errorf("StalledCyclesFrontend this(%v) Not Equal that(%v)", this.StalledCyclesFrontend, that1.StalledCyclesFrontend) - } - if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { - if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { - return fmt.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", *this.StalledCyclesBackend, *that1.StalledCyclesBackend) - } - } else if this.StalledCyclesBackend != nil { - return fmt.Errorf("this.StalledCyclesBackend == nil && that.StalledCyclesBackend != nil") - } else if that1.StalledCyclesBackend != nil { - return fmt.Errorf("StalledCyclesBackend this(%v) Not Equal that(%v)", this.StalledCyclesBackend, that1.StalledCyclesBackend) - } - if this.Instructions != nil && that1.Instructions != nil { - if *this.Instructions != *that1.Instructions { - return fmt.Errorf("Instructions this(%v) Not Equal that(%v)", *this.Instructions, *that1.Instructions) - } - } else if this.Instructions != nil { - return fmt.Errorf("this.Instructions == nil && that.Instructions != nil") - } else if that1.Instructions != nil { - return fmt.Errorf("Instructions this(%v) Not Equal that(%v)", this.Instructions, that1.Instructions) - } - if this.CacheReferences != nil && that1.CacheReferences != nil { - if *this.CacheReferences != *that1.CacheReferences { - return fmt.Errorf("CacheReferences this(%v) Not Equal that(%v)", *this.CacheReferences, *that1.CacheReferences) - } - } else if this.CacheReferences != nil { - return fmt.Errorf("this.CacheReferences == nil && that.CacheReferences != nil") - } else if that1.CacheReferences != nil { - return fmt.Errorf("CacheReferences this(%v) Not Equal that(%v)", this.CacheReferences, that1.CacheReferences) - } - if this.CacheMisses != nil && that1.CacheMisses != nil { - if *this.CacheMisses != *that1.CacheMisses { - return fmt.Errorf("CacheMisses this(%v) Not Equal that(%v)", *this.CacheMisses, *that1.CacheMisses) - } - } else if this.CacheMisses != nil { - return fmt.Errorf("this.CacheMisses == nil && that.CacheMisses != nil") - } else if that1.CacheMisses != nil { - return fmt.Errorf("CacheMisses this(%v) Not Equal that(%v)", this.CacheMisses, that1.CacheMisses) - } - if this.Branches != nil && that1.Branches != nil { - if *this.Branches != *that1.Branches { - return fmt.Errorf("Branches this(%v) Not Equal that(%v)", *this.Branches, *that1.Branches) - } - } else if this.Branches != nil { - return fmt.Errorf("this.Branches == nil && that.Branches != nil") - } else if that1.Branches != nil { - return fmt.Errorf("Branches this(%v) Not Equal that(%v)", this.Branches, that1.Branches) - } - if this.BranchMisses != nil && that1.BranchMisses != nil { - if *this.BranchMisses != *that1.BranchMisses { - return fmt.Errorf("BranchMisses this(%v) Not Equal that(%v)", *this.BranchMisses, *that1.BranchMisses) - } - } else if this.BranchMisses != nil { - return fmt.Errorf("this.BranchMisses == nil && that.BranchMisses != nil") - } else if that1.BranchMisses != nil { - return fmt.Errorf("BranchMisses this(%v) Not Equal that(%v)", this.BranchMisses, that1.BranchMisses) - } - if this.BusCycles != nil && that1.BusCycles != nil { - if *this.BusCycles != *that1.BusCycles { - return fmt.Errorf("BusCycles this(%v) Not Equal that(%v)", *this.BusCycles, *that1.BusCycles) - } - } else if this.BusCycles != nil { - return fmt.Errorf("this.BusCycles == nil && that.BusCycles != nil") - } else if that1.BusCycles != nil { - return fmt.Errorf("BusCycles this(%v) Not Equal that(%v)", this.BusCycles, that1.BusCycles) - } - if this.RefCycles != nil && that1.RefCycles != nil { - if *this.RefCycles != *that1.RefCycles { - return fmt.Errorf("RefCycles this(%v) Not Equal that(%v)", *this.RefCycles, *that1.RefCycles) - } - } else if this.RefCycles != nil { - return fmt.Errorf("this.RefCycles == nil && that.RefCycles != nil") - } else if that1.RefCycles != nil { - return fmt.Errorf("RefCycles this(%v) Not Equal that(%v)", this.RefCycles, that1.RefCycles) - } - if this.CpuClock != nil && that1.CpuClock != nil { - if *this.CpuClock != *that1.CpuClock { - return fmt.Errorf("CpuClock this(%v) Not Equal that(%v)", *this.CpuClock, *that1.CpuClock) - } - } else if this.CpuClock != nil { - return fmt.Errorf("this.CpuClock == nil && that.CpuClock != nil") - } else if that1.CpuClock != nil { - return fmt.Errorf("CpuClock this(%v) Not Equal that(%v)", this.CpuClock, that1.CpuClock) - } - if this.TaskClock != nil && that1.TaskClock != nil { - if *this.TaskClock != *that1.TaskClock { - return fmt.Errorf("TaskClock this(%v) Not Equal that(%v)", *this.TaskClock, *that1.TaskClock) - } - } else if this.TaskClock != nil { - return fmt.Errorf("this.TaskClock == nil && that.TaskClock != nil") - } else if that1.TaskClock != nil { - return fmt.Errorf("TaskClock this(%v) Not Equal that(%v)", this.TaskClock, that1.TaskClock) - } - if this.PageFaults != nil && that1.PageFaults != nil { - if *this.PageFaults != *that1.PageFaults { - return fmt.Errorf("PageFaults this(%v) Not Equal that(%v)", *this.PageFaults, *that1.PageFaults) - } - } else if this.PageFaults != nil { - return fmt.Errorf("this.PageFaults == nil && that.PageFaults != nil") - } else if that1.PageFaults != nil { - return fmt.Errorf("PageFaults this(%v) Not Equal that(%v)", this.PageFaults, that1.PageFaults) - } - if this.MinorFaults != nil && that1.MinorFaults != nil { - if *this.MinorFaults != *that1.MinorFaults { - return fmt.Errorf("MinorFaults this(%v) Not Equal that(%v)", *this.MinorFaults, *that1.MinorFaults) - } - } else if this.MinorFaults != nil { - return fmt.Errorf("this.MinorFaults == nil && that.MinorFaults != nil") - } else if that1.MinorFaults != nil { - return fmt.Errorf("MinorFaults this(%v) Not Equal that(%v)", this.MinorFaults, that1.MinorFaults) - } - if this.MajorFaults != nil && that1.MajorFaults != nil { - if *this.MajorFaults != *that1.MajorFaults { - return fmt.Errorf("MajorFaults this(%v) Not Equal that(%v)", *this.MajorFaults, *that1.MajorFaults) - } - } else if this.MajorFaults != nil { - return fmt.Errorf("this.MajorFaults == nil && that.MajorFaults != nil") - } else if that1.MajorFaults != nil { - return fmt.Errorf("MajorFaults this(%v) Not Equal that(%v)", this.MajorFaults, that1.MajorFaults) - } - if this.ContextSwitches != nil && that1.ContextSwitches != nil { - if *this.ContextSwitches != *that1.ContextSwitches { - return fmt.Errorf("ContextSwitches this(%v) Not Equal that(%v)", *this.ContextSwitches, *that1.ContextSwitches) - } - } else if this.ContextSwitches != nil { - return fmt.Errorf("this.ContextSwitches == nil && that.ContextSwitches != nil") - } else if that1.ContextSwitches != nil { - return fmt.Errorf("ContextSwitches this(%v) Not Equal that(%v)", this.ContextSwitches, that1.ContextSwitches) - } - if this.CpuMigrations != nil && that1.CpuMigrations != nil { - if *this.CpuMigrations != *that1.CpuMigrations { - return fmt.Errorf("CpuMigrations this(%v) Not Equal that(%v)", *this.CpuMigrations, *that1.CpuMigrations) - } - } else if this.CpuMigrations != nil { - return fmt.Errorf("this.CpuMigrations == nil && that.CpuMigrations != nil") - } else if that1.CpuMigrations != nil { - return fmt.Errorf("CpuMigrations this(%v) Not Equal that(%v)", this.CpuMigrations, that1.CpuMigrations) - } - if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { - if *this.AlignmentFaults != *that1.AlignmentFaults { - return fmt.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", *this.AlignmentFaults, *that1.AlignmentFaults) - } - } else if this.AlignmentFaults != nil { - return fmt.Errorf("this.AlignmentFaults == nil && that.AlignmentFaults != nil") - } else if that1.AlignmentFaults != nil { - return fmt.Errorf("AlignmentFaults this(%v) Not Equal that(%v)", this.AlignmentFaults, that1.AlignmentFaults) - } - if this.EmulationFaults != nil && that1.EmulationFaults != nil { - if *this.EmulationFaults != *that1.EmulationFaults { - return fmt.Errorf("EmulationFaults this(%v) Not Equal that(%v)", *this.EmulationFaults, *that1.EmulationFaults) - } - } else if this.EmulationFaults != nil { - return fmt.Errorf("this.EmulationFaults == nil && that.EmulationFaults != nil") - } else if that1.EmulationFaults != nil { - return fmt.Errorf("EmulationFaults this(%v) Not Equal that(%v)", this.EmulationFaults, that1.EmulationFaults) - } - if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { - if *this.L1DcacheLoads != *that1.L1DcacheLoads { - return fmt.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", *this.L1DcacheLoads, *that1.L1DcacheLoads) - } - } else if this.L1DcacheLoads != nil { - return fmt.Errorf("this.L1DcacheLoads == nil && that.L1DcacheLoads != nil") - } else if that1.L1DcacheLoads != nil { - return fmt.Errorf("L1DcacheLoads this(%v) Not Equal that(%v)", this.L1DcacheLoads, that1.L1DcacheLoads) - } - if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { - if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { - return fmt.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1DcacheLoadMisses, *that1.L1DcacheLoadMisses) - } - } else if this.L1DcacheLoadMisses != nil { - return fmt.Errorf("this.L1DcacheLoadMisses == nil && that.L1DcacheLoadMisses != nil") - } else if that1.L1DcacheLoadMisses != nil { - return fmt.Errorf("L1DcacheLoadMisses this(%v) Not Equal that(%v)", this.L1DcacheLoadMisses, that1.L1DcacheLoadMisses) - } - if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { - if *this.L1DcacheStores != *that1.L1DcacheStores { - return fmt.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", *this.L1DcacheStores, *that1.L1DcacheStores) - } - } else if this.L1DcacheStores != nil { - return fmt.Errorf("this.L1DcacheStores == nil && that.L1DcacheStores != nil") - } else if that1.L1DcacheStores != nil { - return fmt.Errorf("L1DcacheStores this(%v) Not Equal that(%v)", this.L1DcacheStores, that1.L1DcacheStores) - } - if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { - if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { - return fmt.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", *this.L1DcacheStoreMisses, *that1.L1DcacheStoreMisses) - } - } else if this.L1DcacheStoreMisses != nil { - return fmt.Errorf("this.L1DcacheStoreMisses == nil && that.L1DcacheStoreMisses != nil") - } else if that1.L1DcacheStoreMisses != nil { - return fmt.Errorf("L1DcacheStoreMisses this(%v) Not Equal that(%v)", this.L1DcacheStoreMisses, that1.L1DcacheStoreMisses) - } - if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { - if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { - return fmt.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", *this.L1DcachePrefetches, *that1.L1DcachePrefetches) - } - } else if this.L1DcachePrefetches != nil { - return fmt.Errorf("this.L1DcachePrefetches == nil && that.L1DcachePrefetches != nil") - } else if that1.L1DcachePrefetches != nil { - return fmt.Errorf("L1DcachePrefetches this(%v) Not Equal that(%v)", this.L1DcachePrefetches, that1.L1DcachePrefetches) - } - if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { - if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { - return fmt.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1DcachePrefetchMisses, *that1.L1DcachePrefetchMisses) - } - } else if this.L1DcachePrefetchMisses != nil { - return fmt.Errorf("this.L1DcachePrefetchMisses == nil && that.L1DcachePrefetchMisses != nil") - } else if that1.L1DcachePrefetchMisses != nil { - return fmt.Errorf("L1DcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1DcachePrefetchMisses, that1.L1DcachePrefetchMisses) - } - if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { - if *this.L1IcacheLoads != *that1.L1IcacheLoads { - return fmt.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", *this.L1IcacheLoads, *that1.L1IcacheLoads) - } - } else if this.L1IcacheLoads != nil { - return fmt.Errorf("this.L1IcacheLoads == nil && that.L1IcacheLoads != nil") - } else if that1.L1IcacheLoads != nil { - return fmt.Errorf("L1IcacheLoads this(%v) Not Equal that(%v)", this.L1IcacheLoads, that1.L1IcacheLoads) - } - if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { - if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { - return fmt.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", *this.L1IcacheLoadMisses, *that1.L1IcacheLoadMisses) - } - } else if this.L1IcacheLoadMisses != nil { - return fmt.Errorf("this.L1IcacheLoadMisses == nil && that.L1IcacheLoadMisses != nil") - } else if that1.L1IcacheLoadMisses != nil { - return fmt.Errorf("L1IcacheLoadMisses this(%v) Not Equal that(%v)", this.L1IcacheLoadMisses, that1.L1IcacheLoadMisses) - } - if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { - if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { - return fmt.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", *this.L1IcachePrefetches, *that1.L1IcachePrefetches) - } - } else if this.L1IcachePrefetches != nil { - return fmt.Errorf("this.L1IcachePrefetches == nil && that.L1IcachePrefetches != nil") - } else if that1.L1IcachePrefetches != nil { - return fmt.Errorf("L1IcachePrefetches this(%v) Not Equal that(%v)", this.L1IcachePrefetches, that1.L1IcachePrefetches) - } - if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { - if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { - return fmt.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", *this.L1IcachePrefetchMisses, *that1.L1IcachePrefetchMisses) - } - } else if this.L1IcachePrefetchMisses != nil { - return fmt.Errorf("this.L1IcachePrefetchMisses == nil && that.L1IcachePrefetchMisses != nil") - } else if that1.L1IcachePrefetchMisses != nil { - return fmt.Errorf("L1IcachePrefetchMisses this(%v) Not Equal that(%v)", this.L1IcachePrefetchMisses, that1.L1IcachePrefetchMisses) - } - if this.LlcLoads != nil && that1.LlcLoads != nil { - if *this.LlcLoads != *that1.LlcLoads { - return fmt.Errorf("LlcLoads this(%v) Not Equal that(%v)", *this.LlcLoads, *that1.LlcLoads) - } - } else if this.LlcLoads != nil { - return fmt.Errorf("this.LlcLoads == nil && that.LlcLoads != nil") - } else if that1.LlcLoads != nil { - return fmt.Errorf("LlcLoads this(%v) Not Equal that(%v)", this.LlcLoads, that1.LlcLoads) - } - if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { - if *this.LlcLoadMisses != *that1.LlcLoadMisses { - return fmt.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", *this.LlcLoadMisses, *that1.LlcLoadMisses) - } - } else if this.LlcLoadMisses != nil { - return fmt.Errorf("this.LlcLoadMisses == nil && that.LlcLoadMisses != nil") - } else if that1.LlcLoadMisses != nil { - return fmt.Errorf("LlcLoadMisses this(%v) Not Equal that(%v)", this.LlcLoadMisses, that1.LlcLoadMisses) - } - if this.LlcStores != nil && that1.LlcStores != nil { - if *this.LlcStores != *that1.LlcStores { - return fmt.Errorf("LlcStores this(%v) Not Equal that(%v)", *this.LlcStores, *that1.LlcStores) - } - } else if this.LlcStores != nil { - return fmt.Errorf("this.LlcStores == nil && that.LlcStores != nil") - } else if that1.LlcStores != nil { - return fmt.Errorf("LlcStores this(%v) Not Equal that(%v)", this.LlcStores, that1.LlcStores) - } - if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { - if *this.LlcStoreMisses != *that1.LlcStoreMisses { - return fmt.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", *this.LlcStoreMisses, *that1.LlcStoreMisses) - } - } else if this.LlcStoreMisses != nil { - return fmt.Errorf("this.LlcStoreMisses == nil && that.LlcStoreMisses != nil") - } else if that1.LlcStoreMisses != nil { - return fmt.Errorf("LlcStoreMisses this(%v) Not Equal that(%v)", this.LlcStoreMisses, that1.LlcStoreMisses) - } - if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { - if *this.LlcPrefetches != *that1.LlcPrefetches { - return fmt.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", *this.LlcPrefetches, *that1.LlcPrefetches) - } - } else if this.LlcPrefetches != nil { - return fmt.Errorf("this.LlcPrefetches == nil && that.LlcPrefetches != nil") - } else if that1.LlcPrefetches != nil { - return fmt.Errorf("LlcPrefetches this(%v) Not Equal that(%v)", this.LlcPrefetches, that1.LlcPrefetches) - } - if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { - if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { - return fmt.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", *this.LlcPrefetchMisses, *that1.LlcPrefetchMisses) - } - } else if this.LlcPrefetchMisses != nil { - return fmt.Errorf("this.LlcPrefetchMisses == nil && that.LlcPrefetchMisses != nil") - } else if that1.LlcPrefetchMisses != nil { - return fmt.Errorf("LlcPrefetchMisses this(%v) Not Equal that(%v)", this.LlcPrefetchMisses, that1.LlcPrefetchMisses) - } - if this.DtlbLoads != nil && that1.DtlbLoads != nil { - if *this.DtlbLoads != *that1.DtlbLoads { - return fmt.Errorf("DtlbLoads this(%v) Not Equal that(%v)", *this.DtlbLoads, *that1.DtlbLoads) - } - } else if this.DtlbLoads != nil { - return fmt.Errorf("this.DtlbLoads == nil && that.DtlbLoads != nil") - } else if that1.DtlbLoads != nil { - return fmt.Errorf("DtlbLoads this(%v) Not Equal that(%v)", this.DtlbLoads, that1.DtlbLoads) - } - if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { - if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { - return fmt.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", *this.DtlbLoadMisses, *that1.DtlbLoadMisses) - } - } else if this.DtlbLoadMisses != nil { - return fmt.Errorf("this.DtlbLoadMisses == nil && that.DtlbLoadMisses != nil") - } else if that1.DtlbLoadMisses != nil { - return fmt.Errorf("DtlbLoadMisses this(%v) Not Equal that(%v)", this.DtlbLoadMisses, that1.DtlbLoadMisses) - } - if this.DtlbStores != nil && that1.DtlbStores != nil { - if *this.DtlbStores != *that1.DtlbStores { - return fmt.Errorf("DtlbStores this(%v) Not Equal that(%v)", *this.DtlbStores, *that1.DtlbStores) - } - } else if this.DtlbStores != nil { - return fmt.Errorf("this.DtlbStores == nil && that.DtlbStores != nil") - } else if that1.DtlbStores != nil { - return fmt.Errorf("DtlbStores this(%v) Not Equal that(%v)", this.DtlbStores, that1.DtlbStores) - } - if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { - if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { - return fmt.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", *this.DtlbStoreMisses, *that1.DtlbStoreMisses) - } - } else if this.DtlbStoreMisses != nil { - return fmt.Errorf("this.DtlbStoreMisses == nil && that.DtlbStoreMisses != nil") - } else if that1.DtlbStoreMisses != nil { - return fmt.Errorf("DtlbStoreMisses this(%v) Not Equal that(%v)", this.DtlbStoreMisses, that1.DtlbStoreMisses) - } - if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { - if *this.DtlbPrefetches != *that1.DtlbPrefetches { - return fmt.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", *this.DtlbPrefetches, *that1.DtlbPrefetches) - } - } else if this.DtlbPrefetches != nil { - return fmt.Errorf("this.DtlbPrefetches == nil && that.DtlbPrefetches != nil") - } else if that1.DtlbPrefetches != nil { - return fmt.Errorf("DtlbPrefetches this(%v) Not Equal that(%v)", this.DtlbPrefetches, that1.DtlbPrefetches) - } - if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { - if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { - return fmt.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", *this.DtlbPrefetchMisses, *that1.DtlbPrefetchMisses) - } - } else if this.DtlbPrefetchMisses != nil { - return fmt.Errorf("this.DtlbPrefetchMisses == nil && that.DtlbPrefetchMisses != nil") - } else if that1.DtlbPrefetchMisses != nil { - return fmt.Errorf("DtlbPrefetchMisses this(%v) Not Equal that(%v)", this.DtlbPrefetchMisses, that1.DtlbPrefetchMisses) - } - if this.ItlbLoads != nil && that1.ItlbLoads != nil { - if *this.ItlbLoads != *that1.ItlbLoads { - return fmt.Errorf("ItlbLoads this(%v) Not Equal that(%v)", *this.ItlbLoads, *that1.ItlbLoads) - } - } else if this.ItlbLoads != nil { - return fmt.Errorf("this.ItlbLoads == nil && that.ItlbLoads != nil") - } else if that1.ItlbLoads != nil { - return fmt.Errorf("ItlbLoads this(%v) Not Equal that(%v)", this.ItlbLoads, that1.ItlbLoads) - } - if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { - if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { - return fmt.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", *this.ItlbLoadMisses, *that1.ItlbLoadMisses) - } - } else if this.ItlbLoadMisses != nil { - return fmt.Errorf("this.ItlbLoadMisses == nil && that.ItlbLoadMisses != nil") - } else if that1.ItlbLoadMisses != nil { - return fmt.Errorf("ItlbLoadMisses this(%v) Not Equal that(%v)", this.ItlbLoadMisses, that1.ItlbLoadMisses) - } - if this.BranchLoads != nil && that1.BranchLoads != nil { - if *this.BranchLoads != *that1.BranchLoads { - return fmt.Errorf("BranchLoads this(%v) Not Equal that(%v)", *this.BranchLoads, *that1.BranchLoads) - } - } else if this.BranchLoads != nil { - return fmt.Errorf("this.BranchLoads == nil && that.BranchLoads != nil") - } else if that1.BranchLoads != nil { - return fmt.Errorf("BranchLoads this(%v) Not Equal that(%v)", this.BranchLoads, that1.BranchLoads) - } - if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { - if *this.BranchLoadMisses != *that1.BranchLoadMisses { - return fmt.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", *this.BranchLoadMisses, *that1.BranchLoadMisses) - } - } else if this.BranchLoadMisses != nil { - return fmt.Errorf("this.BranchLoadMisses == nil && that.BranchLoadMisses != nil") - } else if that1.BranchLoadMisses != nil { - return fmt.Errorf("BranchLoadMisses this(%v) Not Equal that(%v)", this.BranchLoadMisses, that1.BranchLoadMisses) - } - if this.NodeLoads != nil && that1.NodeLoads != nil { - if *this.NodeLoads != *that1.NodeLoads { - return fmt.Errorf("NodeLoads this(%v) Not Equal that(%v)", *this.NodeLoads, *that1.NodeLoads) - } - } else if this.NodeLoads != nil { - return fmt.Errorf("this.NodeLoads == nil && that.NodeLoads != nil") - } else if that1.NodeLoads != nil { - return fmt.Errorf("NodeLoads this(%v) Not Equal that(%v)", this.NodeLoads, that1.NodeLoads) - } - if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { - if *this.NodeLoadMisses != *that1.NodeLoadMisses { - return fmt.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", *this.NodeLoadMisses, *that1.NodeLoadMisses) - } - } else if this.NodeLoadMisses != nil { - return fmt.Errorf("this.NodeLoadMisses == nil && that.NodeLoadMisses != nil") - } else if that1.NodeLoadMisses != nil { - return fmt.Errorf("NodeLoadMisses this(%v) Not Equal that(%v)", this.NodeLoadMisses, that1.NodeLoadMisses) - } - if this.NodeStores != nil && that1.NodeStores != nil { - if *this.NodeStores != *that1.NodeStores { - return fmt.Errorf("NodeStores this(%v) Not Equal that(%v)", *this.NodeStores, *that1.NodeStores) - } - } else if this.NodeStores != nil { - return fmt.Errorf("this.NodeStores == nil && that.NodeStores != nil") - } else if that1.NodeStores != nil { - return fmt.Errorf("NodeStores this(%v) Not Equal that(%v)", this.NodeStores, that1.NodeStores) - } - if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { - if *this.NodeStoreMisses != *that1.NodeStoreMisses { - return fmt.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", *this.NodeStoreMisses, *that1.NodeStoreMisses) - } - } else if this.NodeStoreMisses != nil { - return fmt.Errorf("this.NodeStoreMisses == nil && that.NodeStoreMisses != nil") - } else if that1.NodeStoreMisses != nil { - return fmt.Errorf("NodeStoreMisses this(%v) Not Equal that(%v)", this.NodeStoreMisses, that1.NodeStoreMisses) - } - if this.NodePrefetches != nil && that1.NodePrefetches != nil { - if *this.NodePrefetches != *that1.NodePrefetches { - return fmt.Errorf("NodePrefetches this(%v) Not Equal that(%v)", *this.NodePrefetches, *that1.NodePrefetches) - } - } else if this.NodePrefetches != nil { - return fmt.Errorf("this.NodePrefetches == nil && that.NodePrefetches != nil") - } else if that1.NodePrefetches != nil { - return fmt.Errorf("NodePrefetches this(%v) Not Equal that(%v)", this.NodePrefetches, that1.NodePrefetches) - } - if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { - if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { - return fmt.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", *this.NodePrefetchMisses, *that1.NodePrefetchMisses) - } - } else if this.NodePrefetchMisses != nil { - return fmt.Errorf("this.NodePrefetchMisses == nil && that.NodePrefetchMisses != nil") - } else if that1.NodePrefetchMisses != nil { - return fmt.Errorf("NodePrefetchMisses this(%v) Not Equal that(%v)", this.NodePrefetchMisses, that1.NodePrefetchMisses) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *PerfStatistics) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PerfStatistics) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false - } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false - } - if this.Duration != nil && that1.Duration != nil { - if *this.Duration != *that1.Duration { - return false - } - } else if this.Duration != nil { - return false - } else if that1.Duration != nil { - return false - } - if this.Cycles != nil && that1.Cycles != nil { - if *this.Cycles != *that1.Cycles { - return false - } - } else if this.Cycles != nil { - return false - } else if that1.Cycles != nil { - return false - } - if this.StalledCyclesFrontend != nil && that1.StalledCyclesFrontend != nil { - if *this.StalledCyclesFrontend != *that1.StalledCyclesFrontend { - return false - } - } else if this.StalledCyclesFrontend != nil { - return false - } else if that1.StalledCyclesFrontend != nil { - return false - } - if this.StalledCyclesBackend != nil && that1.StalledCyclesBackend != nil { - if *this.StalledCyclesBackend != *that1.StalledCyclesBackend { - return false - } - } else if this.StalledCyclesBackend != nil { - return false - } else if that1.StalledCyclesBackend != nil { - return false - } - if this.Instructions != nil && that1.Instructions != nil { - if *this.Instructions != *that1.Instructions { - return false - } - } else if this.Instructions != nil { - return false - } else if that1.Instructions != nil { - return false - } - if this.CacheReferences != nil && that1.CacheReferences != nil { - if *this.CacheReferences != *that1.CacheReferences { - return false - } - } else if this.CacheReferences != nil { - return false - } else if that1.CacheReferences != nil { - return false - } - if this.CacheMisses != nil && that1.CacheMisses != nil { - if *this.CacheMisses != *that1.CacheMisses { - return false - } - } else if this.CacheMisses != nil { - return false - } else if that1.CacheMisses != nil { - return false - } - if this.Branches != nil && that1.Branches != nil { - if *this.Branches != *that1.Branches { - return false - } - } else if this.Branches != nil { - return false - } else if that1.Branches != nil { - return false - } - if this.BranchMisses != nil && that1.BranchMisses != nil { - if *this.BranchMisses != *that1.BranchMisses { - return false - } - } else if this.BranchMisses != nil { - return false - } else if that1.BranchMisses != nil { - return false - } - if this.BusCycles != nil && that1.BusCycles != nil { - if *this.BusCycles != *that1.BusCycles { - return false - } - } else if this.BusCycles != nil { - return false - } else if that1.BusCycles != nil { - return false - } - if this.RefCycles != nil && that1.RefCycles != nil { - if *this.RefCycles != *that1.RefCycles { - return false - } - } else if this.RefCycles != nil { - return false - } else if that1.RefCycles != nil { - return false - } - if this.CpuClock != nil && that1.CpuClock != nil { - if *this.CpuClock != *that1.CpuClock { - return false - } - } else if this.CpuClock != nil { - return false - } else if that1.CpuClock != nil { - return false - } - if this.TaskClock != nil && that1.TaskClock != nil { - if *this.TaskClock != *that1.TaskClock { - return false - } - } else if this.TaskClock != nil { - return false - } else if that1.TaskClock != nil { - return false - } - if this.PageFaults != nil && that1.PageFaults != nil { - if *this.PageFaults != *that1.PageFaults { - return false - } - } else if this.PageFaults != nil { - return false - } else if that1.PageFaults != nil { - return false - } - if this.MinorFaults != nil && that1.MinorFaults != nil { - if *this.MinorFaults != *that1.MinorFaults { - return false - } - } else if this.MinorFaults != nil { - return false - } else if that1.MinorFaults != nil { - return false - } - if this.MajorFaults != nil && that1.MajorFaults != nil { - if *this.MajorFaults != *that1.MajorFaults { - return false - } - } else if this.MajorFaults != nil { - return false - } else if that1.MajorFaults != nil { - return false - } - if this.ContextSwitches != nil && that1.ContextSwitches != nil { - if *this.ContextSwitches != *that1.ContextSwitches { - return false - } - } else if this.ContextSwitches != nil { - return false - } else if that1.ContextSwitches != nil { - return false - } - if this.CpuMigrations != nil && that1.CpuMigrations != nil { - if *this.CpuMigrations != *that1.CpuMigrations { - return false - } - } else if this.CpuMigrations != nil { - return false - } else if that1.CpuMigrations != nil { - return false - } - if this.AlignmentFaults != nil && that1.AlignmentFaults != nil { - if *this.AlignmentFaults != *that1.AlignmentFaults { - return false - } - } else if this.AlignmentFaults != nil { - return false - } else if that1.AlignmentFaults != nil { - return false - } - if this.EmulationFaults != nil && that1.EmulationFaults != nil { - if *this.EmulationFaults != *that1.EmulationFaults { - return false - } - } else if this.EmulationFaults != nil { - return false - } else if that1.EmulationFaults != nil { - return false - } - if this.L1DcacheLoads != nil && that1.L1DcacheLoads != nil { - if *this.L1DcacheLoads != *that1.L1DcacheLoads { - return false - } - } else if this.L1DcacheLoads != nil { - return false - } else if that1.L1DcacheLoads != nil { - return false - } - if this.L1DcacheLoadMisses != nil && that1.L1DcacheLoadMisses != nil { - if *this.L1DcacheLoadMisses != *that1.L1DcacheLoadMisses { - return false - } - } else if this.L1DcacheLoadMisses != nil { - return false - } else if that1.L1DcacheLoadMisses != nil { - return false - } - if this.L1DcacheStores != nil && that1.L1DcacheStores != nil { - if *this.L1DcacheStores != *that1.L1DcacheStores { - return false - } - } else if this.L1DcacheStores != nil { - return false - } else if that1.L1DcacheStores != nil { - return false - } - if this.L1DcacheStoreMisses != nil && that1.L1DcacheStoreMisses != nil { - if *this.L1DcacheStoreMisses != *that1.L1DcacheStoreMisses { - return false - } - } else if this.L1DcacheStoreMisses != nil { - return false - } else if that1.L1DcacheStoreMisses != nil { - return false - } - if this.L1DcachePrefetches != nil && that1.L1DcachePrefetches != nil { - if *this.L1DcachePrefetches != *that1.L1DcachePrefetches { - return false - } - } else if this.L1DcachePrefetches != nil { - return false - } else if that1.L1DcachePrefetches != nil { - return false - } - if this.L1DcachePrefetchMisses != nil && that1.L1DcachePrefetchMisses != nil { - if *this.L1DcachePrefetchMisses != *that1.L1DcachePrefetchMisses { - return false - } - } else if this.L1DcachePrefetchMisses != nil { - return false - } else if that1.L1DcachePrefetchMisses != nil { - return false - } - if this.L1IcacheLoads != nil && that1.L1IcacheLoads != nil { - if *this.L1IcacheLoads != *that1.L1IcacheLoads { - return false - } - } else if this.L1IcacheLoads != nil { - return false - } else if that1.L1IcacheLoads != nil { - return false - } - if this.L1IcacheLoadMisses != nil && that1.L1IcacheLoadMisses != nil { - if *this.L1IcacheLoadMisses != *that1.L1IcacheLoadMisses { - return false - } - } else if this.L1IcacheLoadMisses != nil { - return false - } else if that1.L1IcacheLoadMisses != nil { - return false - } - if this.L1IcachePrefetches != nil && that1.L1IcachePrefetches != nil { - if *this.L1IcachePrefetches != *that1.L1IcachePrefetches { - return false - } - } else if this.L1IcachePrefetches != nil { - return false - } else if that1.L1IcachePrefetches != nil { - return false - } - if this.L1IcachePrefetchMisses != nil && that1.L1IcachePrefetchMisses != nil { - if *this.L1IcachePrefetchMisses != *that1.L1IcachePrefetchMisses { - return false - } - } else if this.L1IcachePrefetchMisses != nil { - return false - } else if that1.L1IcachePrefetchMisses != nil { - return false - } - if this.LlcLoads != nil && that1.LlcLoads != nil { - if *this.LlcLoads != *that1.LlcLoads { - return false - } - } else if this.LlcLoads != nil { - return false - } else if that1.LlcLoads != nil { - return false - } - if this.LlcLoadMisses != nil && that1.LlcLoadMisses != nil { - if *this.LlcLoadMisses != *that1.LlcLoadMisses { - return false - } - } else if this.LlcLoadMisses != nil { - return false - } else if that1.LlcLoadMisses != nil { - return false - } - if this.LlcStores != nil && that1.LlcStores != nil { - if *this.LlcStores != *that1.LlcStores { - return false - } - } else if this.LlcStores != nil { - return false - } else if that1.LlcStores != nil { - return false - } - if this.LlcStoreMisses != nil && that1.LlcStoreMisses != nil { - if *this.LlcStoreMisses != *that1.LlcStoreMisses { - return false - } - } else if this.LlcStoreMisses != nil { - return false - } else if that1.LlcStoreMisses != nil { - return false - } - if this.LlcPrefetches != nil && that1.LlcPrefetches != nil { - if *this.LlcPrefetches != *that1.LlcPrefetches { - return false - } - } else if this.LlcPrefetches != nil { - return false - } else if that1.LlcPrefetches != nil { - return false - } - if this.LlcPrefetchMisses != nil && that1.LlcPrefetchMisses != nil { - if *this.LlcPrefetchMisses != *that1.LlcPrefetchMisses { - return false - } - } else if this.LlcPrefetchMisses != nil { - return false - } else if that1.LlcPrefetchMisses != nil { - return false - } - if this.DtlbLoads != nil && that1.DtlbLoads != nil { - if *this.DtlbLoads != *that1.DtlbLoads { - return false - } - } else if this.DtlbLoads != nil { - return false - } else if that1.DtlbLoads != nil { - return false - } - if this.DtlbLoadMisses != nil && that1.DtlbLoadMisses != nil { - if *this.DtlbLoadMisses != *that1.DtlbLoadMisses { - return false - } - } else if this.DtlbLoadMisses != nil { - return false - } else if that1.DtlbLoadMisses != nil { - return false - } - if this.DtlbStores != nil && that1.DtlbStores != nil { - if *this.DtlbStores != *that1.DtlbStores { - return false - } - } else if this.DtlbStores != nil { - return false - } else if that1.DtlbStores != nil { - return false - } - if this.DtlbStoreMisses != nil && that1.DtlbStoreMisses != nil { - if *this.DtlbStoreMisses != *that1.DtlbStoreMisses { - return false - } - } else if this.DtlbStoreMisses != nil { - return false - } else if that1.DtlbStoreMisses != nil { - return false - } - if this.DtlbPrefetches != nil && that1.DtlbPrefetches != nil { - if *this.DtlbPrefetches != *that1.DtlbPrefetches { - return false - } - } else if this.DtlbPrefetches != nil { - return false - } else if that1.DtlbPrefetches != nil { - return false - } - if this.DtlbPrefetchMisses != nil && that1.DtlbPrefetchMisses != nil { - if *this.DtlbPrefetchMisses != *that1.DtlbPrefetchMisses { - return false - } - } else if this.DtlbPrefetchMisses != nil { - return false - } else if that1.DtlbPrefetchMisses != nil { - return false - } - if this.ItlbLoads != nil && that1.ItlbLoads != nil { - if *this.ItlbLoads != *that1.ItlbLoads { - return false - } - } else if this.ItlbLoads != nil { - return false - } else if that1.ItlbLoads != nil { - return false - } - if this.ItlbLoadMisses != nil && that1.ItlbLoadMisses != nil { - if *this.ItlbLoadMisses != *that1.ItlbLoadMisses { - return false - } - } else if this.ItlbLoadMisses != nil { - return false - } else if that1.ItlbLoadMisses != nil { - return false - } - if this.BranchLoads != nil && that1.BranchLoads != nil { - if *this.BranchLoads != *that1.BranchLoads { - return false - } - } else if this.BranchLoads != nil { - return false - } else if that1.BranchLoads != nil { - return false - } - if this.BranchLoadMisses != nil && that1.BranchLoadMisses != nil { - if *this.BranchLoadMisses != *that1.BranchLoadMisses { - return false - } - } else if this.BranchLoadMisses != nil { - return false - } else if that1.BranchLoadMisses != nil { - return false - } - if this.NodeLoads != nil && that1.NodeLoads != nil { - if *this.NodeLoads != *that1.NodeLoads { - return false - } - } else if this.NodeLoads != nil { - return false - } else if that1.NodeLoads != nil { - return false - } - if this.NodeLoadMisses != nil && that1.NodeLoadMisses != nil { - if *this.NodeLoadMisses != *that1.NodeLoadMisses { - return false - } - } else if this.NodeLoadMisses != nil { - return false - } else if that1.NodeLoadMisses != nil { - return false - } - if this.NodeStores != nil && that1.NodeStores != nil { - if *this.NodeStores != *that1.NodeStores { - return false - } - } else if this.NodeStores != nil { - return false - } else if that1.NodeStores != nil { - return false - } - if this.NodeStoreMisses != nil && that1.NodeStoreMisses != nil { - if *this.NodeStoreMisses != *that1.NodeStoreMisses { - return false - } - } else if this.NodeStoreMisses != nil { - return false - } else if that1.NodeStoreMisses != nil { - return false - } - if this.NodePrefetches != nil && that1.NodePrefetches != nil { - if *this.NodePrefetches != *that1.NodePrefetches { - return false - } - } else if this.NodePrefetches != nil { - return false - } else if that1.NodePrefetches != nil { - return false - } - if this.NodePrefetchMisses != nil && that1.NodePrefetchMisses != nil { - if *this.NodePrefetchMisses != *that1.NodePrefetchMisses { - return false - } - } else if this.NodePrefetchMisses != nil { - return false - } else if that1.NodePrefetchMisses != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Request) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Request) - if !ok { - return fmt.Errorf("that is not of type *Request") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Request but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Requestbut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Request) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Request) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer) - if !ok { - return fmt.Errorf("that is not of type *Offer") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Offer but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Offerbut is not nil && this == nil") - } - if !this.Id.Equal(that1.Id) { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if !this.Url.Equal(that1.Url) { - return fmt.Errorf("Url this(%v) Not Equal that(%v)", this.Url, that1.Url) - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if len(this.Attributes) != len(that1.Attributes) { - return fmt.Errorf("Attributes this(%v) Not Equal that(%v)", len(this.Attributes), len(that1.Attributes)) - } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return fmt.Errorf("Attributes this[%v](%v) Not Equal that[%v](%v)", i, this.Attributes[i], i, that1.Attributes[i]) - } - } - if len(this.ExecutorIds) != len(that1.ExecutorIds) { - return fmt.Errorf("ExecutorIds this(%v) Not Equal that(%v)", len(this.ExecutorIds), len(that1.ExecutorIds)) - } - for i := range this.ExecutorIds { - if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { - return fmt.Errorf("ExecutorIds this[%v](%v) Not Equal that[%v](%v)", i, this.ExecutorIds[i], i, that1.ExecutorIds[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Offer) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Id.Equal(that1.Id) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false - } - if !this.Url.Equal(that1.Url) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if len(this.Attributes) != len(that1.Attributes) { - return false - } - for i := range this.Attributes { - if !this.Attributes[i].Equal(that1.Attributes[i]) { - return false - } - } - if len(this.ExecutorIds) != len(that1.ExecutorIds) { - return false - } - for i := range this.ExecutorIds { - if !this.ExecutorIds[i].Equal(that1.ExecutorIds[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer_Operation) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer_Operation) - if !ok { - return fmt.Errorf("that is not of type *Offer_Operation") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Offer_Operation but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Offer_Operationbut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Launch.Equal(that1.Launch) { - return fmt.Errorf("Launch this(%v) Not Equal that(%v)", this.Launch, that1.Launch) - } - if !this.Reserve.Equal(that1.Reserve) { - return fmt.Errorf("Reserve this(%v) Not Equal that(%v)", this.Reserve, that1.Reserve) - } - if !this.Unreserve.Equal(that1.Unreserve) { - return fmt.Errorf("Unreserve this(%v) Not Equal that(%v)", this.Unreserve, that1.Unreserve) - } - if !this.Create.Equal(that1.Create) { - return fmt.Errorf("Create this(%v) Not Equal that(%v)", this.Create, that1.Create) - } - if !this.Destroy.Equal(that1.Destroy) { - return fmt.Errorf("Destroy this(%v) Not Equal that(%v)", this.Destroy, that1.Destroy) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Offer_Operation) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer_Operation) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Launch.Equal(that1.Launch) { - return false - } - if !this.Reserve.Equal(that1.Reserve) { - return false - } - if !this.Unreserve.Equal(that1.Unreserve) { - return false - } - if !this.Create.Equal(that1.Create) { - return false - } - if !this.Destroy.Equal(that1.Destroy) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer_Operation_Launch) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer_Operation_Launch) - if !ok { - return fmt.Errorf("that is not of type *Offer_Operation_Launch") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Offer_Operation_Launch but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Offer_Operation_Launchbut is not nil && this == nil") - } - if len(this.TaskInfos) != len(that1.TaskInfos) { - return fmt.Errorf("TaskInfos this(%v) Not Equal that(%v)", len(this.TaskInfos), len(that1.TaskInfos)) - } - for i := range this.TaskInfos { - if !this.TaskInfos[i].Equal(that1.TaskInfos[i]) { - return fmt.Errorf("TaskInfos this[%v](%v) Not Equal that[%v](%v)", i, this.TaskInfos[i], i, that1.TaskInfos[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Offer_Operation_Launch) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer_Operation_Launch) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.TaskInfos) != len(that1.TaskInfos) { - return false - } - for i := range this.TaskInfos { - if !this.TaskInfos[i].Equal(that1.TaskInfos[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer_Operation_Reserve) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer_Operation_Reserve) - if !ok { - return fmt.Errorf("that is not of type *Offer_Operation_Reserve") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Offer_Operation_Reserve but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Offer_Operation_Reservebut is not nil && this == nil") - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Offer_Operation_Reserve) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer_Operation_Reserve) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer_Operation_Unreserve) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer_Operation_Unreserve) - if !ok { - return fmt.Errorf("that is not of type *Offer_Operation_Unreserve") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Offer_Operation_Unreserve but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Offer_Operation_Unreservebut is not nil && this == nil") - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Offer_Operation_Unreserve) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer_Operation_Unreserve) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer_Operation_Create) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer_Operation_Create) - if !ok { - return fmt.Errorf("that is not of type *Offer_Operation_Create") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Offer_Operation_Create but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Offer_Operation_Createbut is not nil && this == nil") - } - if len(this.Volumes) != len(that1.Volumes) { - return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Offer_Operation_Create) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer_Operation_Create) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Volumes) != len(that1.Volumes) { - return false - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Offer_Operation_Destroy) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Offer_Operation_Destroy) - if !ok { - return fmt.Errorf("that is not of type *Offer_Operation_Destroy") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Offer_Operation_Destroy but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Offer_Operation_Destroybut is not nil && this == nil") - } - if len(this.Volumes) != len(that1.Volumes) { - return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Offer_Operation_Destroy) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Offer_Operation_Destroy) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Volumes) != len(that1.Volumes) { - return false - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *TaskInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*TaskInfo) - if !ok { - return fmt.Errorf("that is not of type *TaskInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *TaskInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *TaskInfobut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if !this.Executor.Equal(that1.Executor) { - return fmt.Errorf("Executor this(%v) Not Equal that(%v)", this.Executor, that1.Executor) - } - if !this.Command.Equal(that1.Command) { - return fmt.Errorf("Command this(%v) Not Equal that(%v)", this.Command, that1.Command) - } - if !this.Container.Equal(that1.Container) { - return fmt.Errorf("Container this(%v) Not Equal that(%v)", this.Container, that1.Container) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !this.HealthCheck.Equal(that1.HealthCheck) { - return fmt.Errorf("HealthCheck this(%v) Not Equal that(%v)", this.HealthCheck, that1.HealthCheck) - } - if !this.Labels.Equal(that1.Labels) { - return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) - } - if !this.Discovery.Equal(that1.Discovery) { - return fmt.Errorf("Discovery this(%v) Not Equal that(%v)", this.Discovery, that1.Discovery) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *TaskInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TaskInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if !this.Executor.Equal(that1.Executor) { - return false - } - if !this.Command.Equal(that1.Command) { - return false - } - if !this.Container.Equal(that1.Container) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !this.HealthCheck.Equal(that1.HealthCheck) { - return false - } - if !this.Labels.Equal(that1.Labels) { - return false - } - if !this.Discovery.Equal(that1.Discovery) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *TaskStatus) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*TaskStatus) - if !ok { - return fmt.Errorf("that is not of type *TaskStatus") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *TaskStatus but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *TaskStatusbut is not nil && this == nil") - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if this.State != nil && that1.State != nil { - if *this.State != *that1.State { - return fmt.Errorf("State this(%v) Not Equal that(%v)", *this.State, *that1.State) - } - } else if this.State != nil { - return fmt.Errorf("this.State == nil && that.State != nil") - } else if that1.State != nil { - return fmt.Errorf("State this(%v) Not Equal that(%v)", this.State, that1.State) - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) - } - } else if this.Message != nil { - return fmt.Errorf("this.Message == nil && that.Message != nil") - } else if that1.Message != nil { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return fmt.Errorf("Source this(%v) Not Equal that(%v)", *this.Source, *that1.Source) - } - } else if this.Source != nil { - return fmt.Errorf("this.Source == nil && that.Source != nil") - } else if that1.Source != nil { - return fmt.Errorf("Source this(%v) Not Equal that(%v)", this.Source, that1.Source) - } - if this.Reason != nil && that1.Reason != nil { - if *this.Reason != *that1.Reason { - return fmt.Errorf("Reason this(%v) Not Equal that(%v)", *this.Reason, *that1.Reason) - } - } else if this.Reason != nil { - return fmt.Errorf("this.Reason == nil && that.Reason != nil") - } else if that1.Reason != nil { - return fmt.Errorf("Reason this(%v) Not Equal that(%v)", this.Reason, that1.Reason) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) - } - } else if this.Timestamp != nil { - return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) - } - if this.Healthy != nil && that1.Healthy != nil { - if *this.Healthy != *that1.Healthy { - return fmt.Errorf("Healthy this(%v) Not Equal that(%v)", *this.Healthy, *that1.Healthy) - } - } else if this.Healthy != nil { - return fmt.Errorf("this.Healthy == nil && that.Healthy != nil") - } else if that1.Healthy != nil { - return fmt.Errorf("Healthy this(%v) Not Equal that(%v)", this.Healthy, that1.Healthy) - } - if !this.Labels.Equal(that1.Labels) { - return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *TaskStatus) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TaskStatus) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if this.State != nil && that1.State != nil { - if *this.State != *that1.State { - return false - } - } else if this.State != nil { - return false - } else if that1.State != nil { - return false - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return false - } - } else if this.Message != nil { - return false - } else if that1.Message != nil { - return false - } - if this.Source != nil && that1.Source != nil { - if *this.Source != *that1.Source { - return false - } - } else if this.Source != nil { - return false - } else if that1.Source != nil { - return false - } - if this.Reason != nil && that1.Reason != nil { - if *this.Reason != *that1.Reason { - return false - } - } else if this.Reason != nil { - return false - } else if that1.Reason != nil { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false - } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return false - } - if this.Healthy != nil && that1.Healthy != nil { - if *this.Healthy != *that1.Healthy { - return false - } - } else if this.Healthy != nil { - return false - } else if that1.Healthy != nil { - return false - } - if !this.Labels.Equal(that1.Labels) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Filters) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Filters) - if !ok { - return fmt.Errorf("that is not of type *Filters") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Filters but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Filtersbut is not nil && this == nil") - } - if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { - if *this.RefuseSeconds != *that1.RefuseSeconds { - return fmt.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", *this.RefuseSeconds, *that1.RefuseSeconds) - } - } else if this.RefuseSeconds != nil { - return fmt.Errorf("this.RefuseSeconds == nil && that.RefuseSeconds != nil") - } else if that1.RefuseSeconds != nil { - return fmt.Errorf("RefuseSeconds this(%v) Not Equal that(%v)", this.RefuseSeconds, that1.RefuseSeconds) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Filters) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Filters) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.RefuseSeconds != nil && that1.RefuseSeconds != nil { - if *this.RefuseSeconds != *that1.RefuseSeconds { - return false - } - } else if this.RefuseSeconds != nil { - return false - } else if that1.RefuseSeconds != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Environment) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Environment) - if !ok { - return fmt.Errorf("that is not of type *Environment") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Environment but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Environmentbut is not nil && this == nil") - } - if len(this.Variables) != len(that1.Variables) { - return fmt.Errorf("Variables this(%v) Not Equal that(%v)", len(this.Variables), len(that1.Variables)) - } - for i := range this.Variables { - if !this.Variables[i].Equal(that1.Variables[i]) { - return fmt.Errorf("Variables this[%v](%v) Not Equal that[%v](%v)", i, this.Variables[i], i, that1.Variables[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Environment) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Environment) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Variables) != len(that1.Variables) { - return false - } - for i := range this.Variables { - if !this.Variables[i].Equal(that1.Variables[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Environment_Variable) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Environment_Variable) - if !ok { - return fmt.Errorf("that is not of type *Environment_Variable") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Environment_Variable but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Environment_Variablebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Environment_Variable) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Environment_Variable) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Parameter) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Parameter) - if !ok { - return fmt.Errorf("that is not of type *Parameter") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Parameter but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Parameterbut is not nil && this == nil") - } - if this.Key != nil && that1.Key != nil { - if *this.Key != *that1.Key { - return fmt.Errorf("Key this(%v) Not Equal that(%v)", *this.Key, *that1.Key) - } - } else if this.Key != nil { - return fmt.Errorf("this.Key == nil && that.Key != nil") - } else if that1.Key != nil { - return fmt.Errorf("Key this(%v) Not Equal that(%v)", this.Key, that1.Key) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Parameter) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Parameter) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Key != nil && that1.Key != nil { - if *this.Key != *that1.Key { - return false - } - } else if this.Key != nil { - return false - } else if that1.Key != nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Parameters) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Parameters) - if !ok { - return fmt.Errorf("that is not of type *Parameters") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Parameters but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Parametersbut is not nil && this == nil") - } - if len(this.Parameter) != len(that1.Parameter) { - return fmt.Errorf("Parameter this(%v) Not Equal that(%v)", len(this.Parameter), len(that1.Parameter)) - } - for i := range this.Parameter { - if !this.Parameter[i].Equal(that1.Parameter[i]) { - return fmt.Errorf("Parameter this[%v](%v) Not Equal that[%v](%v)", i, this.Parameter[i], i, that1.Parameter[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Parameters) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Parameters) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Parameter) != len(that1.Parameter) { - return false - } - for i := range this.Parameter { - if !this.Parameter[i].Equal(that1.Parameter[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Credential) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Credential) - if !ok { - return fmt.Errorf("that is not of type *Credential") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Credential but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Credentialbut is not nil && this == nil") - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) - } - } else if this.Principal != nil { - return fmt.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) - } - if !bytes.Equal(this.Secret, that1.Secret) { - return fmt.Errorf("Secret this(%v) Not Equal that(%v)", this.Secret, that1.Secret) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Credential) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Credential) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false - } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false - } - if !bytes.Equal(this.Secret, that1.Secret) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Credentials) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Credentials) - if !ok { - return fmt.Errorf("that is not of type *Credentials") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Credentials but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Credentialsbut is not nil && this == nil") - } - if len(this.Credentials) != len(that1.Credentials) { - return fmt.Errorf("Credentials this(%v) Not Equal that(%v)", len(this.Credentials), len(that1.Credentials)) - } - for i := range this.Credentials { - if !this.Credentials[i].Equal(that1.Credentials[i]) { - return fmt.Errorf("Credentials this[%v](%v) Not Equal that[%v](%v)", i, this.Credentials[i], i, that1.Credentials[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Credentials) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Credentials) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Credentials) != len(that1.Credentials) { - return false - } - for i := range this.Credentials { - if !this.Credentials[i].Equal(that1.Credentials[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RateLimit) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RateLimit) - if !ok { - return fmt.Errorf("that is not of type *RateLimit") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RateLimit but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RateLimitbut is not nil && this == nil") - } - if this.Qps != nil && that1.Qps != nil { - if *this.Qps != *that1.Qps { - return fmt.Errorf("Qps this(%v) Not Equal that(%v)", *this.Qps, *that1.Qps) - } - } else if this.Qps != nil { - return fmt.Errorf("this.Qps == nil && that.Qps != nil") - } else if that1.Qps != nil { - return fmt.Errorf("Qps this(%v) Not Equal that(%v)", this.Qps, that1.Qps) - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return fmt.Errorf("Principal this(%v) Not Equal that(%v)", *this.Principal, *that1.Principal) - } - } else if this.Principal != nil { - return fmt.Errorf("this.Principal == nil && that.Principal != nil") - } else if that1.Principal != nil { - return fmt.Errorf("Principal this(%v) Not Equal that(%v)", this.Principal, that1.Principal) - } - if this.Capacity != nil && that1.Capacity != nil { - if *this.Capacity != *that1.Capacity { - return fmt.Errorf("Capacity this(%v) Not Equal that(%v)", *this.Capacity, *that1.Capacity) - } - } else if this.Capacity != nil { - return fmt.Errorf("this.Capacity == nil && that.Capacity != nil") - } else if that1.Capacity != nil { - return fmt.Errorf("Capacity this(%v) Not Equal that(%v)", this.Capacity, that1.Capacity) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RateLimit) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RateLimit) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Qps != nil && that1.Qps != nil { - if *this.Qps != *that1.Qps { - return false - } - } else if this.Qps != nil { - return false - } else if that1.Qps != nil { - return false - } - if this.Principal != nil && that1.Principal != nil { - if *this.Principal != *that1.Principal { - return false - } - } else if this.Principal != nil { - return false - } else if that1.Principal != nil { - return false - } - if this.Capacity != nil && that1.Capacity != nil { - if *this.Capacity != *that1.Capacity { - return false - } - } else if this.Capacity != nil { - return false - } else if that1.Capacity != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RateLimits) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RateLimits) - if !ok { - return fmt.Errorf("that is not of type *RateLimits") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RateLimits but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RateLimitsbut is not nil && this == nil") - } - if len(this.Limits) != len(that1.Limits) { - return fmt.Errorf("Limits this(%v) Not Equal that(%v)", len(this.Limits), len(that1.Limits)) - } - for i := range this.Limits { - if !this.Limits[i].Equal(that1.Limits[i]) { - return fmt.Errorf("Limits this[%v](%v) Not Equal that[%v](%v)", i, this.Limits[i], i, that1.Limits[i]) - } - } - if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { - if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { - return fmt.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", *this.AggregateDefaultQps, *that1.AggregateDefaultQps) - } - } else if this.AggregateDefaultQps != nil { - return fmt.Errorf("this.AggregateDefaultQps == nil && that.AggregateDefaultQps != nil") - } else if that1.AggregateDefaultQps != nil { - return fmt.Errorf("AggregateDefaultQps this(%v) Not Equal that(%v)", this.AggregateDefaultQps, that1.AggregateDefaultQps) - } - if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { - if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { - return fmt.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", *this.AggregateDefaultCapacity, *that1.AggregateDefaultCapacity) - } - } else if this.AggregateDefaultCapacity != nil { - return fmt.Errorf("this.AggregateDefaultCapacity == nil && that.AggregateDefaultCapacity != nil") - } else if that1.AggregateDefaultCapacity != nil { - return fmt.Errorf("AggregateDefaultCapacity this(%v) Not Equal that(%v)", this.AggregateDefaultCapacity, that1.AggregateDefaultCapacity) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RateLimits) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RateLimits) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Limits) != len(that1.Limits) { - return false - } - for i := range this.Limits { - if !this.Limits[i].Equal(that1.Limits[i]) { - return false - } - } - if this.AggregateDefaultQps != nil && that1.AggregateDefaultQps != nil { - if *this.AggregateDefaultQps != *that1.AggregateDefaultQps { - return false - } - } else if this.AggregateDefaultQps != nil { - return false - } else if that1.AggregateDefaultQps != nil { - return false - } - if this.AggregateDefaultCapacity != nil && that1.AggregateDefaultCapacity != nil { - if *this.AggregateDefaultCapacity != *that1.AggregateDefaultCapacity { - return false - } - } else if this.AggregateDefaultCapacity != nil { - return false - } else if that1.AggregateDefaultCapacity != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Image) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Image) - if !ok { - return fmt.Errorf("that is not of type *Image") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Image but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Imagebut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Appc.Equal(that1.Appc) { - return fmt.Errorf("Appc this(%v) Not Equal that(%v)", this.Appc, that1.Appc) - } - if !this.Docker.Equal(that1.Docker) { - return fmt.Errorf("Docker this(%v) Not Equal that(%v)", this.Docker, that1.Docker) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Image) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Image) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Appc.Equal(that1.Appc) { - return false - } - if !this.Docker.Equal(that1.Docker) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Image_AppC) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Image_AppC) - if !ok { - return fmt.Errorf("that is not of type *Image_AppC") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Image_AppC but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Image_AppCbut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", *this.Id, *that1.Id) - } - } else if this.Id != nil { - return fmt.Errorf("this.Id == nil && that.Id != nil") - } else if that1.Id != nil { - return fmt.Errorf("Id this(%v) Not Equal that(%v)", this.Id, that1.Id) - } - if !this.Labels.Equal(that1.Labels) { - return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Image_AppC) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Image_AppC) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Id != nil && that1.Id != nil { - if *this.Id != *that1.Id { - return false - } - } else if this.Id != nil { - return false - } else if that1.Id != nil { - return false - } - if !this.Labels.Equal(that1.Labels) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Image_Docker) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Image_Docker) - if !ok { - return fmt.Errorf("that is not of type *Image_Docker") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Image_Docker but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Image_Dockerbut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Image_Docker) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Image_Docker) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Volume) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Volume) - if !ok { - return fmt.Errorf("that is not of type *Volume") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Volume but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Volumebut is not nil && this == nil") - } - if this.Mode != nil && that1.Mode != nil { - if *this.Mode != *that1.Mode { - return fmt.Errorf("Mode this(%v) Not Equal that(%v)", *this.Mode, *that1.Mode) - } - } else if this.Mode != nil { - return fmt.Errorf("this.Mode == nil && that.Mode != nil") - } else if that1.Mode != nil { - return fmt.Errorf("Mode this(%v) Not Equal that(%v)", this.Mode, that1.Mode) - } - if this.ContainerPath != nil && that1.ContainerPath != nil { - if *this.ContainerPath != *that1.ContainerPath { - return fmt.Errorf("ContainerPath this(%v) Not Equal that(%v)", *this.ContainerPath, *that1.ContainerPath) - } - } else if this.ContainerPath != nil { - return fmt.Errorf("this.ContainerPath == nil && that.ContainerPath != nil") - } else if that1.ContainerPath != nil { - return fmt.Errorf("ContainerPath this(%v) Not Equal that(%v)", this.ContainerPath, that1.ContainerPath) - } - if this.HostPath != nil && that1.HostPath != nil { - if *this.HostPath != *that1.HostPath { - return fmt.Errorf("HostPath this(%v) Not Equal that(%v)", *this.HostPath, *that1.HostPath) - } - } else if this.HostPath != nil { - return fmt.Errorf("this.HostPath == nil && that.HostPath != nil") - } else if that1.HostPath != nil { - return fmt.Errorf("HostPath this(%v) Not Equal that(%v)", this.HostPath, that1.HostPath) - } - if !this.Image.Equal(that1.Image) { - return fmt.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Volume) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Volume) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Mode != nil && that1.Mode != nil { - if *this.Mode != *that1.Mode { - return false - } - } else if this.Mode != nil { - return false - } else if that1.Mode != nil { - return false - } - if this.ContainerPath != nil && that1.ContainerPath != nil { - if *this.ContainerPath != *that1.ContainerPath { - return false - } - } else if this.ContainerPath != nil { - return false - } else if that1.ContainerPath != nil { - return false - } - if this.HostPath != nil && that1.HostPath != nil { - if *this.HostPath != *that1.HostPath { - return false - } - } else if this.HostPath != nil { - return false - } else if that1.HostPath != nil { - return false - } - if !this.Image.Equal(that1.Image) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ContainerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ContainerInfo) - if !ok { - return fmt.Errorf("that is not of type *ContainerInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ContainerInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ContainerInfobut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if len(this.Volumes) != len(that1.Volumes) { - return fmt.Errorf("Volumes this(%v) Not Equal that(%v)", len(this.Volumes), len(that1.Volumes)) - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return fmt.Errorf("Volumes this[%v](%v) Not Equal that[%v](%v)", i, this.Volumes[i], i, that1.Volumes[i]) - } - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", *this.Hostname, *that1.Hostname) - } - } else if this.Hostname != nil { - return fmt.Errorf("this.Hostname == nil && that.Hostname != nil") - } else if that1.Hostname != nil { - return fmt.Errorf("Hostname this(%v) Not Equal that(%v)", this.Hostname, that1.Hostname) - } - if !this.Docker.Equal(that1.Docker) { - return fmt.Errorf("Docker this(%v) Not Equal that(%v)", this.Docker, that1.Docker) - } - if !this.Mesos.Equal(that1.Mesos) { - return fmt.Errorf("Mesos this(%v) Not Equal that(%v)", this.Mesos, that1.Mesos) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ContainerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if len(this.Volumes) != len(that1.Volumes) { - return false - } - for i := range this.Volumes { - if !this.Volumes[i].Equal(that1.Volumes[i]) { - return false - } - } - if this.Hostname != nil && that1.Hostname != nil { - if *this.Hostname != *that1.Hostname { - return false - } - } else if this.Hostname != nil { - return false - } else if that1.Hostname != nil { - return false - } - if !this.Docker.Equal(that1.Docker) { - return false - } - if !this.Mesos.Equal(that1.Mesos) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ContainerInfo_DockerInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ContainerInfo_DockerInfo) - if !ok { - return fmt.Errorf("that is not of type *ContainerInfo_DockerInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ContainerInfo_DockerInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ContainerInfo_DockerInfobut is not nil && this == nil") - } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return fmt.Errorf("Image this(%v) Not Equal that(%v)", *this.Image, *that1.Image) - } - } else if this.Image != nil { - return fmt.Errorf("this.Image == nil && that.Image != nil") - } else if that1.Image != nil { - return fmt.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) - } - if this.Network != nil && that1.Network != nil { - if *this.Network != *that1.Network { - return fmt.Errorf("Network this(%v) Not Equal that(%v)", *this.Network, *that1.Network) - } - } else if this.Network != nil { - return fmt.Errorf("this.Network == nil && that.Network != nil") - } else if that1.Network != nil { - return fmt.Errorf("Network this(%v) Not Equal that(%v)", this.Network, that1.Network) - } - if len(this.PortMappings) != len(that1.PortMappings) { - return fmt.Errorf("PortMappings this(%v) Not Equal that(%v)", len(this.PortMappings), len(that1.PortMappings)) - } - for i := range this.PortMappings { - if !this.PortMappings[i].Equal(that1.PortMappings[i]) { - return fmt.Errorf("PortMappings this[%v](%v) Not Equal that[%v](%v)", i, this.PortMappings[i], i, that1.PortMappings[i]) - } - } - if this.Privileged != nil && that1.Privileged != nil { - if *this.Privileged != *that1.Privileged { - return fmt.Errorf("Privileged this(%v) Not Equal that(%v)", *this.Privileged, *that1.Privileged) - } - } else if this.Privileged != nil { - return fmt.Errorf("this.Privileged == nil && that.Privileged != nil") - } else if that1.Privileged != nil { - return fmt.Errorf("Privileged this(%v) Not Equal that(%v)", this.Privileged, that1.Privileged) - } - if len(this.Parameters) != len(that1.Parameters) { - return fmt.Errorf("Parameters this(%v) Not Equal that(%v)", len(this.Parameters), len(that1.Parameters)) - } - for i := range this.Parameters { - if !this.Parameters[i].Equal(that1.Parameters[i]) { - return fmt.Errorf("Parameters this[%v](%v) Not Equal that[%v](%v)", i, this.Parameters[i], i, that1.Parameters[i]) - } - } - if this.ForcePullImage != nil && that1.ForcePullImage != nil { - if *this.ForcePullImage != *that1.ForcePullImage { - return fmt.Errorf("ForcePullImage this(%v) Not Equal that(%v)", *this.ForcePullImage, *that1.ForcePullImage) - } - } else if this.ForcePullImage != nil { - return fmt.Errorf("this.ForcePullImage == nil && that.ForcePullImage != nil") - } else if that1.ForcePullImage != nil { - return fmt.Errorf("ForcePullImage this(%v) Not Equal that(%v)", this.ForcePullImage, that1.ForcePullImage) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ContainerInfo_DockerInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerInfo_DockerInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Image != nil && that1.Image != nil { - if *this.Image != *that1.Image { - return false - } - } else if this.Image != nil { - return false - } else if that1.Image != nil { - return false - } - if this.Network != nil && that1.Network != nil { - if *this.Network != *that1.Network { - return false - } - } else if this.Network != nil { - return false - } else if that1.Network != nil { - return false - } - if len(this.PortMappings) != len(that1.PortMappings) { - return false - } - for i := range this.PortMappings { - if !this.PortMappings[i].Equal(that1.PortMappings[i]) { - return false - } - } - if this.Privileged != nil && that1.Privileged != nil { - if *this.Privileged != *that1.Privileged { - return false - } - } else if this.Privileged != nil { - return false - } else if that1.Privileged != nil { - return false - } - if len(this.Parameters) != len(that1.Parameters) { - return false - } - for i := range this.Parameters { - if !this.Parameters[i].Equal(that1.Parameters[i]) { - return false - } - } - if this.ForcePullImage != nil && that1.ForcePullImage != nil { - if *this.ForcePullImage != *that1.ForcePullImage { - return false - } - } else if this.ForcePullImage != nil { - return false - } else if that1.ForcePullImage != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ContainerInfo_DockerInfo_PortMapping) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) - if !ok { - return fmt.Errorf("that is not of type *ContainerInfo_DockerInfo_PortMapping") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ContainerInfo_DockerInfo_PortMapping but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ContainerInfo_DockerInfo_PortMappingbut is not nil && this == nil") - } - if this.HostPort != nil && that1.HostPort != nil { - if *this.HostPort != *that1.HostPort { - return fmt.Errorf("HostPort this(%v) Not Equal that(%v)", *this.HostPort, *that1.HostPort) - } - } else if this.HostPort != nil { - return fmt.Errorf("this.HostPort == nil && that.HostPort != nil") - } else if that1.HostPort != nil { - return fmt.Errorf("HostPort this(%v) Not Equal that(%v)", this.HostPort, that1.HostPort) - } - if this.ContainerPort != nil && that1.ContainerPort != nil { - if *this.ContainerPort != *that1.ContainerPort { - return fmt.Errorf("ContainerPort this(%v) Not Equal that(%v)", *this.ContainerPort, *that1.ContainerPort) - } - } else if this.ContainerPort != nil { - return fmt.Errorf("this.ContainerPort == nil && that.ContainerPort != nil") - } else if that1.ContainerPort != nil { - return fmt.Errorf("ContainerPort this(%v) Not Equal that(%v)", this.ContainerPort, that1.ContainerPort) - } - if this.Protocol != nil && that1.Protocol != nil { - if *this.Protocol != *that1.Protocol { - return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", *this.Protocol, *that1.Protocol) - } - } else if this.Protocol != nil { - return fmt.Errorf("this.Protocol == nil && that.Protocol != nil") - } else if that1.Protocol != nil { - return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", this.Protocol, that1.Protocol) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ContainerInfo_DockerInfo_PortMapping) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerInfo_DockerInfo_PortMapping) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.HostPort != nil && that1.HostPort != nil { - if *this.HostPort != *that1.HostPort { - return false - } - } else if this.HostPort != nil { - return false - } else if that1.HostPort != nil { - return false - } - if this.ContainerPort != nil && that1.ContainerPort != nil { - if *this.ContainerPort != *that1.ContainerPort { - return false - } - } else if this.ContainerPort != nil { - return false - } else if that1.ContainerPort != nil { - return false - } - if this.Protocol != nil && that1.Protocol != nil { - if *this.Protocol != *that1.Protocol { - return false - } - } else if this.Protocol != nil { - return false - } else if that1.Protocol != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ContainerInfo_MesosInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ContainerInfo_MesosInfo) - if !ok { - return fmt.Errorf("that is not of type *ContainerInfo_MesosInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ContainerInfo_MesosInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ContainerInfo_MesosInfobut is not nil && this == nil") - } - if !this.Image.Equal(that1.Image) { - return fmt.Errorf("Image this(%v) Not Equal that(%v)", this.Image, that1.Image) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ContainerInfo_MesosInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ContainerInfo_MesosInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Image.Equal(that1.Image) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Labels) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Labels) - if !ok { - return fmt.Errorf("that is not of type *Labels") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Labels but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Labelsbut is not nil && this == nil") - } - if len(this.Labels) != len(that1.Labels) { - return fmt.Errorf("Labels this(%v) Not Equal that(%v)", len(this.Labels), len(that1.Labels)) - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return fmt.Errorf("Labels this[%v](%v) Not Equal that[%v](%v)", i, this.Labels[i], i, that1.Labels[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Labels) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Labels) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Label) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Label) - if !ok { - return fmt.Errorf("that is not of type *Label") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Label but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Labelbut is not nil && this == nil") - } - if this.Key != nil && that1.Key != nil { - if *this.Key != *that1.Key { - return fmt.Errorf("Key this(%v) Not Equal that(%v)", *this.Key, *that1.Key) - } - } else if this.Key != nil { - return fmt.Errorf("this.Key == nil && that.Key != nil") - } else if that1.Key != nil { - return fmt.Errorf("Key this(%v) Not Equal that(%v)", this.Key, that1.Key) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Label) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Label) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Key != nil && that1.Key != nil { - if *this.Key != *that1.Key { - return false - } - } else if this.Key != nil { - return false - } else if that1.Key != nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Port) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Port) - if !ok { - return fmt.Errorf("that is not of type *Port") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Port but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Portbut is not nil && this == nil") - } - if this.Number != nil && that1.Number != nil { - if *this.Number != *that1.Number { - return fmt.Errorf("Number this(%v) Not Equal that(%v)", *this.Number, *that1.Number) - } - } else if this.Number != nil { - return fmt.Errorf("this.Number == nil && that.Number != nil") - } else if that1.Number != nil { - return fmt.Errorf("Number this(%v) Not Equal that(%v)", this.Number, that1.Number) - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Protocol != nil && that1.Protocol != nil { - if *this.Protocol != *that1.Protocol { - return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", *this.Protocol, *that1.Protocol) - } - } else if this.Protocol != nil { - return fmt.Errorf("this.Protocol == nil && that.Protocol != nil") - } else if that1.Protocol != nil { - return fmt.Errorf("Protocol this(%v) Not Equal that(%v)", this.Protocol, that1.Protocol) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Port) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Port) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Number != nil && that1.Number != nil { - if *this.Number != *that1.Number { - return false - } - } else if this.Number != nil { - return false - } else if that1.Number != nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Protocol != nil && that1.Protocol != nil { - if *this.Protocol != *that1.Protocol { - return false - } - } else if this.Protocol != nil { - return false - } else if that1.Protocol != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Ports) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Ports) - if !ok { - return fmt.Errorf("that is not of type *Ports") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Ports but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Portsbut is not nil && this == nil") - } - if len(this.Ports) != len(that1.Ports) { - return fmt.Errorf("Ports this(%v) Not Equal that(%v)", len(this.Ports), len(that1.Ports)) - } - for i := range this.Ports { - if !this.Ports[i].Equal(that1.Ports[i]) { - return fmt.Errorf("Ports this[%v](%v) Not Equal that[%v](%v)", i, this.Ports[i], i, that1.Ports[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Ports) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Ports) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Ports) != len(that1.Ports) { - return false - } - for i := range this.Ports { - if !this.Ports[i].Equal(that1.Ports[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *DiscoveryInfo) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*DiscoveryInfo) - if !ok { - return fmt.Errorf("that is not of type *DiscoveryInfo") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *DiscoveryInfo but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *DiscoveryInfobut is not nil && this == nil") - } - if this.Visibility != nil && that1.Visibility != nil { - if *this.Visibility != *that1.Visibility { - return fmt.Errorf("Visibility this(%v) Not Equal that(%v)", *this.Visibility, *that1.Visibility) - } - } else if this.Visibility != nil { - return fmt.Errorf("this.Visibility == nil && that.Visibility != nil") - } else if that1.Visibility != nil { - return fmt.Errorf("Visibility this(%v) Not Equal that(%v)", this.Visibility, that1.Visibility) - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Environment != nil && that1.Environment != nil { - if *this.Environment != *that1.Environment { - return fmt.Errorf("Environment this(%v) Not Equal that(%v)", *this.Environment, *that1.Environment) - } - } else if this.Environment != nil { - return fmt.Errorf("this.Environment == nil && that.Environment != nil") - } else if that1.Environment != nil { - return fmt.Errorf("Environment this(%v) Not Equal that(%v)", this.Environment, that1.Environment) - } - if this.Location != nil && that1.Location != nil { - if *this.Location != *that1.Location { - return fmt.Errorf("Location this(%v) Not Equal that(%v)", *this.Location, *that1.Location) - } - } else if this.Location != nil { - return fmt.Errorf("this.Location == nil && that.Location != nil") - } else if that1.Location != nil { - return fmt.Errorf("Location this(%v) Not Equal that(%v)", this.Location, that1.Location) - } - if this.Version != nil && that1.Version != nil { - if *this.Version != *that1.Version { - return fmt.Errorf("Version this(%v) Not Equal that(%v)", *this.Version, *that1.Version) - } - } else if this.Version != nil { - return fmt.Errorf("this.Version == nil && that.Version != nil") - } else if that1.Version != nil { - return fmt.Errorf("Version this(%v) Not Equal that(%v)", this.Version, that1.Version) - } - if !this.Ports.Equal(that1.Ports) { - return fmt.Errorf("Ports this(%v) Not Equal that(%v)", this.Ports, that1.Ports) - } - if !this.Labels.Equal(that1.Labels) { - return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *DiscoveryInfo) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*DiscoveryInfo) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Visibility != nil && that1.Visibility != nil { - if *this.Visibility != *that1.Visibility { - return false - } - } else if this.Visibility != nil { - return false - } else if that1.Visibility != nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Environment != nil && that1.Environment != nil { - if *this.Environment != *that1.Environment { - return false - } - } else if this.Environment != nil { - return false - } else if that1.Environment != nil { - return false - } - if this.Location != nil && that1.Location != nil { - if *this.Location != *that1.Location { - return false - } - } else if this.Location != nil { - return false - } else if that1.Location != nil { - return false - } - if this.Version != nil && that1.Version != nil { - if *this.Version != *that1.Version { - return false - } - } else if this.Version != nil { - return false - } else if that1.Version != nil { - return false - } - if !this.Ports.Equal(that1.Ports) { - return false - } - if !this.Labels.Equal(that1.Labels) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AppcImageManifest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AppcImageManifest) - if !ok { - return fmt.Errorf("that is not of type *AppcImageManifest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AppcImageManifest but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AppcImageManifestbut is not nil && this == nil") - } - if this.AcKind != nil && that1.AcKind != nil { - if *this.AcKind != *that1.AcKind { - return fmt.Errorf("AcKind this(%v) Not Equal that(%v)", *this.AcKind, *that1.AcKind) - } - } else if this.AcKind != nil { - return fmt.Errorf("this.AcKind == nil && that.AcKind != nil") - } else if that1.AcKind != nil { - return fmt.Errorf("AcKind this(%v) Not Equal that(%v)", this.AcKind, that1.AcKind) - } - if this.AcVersion != nil && that1.AcVersion != nil { - if *this.AcVersion != *that1.AcVersion { - return fmt.Errorf("AcVersion this(%v) Not Equal that(%v)", *this.AcVersion, *that1.AcVersion) - } - } else if this.AcVersion != nil { - return fmt.Errorf("this.AcVersion == nil && that.AcVersion != nil") - } else if that1.AcVersion != nil { - return fmt.Errorf("AcVersion this(%v) Not Equal that(%v)", this.AcVersion, that1.AcVersion) - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if len(this.Labels) != len(that1.Labels) { - return fmt.Errorf("Labels this(%v) Not Equal that(%v)", len(this.Labels), len(that1.Labels)) - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return fmt.Errorf("Labels this[%v](%v) Not Equal that[%v](%v)", i, this.Labels[i], i, that1.Labels[i]) - } - } - if len(this.Annotations) != len(that1.Annotations) { - return fmt.Errorf("Annotations this(%v) Not Equal that(%v)", len(this.Annotations), len(that1.Annotations)) - } - for i := range this.Annotations { - if !this.Annotations[i].Equal(that1.Annotations[i]) { - return fmt.Errorf("Annotations this[%v](%v) Not Equal that[%v](%v)", i, this.Annotations[i], i, that1.Annotations[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AppcImageManifest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AppcImageManifest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.AcKind != nil && that1.AcKind != nil { - if *this.AcKind != *that1.AcKind { - return false - } - } else if this.AcKind != nil { - return false - } else if that1.AcKind != nil { - return false - } - if this.AcVersion != nil && that1.AcVersion != nil { - if *this.AcVersion != *that1.AcVersion { - return false - } - } else if this.AcVersion != nil { - return false - } else if that1.AcVersion != nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if len(this.Annotations) != len(that1.Annotations) { - return false - } - for i := range this.Annotations { - if !this.Annotations[i].Equal(that1.Annotations[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AppcImageManifest_Label) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AppcImageManifest_Label) - if !ok { - return fmt.Errorf("that is not of type *AppcImageManifest_Label") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AppcImageManifest_Label but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AppcImageManifest_Labelbut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AppcImageManifest_Label) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AppcImageManifest_Label) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *AppcImageManifest_Annotation) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*AppcImageManifest_Annotation) - if !ok { - return fmt.Errorf("that is not of type *AppcImageManifest_Annotation") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *AppcImageManifest_Annotation but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *AppcImageManifest_Annotationbut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", *this.Value, *that1.Value) - } - } else if this.Value != nil { - return fmt.Errorf("this.Value == nil && that.Value != nil") - } else if that1.Value != nil { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *AppcImageManifest_Annotation) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*AppcImageManifest_Annotation) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if this.Value != nil && that1.Value != nil { - if *this.Value != *that1.Value { - return false - } - } else if this.Value != nil { - return false - } else if that1.Value != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FrameworkID) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.FrameworkID{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *OfferID) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.OfferID{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SlaveID) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.SlaveID{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskID) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.TaskID{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ExecutorID) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.ExecutorID{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ContainerID) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.ContainerID{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Address) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Address{") - if this.Hostname != nil { - s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") - } - if this.Ip != nil { - s = append(s, "Ip: "+valueToGoStringMesos(this.Ip, "string")+",\n") - } - if this.Port != nil { - s = append(s, "Port: "+valueToGoStringMesos(this.Port, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *URL) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&mesosproto.URL{") - if this.Scheme != nil { - s = append(s, "Scheme: "+valueToGoStringMesos(this.Scheme, "string")+",\n") - } - if this.Address != nil { - s = append(s, "Address: "+fmt.Sprintf("%#v", this.Address)+",\n") - } - if this.Path != nil { - s = append(s, "Path: "+valueToGoStringMesos(this.Path, "string")+",\n") - } - if this.Query != nil { - s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") - } - if this.Fragment != nil { - s = append(s, "Fragment: "+valueToGoStringMesos(this.Fragment, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FrameworkInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 15) - s = append(s, "&mesosproto.FrameworkInfo{") - if this.User != nil { - s = append(s, "User: "+valueToGoStringMesos(this.User, "string")+",\n") - } - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Id != nil { - s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") - } - if this.FailoverTimeout != nil { - s = append(s, "FailoverTimeout: "+valueToGoStringMesos(this.FailoverTimeout, "float64")+",\n") - } - if this.Checkpoint != nil { - s = append(s, "Checkpoint: "+valueToGoStringMesos(this.Checkpoint, "bool")+",\n") - } - if this.Role != nil { - s = append(s, "Role: "+valueToGoStringMesos(this.Role, "string")+",\n") - } - if this.Hostname != nil { - s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") - } - if this.Principal != nil { - s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") - } - if this.WebuiUrl != nil { - s = append(s, "WebuiUrl: "+valueToGoStringMesos(this.WebuiUrl, "string")+",\n") - } - if this.Capabilities != nil { - s = append(s, "Capabilities: "+fmt.Sprintf("%#v", this.Capabilities)+",\n") - } - if this.Labels != nil { - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FrameworkInfo_Capability) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.FrameworkInfo_Capability{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.FrameworkInfo_Capability_Type")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *HealthCheck) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&mesosproto.HealthCheck{") - if this.Http != nil { - s = append(s, "Http: "+fmt.Sprintf("%#v", this.Http)+",\n") - } - if this.DelaySeconds != nil { - s = append(s, "DelaySeconds: "+valueToGoStringMesos(this.DelaySeconds, "float64")+",\n") - } - if this.IntervalSeconds != nil { - s = append(s, "IntervalSeconds: "+valueToGoStringMesos(this.IntervalSeconds, "float64")+",\n") - } - if this.TimeoutSeconds != nil { - s = append(s, "TimeoutSeconds: "+valueToGoStringMesos(this.TimeoutSeconds, "float64")+",\n") - } - if this.ConsecutiveFailures != nil { - s = append(s, "ConsecutiveFailures: "+valueToGoStringMesos(this.ConsecutiveFailures, "uint32")+",\n") - } - if this.GracePeriodSeconds != nil { - s = append(s, "GracePeriodSeconds: "+valueToGoStringMesos(this.GracePeriodSeconds, "float64")+",\n") - } - if this.Command != nil { - s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *HealthCheck_HTTP) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.HealthCheck_HTTP{") - if this.Port != nil { - s = append(s, "Port: "+valueToGoStringMesos(this.Port, "uint32")+",\n") - } - if this.Path != nil { - s = append(s, "Path: "+valueToGoStringMesos(this.Path, "string")+",\n") - } - if this.Statuses != nil { - s = append(s, "Statuses: "+fmt.Sprintf("%#v", this.Statuses)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CommandInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&mesosproto.CommandInfo{") - if this.Container != nil { - s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") - } - if this.Uris != nil { - s = append(s, "Uris: "+fmt.Sprintf("%#v", this.Uris)+",\n") - } - if this.Environment != nil { - s = append(s, "Environment: "+fmt.Sprintf("%#v", this.Environment)+",\n") - } - if this.Shell != nil { - s = append(s, "Shell: "+valueToGoStringMesos(this.Shell, "bool")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.Arguments != nil { - s = append(s, "Arguments: "+fmt.Sprintf("%#v", this.Arguments)+",\n") - } - if this.User != nil { - s = append(s, "User: "+valueToGoStringMesos(this.User, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CommandInfo_URI) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.CommandInfo_URI{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.Executable != nil { - s = append(s, "Executable: "+valueToGoStringMesos(this.Executable, "bool")+",\n") - } - if this.Extract != nil { - s = append(s, "Extract: "+valueToGoStringMesos(this.Extract, "bool")+",\n") - } - if this.Cache != nil { - s = append(s, "Cache: "+valueToGoStringMesos(this.Cache, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CommandInfo_ContainerInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.CommandInfo_ContainerInfo{") - if this.Image != nil { - s = append(s, "Image: "+valueToGoStringMesos(this.Image, "string")+",\n") - } - if this.Options != nil { - s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ExecutorInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&mesosproto.ExecutorInfo{") - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.Command != nil { - s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") - } - if this.Container != nil { - s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") - } - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Source != nil { - s = append(s, "Source: "+valueToGoStringMesos(this.Source, "string")+",\n") - } - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") - } - if this.Discovery != nil { - s = append(s, "Discovery: "+fmt.Sprintf("%#v", this.Discovery)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *MasterInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&mesosproto.MasterInfo{") - if this.Id != nil { - s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") - } - if this.Ip != nil { - s = append(s, "Ip: "+valueToGoStringMesos(this.Ip, "uint32")+",\n") - } - if this.Port != nil { - s = append(s, "Port: "+valueToGoStringMesos(this.Port, "uint32")+",\n") - } - if this.Pid != nil { - s = append(s, "Pid: "+valueToGoStringMesos(this.Pid, "string")+",\n") - } - if this.Hostname != nil { - s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") - } - if this.Version != nil { - s = append(s, "Version: "+valueToGoStringMesos(this.Version, "string")+",\n") - } - if this.Address != nil { - s = append(s, "Address: "+fmt.Sprintf("%#v", this.Address)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SlaveInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&mesosproto.SlaveInfo{") - if this.Hostname != nil { - s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") - } - if this.Port != nil { - s = append(s, "Port: "+valueToGoStringMesos(this.Port, "int32")+",\n") - } - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.Attributes != nil { - s = append(s, "Attributes: "+fmt.Sprintf("%#v", this.Attributes)+",\n") - } - if this.Id != nil { - s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") - } - if this.Checkpoint != nil { - s = append(s, "Checkpoint: "+valueToGoStringMesos(this.Checkpoint, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Value) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&mesosproto.Value{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") - } - if this.Scalar != nil { - s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") - } - if this.Ranges != nil { - s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") - } - if this.Set != nil { - s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") - } - if this.Text != nil { - s = append(s, "Text: "+fmt.Sprintf("%#v", this.Text)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Value_Scalar) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Value_Scalar{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "float64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Value_Range) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Value_Range{") - if this.Begin != nil { - s = append(s, "Begin: "+valueToGoStringMesos(this.Begin, "uint64")+",\n") - } - if this.End != nil { - s = append(s, "End: "+valueToGoStringMesos(this.End, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Value_Ranges) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Value_Ranges{") - if this.Range != nil { - s = append(s, "Range: "+fmt.Sprintf("%#v", this.Range)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Value_Set) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Value_Set{") - if this.Item != nil { - s = append(s, "Item: "+fmt.Sprintf("%#v", this.Item)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Value_Text) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Value_Text{") - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Attribute) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&mesosproto.Attribute{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") - } - if this.Scalar != nil { - s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") - } - if this.Ranges != nil { - s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") - } - if this.Set != nil { - s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") - } - if this.Text != nil { - s = append(s, "Text: "+fmt.Sprintf("%#v", this.Text)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Resource) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 13) - s = append(s, "&mesosproto.Resource{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Value_Type")+",\n") - } - if this.Scalar != nil { - s = append(s, "Scalar: "+fmt.Sprintf("%#v", this.Scalar)+",\n") - } - if this.Ranges != nil { - s = append(s, "Ranges: "+fmt.Sprintf("%#v", this.Ranges)+",\n") - } - if this.Set != nil { - s = append(s, "Set: "+fmt.Sprintf("%#v", this.Set)+",\n") - } - if this.Role != nil { - s = append(s, "Role: "+valueToGoStringMesos(this.Role, "string")+",\n") - } - if this.Reservation != nil { - s = append(s, "Reservation: "+fmt.Sprintf("%#v", this.Reservation)+",\n") - } - if this.Disk != nil { - s = append(s, "Disk: "+fmt.Sprintf("%#v", this.Disk)+",\n") - } - if this.Revocable != nil { - s = append(s, "Revocable: "+fmt.Sprintf("%#v", this.Revocable)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Resource_ReservationInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Resource_ReservationInfo{") - if this.Principal != nil { - s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Resource_DiskInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Resource_DiskInfo{") - if this.Persistence != nil { - s = append(s, "Persistence: "+fmt.Sprintf("%#v", this.Persistence)+",\n") - } - if this.Volume != nil { - s = append(s, "Volume: "+fmt.Sprintf("%#v", this.Volume)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Resource_DiskInfo_Persistence) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Resource_DiskInfo_Persistence{") - if this.Id != nil { - s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Resource_RevocableInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&mesosproto.Resource_RevocableInfo{") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TrafficControlStatistics) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 14) - s = append(s, "&mesosproto.TrafficControlStatistics{") - if this.Id != nil { - s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") - } - if this.Backlog != nil { - s = append(s, "Backlog: "+valueToGoStringMesos(this.Backlog, "uint64")+",\n") - } - if this.Bytes != nil { - s = append(s, "Bytes: "+valueToGoStringMesos(this.Bytes, "uint64")+",\n") - } - if this.Drops != nil { - s = append(s, "Drops: "+valueToGoStringMesos(this.Drops, "uint64")+",\n") - } - if this.Overlimits != nil { - s = append(s, "Overlimits: "+valueToGoStringMesos(this.Overlimits, "uint64")+",\n") - } - if this.Packets != nil { - s = append(s, "Packets: "+valueToGoStringMesos(this.Packets, "uint64")+",\n") - } - if this.Qlen != nil { - s = append(s, "Qlen: "+valueToGoStringMesos(this.Qlen, "uint64")+",\n") - } - if this.Ratebps != nil { - s = append(s, "Ratebps: "+valueToGoStringMesos(this.Ratebps, "uint64")+",\n") - } - if this.Ratepps != nil { - s = append(s, "Ratepps: "+valueToGoStringMesos(this.Ratepps, "uint64")+",\n") - } - if this.Requeues != nil { - s = append(s, "Requeues: "+valueToGoStringMesos(this.Requeues, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ResourceStatistics) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 45) - s = append(s, "&mesosproto.ResourceStatistics{") - if this.Timestamp != nil { - s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") - } - if this.Processes != nil { - s = append(s, "Processes: "+valueToGoStringMesos(this.Processes, "uint32")+",\n") - } - if this.Threads != nil { - s = append(s, "Threads: "+valueToGoStringMesos(this.Threads, "uint32")+",\n") - } - if this.CpusUserTimeSecs != nil { - s = append(s, "CpusUserTimeSecs: "+valueToGoStringMesos(this.CpusUserTimeSecs, "float64")+",\n") - } - if this.CpusSystemTimeSecs != nil { - s = append(s, "CpusSystemTimeSecs: "+valueToGoStringMesos(this.CpusSystemTimeSecs, "float64")+",\n") - } - if this.CpusLimit != nil { - s = append(s, "CpusLimit: "+valueToGoStringMesos(this.CpusLimit, "float64")+",\n") - } - if this.CpusNrPeriods != nil { - s = append(s, "CpusNrPeriods: "+valueToGoStringMesos(this.CpusNrPeriods, "uint32")+",\n") - } - if this.CpusNrThrottled != nil { - s = append(s, "CpusNrThrottled: "+valueToGoStringMesos(this.CpusNrThrottled, "uint32")+",\n") - } - if this.CpusThrottledTimeSecs != nil { - s = append(s, "CpusThrottledTimeSecs: "+valueToGoStringMesos(this.CpusThrottledTimeSecs, "float64")+",\n") - } - if this.MemTotalBytes != nil { - s = append(s, "MemTotalBytes: "+valueToGoStringMesos(this.MemTotalBytes, "uint64")+",\n") - } - if this.MemTotalMemswBytes != nil { - s = append(s, "MemTotalMemswBytes: "+valueToGoStringMesos(this.MemTotalMemswBytes, "uint64")+",\n") - } - if this.MemLimitBytes != nil { - s = append(s, "MemLimitBytes: "+valueToGoStringMesos(this.MemLimitBytes, "uint64")+",\n") - } - if this.MemSoftLimitBytes != nil { - s = append(s, "MemSoftLimitBytes: "+valueToGoStringMesos(this.MemSoftLimitBytes, "uint64")+",\n") - } - if this.MemFileBytes != nil { - s = append(s, "MemFileBytes: "+valueToGoStringMesos(this.MemFileBytes, "uint64")+",\n") - } - if this.MemAnonBytes != nil { - s = append(s, "MemAnonBytes: "+valueToGoStringMesos(this.MemAnonBytes, "uint64")+",\n") - } - if this.MemCacheBytes != nil { - s = append(s, "MemCacheBytes: "+valueToGoStringMesos(this.MemCacheBytes, "uint64")+",\n") - } - if this.MemRssBytes != nil { - s = append(s, "MemRssBytes: "+valueToGoStringMesos(this.MemRssBytes, "uint64")+",\n") - } - if this.MemMappedFileBytes != nil { - s = append(s, "MemMappedFileBytes: "+valueToGoStringMesos(this.MemMappedFileBytes, "uint64")+",\n") - } - if this.MemSwapBytes != nil { - s = append(s, "MemSwapBytes: "+valueToGoStringMesos(this.MemSwapBytes, "uint64")+",\n") - } - if this.MemUnevictableBytes != nil { - s = append(s, "MemUnevictableBytes: "+valueToGoStringMesos(this.MemUnevictableBytes, "uint64")+",\n") - } - if this.MemLowPressureCounter != nil { - s = append(s, "MemLowPressureCounter: "+valueToGoStringMesos(this.MemLowPressureCounter, "uint64")+",\n") - } - if this.MemMediumPressureCounter != nil { - s = append(s, "MemMediumPressureCounter: "+valueToGoStringMesos(this.MemMediumPressureCounter, "uint64")+",\n") - } - if this.MemCriticalPressureCounter != nil { - s = append(s, "MemCriticalPressureCounter: "+valueToGoStringMesos(this.MemCriticalPressureCounter, "uint64")+",\n") - } - if this.DiskLimitBytes != nil { - s = append(s, "DiskLimitBytes: "+valueToGoStringMesos(this.DiskLimitBytes, "uint64")+",\n") - } - if this.DiskUsedBytes != nil { - s = append(s, "DiskUsedBytes: "+valueToGoStringMesos(this.DiskUsedBytes, "uint64")+",\n") - } - if this.Perf != nil { - s = append(s, "Perf: "+fmt.Sprintf("%#v", this.Perf)+",\n") - } - if this.NetRxPackets != nil { - s = append(s, "NetRxPackets: "+valueToGoStringMesos(this.NetRxPackets, "uint64")+",\n") - } - if this.NetRxBytes != nil { - s = append(s, "NetRxBytes: "+valueToGoStringMesos(this.NetRxBytes, "uint64")+",\n") - } - if this.NetRxErrors != nil { - s = append(s, "NetRxErrors: "+valueToGoStringMesos(this.NetRxErrors, "uint64")+",\n") - } - if this.NetRxDropped != nil { - s = append(s, "NetRxDropped: "+valueToGoStringMesos(this.NetRxDropped, "uint64")+",\n") - } - if this.NetTxPackets != nil { - s = append(s, "NetTxPackets: "+valueToGoStringMesos(this.NetTxPackets, "uint64")+",\n") - } - if this.NetTxBytes != nil { - s = append(s, "NetTxBytes: "+valueToGoStringMesos(this.NetTxBytes, "uint64")+",\n") - } - if this.NetTxErrors != nil { - s = append(s, "NetTxErrors: "+valueToGoStringMesos(this.NetTxErrors, "uint64")+",\n") - } - if this.NetTxDropped != nil { - s = append(s, "NetTxDropped: "+valueToGoStringMesos(this.NetTxDropped, "uint64")+",\n") - } - if this.NetTcpRttMicrosecsP50 != nil { - s = append(s, "NetTcpRttMicrosecsP50: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP50, "float64")+",\n") - } - if this.NetTcpRttMicrosecsP90 != nil { - s = append(s, "NetTcpRttMicrosecsP90: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP90, "float64")+",\n") - } - if this.NetTcpRttMicrosecsP95 != nil { - s = append(s, "NetTcpRttMicrosecsP95: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP95, "float64")+",\n") - } - if this.NetTcpRttMicrosecsP99 != nil { - s = append(s, "NetTcpRttMicrosecsP99: "+valueToGoStringMesos(this.NetTcpRttMicrosecsP99, "float64")+",\n") - } - if this.NetTcpActiveConnections != nil { - s = append(s, "NetTcpActiveConnections: "+valueToGoStringMesos(this.NetTcpActiveConnections, "float64")+",\n") - } - if this.NetTcpTimeWaitConnections != nil { - s = append(s, "NetTcpTimeWaitConnections: "+valueToGoStringMesos(this.NetTcpTimeWaitConnections, "float64")+",\n") - } - if this.NetTrafficControlStatistics != nil { - s = append(s, "NetTrafficControlStatistics: "+fmt.Sprintf("%#v", this.NetTrafficControlStatistics)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ResourceUsage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ResourceUsage{") - if this.Executors != nil { - s = append(s, "Executors: "+fmt.Sprintf("%#v", this.Executors)+",\n") - } - if this.Total != nil { - s = append(s, "Total: "+fmt.Sprintf("%#v", this.Total)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ResourceUsage_Executor) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.ResourceUsage_Executor{") - if this.ExecutorInfo != nil { - s = append(s, "ExecutorInfo: "+fmt.Sprintf("%#v", this.ExecutorInfo)+",\n") - } - if this.Allocated != nil { - s = append(s, "Allocated: "+fmt.Sprintf("%#v", this.Allocated)+",\n") - } - if this.Statistics != nil { - s = append(s, "Statistics: "+fmt.Sprintf("%#v", this.Statistics)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PerfStatistics) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 57) - s = append(s, "&mesosproto.PerfStatistics{") - if this.Timestamp != nil { - s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") - } - if this.Duration != nil { - s = append(s, "Duration: "+valueToGoStringMesos(this.Duration, "float64")+",\n") - } - if this.Cycles != nil { - s = append(s, "Cycles: "+valueToGoStringMesos(this.Cycles, "uint64")+",\n") - } - if this.StalledCyclesFrontend != nil { - s = append(s, "StalledCyclesFrontend: "+valueToGoStringMesos(this.StalledCyclesFrontend, "uint64")+",\n") - } - if this.StalledCyclesBackend != nil { - s = append(s, "StalledCyclesBackend: "+valueToGoStringMesos(this.StalledCyclesBackend, "uint64")+",\n") - } - if this.Instructions != nil { - s = append(s, "Instructions: "+valueToGoStringMesos(this.Instructions, "uint64")+",\n") - } - if this.CacheReferences != nil { - s = append(s, "CacheReferences: "+valueToGoStringMesos(this.CacheReferences, "uint64")+",\n") - } - if this.CacheMisses != nil { - s = append(s, "CacheMisses: "+valueToGoStringMesos(this.CacheMisses, "uint64")+",\n") - } - if this.Branches != nil { - s = append(s, "Branches: "+valueToGoStringMesos(this.Branches, "uint64")+",\n") - } - if this.BranchMisses != nil { - s = append(s, "BranchMisses: "+valueToGoStringMesos(this.BranchMisses, "uint64")+",\n") - } - if this.BusCycles != nil { - s = append(s, "BusCycles: "+valueToGoStringMesos(this.BusCycles, "uint64")+",\n") - } - if this.RefCycles != nil { - s = append(s, "RefCycles: "+valueToGoStringMesos(this.RefCycles, "uint64")+",\n") - } - if this.CpuClock != nil { - s = append(s, "CpuClock: "+valueToGoStringMesos(this.CpuClock, "float64")+",\n") - } - if this.TaskClock != nil { - s = append(s, "TaskClock: "+valueToGoStringMesos(this.TaskClock, "float64")+",\n") - } - if this.PageFaults != nil { - s = append(s, "PageFaults: "+valueToGoStringMesos(this.PageFaults, "uint64")+",\n") - } - if this.MinorFaults != nil { - s = append(s, "MinorFaults: "+valueToGoStringMesos(this.MinorFaults, "uint64")+",\n") - } - if this.MajorFaults != nil { - s = append(s, "MajorFaults: "+valueToGoStringMesos(this.MajorFaults, "uint64")+",\n") - } - if this.ContextSwitches != nil { - s = append(s, "ContextSwitches: "+valueToGoStringMesos(this.ContextSwitches, "uint64")+",\n") - } - if this.CpuMigrations != nil { - s = append(s, "CpuMigrations: "+valueToGoStringMesos(this.CpuMigrations, "uint64")+",\n") - } - if this.AlignmentFaults != nil { - s = append(s, "AlignmentFaults: "+valueToGoStringMesos(this.AlignmentFaults, "uint64")+",\n") - } - if this.EmulationFaults != nil { - s = append(s, "EmulationFaults: "+valueToGoStringMesos(this.EmulationFaults, "uint64")+",\n") - } - if this.L1DcacheLoads != nil { - s = append(s, "L1DcacheLoads: "+valueToGoStringMesos(this.L1DcacheLoads, "uint64")+",\n") - } - if this.L1DcacheLoadMisses != nil { - s = append(s, "L1DcacheLoadMisses: "+valueToGoStringMesos(this.L1DcacheLoadMisses, "uint64")+",\n") - } - if this.L1DcacheStores != nil { - s = append(s, "L1DcacheStores: "+valueToGoStringMesos(this.L1DcacheStores, "uint64")+",\n") - } - if this.L1DcacheStoreMisses != nil { - s = append(s, "L1DcacheStoreMisses: "+valueToGoStringMesos(this.L1DcacheStoreMisses, "uint64")+",\n") - } - if this.L1DcachePrefetches != nil { - s = append(s, "L1DcachePrefetches: "+valueToGoStringMesos(this.L1DcachePrefetches, "uint64")+",\n") - } - if this.L1DcachePrefetchMisses != nil { - s = append(s, "L1DcachePrefetchMisses: "+valueToGoStringMesos(this.L1DcachePrefetchMisses, "uint64")+",\n") - } - if this.L1IcacheLoads != nil { - s = append(s, "L1IcacheLoads: "+valueToGoStringMesos(this.L1IcacheLoads, "uint64")+",\n") - } - if this.L1IcacheLoadMisses != nil { - s = append(s, "L1IcacheLoadMisses: "+valueToGoStringMesos(this.L1IcacheLoadMisses, "uint64")+",\n") - } - if this.L1IcachePrefetches != nil { - s = append(s, "L1IcachePrefetches: "+valueToGoStringMesos(this.L1IcachePrefetches, "uint64")+",\n") - } - if this.L1IcachePrefetchMisses != nil { - s = append(s, "L1IcachePrefetchMisses: "+valueToGoStringMesos(this.L1IcachePrefetchMisses, "uint64")+",\n") - } - if this.LlcLoads != nil { - s = append(s, "LlcLoads: "+valueToGoStringMesos(this.LlcLoads, "uint64")+",\n") - } - if this.LlcLoadMisses != nil { - s = append(s, "LlcLoadMisses: "+valueToGoStringMesos(this.LlcLoadMisses, "uint64")+",\n") - } - if this.LlcStores != nil { - s = append(s, "LlcStores: "+valueToGoStringMesos(this.LlcStores, "uint64")+",\n") - } - if this.LlcStoreMisses != nil { - s = append(s, "LlcStoreMisses: "+valueToGoStringMesos(this.LlcStoreMisses, "uint64")+",\n") - } - if this.LlcPrefetches != nil { - s = append(s, "LlcPrefetches: "+valueToGoStringMesos(this.LlcPrefetches, "uint64")+",\n") - } - if this.LlcPrefetchMisses != nil { - s = append(s, "LlcPrefetchMisses: "+valueToGoStringMesos(this.LlcPrefetchMisses, "uint64")+",\n") - } - if this.DtlbLoads != nil { - s = append(s, "DtlbLoads: "+valueToGoStringMesos(this.DtlbLoads, "uint64")+",\n") - } - if this.DtlbLoadMisses != nil { - s = append(s, "DtlbLoadMisses: "+valueToGoStringMesos(this.DtlbLoadMisses, "uint64")+",\n") - } - if this.DtlbStores != nil { - s = append(s, "DtlbStores: "+valueToGoStringMesos(this.DtlbStores, "uint64")+",\n") - } - if this.DtlbStoreMisses != nil { - s = append(s, "DtlbStoreMisses: "+valueToGoStringMesos(this.DtlbStoreMisses, "uint64")+",\n") - } - if this.DtlbPrefetches != nil { - s = append(s, "DtlbPrefetches: "+valueToGoStringMesos(this.DtlbPrefetches, "uint64")+",\n") - } - if this.DtlbPrefetchMisses != nil { - s = append(s, "DtlbPrefetchMisses: "+valueToGoStringMesos(this.DtlbPrefetchMisses, "uint64")+",\n") - } - if this.ItlbLoads != nil { - s = append(s, "ItlbLoads: "+valueToGoStringMesos(this.ItlbLoads, "uint64")+",\n") - } - if this.ItlbLoadMisses != nil { - s = append(s, "ItlbLoadMisses: "+valueToGoStringMesos(this.ItlbLoadMisses, "uint64")+",\n") - } - if this.BranchLoads != nil { - s = append(s, "BranchLoads: "+valueToGoStringMesos(this.BranchLoads, "uint64")+",\n") - } - if this.BranchLoadMisses != nil { - s = append(s, "BranchLoadMisses: "+valueToGoStringMesos(this.BranchLoadMisses, "uint64")+",\n") - } - if this.NodeLoads != nil { - s = append(s, "NodeLoads: "+valueToGoStringMesos(this.NodeLoads, "uint64")+",\n") - } - if this.NodeLoadMisses != nil { - s = append(s, "NodeLoadMisses: "+valueToGoStringMesos(this.NodeLoadMisses, "uint64")+",\n") - } - if this.NodeStores != nil { - s = append(s, "NodeStores: "+valueToGoStringMesos(this.NodeStores, "uint64")+",\n") - } - if this.NodeStoreMisses != nil { - s = append(s, "NodeStoreMisses: "+valueToGoStringMesos(this.NodeStoreMisses, "uint64")+",\n") - } - if this.NodePrefetches != nil { - s = append(s, "NodePrefetches: "+valueToGoStringMesos(this.NodePrefetches, "uint64")+",\n") - } - if this.NodePrefetchMisses != nil { - s = append(s, "NodePrefetchMisses: "+valueToGoStringMesos(this.NodePrefetchMisses, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Request) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Request{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Offer) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&mesosproto.Offer{") - if this.Id != nil { - s = append(s, "Id: "+fmt.Sprintf("%#v", this.Id)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.Hostname != nil { - s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") - } - if this.Url != nil { - s = append(s, "Url: "+fmt.Sprintf("%#v", this.Url)+",\n") - } - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.Attributes != nil { - s = append(s, "Attributes: "+fmt.Sprintf("%#v", this.Attributes)+",\n") - } - if this.ExecutorIds != nil { - s = append(s, "ExecutorIds: "+fmt.Sprintf("%#v", this.ExecutorIds)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Offer_Operation) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&mesosproto.Offer_Operation{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Offer_Operation_Type")+",\n") - } - if this.Launch != nil { - s = append(s, "Launch: "+fmt.Sprintf("%#v", this.Launch)+",\n") - } - if this.Reserve != nil { - s = append(s, "Reserve: "+fmt.Sprintf("%#v", this.Reserve)+",\n") - } - if this.Unreserve != nil { - s = append(s, "Unreserve: "+fmt.Sprintf("%#v", this.Unreserve)+",\n") - } - if this.Create != nil { - s = append(s, "Create: "+fmt.Sprintf("%#v", this.Create)+",\n") - } - if this.Destroy != nil { - s = append(s, "Destroy: "+fmt.Sprintf("%#v", this.Destroy)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Offer_Operation_Launch) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Offer_Operation_Launch{") - if this.TaskInfos != nil { - s = append(s, "TaskInfos: "+fmt.Sprintf("%#v", this.TaskInfos)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Offer_Operation_Reserve) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Offer_Operation_Reserve{") - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Offer_Operation_Unreserve) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Offer_Operation_Unreserve{") - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Offer_Operation_Create) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Offer_Operation_Create{") - if this.Volumes != nil { - s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Offer_Operation_Destroy) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Offer_Operation_Destroy{") - if this.Volumes != nil { - s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 15) - s = append(s, "&mesosproto.TaskInfo{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.Executor != nil { - s = append(s, "Executor: "+fmt.Sprintf("%#v", this.Executor)+",\n") - } - if this.Command != nil { - s = append(s, "Command: "+fmt.Sprintf("%#v", this.Command)+",\n") - } - if this.Container != nil { - s = append(s, "Container: "+fmt.Sprintf("%#v", this.Container)+",\n") - } - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") - } - if this.HealthCheck != nil { - s = append(s, "HealthCheck: "+fmt.Sprintf("%#v", this.HealthCheck)+",\n") - } - if this.Labels != nil { - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - } - if this.Discovery != nil { - s = append(s, "Discovery: "+fmt.Sprintf("%#v", this.Discovery)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskStatus) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 16) - s = append(s, "&mesosproto.TaskStatus{") - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.State != nil { - s = append(s, "State: "+valueToGoStringMesos(this.State, "mesosproto.TaskState")+",\n") - } - if this.Message != nil { - s = append(s, "Message: "+valueToGoStringMesos(this.Message, "string")+",\n") - } - if this.Source != nil { - s = append(s, "Source: "+valueToGoStringMesos(this.Source, "mesosproto.TaskStatus_Source")+",\n") - } - if this.Reason != nil { - s = append(s, "Reason: "+valueToGoStringMesos(this.Reason, "mesosproto.TaskStatus_Reason")+",\n") - } - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringMesos(this.Data, "byte")+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.Timestamp != nil { - s = append(s, "Timestamp: "+valueToGoStringMesos(this.Timestamp, "float64")+",\n") - } - if this.Uuid != nil { - s = append(s, "Uuid: "+valueToGoStringMesos(this.Uuid, "byte")+",\n") - } - if this.Healthy != nil { - s = append(s, "Healthy: "+valueToGoStringMesos(this.Healthy, "bool")+",\n") - } - if this.Labels != nil { - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Filters) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Filters{") - if this.RefuseSeconds != nil { - s = append(s, "RefuseSeconds: "+valueToGoStringMesos(this.RefuseSeconds, "float64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Environment) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Environment{") - if this.Variables != nil { - s = append(s, "Variables: "+fmt.Sprintf("%#v", this.Variables)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Environment_Variable) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Environment_Variable{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Parameter) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Parameter{") - if this.Key != nil { - s = append(s, "Key: "+valueToGoStringMesos(this.Key, "string")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Parameters) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Parameters{") - if this.Parameter != nil { - s = append(s, "Parameter: "+fmt.Sprintf("%#v", this.Parameter)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Credential) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Credential{") - if this.Principal != nil { - s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") - } - if this.Secret != nil { - s = append(s, "Secret: "+valueToGoStringMesos(this.Secret, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Credentials) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Credentials{") - if this.Credentials != nil { - s = append(s, "Credentials: "+fmt.Sprintf("%#v", this.Credentials)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RateLimit) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.RateLimit{") - if this.Qps != nil { - s = append(s, "Qps: "+valueToGoStringMesos(this.Qps, "float64")+",\n") - } - if this.Principal != nil { - s = append(s, "Principal: "+valueToGoStringMesos(this.Principal, "string")+",\n") - } - if this.Capacity != nil { - s = append(s, "Capacity: "+valueToGoStringMesos(this.Capacity, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RateLimits) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.RateLimits{") - if this.Limits != nil { - s = append(s, "Limits: "+fmt.Sprintf("%#v", this.Limits)+",\n") - } - if this.AggregateDefaultQps != nil { - s = append(s, "AggregateDefaultQps: "+valueToGoStringMesos(this.AggregateDefaultQps, "float64")+",\n") - } - if this.AggregateDefaultCapacity != nil { - s = append(s, "AggregateDefaultCapacity: "+valueToGoStringMesos(this.AggregateDefaultCapacity, "uint64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Image) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Image{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.Image_Type")+",\n") - } - if this.Appc != nil { - s = append(s, "Appc: "+fmt.Sprintf("%#v", this.Appc)+",\n") - } - if this.Docker != nil { - s = append(s, "Docker: "+fmt.Sprintf("%#v", this.Docker)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Image_AppC) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Image_AppC{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Id != nil { - s = append(s, "Id: "+valueToGoStringMesos(this.Id, "string")+",\n") - } - if this.Labels != nil { - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Image_Docker) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Image_Docker{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Volume) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.Volume{") - if this.Mode != nil { - s = append(s, "Mode: "+valueToGoStringMesos(this.Mode, "mesosproto.Volume_Mode")+",\n") - } - if this.ContainerPath != nil { - s = append(s, "ContainerPath: "+valueToGoStringMesos(this.ContainerPath, "string")+",\n") - } - if this.HostPath != nil { - s = append(s, "HostPath: "+valueToGoStringMesos(this.HostPath, "string")+",\n") - } - if this.Image != nil { - s = append(s, "Image: "+fmt.Sprintf("%#v", this.Image)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ContainerInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&mesosproto.ContainerInfo{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringMesos(this.Type, "mesosproto.ContainerInfo_Type")+",\n") - } - if this.Volumes != nil { - s = append(s, "Volumes: "+fmt.Sprintf("%#v", this.Volumes)+",\n") - } - if this.Hostname != nil { - s = append(s, "Hostname: "+valueToGoStringMesos(this.Hostname, "string")+",\n") - } - if this.Docker != nil { - s = append(s, "Docker: "+fmt.Sprintf("%#v", this.Docker)+",\n") - } - if this.Mesos != nil { - s = append(s, "Mesos: "+fmt.Sprintf("%#v", this.Mesos)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ContainerInfo_DockerInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&mesosproto.ContainerInfo_DockerInfo{") - if this.Image != nil { - s = append(s, "Image: "+valueToGoStringMesos(this.Image, "string")+",\n") - } - if this.Network != nil { - s = append(s, "Network: "+valueToGoStringMesos(this.Network, "mesosproto.ContainerInfo_DockerInfo_Network")+",\n") - } - if this.PortMappings != nil { - s = append(s, "PortMappings: "+fmt.Sprintf("%#v", this.PortMappings)+",\n") - } - if this.Privileged != nil { - s = append(s, "Privileged: "+valueToGoStringMesos(this.Privileged, "bool")+",\n") - } - if this.Parameters != nil { - s = append(s, "Parameters: "+fmt.Sprintf("%#v", this.Parameters)+",\n") - } - if this.ForcePullImage != nil { - s = append(s, "ForcePullImage: "+valueToGoStringMesos(this.ForcePullImage, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ContainerInfo_DockerInfo_PortMapping) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.ContainerInfo_DockerInfo_PortMapping{") - if this.HostPort != nil { - s = append(s, "HostPort: "+valueToGoStringMesos(this.HostPort, "uint32")+",\n") - } - if this.ContainerPort != nil { - s = append(s, "ContainerPort: "+valueToGoStringMesos(this.ContainerPort, "uint32")+",\n") - } - if this.Protocol != nil { - s = append(s, "Protocol: "+valueToGoStringMesos(this.Protocol, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ContainerInfo_MesosInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.ContainerInfo_MesosInfo{") - if this.Image != nil { - s = append(s, "Image: "+fmt.Sprintf("%#v", this.Image)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Labels) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Labels{") - if this.Labels != nil { - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Label) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Label{") - if this.Key != nil { - s = append(s, "Key: "+valueToGoStringMesos(this.Key, "string")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Port) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Port{") - if this.Number != nil { - s = append(s, "Number: "+valueToGoStringMesos(this.Number, "uint32")+",\n") - } - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Protocol != nil { - s = append(s, "Protocol: "+valueToGoStringMesos(this.Protocol, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Ports) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Ports{") - if this.Ports != nil { - s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DiscoveryInfo) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&mesosproto.DiscoveryInfo{") - if this.Visibility != nil { - s = append(s, "Visibility: "+valueToGoStringMesos(this.Visibility, "mesosproto.DiscoveryInfo_Visibility")+",\n") - } - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Environment != nil { - s = append(s, "Environment: "+valueToGoStringMesos(this.Environment, "string")+",\n") - } - if this.Location != nil { - s = append(s, "Location: "+valueToGoStringMesos(this.Location, "string")+",\n") - } - if this.Version != nil { - s = append(s, "Version: "+valueToGoStringMesos(this.Version, "string")+",\n") - } - if this.Ports != nil { - s = append(s, "Ports: "+fmt.Sprintf("%#v", this.Ports)+",\n") - } - if this.Labels != nil { - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AppcImageManifest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&mesosproto.AppcImageManifest{") - if this.AcKind != nil { - s = append(s, "AcKind: "+valueToGoStringMesos(this.AcKind, "string")+",\n") - } - if this.AcVersion != nil { - s = append(s, "AcVersion: "+valueToGoStringMesos(this.AcVersion, "string")+",\n") - } - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Labels != nil { - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - } - if this.Annotations != nil { - s = append(s, "Annotations: "+fmt.Sprintf("%#v", this.Annotations)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AppcImageManifest_Label) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.AppcImageManifest_Label{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *AppcImageManifest_Annotation) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.AppcImageManifest_Annotation{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMesos(this.Name, "string")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringMesos(this.Value, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringMesos(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringMesos(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *FrameworkID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *FrameworkID) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *OfferID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *OfferID) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SlaveID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *SlaveID) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *TaskID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *TaskID) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ExecutorID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ExecutorID) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ContainerID) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ContainerID) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Address) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Address) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Hostname != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if m.Ip != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Ip))) - i += copy(data[i:], *m.Ip) - } - if m.Port == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") - } else { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *URL) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *URL) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Scheme == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("scheme") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Scheme))) - i += copy(data[i:], *m.Scheme) - } - if m.Address == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Address.Size())) - n1, err := m.Address.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.Path != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Path))) - i += copy(data[i:], *m.Path) - } - if len(m.Query) > 0 { - for _, msg := range m.Query { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Fragment != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Fragment))) - i += copy(data[i:], *m.Fragment) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *FrameworkInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *FrameworkInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.User == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("user") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.User))) - i += copy(data[i:], *m.User) - } - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Id != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n2, err := m.Id.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.FailoverTimeout != nil { - data[i] = 0x21 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.FailoverTimeout))) - } - if m.Checkpoint != nil { - data[i] = 0x28 - i++ - if *m.Checkpoint { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Role != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Role))) - i += copy(data[i:], *m.Role) - } - if m.Hostname != nil { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if m.Principal != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) - } - if m.WebuiUrl != nil { - data[i] = 0x4a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.WebuiUrl))) - i += copy(data[i:], *m.WebuiUrl) - } - if len(m.Capabilities) > 0 { - for _, msg := range m.Capabilities { - data[i] = 0x52 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Labels != nil { - data[i] = 0x5a - i++ - i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) - n3, err := m.Labels.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *FrameworkInfo_Capability) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *FrameworkInfo_Capability) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *HealthCheck) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *HealthCheck) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Http != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Http.Size())) - n4, err := m.Http.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.DelaySeconds != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.DelaySeconds))) - } - if m.IntervalSeconds != nil { - data[i] = 0x19 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.IntervalSeconds))) - } - if m.TimeoutSeconds != nil { - data[i] = 0x21 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.TimeoutSeconds))) - } - if m.ConsecutiveFailures != nil { - data[i] = 0x28 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ConsecutiveFailures)) - } - if m.GracePeriodSeconds != nil { - data[i] = 0x31 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.GracePeriodSeconds))) - } - if m.Command != nil { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n5, err := m.Command.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *HealthCheck_HTTP) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *HealthCheck_HTTP) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Port == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) - } - if m.Path != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Path))) - i += copy(data[i:], *m.Path) - } - if len(m.Statuses) > 0 { - for _, num := range m.Statuses { - data[i] = 0x20 - i++ - i = encodeVarintMesos(data, i, uint64(num)) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *CommandInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *CommandInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Uris) > 0 { - for _, msg := range m.Uris { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Environment != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Environment.Size())) - n6, err := m.Environment.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.Value != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.Container != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n7, err := m.Container.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.User != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.User))) - i += copy(data[i:], *m.User) - } - if m.Shell != nil { - data[i] = 0x30 - i++ - if *m.Shell { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if len(m.Arguments) > 0 { - for _, s := range m.Arguments { - data[i] = 0x3a - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *CommandInfo_URI) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *CommandInfo_URI) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.Executable != nil { - data[i] = 0x10 - i++ - if *m.Executable { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Extract != nil { - data[i] = 0x18 - i++ - if *m.Extract { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Cache != nil { - data[i] = 0x20 - i++ - if *m.Cache { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *CommandInfo_ContainerInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *CommandInfo_ContainerInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Image == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Image))) - i += copy(data[i:], *m.Image) - } - if len(m.Options) > 0 { - for _, s := range m.Options { - data[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ExecutorInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ExecutorInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) - n8, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.Data != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Command == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("command") - } else { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n9, err := m.Command.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n9 - } - if m.FrameworkId != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) - n10, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n10 - } - if m.Name != nil { - data[i] = 0x4a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Source != nil { - data[i] = 0x52 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Source))) - i += copy(data[i:], *m.Source) - } - if m.Container != nil { - data[i] = 0x5a - i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n11, err := m.Container.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n11 - } - if m.Discovery != nil { - data[i] = 0x62 - i++ - i = encodeVarintMesos(data, i, uint64(m.Discovery.Size())) - n12, err := m.Discovery.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n12 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *MasterInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *MasterInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Id == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Id))) - i += copy(data[i:], *m.Id) - } - if m.Ip == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("ip") - } else { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Ip)) - } - if m.Port == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") - } else { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) - } - if m.Pid != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Pid))) - i += copy(data[i:], *m.Pid) - } - if m.Hostname != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if m.Version != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Version))) - i += copy(data[i:], *m.Version) - } - if m.Address != nil { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(m.Address.Size())) - n13, err := m.Address.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SlaveInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *SlaveInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Hostname == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Attributes) > 0 { - for _, msg := range m.Attributes { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Id != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n14, err := m.Id.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n14 - } - if m.Checkpoint != nil { - data[i] = 0x38 - i++ - if *m.Checkpoint { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Port != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Port)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Value) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Value) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n15, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if m.Ranges != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n16, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if m.Set != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n17, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n17 - } - if m.Text != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Text.Size())) - n18, err := m.Text.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n18 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Value_Scalar) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Value_Scalar) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Value))) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Value_Range) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Value_Range) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Begin == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("begin") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Begin)) - } - if m.End == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("end") - } else { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.End)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Value_Ranges) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Value_Ranges) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Range) > 0 { - for _, msg := range m.Range { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Value_Set) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Value_Set) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Item) > 0 { - for _, s := range m.Item { - data[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Value_Text) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Value_Text) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Attribute) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Attribute) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n19, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n19 - } - if m.Ranges != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n20, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n20 - } - if m.Text != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Text.Size())) - n21, err := m.Text.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n21 - } - if m.Set != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n22, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Resource) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Resource) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Scalar != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Scalar.Size())) - n23, err := m.Scalar.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n23 - } - if m.Ranges != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Ranges.Size())) - n24, err := m.Ranges.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n24 - } - if m.Set != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Set.Size())) - n25, err := m.Set.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n25 - } - if m.Role != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Role))) - i += copy(data[i:], *m.Role) - } - if m.Disk != nil { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(m.Disk.Size())) - n26, err := m.Disk.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n26 - } - if m.Reservation != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(m.Reservation.Size())) - n27, err := m.Reservation.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n27 - } - if m.Revocable != nil { - data[i] = 0x4a - i++ - i = encodeVarintMesos(data, i, uint64(m.Revocable.Size())) - n28, err := m.Revocable.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n28 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Resource_ReservationInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Resource_ReservationInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Principal == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Resource_DiskInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Resource_DiskInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Persistence != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Persistence.Size())) - n29, err := m.Persistence.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if m.Volume != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Volume.Size())) - n30, err := m.Volume.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n30 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Resource_DiskInfo_Persistence) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Resource_DiskInfo_Persistence) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Id == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Id))) - i += copy(data[i:], *m.Id) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Resource_RevocableInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Resource_RevocableInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *TrafficControlStatistics) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *TrafficControlStatistics) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Id == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Id))) - i += copy(data[i:], *m.Id) - } - if m.Backlog != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Backlog)) - } - if m.Bytes != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Bytes)) - } - if m.Drops != nil { - data[i] = 0x20 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Drops)) - } - if m.Overlimits != nil { - data[i] = 0x28 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Overlimits)) - } - if m.Packets != nil { - data[i] = 0x30 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Packets)) - } - if m.Qlen != nil { - data[i] = 0x38 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Qlen)) - } - if m.Ratebps != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Ratebps)) - } - if m.Ratepps != nil { - data[i] = 0x48 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Ratepps)) - } - if m.Requeues != nil { - data[i] = 0x50 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Requeues)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ResourceStatistics) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ResourceStatistics) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Timestamp == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") - } else { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) - } - if m.CpusUserTimeSecs != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusUserTimeSecs))) - } - if m.CpusSystemTimeSecs != nil { - data[i] = 0x19 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusSystemTimeSecs))) - } - if m.CpusLimit != nil { - data[i] = 0x21 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusLimit))) - } - if m.MemRssBytes != nil { - data[i] = 0x28 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemRssBytes)) - } - if m.MemLimitBytes != nil { - data[i] = 0x30 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemLimitBytes)) - } - if m.CpusNrPeriods != nil { - data[i] = 0x38 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpusNrPeriods)) - } - if m.CpusNrThrottled != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpusNrThrottled)) - } - if m.CpusThrottledTimeSecs != nil { - data[i] = 0x49 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpusThrottledTimeSecs))) - } - if m.MemFileBytes != nil { - data[i] = 0x50 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemFileBytes)) - } - if m.MemAnonBytes != nil { - data[i] = 0x58 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemAnonBytes)) - } - if m.MemMappedFileBytes != nil { - data[i] = 0x60 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemMappedFileBytes)) - } - if m.Perf != nil { - data[i] = 0x6a - i++ - i = encodeVarintMesos(data, i, uint64(m.Perf.Size())) - n31, err := m.Perf.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n31 - } - if m.NetRxPackets != nil { - data[i] = 0x70 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxPackets)) - } - if m.NetRxBytes != nil { - data[i] = 0x78 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxBytes)) - } - if m.NetRxErrors != nil { - data[i] = 0x80 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxErrors)) - } - if m.NetRxDropped != nil { - data[i] = 0x88 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetRxDropped)) - } - if m.NetTxPackets != nil { - data[i] = 0x90 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxPackets)) - } - if m.NetTxBytes != nil { - data[i] = 0x98 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxBytes)) - } - if m.NetTxErrors != nil { - data[i] = 0xa0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxErrors)) - } - if m.NetTxDropped != nil { - data[i] = 0xa8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NetTxDropped)) - } - if m.NetTcpRttMicrosecsP50 != nil { - data[i] = 0xb1 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP50))) - } - if m.NetTcpRttMicrosecsP90 != nil { - data[i] = 0xb9 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP90))) - } - if m.NetTcpRttMicrosecsP95 != nil { - data[i] = 0xc1 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP95))) - } - if m.NetTcpRttMicrosecsP99 != nil { - data[i] = 0xc9 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpRttMicrosecsP99))) - } - if m.DiskLimitBytes != nil { - data[i] = 0xd0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DiskLimitBytes)) - } - if m.DiskUsedBytes != nil { - data[i] = 0xd8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DiskUsedBytes)) - } - if m.NetTcpActiveConnections != nil { - data[i] = 0xe1 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpActiveConnections))) - } - if m.NetTcpTimeWaitConnections != nil { - data[i] = 0xe9 - i++ - data[i] = 0x1 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.NetTcpTimeWaitConnections))) - } - if m.Processes != nil { - data[i] = 0xf0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Processes)) - } - if m.Threads != nil { - data[i] = 0xf8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Threads)) - } - if m.MemLowPressureCounter != nil { - data[i] = 0x80 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemLowPressureCounter)) - } - if m.MemMediumPressureCounter != nil { - data[i] = 0x88 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemMediumPressureCounter)) - } - if m.MemCriticalPressureCounter != nil { - data[i] = 0x90 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemCriticalPressureCounter)) - } - if len(m.NetTrafficControlStatistics) > 0 { - for _, msg := range m.NetTrafficControlStatistics { - data[i] = 0x9a - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.MemTotalBytes != nil { - data[i] = 0xa0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemTotalBytes)) - } - if m.MemTotalMemswBytes != nil { - data[i] = 0xa8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemTotalMemswBytes)) - } - if m.MemSoftLimitBytes != nil { - data[i] = 0xb0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemSoftLimitBytes)) - } - if m.MemCacheBytes != nil { - data[i] = 0xb8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemCacheBytes)) - } - if m.MemSwapBytes != nil { - data[i] = 0xc0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemSwapBytes)) - } - if m.MemUnevictableBytes != nil { - data[i] = 0xc8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MemUnevictableBytes)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ResourceUsage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ResourceUsage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Executors) > 0 { - for _, msg := range m.Executors { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Total) > 0 { - for _, msg := range m.Total { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ResourceUsage_Executor) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ResourceUsage_Executor) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ExecutorInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_info") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorInfo.Size())) - n32, err := m.ExecutorInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n32 - } - if len(m.Allocated) > 0 { - for _, msg := range m.Allocated { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Statistics != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Statistics.Size())) - n33, err := m.Statistics.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n33 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *PerfStatistics) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *PerfStatistics) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Timestamp == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") - } else { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) - } - if m.Duration == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("duration") - } else { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Duration))) - } - if m.Cycles != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Cycles)) - } - if m.StalledCyclesFrontend != nil { - data[i] = 0x20 - i++ - i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesFrontend)) - } - if m.StalledCyclesBackend != nil { - data[i] = 0x28 - i++ - i = encodeVarintMesos(data, i, uint64(*m.StalledCyclesBackend)) - } - if m.Instructions != nil { - data[i] = 0x30 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Instructions)) - } - if m.CacheReferences != nil { - data[i] = 0x38 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CacheReferences)) - } - if m.CacheMisses != nil { - data[i] = 0x40 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CacheMisses)) - } - if m.Branches != nil { - data[i] = 0x48 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Branches)) - } - if m.BranchMisses != nil { - data[i] = 0x50 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchMisses)) - } - if m.BusCycles != nil { - data[i] = 0x58 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BusCycles)) - } - if m.RefCycles != nil { - data[i] = 0x60 - i++ - i = encodeVarintMesos(data, i, uint64(*m.RefCycles)) - } - if m.CpuClock != nil { - data[i] = 0x69 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.CpuClock))) - } - if m.TaskClock != nil { - data[i] = 0x71 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.TaskClock))) - } - if m.PageFaults != nil { - data[i] = 0x78 - i++ - i = encodeVarintMesos(data, i, uint64(*m.PageFaults)) - } - if m.MinorFaults != nil { - data[i] = 0x80 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MinorFaults)) - } - if m.MajorFaults != nil { - data[i] = 0x88 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.MajorFaults)) - } - if m.ContextSwitches != nil { - data[i] = 0x90 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ContextSwitches)) - } - if m.CpuMigrations != nil { - data[i] = 0x98 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.CpuMigrations)) - } - if m.AlignmentFaults != nil { - data[i] = 0xa0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.AlignmentFaults)) - } - if m.EmulationFaults != nil { - data[i] = 0xa8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.EmulationFaults)) - } - if m.L1DcacheLoads != nil { - data[i] = 0xb0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoads)) - } - if m.L1DcacheLoadMisses != nil { - data[i] = 0xb8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheLoadMisses)) - } - if m.L1DcacheStores != nil { - data[i] = 0xc0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStores)) - } - if m.L1DcacheStoreMisses != nil { - data[i] = 0xc8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcacheStoreMisses)) - } - if m.L1DcachePrefetches != nil { - data[i] = 0xd0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetches)) - } - if m.L1DcachePrefetchMisses != nil { - data[i] = 0xd8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1DcachePrefetchMisses)) - } - if m.L1IcacheLoads != nil { - data[i] = 0xe0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoads)) - } - if m.L1IcacheLoadMisses != nil { - data[i] = 0xe8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcacheLoadMisses)) - } - if m.L1IcachePrefetches != nil { - data[i] = 0xf0 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetches)) - } - if m.L1IcachePrefetchMisses != nil { - data[i] = 0xf8 - i++ - data[i] = 0x1 - i++ - i = encodeVarintMesos(data, i, uint64(*m.L1IcachePrefetchMisses)) - } - if m.LlcLoads != nil { - data[i] = 0x80 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcLoads)) - } - if m.LlcLoadMisses != nil { - data[i] = 0x88 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcLoadMisses)) - } - if m.LlcStores != nil { - data[i] = 0x90 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcStores)) - } - if m.LlcStoreMisses != nil { - data[i] = 0x98 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcStoreMisses)) - } - if m.LlcPrefetches != nil { - data[i] = 0xa0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetches)) - } - if m.LlcPrefetchMisses != nil { - data[i] = 0xa8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.LlcPrefetchMisses)) - } - if m.DtlbLoads != nil { - data[i] = 0xb0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbLoads)) - } - if m.DtlbLoadMisses != nil { - data[i] = 0xb8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbLoadMisses)) - } - if m.DtlbStores != nil { - data[i] = 0xc0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbStores)) - } - if m.DtlbStoreMisses != nil { - data[i] = 0xc8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbStoreMisses)) - } - if m.DtlbPrefetches != nil { - data[i] = 0xd0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetches)) - } - if m.DtlbPrefetchMisses != nil { - data[i] = 0xd8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.DtlbPrefetchMisses)) - } - if m.ItlbLoads != nil { - data[i] = 0xe0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ItlbLoads)) - } - if m.ItlbLoadMisses != nil { - data[i] = 0xe8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ItlbLoadMisses)) - } - if m.BranchLoads != nil { - data[i] = 0xf0 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchLoads)) - } - if m.BranchLoadMisses != nil { - data[i] = 0xf8 - i++ - data[i] = 0x2 - i++ - i = encodeVarintMesos(data, i, uint64(*m.BranchLoadMisses)) - } - if m.NodeLoads != nil { - data[i] = 0x80 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeLoads)) - } - if m.NodeLoadMisses != nil { - data[i] = 0x88 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeLoadMisses)) - } - if m.NodeStores != nil { - data[i] = 0x90 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeStores)) - } - if m.NodeStoreMisses != nil { - data[i] = 0x98 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodeStoreMisses)) - } - if m.NodePrefetches != nil { - data[i] = 0xa0 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodePrefetches)) - } - if m.NodePrefetchMisses != nil { - data[i] = 0xa8 - i++ - data[i] = 0x3 - i++ - i = encodeVarintMesos(data, i, uint64(*m.NodePrefetchMisses)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Request) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Request) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n34, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n34 - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Offer) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Offer) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Id == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Id.Size())) - n35, err := m.Id.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n35 - } - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.FrameworkId.Size())) - n36, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n36 - } - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n37, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n37 - } - if m.Hostname == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") - } else { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.ExecutorIds) > 0 { - for _, msg := range m.ExecutorIds { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Attributes) > 0 { - for _, msg := range m.Attributes { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Url != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(m.Url.Size())) - n38, err := m.Url.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n38 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Offer_Operation) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Offer_Operation) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Launch != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Launch.Size())) - n39, err := m.Launch.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n39 - } - if m.Reserve != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Reserve.Size())) - n40, err := m.Reserve.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n40 - } - if m.Unreserve != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Unreserve.Size())) - n41, err := m.Unreserve.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n41 - } - if m.Create != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Create.Size())) - n42, err := m.Create.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n42 - } - if m.Destroy != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(m.Destroy.Size())) - n43, err := m.Destroy.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n43 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Offer_Operation_Launch) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Offer_Operation_Launch) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.TaskInfos) > 0 { - for _, msg := range m.TaskInfos { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Offer_Operation_Reserve) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Offer_Operation_Reserve) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Offer_Operation_Unreserve) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Offer_Operation_Unreserve) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Offer_Operation_Create) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Offer_Operation_Create) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Volumes) > 0 { - for _, msg := range m.Volumes { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Offer_Operation_Destroy) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Offer_Operation_Destroy) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Volumes) > 0 { - for _, msg := range m.Volumes { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *TaskInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *TaskInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) - n44, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n44 - } - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n45, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n45 - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Executor != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Executor.Size())) - n46, err := m.Executor.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n46 - } - if m.Data != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if m.Command != nil { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(m.Command.Size())) - n47, err := m.Command.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n47 - } - if m.HealthCheck != nil { - data[i] = 0x42 - i++ - i = encodeVarintMesos(data, i, uint64(m.HealthCheck.Size())) - n48, err := m.HealthCheck.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n48 - } - if m.Container != nil { - data[i] = 0x4a - i++ - i = encodeVarintMesos(data, i, uint64(m.Container.Size())) - n49, err := m.Container.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n49 - } - if m.Labels != nil { - data[i] = 0x52 - i++ - i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) - n50, err := m.Labels.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n50 - } - if m.Discovery != nil { - data[i] = 0x5a - i++ - i = encodeVarintMesos(data, i, uint64(m.Discovery.Size())) - n51, err := m.Discovery.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n51 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *TaskStatus) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *TaskStatus) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.TaskId.Size())) - n52, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n52 - } - if m.State == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("state") - } else { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.State)) - } - if m.Data != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if m.Message != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Message))) - i += copy(data[i:], *m.Message) - } - if m.SlaveId != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.SlaveId.Size())) - n53, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n53 - } - if m.Timestamp != nil { - data[i] = 0x31 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Timestamp))) - } - if m.ExecutorId != nil { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(m.ExecutorId.Size())) - n54, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n54 - } - if m.Healthy != nil { - data[i] = 0x40 - i++ - if *m.Healthy { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.Source != nil { - data[i] = 0x48 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Source)) - } - if m.Reason != nil { - data[i] = 0x50 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Reason)) - } - if m.Uuid != nil { - data[i] = 0x5a - i++ - i = encodeVarintMesos(data, i, uint64(len(m.Uuid))) - i += copy(data[i:], m.Uuid) - } - if m.Labels != nil { - data[i] = 0x62 - i++ - i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) - n55, err := m.Labels.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n55 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Filters) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Filters) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.RefuseSeconds != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.RefuseSeconds))) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Environment) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Environment) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Variables) > 0 { - for _, msg := range m.Variables { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Environment_Variable) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Environment_Variable) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Parameter) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Parameter) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Key == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Key))) - i += copy(data[i:], *m.Key) - } - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Parameters) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Parameters) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Parameter) > 0 { - for _, msg := range m.Parameter { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Credential) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Credential) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Principal == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) - } - if m.Secret != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(m.Secret))) - i += copy(data[i:], m.Secret) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Credentials) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Credentials) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Credentials) > 0 { - for _, msg := range m.Credentials { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RateLimit) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RateLimit) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Qps != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.Qps))) - } - if m.Principal == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Principal))) - i += copy(data[i:], *m.Principal) - } - if m.Capacity != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Capacity)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RateLimits) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RateLimits) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Limits) > 0 { - for _, msg := range m.Limits { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.AggregateDefaultQps != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Mesos(data, i, uint64(math.Float64bits(*m.AggregateDefaultQps))) - } - if m.AggregateDefaultCapacity != nil { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.AggregateDefaultCapacity)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Image) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Image) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if m.Appc != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(m.Appc.Size())) - n56, err := m.Appc.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n56 - } - if m.Docker != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Docker.Size())) - n57, err := m.Docker.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n57 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Image_AppC) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Image_AppC) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Id != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Id))) - i += copy(data[i:], *m.Id) - } - if m.Labels != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) - n58, err := m.Labels.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n58 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Image_Docker) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Image_Docker) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Volume) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Volume) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ContainerPath == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_path") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.ContainerPath))) - i += copy(data[i:], *m.ContainerPath) - } - if m.HostPath != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.HostPath))) - i += copy(data[i:], *m.HostPath) - } - if m.Mode == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("mode") - } else { - data[i] = 0x18 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Mode)) - } - if m.Image != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(m.Image.Size())) - n59, err := m.Image.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n59 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ContainerInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ContainerInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Type)) - } - if len(m.Volumes) > 0 { - for _, msg := range m.Volumes { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Docker != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(m.Docker.Size())) - n60, err := m.Docker.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n60 - } - if m.Hostname != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Hostname))) - i += copy(data[i:], *m.Hostname) - } - if m.Mesos != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(m.Mesos.Size())) - n61, err := m.Mesos.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n61 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ContainerInfo_DockerInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ContainerInfo_DockerInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Image == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Image))) - i += copy(data[i:], *m.Image) - } - if m.Network != nil { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Network)) - } - if len(m.PortMappings) > 0 { - for _, msg := range m.PortMappings { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Privileged != nil { - data[i] = 0x20 - i++ - if *m.Privileged { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if len(m.Parameters) > 0 { - for _, msg := range m.Parameters { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.ForcePullImage != nil { - data[i] = 0x30 - i++ - if *m.ForcePullImage { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ContainerInfo_DockerInfo_PortMapping) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ContainerInfo_DockerInfo_PortMapping) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.HostPort == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("host_port") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.HostPort)) - } - if m.ContainerPort == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_port") - } else { - data[i] = 0x10 - i++ - i = encodeVarintMesos(data, i, uint64(*m.ContainerPort)) - } - if m.Protocol != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Protocol))) - i += copy(data[i:], *m.Protocol) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ContainerInfo_MesosInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ContainerInfo_MesosInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Image != nil { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(m.Image.Size())) - n62, err := m.Image.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n62 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Labels) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Labels) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Labels) > 0 { - for _, msg := range m.Labels { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Label) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Label) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Key == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Key))) - i += copy(data[i:], *m.Key) - } - if m.Value != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Port) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Port) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Number == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("number") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Number)) - } - if m.Name != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Protocol != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Protocol))) - i += copy(data[i:], *m.Protocol) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Ports) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Ports) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Ports) > 0 { - for _, msg := range m.Ports { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *DiscoveryInfo) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *DiscoveryInfo) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Visibility == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("visibility") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMesos(data, i, uint64(*m.Visibility)) - } - if m.Name != nil { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Environment != nil { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Environment))) - i += copy(data[i:], *m.Environment) - } - if m.Location != nil { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Location))) - i += copy(data[i:], *m.Location) - } - if m.Version != nil { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Version))) - i += copy(data[i:], *m.Version) - } - if m.Ports != nil { - data[i] = 0x32 - i++ - i = encodeVarintMesos(data, i, uint64(m.Ports.Size())) - n63, err := m.Ports.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n63 - } - if m.Labels != nil { - data[i] = 0x3a - i++ - i = encodeVarintMesos(data, i, uint64(m.Labels.Size())) - n64, err := m.Labels.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n64 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AppcImageManifest) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AppcImageManifest) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.AcKind == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("acKind") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.AcKind))) - i += copy(data[i:], *m.AcKind) - } - if m.AcVersion == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("acVersion") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.AcVersion))) - i += copy(data[i:], *m.AcVersion) - } - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if len(m.Labels) > 0 { - for _, msg := range m.Labels { - data[i] = 0x22 - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Annotations) > 0 { - for _, msg := range m.Annotations { - data[i] = 0x2a - i++ - i = encodeVarintMesos(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AppcImageManifest_Label) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AppcImageManifest_Label) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *AppcImageManifest_Annotation) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *AppcImageManifest_Annotation) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMesos(data, i, uint64(len(*m.Value))) - i += copy(data[i:], *m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Mesos(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Mesos(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintMesos(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedFrameworkID(r randyMesos, easy bool) *FrameworkID { - this := &FrameworkID{} - v1 := randStringMesos(r) - this.Value = &v1 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedOfferID(r randyMesos, easy bool) *OfferID { - this := &OfferID{} - v2 := randStringMesos(r) - this.Value = &v2 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedSlaveID(r randyMesos, easy bool) *SlaveID { - this := &SlaveID{} - v3 := randStringMesos(r) - this.Value = &v3 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedTaskID(r randyMesos, easy bool) *TaskID { - this := &TaskID{} - v4 := randStringMesos(r) - this.Value = &v4 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedExecutorID(r randyMesos, easy bool) *ExecutorID { - this := &ExecutorID{} - v5 := randStringMesos(r) - this.Value = &v5 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedContainerID(r randyMesos, easy bool) *ContainerID { - this := &ContainerID{} - v6 := randStringMesos(r) - this.Value = &v6 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedAddress(r randyMesos, easy bool) *Address { - this := &Address{} - if r.Intn(10) != 0 { - v7 := randStringMesos(r) - this.Hostname = &v7 - } - if r.Intn(10) != 0 { - v8 := randStringMesos(r) - this.Ip = &v8 - } - v9 := int32(r.Int31()) - if r.Intn(2) == 0 { - v9 *= -1 - } - this.Port = &v9 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) - } - return this -} - -func NewPopulatedURL(r randyMesos, easy bool) *URL { - this := &URL{} - v10 := randStringMesos(r) - this.Scheme = &v10 - this.Address = NewPopulatedAddress(r, easy) - if r.Intn(10) != 0 { - v11 := randStringMesos(r) - this.Path = &v11 - } - if r.Intn(10) != 0 { - v12 := r.Intn(10) - this.Query = make([]*Parameter, v12) - for i := 0; i < v12; i++ { - this.Query[i] = NewPopulatedParameter(r, easy) - } - } - if r.Intn(10) != 0 { - v13 := randStringMesos(r) - this.Fragment = &v13 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) - } - return this -} - -func NewPopulatedFrameworkInfo(r randyMesos, easy bool) *FrameworkInfo { - this := &FrameworkInfo{} - v14 := randStringMesos(r) - this.User = &v14 - v15 := randStringMesos(r) - this.Name = &v15 - if r.Intn(10) != 0 { - this.Id = NewPopulatedFrameworkID(r, easy) - } - if r.Intn(10) != 0 { - v16 := float64(r.Float64()) - if r.Intn(2) == 0 { - v16 *= -1 - } - this.FailoverTimeout = &v16 - } - if r.Intn(10) != 0 { - v17 := bool(bool(r.Intn(2) == 0)) - this.Checkpoint = &v17 - } - if r.Intn(10) != 0 { - v18 := randStringMesos(r) - this.Role = &v18 - } - if r.Intn(10) != 0 { - v19 := randStringMesos(r) - this.Hostname = &v19 - } - if r.Intn(10) != 0 { - v20 := randStringMesos(r) - this.Principal = &v20 - } - if r.Intn(10) != 0 { - v21 := randStringMesos(r) - this.WebuiUrl = &v21 - } - if r.Intn(10) != 0 { - v22 := r.Intn(10) - this.Capabilities = make([]*FrameworkInfo_Capability, v22) - for i := 0; i < v22; i++ { - this.Capabilities[i] = NewPopulatedFrameworkInfo_Capability(r, easy) - } - } - if r.Intn(10) != 0 { - this.Labels = NewPopulatedLabels(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 12) - } - return this -} - -func NewPopulatedFrameworkInfo_Capability(r randyMesos, easy bool) *FrameworkInfo_Capability { - this := &FrameworkInfo_Capability{} - v23 := FrameworkInfo_Capability_Type([]int32{1}[r.Intn(1)]) - this.Type = &v23 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedHealthCheck(r randyMesos, easy bool) *HealthCheck { - this := &HealthCheck{} - if r.Intn(10) != 0 { - this.Http = NewPopulatedHealthCheck_HTTP(r, easy) - } - if r.Intn(10) != 0 { - v24 := float64(r.Float64()) - if r.Intn(2) == 0 { - v24 *= -1 - } - this.DelaySeconds = &v24 - } - if r.Intn(10) != 0 { - v25 := float64(r.Float64()) - if r.Intn(2) == 0 { - v25 *= -1 - } - this.IntervalSeconds = &v25 - } - if r.Intn(10) != 0 { - v26 := float64(r.Float64()) - if r.Intn(2) == 0 { - v26 *= -1 - } - this.TimeoutSeconds = &v26 - } - if r.Intn(10) != 0 { - v27 := uint32(r.Uint32()) - this.ConsecutiveFailures = &v27 - } - if r.Intn(10) != 0 { - v28 := float64(r.Float64()) - if r.Intn(2) == 0 { - v28 *= -1 - } - this.GracePeriodSeconds = &v28 - } - if r.Intn(10) != 0 { - this.Command = NewPopulatedCommandInfo(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) - } - return this -} - -func NewPopulatedHealthCheck_HTTP(r randyMesos, easy bool) *HealthCheck_HTTP { - this := &HealthCheck_HTTP{} - v29 := uint32(r.Uint32()) - this.Port = &v29 - if r.Intn(10) != 0 { - v30 := randStringMesos(r) - this.Path = &v30 - } - if r.Intn(10) != 0 { - v31 := r.Intn(100) - this.Statuses = make([]uint32, v31) - for i := 0; i < v31; i++ { - this.Statuses[i] = uint32(r.Uint32()) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) - } - return this -} - -func NewPopulatedCommandInfo(r randyMesos, easy bool) *CommandInfo { - this := &CommandInfo{} - if r.Intn(10) != 0 { - v32 := r.Intn(10) - this.Uris = make([]*CommandInfo_URI, v32) - for i := 0; i < v32; i++ { - this.Uris[i] = NewPopulatedCommandInfo_URI(r, easy) - } - } - if r.Intn(10) != 0 { - this.Environment = NewPopulatedEnvironment(r, easy) - } - if r.Intn(10) != 0 { - v33 := randStringMesos(r) - this.Value = &v33 - } - if r.Intn(10) != 0 { - this.Container = NewPopulatedCommandInfo_ContainerInfo(r, easy) - } - if r.Intn(10) != 0 { - v34 := randStringMesos(r) - this.User = &v34 - } - if r.Intn(10) != 0 { - v35 := bool(bool(r.Intn(2) == 0)) - this.Shell = &v35 - } - if r.Intn(10) != 0 { - v36 := r.Intn(10) - this.Arguments = make([]string, v36) - for i := 0; i < v36; i++ { - this.Arguments[i] = randStringMesos(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) - } - return this -} - -func NewPopulatedCommandInfo_URI(r randyMesos, easy bool) *CommandInfo_URI { - this := &CommandInfo_URI{} - v37 := randStringMesos(r) - this.Value = &v37 - if r.Intn(10) != 0 { - v38 := bool(bool(r.Intn(2) == 0)) - this.Executable = &v38 - } - if r.Intn(10) != 0 { - v39 := bool(bool(r.Intn(2) == 0)) - this.Extract = &v39 - } - if r.Intn(10) != 0 { - v40 := bool(bool(r.Intn(2) == 0)) - this.Cache = &v40 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) - } - return this -} - -func NewPopulatedCommandInfo_ContainerInfo(r randyMesos, easy bool) *CommandInfo_ContainerInfo { - this := &CommandInfo_ContainerInfo{} - v41 := randStringMesos(r) - this.Image = &v41 - if r.Intn(10) != 0 { - v42 := r.Intn(10) - this.Options = make([]string, v42) - for i := 0; i < v42; i++ { - this.Options[i] = randStringMesos(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedExecutorInfo(r randyMesos, easy bool) *ExecutorInfo { - this := &ExecutorInfo{} - this.ExecutorId = NewPopulatedExecutorID(r, easy) - if r.Intn(10) != 0 { - v43 := r.Intn(100) - this.Data = make([]byte, v43) - for i := 0; i < v43; i++ { - this.Data[i] = byte(r.Intn(256)) - } - } - if r.Intn(10) != 0 { - v44 := r.Intn(10) - this.Resources = make([]*Resource, v44) - for i := 0; i < v44; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - this.Command = NewPopulatedCommandInfo(r, easy) - if r.Intn(10) != 0 { - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - } - if r.Intn(10) != 0 { - v45 := randStringMesos(r) - this.Name = &v45 - } - if r.Intn(10) != 0 { - v46 := randStringMesos(r) - this.Source = &v46 - } - if r.Intn(10) != 0 { - this.Container = NewPopulatedContainerInfo(r, easy) - } - if r.Intn(10) != 0 { - this.Discovery = NewPopulatedDiscoveryInfo(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 13) - } - return this -} - -func NewPopulatedMasterInfo(r randyMesos, easy bool) *MasterInfo { - this := &MasterInfo{} - v47 := randStringMesos(r) - this.Id = &v47 - v48 := uint32(r.Uint32()) - this.Ip = &v48 - v49 := uint32(r.Uint32()) - this.Port = &v49 - if r.Intn(10) != 0 { - v50 := randStringMesos(r) - this.Pid = &v50 - } - if r.Intn(10) != 0 { - v51 := randStringMesos(r) - this.Hostname = &v51 - } - if r.Intn(10) != 0 { - v52 := randStringMesos(r) - this.Version = &v52 - } - if r.Intn(10) != 0 { - this.Address = NewPopulatedAddress(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) - } - return this -} - -func NewPopulatedSlaveInfo(r randyMesos, easy bool) *SlaveInfo { - this := &SlaveInfo{} - v53 := randStringMesos(r) - this.Hostname = &v53 - if r.Intn(10) != 0 { - v54 := r.Intn(10) - this.Resources = make([]*Resource, v54) - for i := 0; i < v54; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if r.Intn(10) != 0 { - v55 := r.Intn(10) - this.Attributes = make([]*Attribute, v55) - for i := 0; i < v55; i++ { - this.Attributes[i] = NewPopulatedAttribute(r, easy) - } - } - if r.Intn(10) != 0 { - this.Id = NewPopulatedSlaveID(r, easy) - } - if r.Intn(10) != 0 { - v56 := bool(bool(r.Intn(2) == 0)) - this.Checkpoint = &v56 - } - if r.Intn(10) != 0 { - v57 := int32(r.Int31()) - if r.Intn(2) == 0 { - v57 *= -1 - } - this.Port = &v57 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 9) - } - return this -} - -func NewPopulatedValue(r randyMesos, easy bool) *Value { - this := &Value{} - v58 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v58 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) - } - if r.Intn(10) != 0 { - this.Text = NewPopulatedValue_Text(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) - } - return this -} - -func NewPopulatedValue_Scalar(r randyMesos, easy bool) *Value_Scalar { - this := &Value_Scalar{} - v59 := float64(r.Float64()) - if r.Intn(2) == 0 { - v59 *= -1 - } - this.Value = &v59 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedValue_Range(r randyMesos, easy bool) *Value_Range { - this := &Value_Range{} - v60 := uint64(uint64(r.Uint32())) - this.Begin = &v60 - v61 := uint64(uint64(r.Uint32())) - this.End = &v61 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedValue_Ranges(r randyMesos, easy bool) *Value_Ranges { - this := &Value_Ranges{} - if r.Intn(10) != 0 { - v62 := r.Intn(10) - this.Range = make([]*Value_Range, v62) - for i := 0; i < v62; i++ { - this.Range[i] = NewPopulatedValue_Range(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedValue_Set(r randyMesos, easy bool) *Value_Set { - this := &Value_Set{} - if r.Intn(10) != 0 { - v63 := r.Intn(10) - this.Item = make([]string, v63) - for i := 0; i < v63; i++ { - this.Item[i] = randStringMesos(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedValue_Text(r randyMesos, easy bool) *Value_Text { - this := &Value_Text{} - v64 := randStringMesos(r) - this.Value = &v64 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedAttribute(r randyMesos, easy bool) *Attribute { - this := &Attribute{} - v65 := randStringMesos(r) - this.Name = &v65 - v66 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v66 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Text = NewPopulatedValue_Text(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) - } - return this -} - -func NewPopulatedResource(r randyMesos, easy bool) *Resource { - this := &Resource{} - v67 := randStringMesos(r) - this.Name = &v67 - v68 := Value_Type([]int32{0, 1, 2, 3}[r.Intn(4)]) - this.Type = &v68 - if r.Intn(10) != 0 { - this.Scalar = NewPopulatedValue_Scalar(r, easy) - } - if r.Intn(10) != 0 { - this.Ranges = NewPopulatedValue_Ranges(r, easy) - } - if r.Intn(10) != 0 { - this.Set = NewPopulatedValue_Set(r, easy) - } - if r.Intn(10) != 0 { - v69 := randStringMesos(r) - this.Role = &v69 - } - if r.Intn(10) != 0 { - this.Disk = NewPopulatedResource_DiskInfo(r, easy) - } - if r.Intn(10) != 0 { - this.Reservation = NewPopulatedResource_ReservationInfo(r, easy) - } - if r.Intn(10) != 0 { - this.Revocable = NewPopulatedResource_RevocableInfo(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 10) - } - return this -} - -func NewPopulatedResource_ReservationInfo(r randyMesos, easy bool) *Resource_ReservationInfo { - this := &Resource_ReservationInfo{} - v70 := randStringMesos(r) - this.Principal = &v70 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedResource_DiskInfo(r randyMesos, easy bool) *Resource_DiskInfo { - this := &Resource_DiskInfo{} - if r.Intn(10) != 0 { - this.Persistence = NewPopulatedResource_DiskInfo_Persistence(r, easy) - } - if r.Intn(10) != 0 { - this.Volume = NewPopulatedVolume(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedResource_DiskInfo_Persistence(r randyMesos, easy bool) *Resource_DiskInfo_Persistence { - this := &Resource_DiskInfo_Persistence{} - v71 := randStringMesos(r) - this.Id = &v71 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedResource_RevocableInfo(r randyMesos, easy bool) *Resource_RevocableInfo { - this := &Resource_RevocableInfo{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 1) - } - return this -} - -func NewPopulatedTrafficControlStatistics(r randyMesos, easy bool) *TrafficControlStatistics { - this := &TrafficControlStatistics{} - v72 := randStringMesos(r) - this.Id = &v72 - if r.Intn(10) != 0 { - v73 := uint64(uint64(r.Uint32())) - this.Backlog = &v73 - } - if r.Intn(10) != 0 { - v74 := uint64(uint64(r.Uint32())) - this.Bytes = &v74 - } - if r.Intn(10) != 0 { - v75 := uint64(uint64(r.Uint32())) - this.Drops = &v75 - } - if r.Intn(10) != 0 { - v76 := uint64(uint64(r.Uint32())) - this.Overlimits = &v76 - } - if r.Intn(10) != 0 { - v77 := uint64(uint64(r.Uint32())) - this.Packets = &v77 - } - if r.Intn(10) != 0 { - v78 := uint64(uint64(r.Uint32())) - this.Qlen = &v78 - } - if r.Intn(10) != 0 { - v79 := uint64(uint64(r.Uint32())) - this.Ratebps = &v79 - } - if r.Intn(10) != 0 { - v80 := uint64(uint64(r.Uint32())) - this.Ratepps = &v80 - } - if r.Intn(10) != 0 { - v81 := uint64(uint64(r.Uint32())) - this.Requeues = &v81 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 11) - } - return this -} - -func NewPopulatedResourceStatistics(r randyMesos, easy bool) *ResourceStatistics { - this := &ResourceStatistics{} - v82 := float64(r.Float64()) - if r.Intn(2) == 0 { - v82 *= -1 - } - this.Timestamp = &v82 - if r.Intn(10) != 0 { - v83 := float64(r.Float64()) - if r.Intn(2) == 0 { - v83 *= -1 - } - this.CpusUserTimeSecs = &v83 - } - if r.Intn(10) != 0 { - v84 := float64(r.Float64()) - if r.Intn(2) == 0 { - v84 *= -1 - } - this.CpusSystemTimeSecs = &v84 - } - if r.Intn(10) != 0 { - v85 := float64(r.Float64()) - if r.Intn(2) == 0 { - v85 *= -1 - } - this.CpusLimit = &v85 - } - if r.Intn(10) != 0 { - v86 := uint64(uint64(r.Uint32())) - this.MemRssBytes = &v86 - } - if r.Intn(10) != 0 { - v87 := uint64(uint64(r.Uint32())) - this.MemLimitBytes = &v87 - } - if r.Intn(10) != 0 { - v88 := uint32(r.Uint32()) - this.CpusNrPeriods = &v88 - } - if r.Intn(10) != 0 { - v89 := uint32(r.Uint32()) - this.CpusNrThrottled = &v89 - } - if r.Intn(10) != 0 { - v90 := float64(r.Float64()) - if r.Intn(2) == 0 { - v90 *= -1 - } - this.CpusThrottledTimeSecs = &v90 - } - if r.Intn(10) != 0 { - v91 := uint64(uint64(r.Uint32())) - this.MemFileBytes = &v91 - } - if r.Intn(10) != 0 { - v92 := uint64(uint64(r.Uint32())) - this.MemAnonBytes = &v92 - } - if r.Intn(10) != 0 { - v93 := uint64(uint64(r.Uint32())) - this.MemMappedFileBytes = &v93 - } - if r.Intn(10) != 0 { - this.Perf = NewPopulatedPerfStatistics(r, easy) - } - if r.Intn(10) != 0 { - v94 := uint64(uint64(r.Uint32())) - this.NetRxPackets = &v94 - } - if r.Intn(10) != 0 { - v95 := uint64(uint64(r.Uint32())) - this.NetRxBytes = &v95 - } - if r.Intn(10) != 0 { - v96 := uint64(uint64(r.Uint32())) - this.NetRxErrors = &v96 - } - if r.Intn(10) != 0 { - v97 := uint64(uint64(r.Uint32())) - this.NetRxDropped = &v97 - } - if r.Intn(10) != 0 { - v98 := uint64(uint64(r.Uint32())) - this.NetTxPackets = &v98 - } - if r.Intn(10) != 0 { - v99 := uint64(uint64(r.Uint32())) - this.NetTxBytes = &v99 - } - if r.Intn(10) != 0 { - v100 := uint64(uint64(r.Uint32())) - this.NetTxErrors = &v100 - } - if r.Intn(10) != 0 { - v101 := uint64(uint64(r.Uint32())) - this.NetTxDropped = &v101 - } - if r.Intn(10) != 0 { - v102 := float64(r.Float64()) - if r.Intn(2) == 0 { - v102 *= -1 - } - this.NetTcpRttMicrosecsP50 = &v102 - } - if r.Intn(10) != 0 { - v103 := float64(r.Float64()) - if r.Intn(2) == 0 { - v103 *= -1 - } - this.NetTcpRttMicrosecsP90 = &v103 - } - if r.Intn(10) != 0 { - v104 := float64(r.Float64()) - if r.Intn(2) == 0 { - v104 *= -1 - } - this.NetTcpRttMicrosecsP95 = &v104 - } - if r.Intn(10) != 0 { - v105 := float64(r.Float64()) - if r.Intn(2) == 0 { - v105 *= -1 - } - this.NetTcpRttMicrosecsP99 = &v105 - } - if r.Intn(10) != 0 { - v106 := uint64(uint64(r.Uint32())) - this.DiskLimitBytes = &v106 - } - if r.Intn(10) != 0 { - v107 := uint64(uint64(r.Uint32())) - this.DiskUsedBytes = &v107 - } - if r.Intn(10) != 0 { - v108 := float64(r.Float64()) - if r.Intn(2) == 0 { - v108 *= -1 - } - this.NetTcpActiveConnections = &v108 - } - if r.Intn(10) != 0 { - v109 := float64(r.Float64()) - if r.Intn(2) == 0 { - v109 *= -1 - } - this.NetTcpTimeWaitConnections = &v109 - } - if r.Intn(10) != 0 { - v110 := uint32(r.Uint32()) - this.Processes = &v110 - } - if r.Intn(10) != 0 { - v111 := uint32(r.Uint32()) - this.Threads = &v111 - } - if r.Intn(10) != 0 { - v112 := uint64(uint64(r.Uint32())) - this.MemLowPressureCounter = &v112 - } - if r.Intn(10) != 0 { - v113 := uint64(uint64(r.Uint32())) - this.MemMediumPressureCounter = &v113 - } - if r.Intn(10) != 0 { - v114 := uint64(uint64(r.Uint32())) - this.MemCriticalPressureCounter = &v114 - } - if r.Intn(10) != 0 { - v115 := r.Intn(10) - this.NetTrafficControlStatistics = make([]*TrafficControlStatistics, v115) - for i := 0; i < v115; i++ { - this.NetTrafficControlStatistics[i] = NewPopulatedTrafficControlStatistics(r, easy) - } - } - if r.Intn(10) != 0 { - v116 := uint64(uint64(r.Uint32())) - this.MemTotalBytes = &v116 - } - if r.Intn(10) != 0 { - v117 := uint64(uint64(r.Uint32())) - this.MemTotalMemswBytes = &v117 - } - if r.Intn(10) != 0 { - v118 := uint64(uint64(r.Uint32())) - this.MemSoftLimitBytes = &v118 - } - if r.Intn(10) != 0 { - v119 := uint64(uint64(r.Uint32())) - this.MemCacheBytes = &v119 - } - if r.Intn(10) != 0 { - v120 := uint64(uint64(r.Uint32())) - this.MemSwapBytes = &v120 - } - if r.Intn(10) != 0 { - v121 := uint64(uint64(r.Uint32())) - this.MemUnevictableBytes = &v121 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 42) - } - return this -} - -func NewPopulatedResourceUsage(r randyMesos, easy bool) *ResourceUsage { - this := &ResourceUsage{} - if r.Intn(10) != 0 { - v122 := r.Intn(10) - this.Executors = make([]*ResourceUsage_Executor, v122) - for i := 0; i < v122; i++ { - this.Executors[i] = NewPopulatedResourceUsage_Executor(r, easy) - } - } - if r.Intn(10) != 0 { - v123 := r.Intn(10) - this.Total = make([]*Resource, v123) - for i := 0; i < v123; i++ { - this.Total[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedResourceUsage_Executor(r randyMesos, easy bool) *ResourceUsage_Executor { - this := &ResourceUsage_Executor{} - this.ExecutorInfo = NewPopulatedExecutorInfo(r, easy) - if r.Intn(10) != 0 { - v124 := r.Intn(10) - this.Allocated = make([]*Resource, v124) - for i := 0; i < v124; i++ { - this.Allocated[i] = NewPopulatedResource(r, easy) - } - } - if r.Intn(10) != 0 { - this.Statistics = NewPopulatedResourceStatistics(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) - } - return this -} - -func NewPopulatedPerfStatistics(r randyMesos, easy bool) *PerfStatistics { - this := &PerfStatistics{} - v125 := float64(r.Float64()) - if r.Intn(2) == 0 { - v125 *= -1 - } - this.Timestamp = &v125 - v126 := float64(r.Float64()) - if r.Intn(2) == 0 { - v126 *= -1 - } - this.Duration = &v126 - if r.Intn(10) != 0 { - v127 := uint64(uint64(r.Uint32())) - this.Cycles = &v127 - } - if r.Intn(10) != 0 { - v128 := uint64(uint64(r.Uint32())) - this.StalledCyclesFrontend = &v128 - } - if r.Intn(10) != 0 { - v129 := uint64(uint64(r.Uint32())) - this.StalledCyclesBackend = &v129 - } - if r.Intn(10) != 0 { - v130 := uint64(uint64(r.Uint32())) - this.Instructions = &v130 - } - if r.Intn(10) != 0 { - v131 := uint64(uint64(r.Uint32())) - this.CacheReferences = &v131 - } - if r.Intn(10) != 0 { - v132 := uint64(uint64(r.Uint32())) - this.CacheMisses = &v132 - } - if r.Intn(10) != 0 { - v133 := uint64(uint64(r.Uint32())) - this.Branches = &v133 - } - if r.Intn(10) != 0 { - v134 := uint64(uint64(r.Uint32())) - this.BranchMisses = &v134 - } - if r.Intn(10) != 0 { - v135 := uint64(uint64(r.Uint32())) - this.BusCycles = &v135 - } - if r.Intn(10) != 0 { - v136 := uint64(uint64(r.Uint32())) - this.RefCycles = &v136 - } - if r.Intn(10) != 0 { - v137 := float64(r.Float64()) - if r.Intn(2) == 0 { - v137 *= -1 - } - this.CpuClock = &v137 - } - if r.Intn(10) != 0 { - v138 := float64(r.Float64()) - if r.Intn(2) == 0 { - v138 *= -1 - } - this.TaskClock = &v138 - } - if r.Intn(10) != 0 { - v139 := uint64(uint64(r.Uint32())) - this.PageFaults = &v139 - } - if r.Intn(10) != 0 { - v140 := uint64(uint64(r.Uint32())) - this.MinorFaults = &v140 - } - if r.Intn(10) != 0 { - v141 := uint64(uint64(r.Uint32())) - this.MajorFaults = &v141 - } - if r.Intn(10) != 0 { - v142 := uint64(uint64(r.Uint32())) - this.ContextSwitches = &v142 - } - if r.Intn(10) != 0 { - v143 := uint64(uint64(r.Uint32())) - this.CpuMigrations = &v143 - } - if r.Intn(10) != 0 { - v144 := uint64(uint64(r.Uint32())) - this.AlignmentFaults = &v144 - } - if r.Intn(10) != 0 { - v145 := uint64(uint64(r.Uint32())) - this.EmulationFaults = &v145 - } - if r.Intn(10) != 0 { - v146 := uint64(uint64(r.Uint32())) - this.L1DcacheLoads = &v146 - } - if r.Intn(10) != 0 { - v147 := uint64(uint64(r.Uint32())) - this.L1DcacheLoadMisses = &v147 - } - if r.Intn(10) != 0 { - v148 := uint64(uint64(r.Uint32())) - this.L1DcacheStores = &v148 - } - if r.Intn(10) != 0 { - v149 := uint64(uint64(r.Uint32())) - this.L1DcacheStoreMisses = &v149 - } - if r.Intn(10) != 0 { - v150 := uint64(uint64(r.Uint32())) - this.L1DcachePrefetches = &v150 - } - if r.Intn(10) != 0 { - v151 := uint64(uint64(r.Uint32())) - this.L1DcachePrefetchMisses = &v151 - } - if r.Intn(10) != 0 { - v152 := uint64(uint64(r.Uint32())) - this.L1IcacheLoads = &v152 - } - if r.Intn(10) != 0 { - v153 := uint64(uint64(r.Uint32())) - this.L1IcacheLoadMisses = &v153 - } - if r.Intn(10) != 0 { - v154 := uint64(uint64(r.Uint32())) - this.L1IcachePrefetches = &v154 - } - if r.Intn(10) != 0 { - v155 := uint64(uint64(r.Uint32())) - this.L1IcachePrefetchMisses = &v155 - } - if r.Intn(10) != 0 { - v156 := uint64(uint64(r.Uint32())) - this.LlcLoads = &v156 - } - if r.Intn(10) != 0 { - v157 := uint64(uint64(r.Uint32())) - this.LlcLoadMisses = &v157 - } - if r.Intn(10) != 0 { - v158 := uint64(uint64(r.Uint32())) - this.LlcStores = &v158 - } - if r.Intn(10) != 0 { - v159 := uint64(uint64(r.Uint32())) - this.LlcStoreMisses = &v159 - } - if r.Intn(10) != 0 { - v160 := uint64(uint64(r.Uint32())) - this.LlcPrefetches = &v160 - } - if r.Intn(10) != 0 { - v161 := uint64(uint64(r.Uint32())) - this.LlcPrefetchMisses = &v161 - } - if r.Intn(10) != 0 { - v162 := uint64(uint64(r.Uint32())) - this.DtlbLoads = &v162 - } - if r.Intn(10) != 0 { - v163 := uint64(uint64(r.Uint32())) - this.DtlbLoadMisses = &v163 - } - if r.Intn(10) != 0 { - v164 := uint64(uint64(r.Uint32())) - this.DtlbStores = &v164 - } - if r.Intn(10) != 0 { - v165 := uint64(uint64(r.Uint32())) - this.DtlbStoreMisses = &v165 - } - if r.Intn(10) != 0 { - v166 := uint64(uint64(r.Uint32())) - this.DtlbPrefetches = &v166 - } - if r.Intn(10) != 0 { - v167 := uint64(uint64(r.Uint32())) - this.DtlbPrefetchMisses = &v167 - } - if r.Intn(10) != 0 { - v168 := uint64(uint64(r.Uint32())) - this.ItlbLoads = &v168 - } - if r.Intn(10) != 0 { - v169 := uint64(uint64(r.Uint32())) - this.ItlbLoadMisses = &v169 - } - if r.Intn(10) != 0 { - v170 := uint64(uint64(r.Uint32())) - this.BranchLoads = &v170 - } - if r.Intn(10) != 0 { - v171 := uint64(uint64(r.Uint32())) - this.BranchLoadMisses = &v171 - } - if r.Intn(10) != 0 { - v172 := uint64(uint64(r.Uint32())) - this.NodeLoads = &v172 - } - if r.Intn(10) != 0 { - v173 := uint64(uint64(r.Uint32())) - this.NodeLoadMisses = &v173 - } - if r.Intn(10) != 0 { - v174 := uint64(uint64(r.Uint32())) - this.NodeStores = &v174 - } - if r.Intn(10) != 0 { - v175 := uint64(uint64(r.Uint32())) - this.NodeStoreMisses = &v175 - } - if r.Intn(10) != 0 { - v176 := uint64(uint64(r.Uint32())) - this.NodePrefetches = &v176 - } - if r.Intn(10) != 0 { - v177 := uint64(uint64(r.Uint32())) - this.NodePrefetchMisses = &v177 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 54) - } - return this -} - -func NewPopulatedRequest(r randyMesos, easy bool) *Request { - this := &Request{} - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) - } - if r.Intn(10) != 0 { - v178 := r.Intn(10) - this.Resources = make([]*Resource, v178) - for i := 0; i < v178; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedOffer(r randyMesos, easy bool) *Offer { - this := &Offer{} - this.Id = NewPopulatedOfferID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.SlaveId = NewPopulatedSlaveID(r, easy) - v179 := randStringMesos(r) - this.Hostname = &v179 - if r.Intn(10) != 0 { - v180 := r.Intn(10) - this.Resources = make([]*Resource, v180) - for i := 0; i < v180; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if r.Intn(10) != 0 { - v181 := r.Intn(10) - this.ExecutorIds = make([]*ExecutorID, v181) - for i := 0; i < v181; i++ { - this.ExecutorIds[i] = NewPopulatedExecutorID(r, easy) - } - } - if r.Intn(10) != 0 { - v182 := r.Intn(10) - this.Attributes = make([]*Attribute, v182) - for i := 0; i < v182; i++ { - this.Attributes[i] = NewPopulatedAttribute(r, easy) - } - } - if r.Intn(10) != 0 { - this.Url = NewPopulatedURL(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 9) - } - return this -} - -func NewPopulatedOffer_Operation(r randyMesos, easy bool) *Offer_Operation { - this := &Offer_Operation{} - v183 := Offer_Operation_Type([]int32{1, 2, 3, 4, 5}[r.Intn(5)]) - this.Type = &v183 - if r.Intn(10) != 0 { - this.Launch = NewPopulatedOffer_Operation_Launch(r, easy) - } - if r.Intn(10) != 0 { - this.Reserve = NewPopulatedOffer_Operation_Reserve(r, easy) - } - if r.Intn(10) != 0 { - this.Unreserve = NewPopulatedOffer_Operation_Unreserve(r, easy) - } - if r.Intn(10) != 0 { - this.Create = NewPopulatedOffer_Operation_Create(r, easy) - } - if r.Intn(10) != 0 { - this.Destroy = NewPopulatedOffer_Operation_Destroy(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) - } - return this -} - -func NewPopulatedOffer_Operation_Launch(r randyMesos, easy bool) *Offer_Operation_Launch { - this := &Offer_Operation_Launch{} - if r.Intn(10) != 0 { - v184 := r.Intn(10) - this.TaskInfos = make([]*TaskInfo, v184) - for i := 0; i < v184; i++ { - this.TaskInfos[i] = NewPopulatedTaskInfo(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedOffer_Operation_Reserve(r randyMesos, easy bool) *Offer_Operation_Reserve { - this := &Offer_Operation_Reserve{} - if r.Intn(10) != 0 { - v185 := r.Intn(10) - this.Resources = make([]*Resource, v185) - for i := 0; i < v185; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedOffer_Operation_Unreserve(r randyMesos, easy bool) *Offer_Operation_Unreserve { - this := &Offer_Operation_Unreserve{} - if r.Intn(10) != 0 { - v186 := r.Intn(10) - this.Resources = make([]*Resource, v186) - for i := 0; i < v186; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedOffer_Operation_Create(r randyMesos, easy bool) *Offer_Operation_Create { - this := &Offer_Operation_Create{} - if r.Intn(10) != 0 { - v187 := r.Intn(10) - this.Volumes = make([]*Resource, v187) - for i := 0; i < v187; i++ { - this.Volumes[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedOffer_Operation_Destroy(r randyMesos, easy bool) *Offer_Operation_Destroy { - this := &Offer_Operation_Destroy{} - if r.Intn(10) != 0 { - v188 := r.Intn(10) - this.Volumes = make([]*Resource, v188) - for i := 0; i < v188; i++ { - this.Volumes[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedTaskInfo(r randyMesos, easy bool) *TaskInfo { - this := &TaskInfo{} - v189 := randStringMesos(r) - this.Name = &v189 - this.TaskId = NewPopulatedTaskID(r, easy) - this.SlaveId = NewPopulatedSlaveID(r, easy) - if r.Intn(10) != 0 { - v190 := r.Intn(10) - this.Resources = make([]*Resource, v190) - for i := 0; i < v190; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if r.Intn(10) != 0 { - this.Executor = NewPopulatedExecutorInfo(r, easy) - } - if r.Intn(10) != 0 { - v191 := r.Intn(100) - this.Data = make([]byte, v191) - for i := 0; i < v191; i++ { - this.Data[i] = byte(r.Intn(256)) - } - } - if r.Intn(10) != 0 { - this.Command = NewPopulatedCommandInfo(r, easy) - } - if r.Intn(10) != 0 { - this.HealthCheck = NewPopulatedHealthCheck(r, easy) - } - if r.Intn(10) != 0 { - this.Container = NewPopulatedContainerInfo(r, easy) - } - if r.Intn(10) != 0 { - this.Labels = NewPopulatedLabels(r, easy) - } - if r.Intn(10) != 0 { - this.Discovery = NewPopulatedDiscoveryInfo(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 12) - } - return this -} - -func NewPopulatedTaskStatus(r randyMesos, easy bool) *TaskStatus { - this := &TaskStatus{} - this.TaskId = NewPopulatedTaskID(r, easy) - v192 := TaskState([]int32{6, 0, 1, 2, 3, 4, 5, 7}[r.Intn(8)]) - this.State = &v192 - if r.Intn(10) != 0 { - v193 := r.Intn(100) - this.Data = make([]byte, v193) - for i := 0; i < v193; i++ { - this.Data[i] = byte(r.Intn(256)) - } - } - if r.Intn(10) != 0 { - v194 := randStringMesos(r) - this.Message = &v194 - } - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) - } - if r.Intn(10) != 0 { - v195 := float64(r.Float64()) - if r.Intn(2) == 0 { - v195 *= -1 - } - this.Timestamp = &v195 - } - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) - } - if r.Intn(10) != 0 { - v196 := bool(bool(r.Intn(2) == 0)) - this.Healthy = &v196 - } - if r.Intn(10) != 0 { - v197 := TaskStatus_Source([]int32{0, 1, 2}[r.Intn(3)]) - this.Source = &v197 - } - if r.Intn(10) != 0 { - v198 := TaskStatus_Reason([]int32{0, 17, 1, 2, 3, 4, 5, 6, 7, 8, 9, 18, 10, 11, 12, 13, 14, 15, 16}[r.Intn(19)]) - this.Reason = &v198 - } - if r.Intn(10) != 0 { - v199 := r.Intn(100) - this.Uuid = make([]byte, v199) - for i := 0; i < v199; i++ { - this.Uuid[i] = byte(r.Intn(256)) - } - } - if r.Intn(10) != 0 { - this.Labels = NewPopulatedLabels(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 13) - } - return this -} - -func NewPopulatedFilters(r randyMesos, easy bool) *Filters { - this := &Filters{} - if r.Intn(10) != 0 { - v200 := float64(r.Float64()) - if r.Intn(2) == 0 { - v200 *= -1 - } - this.RefuseSeconds = &v200 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedEnvironment(r randyMesos, easy bool) *Environment { - this := &Environment{} - if r.Intn(10) != 0 { - v201 := r.Intn(10) - this.Variables = make([]*Environment_Variable, v201) - for i := 0; i < v201; i++ { - this.Variables[i] = NewPopulatedEnvironment_Variable(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedEnvironment_Variable(r randyMesos, easy bool) *Environment_Variable { - this := &Environment_Variable{} - v202 := randStringMesos(r) - this.Name = &v202 - v203 := randStringMesos(r) - this.Value = &v203 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedParameter(r randyMesos, easy bool) *Parameter { - this := &Parameter{} - v204 := randStringMesos(r) - this.Key = &v204 - v205 := randStringMesos(r) - this.Value = &v205 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedParameters(r randyMesos, easy bool) *Parameters { - this := &Parameters{} - if r.Intn(10) != 0 { - v206 := r.Intn(10) - this.Parameter = make([]*Parameter, v206) - for i := 0; i < v206; i++ { - this.Parameter[i] = NewPopulatedParameter(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedCredential(r randyMesos, easy bool) *Credential { - this := &Credential{} - v207 := randStringMesos(r) - this.Principal = &v207 - if r.Intn(10) != 0 { - v208 := r.Intn(100) - this.Secret = make([]byte, v208) - for i := 0; i < v208; i++ { - this.Secret[i] = byte(r.Intn(256)) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedCredentials(r randyMesos, easy bool) *Credentials { - this := &Credentials{} - if r.Intn(10) != 0 { - v209 := r.Intn(10) - this.Credentials = make([]*Credential, v209) - for i := 0; i < v209; i++ { - this.Credentials[i] = NewPopulatedCredential(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedRateLimit(r randyMesos, easy bool) *RateLimit { - this := &RateLimit{} - if r.Intn(10) != 0 { - v210 := float64(r.Float64()) - if r.Intn(2) == 0 { - v210 *= -1 - } - this.Qps = &v210 - } - v211 := randStringMesos(r) - this.Principal = &v211 - if r.Intn(10) != 0 { - v212 := uint64(uint64(r.Uint32())) - this.Capacity = &v212 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) - } - return this -} - -func NewPopulatedRateLimits(r randyMesos, easy bool) *RateLimits { - this := &RateLimits{} - if r.Intn(10) != 0 { - v213 := r.Intn(10) - this.Limits = make([]*RateLimit, v213) - for i := 0; i < v213; i++ { - this.Limits[i] = NewPopulatedRateLimit(r, easy) - } - } - if r.Intn(10) != 0 { - v214 := float64(r.Float64()) - if r.Intn(2) == 0 { - v214 *= -1 - } - this.AggregateDefaultQps = &v214 - } - if r.Intn(10) != 0 { - v215 := uint64(uint64(r.Uint32())) - this.AggregateDefaultCapacity = &v215 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) - } - return this -} - -func NewPopulatedImage(r randyMesos, easy bool) *Image { - this := &Image{} - v216 := Image_Type([]int32{1, 2}[r.Intn(2)]) - this.Type = &v216 - if r.Intn(10) != 0 { - this.Appc = NewPopulatedImage_AppC(r, easy) - } - if r.Intn(10) != 0 { - this.Docker = NewPopulatedImage_Docker(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) - } - return this -} - -func NewPopulatedImage_AppC(r randyMesos, easy bool) *Image_AppC { - this := &Image_AppC{} - v217 := randStringMesos(r) - this.Name = &v217 - if r.Intn(10) != 0 { - v218 := randStringMesos(r) - this.Id = &v218 - } - if r.Intn(10) != 0 { - this.Labels = NewPopulatedLabels(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) - } - return this -} - -func NewPopulatedImage_Docker(r randyMesos, easy bool) *Image_Docker { - this := &Image_Docker{} - v219 := randStringMesos(r) - this.Name = &v219 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedVolume(r randyMesos, easy bool) *Volume { - this := &Volume{} - v220 := randStringMesos(r) - this.ContainerPath = &v220 - if r.Intn(10) != 0 { - v221 := randStringMesos(r) - this.HostPath = &v221 - } - v222 := Volume_Mode([]int32{1, 2}[r.Intn(2)]) - this.Mode = &v222 - if r.Intn(10) != 0 { - this.Image = NewPopulatedImage(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 5) - } - return this -} - -func NewPopulatedContainerInfo(r randyMesos, easy bool) *ContainerInfo { - this := &ContainerInfo{} - v223 := ContainerInfo_Type([]int32{1, 2}[r.Intn(2)]) - this.Type = &v223 - if r.Intn(10) != 0 { - v224 := r.Intn(10) - this.Volumes = make([]*Volume, v224) - for i := 0; i < v224; i++ { - this.Volumes[i] = NewPopulatedVolume(r, easy) - } - } - if r.Intn(10) != 0 { - this.Docker = NewPopulatedContainerInfo_DockerInfo(r, easy) - } - if r.Intn(10) != 0 { - v225 := randStringMesos(r) - this.Hostname = &v225 - } - if r.Intn(10) != 0 { - this.Mesos = NewPopulatedContainerInfo_MesosInfo(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) - } - return this -} - -func NewPopulatedContainerInfo_DockerInfo(r randyMesos, easy bool) *ContainerInfo_DockerInfo { - this := &ContainerInfo_DockerInfo{} - v226 := randStringMesos(r) - this.Image = &v226 - if r.Intn(10) != 0 { - v227 := ContainerInfo_DockerInfo_Network([]int32{1, 2, 3}[r.Intn(3)]) - this.Network = &v227 - } - if r.Intn(10) != 0 { - v228 := r.Intn(10) - this.PortMappings = make([]*ContainerInfo_DockerInfo_PortMapping, v228) - for i := 0; i < v228; i++ { - this.PortMappings[i] = NewPopulatedContainerInfo_DockerInfo_PortMapping(r, easy) - } - } - if r.Intn(10) != 0 { - v229 := bool(bool(r.Intn(2) == 0)) - this.Privileged = &v229 - } - if r.Intn(10) != 0 { - v230 := r.Intn(10) - this.Parameters = make([]*Parameter, v230) - for i := 0; i < v230; i++ { - this.Parameters[i] = NewPopulatedParameter(r, easy) - } - } - if r.Intn(10) != 0 { - v231 := bool(bool(r.Intn(2) == 0)) - this.ForcePullImage = &v231 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 7) - } - return this -} - -func NewPopulatedContainerInfo_DockerInfo_PortMapping(r randyMesos, easy bool) *ContainerInfo_DockerInfo_PortMapping { - this := &ContainerInfo_DockerInfo_PortMapping{} - v232 := uint32(r.Uint32()) - this.HostPort = &v232 - v233 := uint32(r.Uint32()) - this.ContainerPort = &v233 - if r.Intn(10) != 0 { - v234 := randStringMesos(r) - this.Protocol = &v234 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) - } - return this -} - -func NewPopulatedContainerInfo_MesosInfo(r randyMesos, easy bool) *ContainerInfo_MesosInfo { - this := &ContainerInfo_MesosInfo{} - if r.Intn(10) != 0 { - this.Image = NewPopulatedImage(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedLabels(r randyMesos, easy bool) *Labels { - this := &Labels{} - if r.Intn(10) != 0 { - v235 := r.Intn(10) - this.Labels = make([]*Label, v235) - for i := 0; i < v235; i++ { - this.Labels[i] = NewPopulatedLabel(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedLabel(r randyMesos, easy bool) *Label { - this := &Label{} - v236 := randStringMesos(r) - this.Key = &v236 - if r.Intn(10) != 0 { - v237 := randStringMesos(r) - this.Value = &v237 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedPort(r randyMesos, easy bool) *Port { - this := &Port{} - v238 := uint32(r.Uint32()) - this.Number = &v238 - if r.Intn(10) != 0 { - v239 := randStringMesos(r) - this.Name = &v239 - } - if r.Intn(10) != 0 { - v240 := randStringMesos(r) - this.Protocol = &v240 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 4) - } - return this -} - -func NewPopulatedPorts(r randyMesos, easy bool) *Ports { - this := &Ports{} - if r.Intn(10) != 0 { - v241 := r.Intn(10) - this.Ports = make([]*Port, v241) - for i := 0; i < v241; i++ { - this.Ports[i] = NewPopulatedPort(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 2) - } - return this -} - -func NewPopulatedDiscoveryInfo(r randyMesos, easy bool) *DiscoveryInfo { - this := &DiscoveryInfo{} - v242 := DiscoveryInfo_Visibility([]int32{0, 1, 2}[r.Intn(3)]) - this.Visibility = &v242 - if r.Intn(10) != 0 { - v243 := randStringMesos(r) - this.Name = &v243 - } - if r.Intn(10) != 0 { - v244 := randStringMesos(r) - this.Environment = &v244 - } - if r.Intn(10) != 0 { - v245 := randStringMesos(r) - this.Location = &v245 - } - if r.Intn(10) != 0 { - v246 := randStringMesos(r) - this.Version = &v246 - } - if r.Intn(10) != 0 { - this.Ports = NewPopulatedPorts(r, easy) - } - if r.Intn(10) != 0 { - this.Labels = NewPopulatedLabels(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 8) - } - return this -} - -func NewPopulatedAppcImageManifest(r randyMesos, easy bool) *AppcImageManifest { - this := &AppcImageManifest{} - v247 := randStringMesos(r) - this.AcKind = &v247 - v248 := randStringMesos(r) - this.AcVersion = &v248 - v249 := randStringMesos(r) - this.Name = &v249 - if r.Intn(10) != 0 { - v250 := r.Intn(10) - this.Labels = make([]*AppcImageManifest_Label, v250) - for i := 0; i < v250; i++ { - this.Labels[i] = NewPopulatedAppcImageManifest_Label(r, easy) - } - } - if r.Intn(10) != 0 { - v251 := r.Intn(10) - this.Annotations = make([]*AppcImageManifest_Annotation, v251) - for i := 0; i < v251; i++ { - this.Annotations[i] = NewPopulatedAppcImageManifest_Annotation(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 6) - } - return this -} - -func NewPopulatedAppcImageManifest_Label(r randyMesos, easy bool) *AppcImageManifest_Label { - this := &AppcImageManifest_Label{} - v252 := randStringMesos(r) - this.Name = &v252 - v253 := randStringMesos(r) - this.Value = &v253 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -func NewPopulatedAppcImageManifest_Annotation(r randyMesos, easy bool) *AppcImageManifest_Annotation { - this := &AppcImageManifest_Annotation{} - v254 := randStringMesos(r) - this.Name = &v254 - v255 := randStringMesos(r) - this.Value = &v255 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMesos(r, 3) - } - return this -} - -type randyMesos interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneMesos(r randyMesos) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringMesos(r randyMesos) string { - v256 := r.Intn(100) - tmps := make([]rune, v256) - for i := 0; i < v256; i++ { - tmps[i] = randUTF8RuneMesos(r) - } - return string(tmps) -} -func randUnrecognizedMesos(r randyMesos, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldMesos(data, r, fieldNumber, wire) - } - return data -} -func randFieldMesos(data []byte, r randyMesos, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateMesos(data, uint64(key)) - v257 := r.Int63() - if r.Intn(2) == 0 { - v257 *= -1 - } - data = encodeVarintPopulateMesos(data, uint64(v257)) - case 1: - data = encodeVarintPopulateMesos(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateMesos(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateMesos(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateMesos(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateMesos(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *FrameworkID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *OfferID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SlaveID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TaskID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ExecutorID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ContainerID) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Address) Size() (n int) { - var l int - _ = l - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Ip != nil { - l = len(*m.Ip) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *URL) Size() (n int) { - var l int - _ = l - if m.Scheme != nil { - l = len(*m.Scheme) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Address != nil { - l = m.Address.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Path != nil { - l = len(*m.Path) - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Query) > 0 { - for _, e := range m.Query { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Fragment != nil { - l = len(*m.Fragment) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FrameworkInfo) Size() (n int) { - var l int - _ = l - if m.User != nil { - l = len(*m.User) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.FailoverTimeout != nil { - n += 9 - } - if m.Checkpoint != nil { - n += 2 - } - if m.Role != nil { - l = len(*m.Role) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) - } - if m.WebuiUrl != nil { - l = len(*m.WebuiUrl) - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Capabilities) > 0 { - for _, e := range m.Capabilities { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Labels != nil { - l = m.Labels.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FrameworkInfo_Capability) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *HealthCheck) Size() (n int) { - var l int - _ = l - if m.Http != nil { - l = m.Http.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.DelaySeconds != nil { - n += 9 - } - if m.IntervalSeconds != nil { - n += 9 - } - if m.TimeoutSeconds != nil { - n += 9 - } - if m.ConsecutiveFailures != nil { - n += 1 + sovMesos(uint64(*m.ConsecutiveFailures)) - } - if m.GracePeriodSeconds != nil { - n += 9 - } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *HealthCheck_HTTP) Size() (n int) { - var l int - _ = l - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) - } - if m.Path != nil { - l = len(*m.Path) - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Statuses) > 0 { - for _, e := range m.Statuses { - n += 1 + sovMesos(uint64(e)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CommandInfo) Size() (n int) { - var l int - _ = l - if len(m.Uris) > 0 { - for _, e := range m.Uris { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Environment != nil { - l = m.Environment.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.User != nil { - l = len(*m.User) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Shell != nil { - n += 2 - } - if len(m.Arguments) > 0 { - for _, s := range m.Arguments { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CommandInfo_URI) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Executable != nil { - n += 2 - } - if m.Extract != nil { - n += 2 - } - if m.Cache != nil { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CommandInfo_ContainerInfo) Size() (n int) { - var l int - _ = l - if m.Image != nil { - l = len(*m.Image) - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Options) > 0 { - for _, s := range m.Options { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ExecutorInfo) Size() (n int) { - var l int - _ = l - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Source != nil { - l = len(*m.Source) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Discovery != nil { - l = m.Discovery.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MasterInfo) Size() (n int) { - var l int - _ = l - if m.Id != nil { - l = len(*m.Id) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Ip != nil { - n += 1 + sovMesos(uint64(*m.Ip)) - } - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) - } - if m.Pid != nil { - l = len(*m.Pid) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Version != nil { - l = len(*m.Version) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Address != nil { - l = m.Address.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SlaveInfo) Size() (n int) { - var l int - _ = l - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Checkpoint != nil { - n += 2 - } - if m.Port != nil { - n += 1 + sovMesos(uint64(*m.Port)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Value) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Value_Scalar) Size() (n int) { - var l int - _ = l - if m.Value != nil { - n += 9 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Value_Range) Size() (n int) { - var l int - _ = l - if m.Begin != nil { - n += 1 + sovMesos(uint64(*m.Begin)) - } - if m.End != nil { - n += 1 + sovMesos(uint64(*m.End)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Value_Ranges) Size() (n int) { - var l int - _ = l - if len(m.Range) > 0 { - for _, e := range m.Range { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Value_Set) Size() (n int) { - var l int - _ = l - if len(m.Item) > 0 { - for _, s := range m.Item { - l = len(s) - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Value_Text) Size() (n int) { - var l int - _ = l - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Attribute) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Text != nil { - l = m.Text.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Resource) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if m.Scalar != nil { - l = m.Scalar.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Ranges != nil { - l = m.Ranges.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Set != nil { - l = m.Set.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Role != nil { - l = len(*m.Role) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Disk != nil { - l = m.Disk.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Reservation != nil { - l = m.Reservation.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Revocable != nil { - l = m.Revocable.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Resource_ReservationInfo) Size() (n int) { - var l int - _ = l - if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Resource_DiskInfo) Size() (n int) { - var l int - _ = l - if m.Persistence != nil { - l = m.Persistence.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Volume != nil { - l = m.Volume.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Resource_DiskInfo_Persistence) Size() (n int) { - var l int - _ = l - if m.Id != nil { - l = len(*m.Id) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Resource_RevocableInfo) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TrafficControlStatistics) Size() (n int) { - var l int - _ = l - if m.Id != nil { - l = len(*m.Id) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Backlog != nil { - n += 1 + sovMesos(uint64(*m.Backlog)) - } - if m.Bytes != nil { - n += 1 + sovMesos(uint64(*m.Bytes)) - } - if m.Drops != nil { - n += 1 + sovMesos(uint64(*m.Drops)) - } - if m.Overlimits != nil { - n += 1 + sovMesos(uint64(*m.Overlimits)) - } - if m.Packets != nil { - n += 1 + sovMesos(uint64(*m.Packets)) - } - if m.Qlen != nil { - n += 1 + sovMesos(uint64(*m.Qlen)) - } - if m.Ratebps != nil { - n += 1 + sovMesos(uint64(*m.Ratebps)) - } - if m.Ratepps != nil { - n += 1 + sovMesos(uint64(*m.Ratepps)) - } - if m.Requeues != nil { - n += 1 + sovMesos(uint64(*m.Requeues)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ResourceStatistics) Size() (n int) { - var l int - _ = l - if m.Timestamp != nil { - n += 9 - } - if m.CpusUserTimeSecs != nil { - n += 9 - } - if m.CpusSystemTimeSecs != nil { - n += 9 - } - if m.CpusLimit != nil { - n += 9 - } - if m.MemRssBytes != nil { - n += 1 + sovMesos(uint64(*m.MemRssBytes)) - } - if m.MemLimitBytes != nil { - n += 1 + sovMesos(uint64(*m.MemLimitBytes)) - } - if m.CpusNrPeriods != nil { - n += 1 + sovMesos(uint64(*m.CpusNrPeriods)) - } - if m.CpusNrThrottled != nil { - n += 1 + sovMesos(uint64(*m.CpusNrThrottled)) - } - if m.CpusThrottledTimeSecs != nil { - n += 9 - } - if m.MemFileBytes != nil { - n += 1 + sovMesos(uint64(*m.MemFileBytes)) - } - if m.MemAnonBytes != nil { - n += 1 + sovMesos(uint64(*m.MemAnonBytes)) - } - if m.MemMappedFileBytes != nil { - n += 1 + sovMesos(uint64(*m.MemMappedFileBytes)) - } - if m.Perf != nil { - l = m.Perf.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.NetRxPackets != nil { - n += 1 + sovMesos(uint64(*m.NetRxPackets)) - } - if m.NetRxBytes != nil { - n += 1 + sovMesos(uint64(*m.NetRxBytes)) - } - if m.NetRxErrors != nil { - n += 2 + sovMesos(uint64(*m.NetRxErrors)) - } - if m.NetRxDropped != nil { - n += 2 + sovMesos(uint64(*m.NetRxDropped)) - } - if m.NetTxPackets != nil { - n += 2 + sovMesos(uint64(*m.NetTxPackets)) - } - if m.NetTxBytes != nil { - n += 2 + sovMesos(uint64(*m.NetTxBytes)) - } - if m.NetTxErrors != nil { - n += 2 + sovMesos(uint64(*m.NetTxErrors)) - } - if m.NetTxDropped != nil { - n += 2 + sovMesos(uint64(*m.NetTxDropped)) - } - if m.NetTcpRttMicrosecsP50 != nil { - n += 10 - } - if m.NetTcpRttMicrosecsP90 != nil { - n += 10 - } - if m.NetTcpRttMicrosecsP95 != nil { - n += 10 - } - if m.NetTcpRttMicrosecsP99 != nil { - n += 10 - } - if m.DiskLimitBytes != nil { - n += 2 + sovMesos(uint64(*m.DiskLimitBytes)) - } - if m.DiskUsedBytes != nil { - n += 2 + sovMesos(uint64(*m.DiskUsedBytes)) - } - if m.NetTcpActiveConnections != nil { - n += 10 - } - if m.NetTcpTimeWaitConnections != nil { - n += 10 - } - if m.Processes != nil { - n += 2 + sovMesos(uint64(*m.Processes)) - } - if m.Threads != nil { - n += 2 + sovMesos(uint64(*m.Threads)) - } - if m.MemLowPressureCounter != nil { - n += 2 + sovMesos(uint64(*m.MemLowPressureCounter)) - } - if m.MemMediumPressureCounter != nil { - n += 2 + sovMesos(uint64(*m.MemMediumPressureCounter)) - } - if m.MemCriticalPressureCounter != nil { - n += 2 + sovMesos(uint64(*m.MemCriticalPressureCounter)) - } - if len(m.NetTrafficControlStatistics) > 0 { - for _, e := range m.NetTrafficControlStatistics { - l = e.Size() - n += 2 + l + sovMesos(uint64(l)) - } - } - if m.MemTotalBytes != nil { - n += 2 + sovMesos(uint64(*m.MemTotalBytes)) - } - if m.MemTotalMemswBytes != nil { - n += 2 + sovMesos(uint64(*m.MemTotalMemswBytes)) - } - if m.MemSoftLimitBytes != nil { - n += 2 + sovMesos(uint64(*m.MemSoftLimitBytes)) - } - if m.MemCacheBytes != nil { - n += 2 + sovMesos(uint64(*m.MemCacheBytes)) - } - if m.MemSwapBytes != nil { - n += 2 + sovMesos(uint64(*m.MemSwapBytes)) - } - if m.MemUnevictableBytes != nil { - n += 2 + sovMesos(uint64(*m.MemUnevictableBytes)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ResourceUsage) Size() (n int) { - var l int - _ = l - if len(m.Executors) > 0 { - for _, e := range m.Executors { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if len(m.Total) > 0 { - for _, e := range m.Total { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ResourceUsage_Executor) Size() (n int) { - var l int - _ = l - if m.ExecutorInfo != nil { - l = m.ExecutorInfo.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Allocated) > 0 { - for _, e := range m.Allocated { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Statistics != nil { - l = m.Statistics.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PerfStatistics) Size() (n int) { - var l int - _ = l - if m.Timestamp != nil { - n += 9 - } - if m.Duration != nil { - n += 9 - } - if m.Cycles != nil { - n += 1 + sovMesos(uint64(*m.Cycles)) - } - if m.StalledCyclesFrontend != nil { - n += 1 + sovMesos(uint64(*m.StalledCyclesFrontend)) - } - if m.StalledCyclesBackend != nil { - n += 1 + sovMesos(uint64(*m.StalledCyclesBackend)) - } - if m.Instructions != nil { - n += 1 + sovMesos(uint64(*m.Instructions)) - } - if m.CacheReferences != nil { - n += 1 + sovMesos(uint64(*m.CacheReferences)) - } - if m.CacheMisses != nil { - n += 1 + sovMesos(uint64(*m.CacheMisses)) - } - if m.Branches != nil { - n += 1 + sovMesos(uint64(*m.Branches)) - } - if m.BranchMisses != nil { - n += 1 + sovMesos(uint64(*m.BranchMisses)) - } - if m.BusCycles != nil { - n += 1 + sovMesos(uint64(*m.BusCycles)) - } - if m.RefCycles != nil { - n += 1 + sovMesos(uint64(*m.RefCycles)) - } - if m.CpuClock != nil { - n += 9 - } - if m.TaskClock != nil { - n += 9 - } - if m.PageFaults != nil { - n += 1 + sovMesos(uint64(*m.PageFaults)) - } - if m.MinorFaults != nil { - n += 2 + sovMesos(uint64(*m.MinorFaults)) - } - if m.MajorFaults != nil { - n += 2 + sovMesos(uint64(*m.MajorFaults)) - } - if m.ContextSwitches != nil { - n += 2 + sovMesos(uint64(*m.ContextSwitches)) - } - if m.CpuMigrations != nil { - n += 2 + sovMesos(uint64(*m.CpuMigrations)) - } - if m.AlignmentFaults != nil { - n += 2 + sovMesos(uint64(*m.AlignmentFaults)) - } - if m.EmulationFaults != nil { - n += 2 + sovMesos(uint64(*m.EmulationFaults)) - } - if m.L1DcacheLoads != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheLoads)) - } - if m.L1DcacheLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheLoadMisses)) - } - if m.L1DcacheStores != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheStores)) - } - if m.L1DcacheStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcacheStoreMisses)) - } - if m.L1DcachePrefetches != nil { - n += 2 + sovMesos(uint64(*m.L1DcachePrefetches)) - } - if m.L1DcachePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.L1DcachePrefetchMisses)) - } - if m.L1IcacheLoads != nil { - n += 2 + sovMesos(uint64(*m.L1IcacheLoads)) - } - if m.L1IcacheLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.L1IcacheLoadMisses)) - } - if m.L1IcachePrefetches != nil { - n += 2 + sovMesos(uint64(*m.L1IcachePrefetches)) - } - if m.L1IcachePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.L1IcachePrefetchMisses)) - } - if m.LlcLoads != nil { - n += 2 + sovMesos(uint64(*m.LlcLoads)) - } - if m.LlcLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcLoadMisses)) - } - if m.LlcStores != nil { - n += 2 + sovMesos(uint64(*m.LlcStores)) - } - if m.LlcStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcStoreMisses)) - } - if m.LlcPrefetches != nil { - n += 2 + sovMesos(uint64(*m.LlcPrefetches)) - } - if m.LlcPrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.LlcPrefetchMisses)) - } - if m.DtlbLoads != nil { - n += 2 + sovMesos(uint64(*m.DtlbLoads)) - } - if m.DtlbLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbLoadMisses)) - } - if m.DtlbStores != nil { - n += 2 + sovMesos(uint64(*m.DtlbStores)) - } - if m.DtlbStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbStoreMisses)) - } - if m.DtlbPrefetches != nil { - n += 2 + sovMesos(uint64(*m.DtlbPrefetches)) - } - if m.DtlbPrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.DtlbPrefetchMisses)) - } - if m.ItlbLoads != nil { - n += 2 + sovMesos(uint64(*m.ItlbLoads)) - } - if m.ItlbLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.ItlbLoadMisses)) - } - if m.BranchLoads != nil { - n += 2 + sovMesos(uint64(*m.BranchLoads)) - } - if m.BranchLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.BranchLoadMisses)) - } - if m.NodeLoads != nil { - n += 2 + sovMesos(uint64(*m.NodeLoads)) - } - if m.NodeLoadMisses != nil { - n += 2 + sovMesos(uint64(*m.NodeLoadMisses)) - } - if m.NodeStores != nil { - n += 2 + sovMesos(uint64(*m.NodeStores)) - } - if m.NodeStoreMisses != nil { - n += 2 + sovMesos(uint64(*m.NodeStoreMisses)) - } - if m.NodePrefetches != nil { - n += 2 + sovMesos(uint64(*m.NodePrefetches)) - } - if m.NodePrefetchMisses != nil { - n += 2 + sovMesos(uint64(*m.NodePrefetchMisses)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Request) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Offer) Size() (n int) { - var l int - _ = l - if m.Id != nil { - l = m.Id.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if len(m.ExecutorIds) > 0 { - for _, e := range m.ExecutorIds { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Url != nil { - l = m.Url.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Offer_Operation) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if m.Launch != nil { - l = m.Launch.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Reserve != nil { - l = m.Reserve.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Unreserve != nil { - l = m.Unreserve.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Create != nil { - l = m.Create.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Destroy != nil { - l = m.Destroy.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Offer_Operation_Launch) Size() (n int) { - var l int - _ = l - if len(m.TaskInfos) > 0 { - for _, e := range m.TaskInfos { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Offer_Operation_Reserve) Size() (n int) { - var l int - _ = l - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Offer_Operation_Unreserve) Size() (n int) { - var l int - _ = l - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Offer_Operation_Create) Size() (n int) { - var l int - _ = l - if len(m.Volumes) > 0 { - for _, e := range m.Volumes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Offer_Operation_Destroy) Size() (n int) { - var l int - _ = l - if len(m.Volumes) > 0 { - for _, e := range m.Volumes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TaskInfo) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Executor != nil { - l = m.Executor.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Command != nil { - l = m.Command.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.HealthCheck != nil { - l = m.HealthCheck.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Container != nil { - l = m.Container.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Labels != nil { - l = m.Labels.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Discovery != nil { - l = m.Discovery.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TaskStatus) Size() (n int) { - var l int - _ = l - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.State != nil { - n += 1 + sovMesos(uint64(*m.State)) - } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovMesos(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Timestamp != nil { - n += 9 - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Healthy != nil { - n += 2 - } - if m.Source != nil { - n += 1 + sovMesos(uint64(*m.Source)) - } - if m.Reason != nil { - n += 1 + sovMesos(uint64(*m.Reason)) - } - if m.Uuid != nil { - l = len(m.Uuid) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Labels != nil { - l = m.Labels.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Filters) Size() (n int) { - var l int - _ = l - if m.RefuseSeconds != nil { - n += 9 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Environment) Size() (n int) { - var l int - _ = l - if len(m.Variables) > 0 { - for _, e := range m.Variables { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Environment_Variable) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Parameter) Size() (n int) { - var l int - _ = l - if m.Key != nil { - l = len(*m.Key) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Parameters) Size() (n int) { - var l int - _ = l - if len(m.Parameter) > 0 { - for _, e := range m.Parameter { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Credential) Size() (n int) { - var l int - _ = l - if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Secret != nil { - l = len(m.Secret) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Credentials) Size() (n int) { - var l int - _ = l - if len(m.Credentials) > 0 { - for _, e := range m.Credentials { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RateLimit) Size() (n int) { - var l int - _ = l - if m.Qps != nil { - n += 9 - } - if m.Principal != nil { - l = len(*m.Principal) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Capacity != nil { - n += 1 + sovMesos(uint64(*m.Capacity)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RateLimits) Size() (n int) { - var l int - _ = l - if len(m.Limits) > 0 { - for _, e := range m.Limits { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.AggregateDefaultQps != nil { - n += 9 - } - if m.AggregateDefaultCapacity != nil { - n += 1 + sovMesos(uint64(*m.AggregateDefaultCapacity)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Image) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if m.Appc != nil { - l = m.Appc.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Docker != nil { - l = m.Docker.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Image_AppC) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Id != nil { - l = len(*m.Id) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Labels != nil { - l = m.Labels.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Image_Docker) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Volume) Size() (n int) { - var l int - _ = l - if m.ContainerPath != nil { - l = len(*m.ContainerPath) - n += 1 + l + sovMesos(uint64(l)) - } - if m.HostPath != nil { - l = len(*m.HostPath) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Mode != nil { - n += 1 + sovMesos(uint64(*m.Mode)) - } - if m.Image != nil { - l = m.Image.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ContainerInfo) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovMesos(uint64(*m.Type)) - } - if len(m.Volumes) > 0 { - for _, e := range m.Volumes { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Docker != nil { - l = m.Docker.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Hostname != nil { - l = len(*m.Hostname) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Mesos != nil { - l = m.Mesos.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ContainerInfo_DockerInfo) Size() (n int) { - var l int - _ = l - if m.Image != nil { - l = len(*m.Image) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Network != nil { - n += 1 + sovMesos(uint64(*m.Network)) - } - if len(m.PortMappings) > 0 { - for _, e := range m.PortMappings { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.Privileged != nil { - n += 2 - } - if len(m.Parameters) > 0 { - for _, e := range m.Parameters { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.ForcePullImage != nil { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ContainerInfo_DockerInfo_PortMapping) Size() (n int) { - var l int - _ = l - if m.HostPort != nil { - n += 1 + sovMesos(uint64(*m.HostPort)) - } - if m.ContainerPort != nil { - n += 1 + sovMesos(uint64(*m.ContainerPort)) - } - if m.Protocol != nil { - l = len(*m.Protocol) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ContainerInfo_MesosInfo) Size() (n int) { - var l int - _ = l - if m.Image != nil { - l = m.Image.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Labels) Size() (n int) { - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Label) Size() (n int) { - var l int - _ = l - if m.Key != nil { - l = len(*m.Key) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Port) Size() (n int) { - var l int - _ = l - if m.Number != nil { - n += 1 + sovMesos(uint64(*m.Number)) - } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Protocol != nil { - l = len(*m.Protocol) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Ports) Size() (n int) { - var l int - _ = l - if len(m.Ports) > 0 { - for _, e := range m.Ports { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DiscoveryInfo) Size() (n int) { - var l int - _ = l - if m.Visibility != nil { - n += 1 + sovMesos(uint64(*m.Visibility)) - } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Environment != nil { - l = len(*m.Environment) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Location != nil { - l = len(*m.Location) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Version != nil { - l = len(*m.Version) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Ports != nil { - l = m.Ports.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.Labels != nil { - l = m.Labels.Size() - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AppcImageManifest) Size() (n int) { - var l int - _ = l - if m.AcKind != nil { - l = len(*m.AcKind) - n += 1 + l + sovMesos(uint64(l)) - } - if m.AcVersion != nil { - l = len(*m.AcVersion) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if len(m.Annotations) > 0 { - for _, e := range m.Annotations { - l = e.Size() - n += 1 + l + sovMesos(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AppcImageManifest_Label) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *AppcImageManifest_Annotation) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMesos(uint64(l)) - } - if m.Value != nil { - l = len(*m.Value) - n += 1 + l + sovMesos(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovMesos(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozMesos(x uint64) (n int) { - return sovMesos(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *FrameworkID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrameworkID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *OfferID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&OfferID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SlaveID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SlaveID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TaskID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ExecutorID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerID) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerID{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Address) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Address{`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Ip:` + valueToStringMesos(this.Ip) + `,`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *URL) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&URL{`, - `Scheme:` + valueToStringMesos(this.Scheme) + `,`, - `Address:` + strings.Replace(fmt.Sprintf("%v", this.Address), "Address", "Address", 1) + `,`, - `Path:` + valueToStringMesos(this.Path) + `,`, - `Query:` + strings.Replace(fmt.Sprintf("%v", this.Query), "Parameter", "Parameter", 1) + `,`, - `Fragment:` + valueToStringMesos(this.Fragment) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FrameworkInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrameworkInfo{`, - `User:` + valueToStringMesos(this.User) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "FrameworkID", "FrameworkID", 1) + `,`, - `FailoverTimeout:` + valueToStringMesos(this.FailoverTimeout) + `,`, - `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, - `Role:` + valueToStringMesos(this.Role) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `WebuiUrl:` + valueToStringMesos(this.WebuiUrl) + `,`, - `Capabilities:` + strings.Replace(fmt.Sprintf("%v", this.Capabilities), "FrameworkInfo_Capability", "FrameworkInfo_Capability", 1) + `,`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FrameworkInfo_Capability) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrameworkInfo_Capability{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *HealthCheck) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HealthCheck{`, - `Http:` + strings.Replace(fmt.Sprintf("%v", this.Http), "HealthCheck_HTTP", "HealthCheck_HTTP", 1) + `,`, - `DelaySeconds:` + valueToStringMesos(this.DelaySeconds) + `,`, - `IntervalSeconds:` + valueToStringMesos(this.IntervalSeconds) + `,`, - `TimeoutSeconds:` + valueToStringMesos(this.TimeoutSeconds) + `,`, - `ConsecutiveFailures:` + valueToStringMesos(this.ConsecutiveFailures) + `,`, - `GracePeriodSeconds:` + valueToStringMesos(this.GracePeriodSeconds) + `,`, - `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *HealthCheck_HTTP) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HealthCheck_HTTP{`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `Path:` + valueToStringMesos(this.Path) + `,`, - `Statuses:` + fmt.Sprintf("%v", this.Statuses) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CommandInfo{`, - `Uris:` + strings.Replace(fmt.Sprintf("%v", this.Uris), "CommandInfo_URI", "CommandInfo_URI", 1) + `,`, - `Environment:` + strings.Replace(fmt.Sprintf("%v", this.Environment), "Environment", "Environment", 1) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "CommandInfo_ContainerInfo", "CommandInfo_ContainerInfo", 1) + `,`, - `User:` + valueToStringMesos(this.User) + `,`, - `Shell:` + valueToStringMesos(this.Shell) + `,`, - `Arguments:` + fmt.Sprintf("%v", this.Arguments) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo_URI) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CommandInfo_URI{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `Executable:` + valueToStringMesos(this.Executable) + `,`, - `Extract:` + valueToStringMesos(this.Extract) + `,`, - `Cache:` + valueToStringMesos(this.Cache) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CommandInfo_ContainerInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CommandInfo_ContainerInfo{`, - `Image:` + valueToStringMesos(this.Image) + `,`, - `Options:` + fmt.Sprintf("%v", this.Options) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ExecutorInfo{`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Source:` + valueToStringMesos(this.Source) + `,`, - `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, - `Discovery:` + strings.Replace(fmt.Sprintf("%v", this.Discovery), "DiscoveryInfo", "DiscoveryInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *MasterInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MasterInfo{`, - `Id:` + valueToStringMesos(this.Id) + `,`, - `Ip:` + valueToStringMesos(this.Ip) + `,`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `Pid:` + valueToStringMesos(this.Pid) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Version:` + valueToStringMesos(this.Version) + `,`, - `Address:` + strings.Replace(fmt.Sprintf("%v", this.Address), "Address", "Address", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SlaveInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SlaveInfo{`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, - `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "SlaveID", "SlaveID", 1) + `,`, - `Checkpoint:` + valueToStringMesos(this.Checkpoint) + `,`, - `Port:` + valueToStringMesos(this.Port) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `Text:` + strings.Replace(fmt.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Scalar) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_Scalar{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Range) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_Range{`, - `Begin:` + valueToStringMesos(this.Begin) + `,`, - `End:` + valueToStringMesos(this.End) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Ranges) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_Ranges{`, - `Range:` + strings.Replace(fmt.Sprintf("%v", this.Range), "Value_Range", "Value_Range", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Set) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_Set{`, - `Item:` + fmt.Sprintf("%v", this.Item) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Value_Text) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Value_Text{`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Attribute) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Attribute{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Text:` + strings.Replace(fmt.Sprintf("%v", this.Text), "Value_Text", "Value_Text", 1) + `,`, - `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Resource) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Resource{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Scalar:` + strings.Replace(fmt.Sprintf("%v", this.Scalar), "Value_Scalar", "Value_Scalar", 1) + `,`, - `Ranges:` + strings.Replace(fmt.Sprintf("%v", this.Ranges), "Value_Ranges", "Value_Ranges", 1) + `,`, - `Set:` + strings.Replace(fmt.Sprintf("%v", this.Set), "Value_Set", "Value_Set", 1) + `,`, - `Role:` + valueToStringMesos(this.Role) + `,`, - `Disk:` + strings.Replace(fmt.Sprintf("%v", this.Disk), "Resource_DiskInfo", "Resource_DiskInfo", 1) + `,`, - `Reservation:` + strings.Replace(fmt.Sprintf("%v", this.Reservation), "Resource_ReservationInfo", "Resource_ReservationInfo", 1) + `,`, - `Revocable:` + strings.Replace(fmt.Sprintf("%v", this.Revocable), "Resource_RevocableInfo", "Resource_RevocableInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Resource_ReservationInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Resource_ReservationInfo{`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Resource_DiskInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Resource_DiskInfo{`, - `Persistence:` + strings.Replace(fmt.Sprintf("%v", this.Persistence), "Resource_DiskInfo_Persistence", "Resource_DiskInfo_Persistence", 1) + `,`, - `Volume:` + strings.Replace(fmt.Sprintf("%v", this.Volume), "Volume", "Volume", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Resource_DiskInfo_Persistence) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Resource_DiskInfo_Persistence{`, - `Id:` + valueToStringMesos(this.Id) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Resource_RevocableInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Resource_RevocableInfo{`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TrafficControlStatistics) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TrafficControlStatistics{`, - `Id:` + valueToStringMesos(this.Id) + `,`, - `Backlog:` + valueToStringMesos(this.Backlog) + `,`, - `Bytes:` + valueToStringMesos(this.Bytes) + `,`, - `Drops:` + valueToStringMesos(this.Drops) + `,`, - `Overlimits:` + valueToStringMesos(this.Overlimits) + `,`, - `Packets:` + valueToStringMesos(this.Packets) + `,`, - `Qlen:` + valueToStringMesos(this.Qlen) + `,`, - `Ratebps:` + valueToStringMesos(this.Ratebps) + `,`, - `Ratepps:` + valueToStringMesos(this.Ratepps) + `,`, - `Requeues:` + valueToStringMesos(this.Requeues) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceStatistics) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceStatistics{`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `CpusUserTimeSecs:` + valueToStringMesos(this.CpusUserTimeSecs) + `,`, - `CpusSystemTimeSecs:` + valueToStringMesos(this.CpusSystemTimeSecs) + `,`, - `CpusLimit:` + valueToStringMesos(this.CpusLimit) + `,`, - `MemRssBytes:` + valueToStringMesos(this.MemRssBytes) + `,`, - `MemLimitBytes:` + valueToStringMesos(this.MemLimitBytes) + `,`, - `CpusNrPeriods:` + valueToStringMesos(this.CpusNrPeriods) + `,`, - `CpusNrThrottled:` + valueToStringMesos(this.CpusNrThrottled) + `,`, - `CpusThrottledTimeSecs:` + valueToStringMesos(this.CpusThrottledTimeSecs) + `,`, - `MemFileBytes:` + valueToStringMesos(this.MemFileBytes) + `,`, - `MemAnonBytes:` + valueToStringMesos(this.MemAnonBytes) + `,`, - `MemMappedFileBytes:` + valueToStringMesos(this.MemMappedFileBytes) + `,`, - `Perf:` + strings.Replace(fmt.Sprintf("%v", this.Perf), "PerfStatistics", "PerfStatistics", 1) + `,`, - `NetRxPackets:` + valueToStringMesos(this.NetRxPackets) + `,`, - `NetRxBytes:` + valueToStringMesos(this.NetRxBytes) + `,`, - `NetRxErrors:` + valueToStringMesos(this.NetRxErrors) + `,`, - `NetRxDropped:` + valueToStringMesos(this.NetRxDropped) + `,`, - `NetTxPackets:` + valueToStringMesos(this.NetTxPackets) + `,`, - `NetTxBytes:` + valueToStringMesos(this.NetTxBytes) + `,`, - `NetTxErrors:` + valueToStringMesos(this.NetTxErrors) + `,`, - `NetTxDropped:` + valueToStringMesos(this.NetTxDropped) + `,`, - `NetTcpRttMicrosecsP50:` + valueToStringMesos(this.NetTcpRttMicrosecsP50) + `,`, - `NetTcpRttMicrosecsP90:` + valueToStringMesos(this.NetTcpRttMicrosecsP90) + `,`, - `NetTcpRttMicrosecsP95:` + valueToStringMesos(this.NetTcpRttMicrosecsP95) + `,`, - `NetTcpRttMicrosecsP99:` + valueToStringMesos(this.NetTcpRttMicrosecsP99) + `,`, - `DiskLimitBytes:` + valueToStringMesos(this.DiskLimitBytes) + `,`, - `DiskUsedBytes:` + valueToStringMesos(this.DiskUsedBytes) + `,`, - `NetTcpActiveConnections:` + valueToStringMesos(this.NetTcpActiveConnections) + `,`, - `NetTcpTimeWaitConnections:` + valueToStringMesos(this.NetTcpTimeWaitConnections) + `,`, - `Processes:` + valueToStringMesos(this.Processes) + `,`, - `Threads:` + valueToStringMesos(this.Threads) + `,`, - `MemLowPressureCounter:` + valueToStringMesos(this.MemLowPressureCounter) + `,`, - `MemMediumPressureCounter:` + valueToStringMesos(this.MemMediumPressureCounter) + `,`, - `MemCriticalPressureCounter:` + valueToStringMesos(this.MemCriticalPressureCounter) + `,`, - `NetTrafficControlStatistics:` + strings.Replace(fmt.Sprintf("%v", this.NetTrafficControlStatistics), "TrafficControlStatistics", "TrafficControlStatistics", 1) + `,`, - `MemTotalBytes:` + valueToStringMesos(this.MemTotalBytes) + `,`, - `MemTotalMemswBytes:` + valueToStringMesos(this.MemTotalMemswBytes) + `,`, - `MemSoftLimitBytes:` + valueToStringMesos(this.MemSoftLimitBytes) + `,`, - `MemCacheBytes:` + valueToStringMesos(this.MemCacheBytes) + `,`, - `MemSwapBytes:` + valueToStringMesos(this.MemSwapBytes) + `,`, - `MemUnevictableBytes:` + valueToStringMesos(this.MemUnevictableBytes) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceUsage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceUsage{`, - `Executors:` + strings.Replace(fmt.Sprintf("%v", this.Executors), "ResourceUsage_Executor", "ResourceUsage_Executor", 1) + `,`, - `Total:` + strings.Replace(fmt.Sprintf("%v", this.Total), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceUsage_Executor) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceUsage_Executor{`, - `ExecutorInfo:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorInfo), "ExecutorInfo", "ExecutorInfo", 1) + `,`, - `Allocated:` + strings.Replace(fmt.Sprintf("%v", this.Allocated), "Resource", "Resource", 1) + `,`, - `Statistics:` + strings.Replace(fmt.Sprintf("%v", this.Statistics), "ResourceStatistics", "ResourceStatistics", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PerfStatistics) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PerfStatistics{`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `Duration:` + valueToStringMesos(this.Duration) + `,`, - `Cycles:` + valueToStringMesos(this.Cycles) + `,`, - `StalledCyclesFrontend:` + valueToStringMesos(this.StalledCyclesFrontend) + `,`, - `StalledCyclesBackend:` + valueToStringMesos(this.StalledCyclesBackend) + `,`, - `Instructions:` + valueToStringMesos(this.Instructions) + `,`, - `CacheReferences:` + valueToStringMesos(this.CacheReferences) + `,`, - `CacheMisses:` + valueToStringMesos(this.CacheMisses) + `,`, - `Branches:` + valueToStringMesos(this.Branches) + `,`, - `BranchMisses:` + valueToStringMesos(this.BranchMisses) + `,`, - `BusCycles:` + valueToStringMesos(this.BusCycles) + `,`, - `RefCycles:` + valueToStringMesos(this.RefCycles) + `,`, - `CpuClock:` + valueToStringMesos(this.CpuClock) + `,`, - `TaskClock:` + valueToStringMesos(this.TaskClock) + `,`, - `PageFaults:` + valueToStringMesos(this.PageFaults) + `,`, - `MinorFaults:` + valueToStringMesos(this.MinorFaults) + `,`, - `MajorFaults:` + valueToStringMesos(this.MajorFaults) + `,`, - `ContextSwitches:` + valueToStringMesos(this.ContextSwitches) + `,`, - `CpuMigrations:` + valueToStringMesos(this.CpuMigrations) + `,`, - `AlignmentFaults:` + valueToStringMesos(this.AlignmentFaults) + `,`, - `EmulationFaults:` + valueToStringMesos(this.EmulationFaults) + `,`, - `L1DcacheLoads:` + valueToStringMesos(this.L1DcacheLoads) + `,`, - `L1DcacheLoadMisses:` + valueToStringMesos(this.L1DcacheLoadMisses) + `,`, - `L1DcacheStores:` + valueToStringMesos(this.L1DcacheStores) + `,`, - `L1DcacheStoreMisses:` + valueToStringMesos(this.L1DcacheStoreMisses) + `,`, - `L1DcachePrefetches:` + valueToStringMesos(this.L1DcachePrefetches) + `,`, - `L1DcachePrefetchMisses:` + valueToStringMesos(this.L1DcachePrefetchMisses) + `,`, - `L1IcacheLoads:` + valueToStringMesos(this.L1IcacheLoads) + `,`, - `L1IcacheLoadMisses:` + valueToStringMesos(this.L1IcacheLoadMisses) + `,`, - `L1IcachePrefetches:` + valueToStringMesos(this.L1IcachePrefetches) + `,`, - `L1IcachePrefetchMisses:` + valueToStringMesos(this.L1IcachePrefetchMisses) + `,`, - `LlcLoads:` + valueToStringMesos(this.LlcLoads) + `,`, - `LlcLoadMisses:` + valueToStringMesos(this.LlcLoadMisses) + `,`, - `LlcStores:` + valueToStringMesos(this.LlcStores) + `,`, - `LlcStoreMisses:` + valueToStringMesos(this.LlcStoreMisses) + `,`, - `LlcPrefetches:` + valueToStringMesos(this.LlcPrefetches) + `,`, - `LlcPrefetchMisses:` + valueToStringMesos(this.LlcPrefetchMisses) + `,`, - `DtlbLoads:` + valueToStringMesos(this.DtlbLoads) + `,`, - `DtlbLoadMisses:` + valueToStringMesos(this.DtlbLoadMisses) + `,`, - `DtlbStores:` + valueToStringMesos(this.DtlbStores) + `,`, - `DtlbStoreMisses:` + valueToStringMesos(this.DtlbStoreMisses) + `,`, - `DtlbPrefetches:` + valueToStringMesos(this.DtlbPrefetches) + `,`, - `DtlbPrefetchMisses:` + valueToStringMesos(this.DtlbPrefetchMisses) + `,`, - `ItlbLoads:` + valueToStringMesos(this.ItlbLoads) + `,`, - `ItlbLoadMisses:` + valueToStringMesos(this.ItlbLoadMisses) + `,`, - `BranchLoads:` + valueToStringMesos(this.BranchLoads) + `,`, - `BranchLoadMisses:` + valueToStringMesos(this.BranchLoadMisses) + `,`, - `NodeLoads:` + valueToStringMesos(this.NodeLoads) + `,`, - `NodeLoadMisses:` + valueToStringMesos(this.NodeLoadMisses) + `,`, - `NodeStores:` + valueToStringMesos(this.NodeStores) + `,`, - `NodeStoreMisses:` + valueToStringMesos(this.NodeStoreMisses) + `,`, - `NodePrefetches:` + valueToStringMesos(this.NodePrefetches) + `,`, - `NodePrefetchMisses:` + valueToStringMesos(this.NodePrefetchMisses) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Request) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Request{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Offer) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Offer{`, - `Id:` + strings.Replace(fmt.Sprintf("%v", this.Id), "OfferID", "OfferID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `ExecutorIds:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorIds), "ExecutorID", "ExecutorID", 1) + `,`, - `Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attribute", "Attribute", 1) + `,`, - `Url:` + strings.Replace(fmt.Sprintf("%v", this.Url), "URL", "URL", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Offer_Operation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Offer_Operation{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Launch:` + strings.Replace(fmt.Sprintf("%v", this.Launch), "Offer_Operation_Launch", "Offer_Operation_Launch", 1) + `,`, - `Reserve:` + strings.Replace(fmt.Sprintf("%v", this.Reserve), "Offer_Operation_Reserve", "Offer_Operation_Reserve", 1) + `,`, - `Unreserve:` + strings.Replace(fmt.Sprintf("%v", this.Unreserve), "Offer_Operation_Unreserve", "Offer_Operation_Unreserve", 1) + `,`, - `Create:` + strings.Replace(fmt.Sprintf("%v", this.Create), "Offer_Operation_Create", "Offer_Operation_Create", 1) + `,`, - `Destroy:` + strings.Replace(fmt.Sprintf("%v", this.Destroy), "Offer_Operation_Destroy", "Offer_Operation_Destroy", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Offer_Operation_Launch) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Offer_Operation_Launch{`, - `TaskInfos:` + strings.Replace(fmt.Sprintf("%v", this.TaskInfos), "TaskInfo", "TaskInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Offer_Operation_Reserve) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Offer_Operation_Reserve{`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Offer_Operation_Unreserve) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Offer_Operation_Unreserve{`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Offer_Operation_Create) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Offer_Operation_Create{`, - `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Offer_Operation_Destroy) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Offer_Operation_Destroy{`, - `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TaskInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskInfo{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Executor:` + strings.Replace(fmt.Sprintf("%v", this.Executor), "ExecutorInfo", "ExecutorInfo", 1) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `Command:` + strings.Replace(fmt.Sprintf("%v", this.Command), "CommandInfo", "CommandInfo", 1) + `,`, - `HealthCheck:` + strings.Replace(fmt.Sprintf("%v", this.HealthCheck), "HealthCheck", "HealthCheck", 1) + `,`, - `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "ContainerInfo", "ContainerInfo", 1) + `,`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, - `Discovery:` + strings.Replace(fmt.Sprintf("%v", this.Discovery), "DiscoveryInfo", "DiscoveryInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TaskStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskStatus{`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `State:` + valueToStringMesos(this.State) + `,`, - `Data:` + valueToStringMesos(this.Data) + `,`, - `Message:` + valueToStringMesos(this.Message) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Timestamp:` + valueToStringMesos(this.Timestamp) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Healthy:` + valueToStringMesos(this.Healthy) + `,`, - `Source:` + valueToStringMesos(this.Source) + `,`, - `Reason:` + valueToStringMesos(this.Reason) + `,`, - `Uuid:` + valueToStringMesos(this.Uuid) + `,`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Filters) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Filters{`, - `RefuseSeconds:` + valueToStringMesos(this.RefuseSeconds) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Environment) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Environment{`, - `Variables:` + strings.Replace(fmt.Sprintf("%v", this.Variables), "Environment_Variable", "Environment_Variable", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Environment_Variable) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Environment_Variable{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Parameter) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Parameter{`, - `Key:` + valueToStringMesos(this.Key) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Parameters) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Parameters{`, - `Parameter:` + strings.Replace(fmt.Sprintf("%v", this.Parameter), "Parameter", "Parameter", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Credential) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Credential{`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `Secret:` + valueToStringMesos(this.Secret) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Credentials) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Credentials{`, - `Credentials:` + strings.Replace(fmt.Sprintf("%v", this.Credentials), "Credential", "Credential", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RateLimit) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RateLimit{`, - `Qps:` + valueToStringMesos(this.Qps) + `,`, - `Principal:` + valueToStringMesos(this.Principal) + `,`, - `Capacity:` + valueToStringMesos(this.Capacity) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RateLimits) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RateLimits{`, - `Limits:` + strings.Replace(fmt.Sprintf("%v", this.Limits), "RateLimit", "RateLimit", 1) + `,`, - `AggregateDefaultQps:` + valueToStringMesos(this.AggregateDefaultQps) + `,`, - `AggregateDefaultCapacity:` + valueToStringMesos(this.AggregateDefaultCapacity) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Image) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Image{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Appc:` + strings.Replace(fmt.Sprintf("%v", this.Appc), "Image_AppC", "Image_AppC", 1) + `,`, - `Docker:` + strings.Replace(fmt.Sprintf("%v", this.Docker), "Image_Docker", "Image_Docker", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Image_AppC) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Image_AppC{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Id:` + valueToStringMesos(this.Id) + `,`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Image_Docker) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Image_Docker{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Volume) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Volume{`, - `ContainerPath:` + valueToStringMesos(this.ContainerPath) + `,`, - `HostPath:` + valueToStringMesos(this.HostPath) + `,`, - `Mode:` + valueToStringMesos(this.Mode) + `,`, - `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "Image", "Image", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerInfo{`, - `Type:` + valueToStringMesos(this.Type) + `,`, - `Volumes:` + strings.Replace(fmt.Sprintf("%v", this.Volumes), "Volume", "Volume", 1) + `,`, - `Docker:` + strings.Replace(fmt.Sprintf("%v", this.Docker), "ContainerInfo_DockerInfo", "ContainerInfo_DockerInfo", 1) + `,`, - `Hostname:` + valueToStringMesos(this.Hostname) + `,`, - `Mesos:` + strings.Replace(fmt.Sprintf("%v", this.Mesos), "ContainerInfo_MesosInfo", "ContainerInfo_MesosInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerInfo_DockerInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerInfo_DockerInfo{`, - `Image:` + valueToStringMesos(this.Image) + `,`, - `Network:` + valueToStringMesos(this.Network) + `,`, - `PortMappings:` + strings.Replace(fmt.Sprintf("%v", this.PortMappings), "ContainerInfo_DockerInfo_PortMapping", "ContainerInfo_DockerInfo_PortMapping", 1) + `,`, - `Privileged:` + valueToStringMesos(this.Privileged) + `,`, - `Parameters:` + strings.Replace(fmt.Sprintf("%v", this.Parameters), "Parameter", "Parameter", 1) + `,`, - `ForcePullImage:` + valueToStringMesos(this.ForcePullImage) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerInfo_DockerInfo_PortMapping) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerInfo_DockerInfo_PortMapping{`, - `HostPort:` + valueToStringMesos(this.HostPort) + `,`, - `ContainerPort:` + valueToStringMesos(this.ContainerPort) + `,`, - `Protocol:` + valueToStringMesos(this.Protocol) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ContainerInfo_MesosInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ContainerInfo_MesosInfo{`, - `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "Image", "Image", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Labels) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Labels{`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Label", "Label", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Label) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Label{`, - `Key:` + valueToStringMesos(this.Key) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Port) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Port{`, - `Number:` + valueToStringMesos(this.Number) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Protocol:` + valueToStringMesos(this.Protocol) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Ports) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Ports{`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "Port", "Port", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *DiscoveryInfo) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DiscoveryInfo{`, - `Visibility:` + valueToStringMesos(this.Visibility) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Environment:` + valueToStringMesos(this.Environment) + `,`, - `Location:` + valueToStringMesos(this.Location) + `,`, - `Version:` + valueToStringMesos(this.Version) + `,`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "Ports", "Ports", 1) + `,`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AppcImageManifest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AppcImageManifest{`, - `AcKind:` + valueToStringMesos(this.AcKind) + `,`, - `AcVersion:` + valueToStringMesos(this.AcVersion) + `,`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "AppcImageManifest_Label", "AppcImageManifest_Label", 1) + `,`, - `Annotations:` + strings.Replace(fmt.Sprintf("%v", this.Annotations), "AppcImageManifest_Annotation", "AppcImageManifest_Annotation", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AppcImageManifest_Label) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AppcImageManifest_Label{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *AppcImageManifest_Annotation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&AppcImageManifest_Annotation{`, - `Name:` + valueToStringMesos(this.Name) + `,`, - `Value:` + valueToStringMesos(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringMesos(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *FrameworkID) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *OfferID) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *SlaveID) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *TaskID) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *ExecutorID) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *ContainerID) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *Address) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Hostname = &s - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Ip = &s - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") - } - - return nil -} -func (m *URL) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scheme", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Scheme = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Address == nil { - m.Address = &Address{} - } - if err := m.Address.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Path = &s - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Query = append(m.Query, &Parameter{}) - if err := m.Query[len(m.Query)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fragment", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Fragment = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("scheme") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address") - } - - return nil -} -func (m *FrameworkInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.User = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &FrameworkID{} - } - if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field FailoverTimeout", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.FailoverTimeout = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Checkpoint = &b - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Role = &s - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Hostname = &s - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Principal = &s - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WebuiUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.WebuiUrl = &s - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Capabilities", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Capabilities = append(m.Capabilities, &FrameworkInfo_Capability{}) - if err := m.Capabilities[len(m.Capabilities)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = &Labels{} - } - if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("user") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - - return nil -} -func (m *FrameworkInfo_Capability) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v FrameworkInfo_Capability_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (FrameworkInfo_Capability_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *HealthCheck) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Http == nil { - m.Http = &HealthCheck_HTTP{} - } - if err := m.Http.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field DelaySeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.DelaySeconds = &v2 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field IntervalSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.IntervalSeconds = &v2 - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.TimeoutSeconds = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsecutiveFailures", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ConsecutiveFailures = &v - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field GracePeriodSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.GracePeriodSeconds = &v2 - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *HealthCheck_HTTP) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Path = &s - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Statuses = append(m.Statuses, v) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") - } - - return nil -} -func (m *CommandInfo) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uris", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uris = append(m.Uris, &CommandInfo_URI{}) - if err := m.Uris[len(m.Uris)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Environment", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Environment == nil { - m.Environment = &Environment{} - } - if err := m.Environment.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &CommandInfo_ContainerInfo{} - } - if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.User = &s - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Shell", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Shell = &b - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Arguments", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Arguments = append(m.Arguments, string(data[iNdEx:postIndex])) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *CommandInfo_URI) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Executable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Executable = &b - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Extract", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Extract = &b - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Cache", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Cache = &b - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *CommandInfo_ContainerInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Image = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, string(data[iNdEx:postIndex])) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") - } - - return nil -} -func (m *ExecutorInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Source = &s - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &ContainerInfo{} - } - if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Discovery", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Discovery == nil { - m.Discovery = &DiscoveryInfo{} - } - if err := m.Discovery.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("command") - } - - return nil -} -func (m *MasterInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Id = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Ip = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Pid = &s - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Hostname = &s - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Version = &s - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Address == nil { - m.Address = &Address{} - } - if err := m.Address.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("ip") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("port") - } - - return nil -} -func (m *SlaveInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Hostname = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, &Attribute{}) - if err := m.Attributes[len(m.Attributes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &SlaveID{} - } - if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Checkpoint = &b - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Port = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") - } - - return nil -} -func (m *Value) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Text == nil { - m.Text = &Value_Text{} - } - if err := m.Text.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *Value_Scalar) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Value = &v2 - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *Value_Range) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Begin", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Begin = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field End", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.End = &v - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("begin") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("end") - } - - return nil -} -func (m *Value_Ranges) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Range = append(m.Range, &Value_Range{}) - if err := m.Range[len(m.Range)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Value_Set) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Item", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Item = append(m.Item, string(data[iNdEx:postIndex])) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Value_Text) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *Attribute) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Text == nil { - m.Text = &Value_Text{} - } - if err := m.Text.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *Resource) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Value_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Value_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scalar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Scalar == nil { - m.Scalar = &Value_Scalar{} - } - if err := m.Scalar.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ranges == nil { - m.Ranges = &Value_Ranges{} - } - if err := m.Ranges.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Set == nil { - m.Set = &Value_Set{} - } - if err := m.Set.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Role = &s - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Disk", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Disk == nil { - m.Disk = &Resource_DiskInfo{} - } - if err := m.Disk.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reservation", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Reservation == nil { - m.Reservation = &Resource_ReservationInfo{} - } - if err := m.Reservation.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revocable", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Revocable == nil { - m.Revocable = &Resource_RevocableInfo{} - } - if err := m.Revocable.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *Resource_ReservationInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Principal = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") - } - - return nil -} -func (m *Resource_DiskInfo) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Persistence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Persistence == nil { - m.Persistence = &Resource_DiskInfo_Persistence{} - } - if err := m.Persistence.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volume", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Volume == nil { - m.Volume = &Volume{} - } - if err := m.Volume.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Resource_DiskInfo_Persistence) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Id = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") - } - - return nil -} -func (m *Resource_RevocableInfo) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *TrafficControlStatistics) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Id = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Backlog", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Backlog = &v - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Bytes = &v - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Drops", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Drops = &v - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Overlimits", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Overlimits = &v - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Packets", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Packets = &v - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Qlen", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Qlen = &v - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ratebps", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Ratebps = &v - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ratepps", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Ratepps = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Requeues", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Requeues = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") - } - - return nil -} -func (m *ResourceStatistics) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Timestamp = &v2 - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusUserTimeSecs", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.CpusUserTimeSecs = &v2 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusSystemTimeSecs", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.CpusSystemTimeSecs = &v2 - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusLimit", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.CpusLimit = &v2 - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemRssBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemRssBytes = &v - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemLimitBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemLimitBytes = &v - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusNrPeriods", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpusNrPeriods = &v - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusNrThrottled", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpusNrThrottled = &v - case 9: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpusThrottledTimeSecs", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.CpusThrottledTimeSecs = &v2 - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemFileBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemFileBytes = &v - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemAnonBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemAnonBytes = &v - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemMappedFileBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemMappedFileBytes = &v - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Perf", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Perf == nil { - m.Perf = &PerfStatistics{} - } - if err := m.Perf.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxPackets", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxPackets = &v - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxBytes = &v - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxErrors", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxErrors = &v - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetRxDropped", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetRxDropped = &v - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxPackets", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxPackets = &v - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxBytes = &v - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxErrors", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxErrors = &v - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTxDropped", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NetTxDropped = &v - case 22: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP50", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.NetTcpRttMicrosecsP50 = &v2 - case 23: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP90", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.NetTcpRttMicrosecsP90 = &v2 - case 24: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP95", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.NetTcpRttMicrosecsP95 = &v2 - case 25: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpRttMicrosecsP99", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.NetTcpRttMicrosecsP99 = &v2 - case 26: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskLimitBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DiskLimitBytes = &v - case 27: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiskUsedBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DiskUsedBytes = &v - case 28: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpActiveConnections", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.NetTcpActiveConnections = &v2 - case 29: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTcpTimeWaitConnections", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.NetTcpTimeWaitConnections = &v2 - case 30: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Processes", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Processes = &v - case 31: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Threads", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Threads = &v - case 32: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemLowPressureCounter", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemLowPressureCounter = &v - case 33: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemMediumPressureCounter", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemMediumPressureCounter = &v - case 34: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemCriticalPressureCounter", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemCriticalPressureCounter = &v - case 35: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NetTrafficControlStatistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NetTrafficControlStatistics = append(m.NetTrafficControlStatistics, &TrafficControlStatistics{}) - if err := m.NetTrafficControlStatistics[len(m.NetTrafficControlStatistics)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 36: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemTotalBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemTotalBytes = &v - case 37: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemTotalMemswBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemTotalMemswBytes = &v - case 38: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemSoftLimitBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemSoftLimitBytes = &v - case 39: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemCacheBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemCacheBytes = &v - case 40: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemSwapBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemSwapBytes = &v - case 41: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MemUnevictableBytes", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MemUnevictableBytes = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") - } - - return nil -} -func (m *ResourceUsage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Executors", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Executors = append(m.Executors, &ResourceUsage_Executor{}) - if err := m.Executors[len(m.Executors)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Total = append(m.Total, &Resource{}) - if err := m.Total[len(m.Total)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *ResourceUsage_Executor) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorInfo == nil { - m.ExecutorInfo = &ExecutorInfo{} - } - if err := m.ExecutorInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allocated", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Allocated = append(m.Allocated, &Resource{}) - if err := m.Allocated[len(m.Allocated)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statistics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Statistics == nil { - m.Statistics = &ResourceStatistics{} - } - if err := m.Statistics.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_info") - } - - return nil -} -func (m *PerfStatistics) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Timestamp = &v2 - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Duration = &v2 - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Cycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Cycles = &v - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesFrontend", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.StalledCyclesFrontend = &v - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StalledCyclesBackend", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.StalledCyclesBackend = &v - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Instructions", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Instructions = &v - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CacheReferences", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CacheReferences = &v - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CacheMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CacheMisses = &v - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Branches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Branches = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchMisses = &v - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BusCycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BusCycles = &v - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RefCycles", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.RefCycles = &v - case 13: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuClock", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.CpuClock = &v2 - case 14: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskClock", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.TaskClock = &v2 - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PageFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.PageFaults = &v - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinorFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MinorFaults = &v - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MajorFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MajorFaults = &v - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContextSwitches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ContextSwitches = &v - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CpuMigrations", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.CpuMigrations = &v - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AlignmentFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AlignmentFaults = &v - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EmulationFaults", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.EmulationFaults = &v - case 22: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheLoads = &v - case 23: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheLoadMisses = &v - case 24: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheStores = &v - case 25: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcacheStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcacheStoreMisses = &v - case 26: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcachePrefetches = &v - case 27: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1DcachePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1DcachePrefetchMisses = &v - case 28: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcacheLoads = &v - case 29: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcacheLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcacheLoadMisses = &v - case 30: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcachePrefetches = &v - case 31: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field L1IcachePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.L1IcachePrefetchMisses = &v - case 32: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcLoads = &v - case 33: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcLoadMisses = &v - case 34: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcStores = &v - case 35: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcStoreMisses = &v - case 36: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcPrefetches = &v - case 37: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LlcPrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LlcPrefetchMisses = &v - case 38: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbLoads = &v - case 39: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbLoadMisses = &v - case 40: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbStores = &v - case 41: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbStoreMisses = &v - case 42: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbPrefetches = &v - case 43: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DtlbPrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.DtlbPrefetchMisses = &v - case 44: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ItlbLoads = &v - case 45: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ItlbLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ItlbLoadMisses = &v - case 46: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchLoads = &v - case 47: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BranchLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.BranchLoadMisses = &v - case 48: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeLoads", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeLoads = &v - case 49: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeLoadMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeLoadMisses = &v - case 50: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeStores", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeStores = &v - case 51: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodeStoreMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodeStoreMisses = &v - case 52: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetches", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodePrefetches = &v - case 53: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NodePrefetchMisses", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NodePrefetchMisses = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("duration") - } - - return nil -} -func (m *Request) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Offer) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Id == nil { - m.Id = &OfferID{} - } - if err := m.Id.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Hostname = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000008) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExecutorIds = append(m.ExecutorIds, &ExecutorID{}) - if err := m.ExecutorIds[len(m.ExecutorIds)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, &Attribute{}) - if err := m.Attributes[len(m.Attributes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Url == nil { - m.Url = &URL{} - } - if err := m.Url.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000008) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("hostname") - } - - return nil -} -func (m *Offer_Operation) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Offer_Operation_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Offer_Operation_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Launch", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Launch == nil { - m.Launch = &Offer_Operation_Launch{} - } - if err := m.Launch.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reserve", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Reserve == nil { - m.Reserve = &Offer_Operation_Reserve{} - } - if err := m.Reserve.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unreserve", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Unreserve == nil { - m.Unreserve = &Offer_Operation_Unreserve{} - } - if err := m.Unreserve.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Create", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Create == nil { - m.Create = &Offer_Operation_Create{} - } - if err := m.Create.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Destroy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Destroy == nil { - m.Destroy = &Offer_Operation_Destroy{} - } - if err := m.Destroy.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *Offer_Operation_Launch) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TaskInfos = append(m.TaskInfos, &TaskInfo{}) - if err := m.TaskInfos[len(m.TaskInfos)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Offer_Operation_Reserve) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Offer_Operation_Unreserve) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Offer_Operation_Create) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Volumes = append(m.Volumes, &Resource{}) - if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Offer_Operation_Destroy) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Volumes = append(m.Volumes, &Resource{}) - if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *TaskInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Executor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Executor == nil { - m.Executor = &ExecutorInfo{} - } - if err := m.Executor.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Command == nil { - m.Command = &CommandInfo{} - } - if err := m.Command.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HealthCheck", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.HealthCheck == nil { - m.HealthCheck = &HealthCheck{} - } - if err := m.HealthCheck.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Container == nil { - m.Container = &ContainerInfo{} - } - if err := m.Container.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = &Labels{} - } - if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Discovery", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Discovery == nil { - m.Discovery = &DiscoveryInfo{} - } - if err := m.Discovery.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - - return nil -} -func (m *TaskStatus) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var v TaskState - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (TaskState(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.State = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Timestamp = &v2 - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Healthy", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Healthy = &b - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var v TaskStatus_Source - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (TaskStatus_Source(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Source = &v - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) - } - var v TaskStatus_Reason - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (TaskStatus_Reason(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Reason = &v - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = &Labels{} - } - if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("state") - } - - return nil -} -func (m *Filters) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field RefuseSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.RefuseSeconds = &v2 - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Environment) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Variables", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Variables = append(m.Variables, &Environment_Variable{}) - if err := m.Variables[len(m.Variables)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Environment_Variable) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *Parameter) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Key = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *Parameters) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameter", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parameter = append(m.Parameter, &Parameter{}) - if err := m.Parameter[len(m.Parameter)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Credential) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Principal = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Secret = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") - } - - return nil -} -func (m *Credentials) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Credentials", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Credentials = append(m.Credentials, &Credential{}) - if err := m.Credentials[len(m.Credentials)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *RateLimit) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Qps", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Qps = &v2 - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Principal = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Capacity = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("principal") - } - - return nil -} -func (m *RateLimits) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Limits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Limits = append(m.Limits, &RateLimit{}) - if err := m.Limits[len(m.Limits)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultQps", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.AggregateDefaultQps = &v2 - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregateDefaultCapacity", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AggregateDefaultCapacity = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Image) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Image_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Image_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Appc", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Appc == nil { - m.Appc = &Image_AppC{} - } - if err := m.Appc.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docker", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Docker == nil { - m.Docker = &Image_Docker{} - } - if err := m.Docker.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *Image_AppC) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Id = &s - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = &Labels{} - } - if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - - return nil -} -func (m *Image_Docker) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - - return nil -} -func (m *Volume) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.ContainerPath = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.HostPath = &s - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) - } - var v Volume_Mode - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Volume_Mode(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Mode = &v - hasFields[0] |= uint64(0x00000002) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Image == nil { - m.Image = &Image{} - } - if err := m.Image.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_path") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("mode") - } - - return nil -} -func (m *ContainerInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v ContainerInfo_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (ContainerInfo_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Volumes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Volumes = append(m.Volumes, &Volume{}) - if err := m.Volumes[len(m.Volumes)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Docker", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Docker == nil { - m.Docker = &ContainerInfo_DockerInfo{} - } - if err := m.Docker.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Hostname = &s - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mesos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Mesos == nil { - m.Mesos = &ContainerInfo_MesosInfo{} - } - if err := m.Mesos.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *ContainerInfo_DockerInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Image = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var v ContainerInfo_DockerInfo_Network - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (ContainerInfo_DockerInfo_Network(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Network = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PortMappings = append(m.PortMappings, &ContainerInfo_DockerInfo_PortMapping{}) - if err := m.PortMappings[len(m.PortMappings)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Privileged = &b - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parameters = append(m.Parameters, &Parameter{}) - if err := m.Parameters[len(m.Parameters)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ForcePullImage", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.ForcePullImage = &b - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("image") - } - - return nil -} -func (m *ContainerInfo_DockerInfo_PortMapping) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.HostPort = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ContainerPort = &v - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Protocol = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("host_port") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("container_port") - } - - return nil -} -func (m *ContainerInfo_MesosInfo) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Image == nil { - m.Image = &Image{} - } - if err := m.Image.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Labels) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, &Label{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Label) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Key = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("key") - } - - return nil -} -func (m *Port) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Number = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Protocol = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("number") - } - - return nil -} -func (m *Ports) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ports = append(m.Ports, &Port{}) - if err := m.Ports[len(m.Ports)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *DiscoveryInfo) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Visibility", wireType) - } - var v DiscoveryInfo_Visibility - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (DiscoveryInfo_Visibility(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Visibility = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Environment", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Environment = &s - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Location = &s - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Version = &s - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Ports == nil { - m.Ports = &Ports{} - } - if err := m.Ports.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = &Labels{} - } - if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("visibility") - } - - return nil -} -func (m *AppcImageManifest) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AcKind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.AcKind = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AcVersion", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.AcVersion = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, &AppcImageManifest_Label{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Annotations = append(m.Annotations, &AppcImageManifest_Annotation{}) - if err := m.Annotations[len(m.Annotations)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("acKind") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("acVersion") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - - return nil -} -func (m *AppcImageManifest_Label) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *AppcImageManifest_Annotation) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMesos - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Value = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMesos(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMesos - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func skipMesos(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthMesos - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipMesos(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthMesos = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/messages.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/messages.pb.go deleted file mode 100644 index 9dd1bc2fa..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/messages.pb.go +++ /dev/null @@ -1,16836 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: messages.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type StatusUpdateRecord_Type int32 - -const ( - StatusUpdateRecord_UPDATE StatusUpdateRecord_Type = 0 - StatusUpdateRecord_ACK StatusUpdateRecord_Type = 1 -) - -var StatusUpdateRecord_Type_name = map[int32]string{ - 0: "UPDATE", - 1: "ACK", -} -var StatusUpdateRecord_Type_value = map[string]int32{ - "UPDATE": 0, - "ACK": 1, -} - -func (x StatusUpdateRecord_Type) Enum() *StatusUpdateRecord_Type { - p := new(StatusUpdateRecord_Type) - *p = x - return p -} -func (x StatusUpdateRecord_Type) String() string { - return proto.EnumName(StatusUpdateRecord_Type_name, int32(x)) -} -func (x *StatusUpdateRecord_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(StatusUpdateRecord_Type_value, data, "StatusUpdateRecord_Type") - if err != nil { - return err - } - *x = StatusUpdateRecord_Type(value) - return nil -} - -// TODO(benh): It would be great if this could just be a -// TaskInfo wherever it gets used! However, doing so would -// require adding the framework_id field, the executor_id field, and -// the state field into TaskInfo though (or send them another -// way). Also, one performance reason why we don't do that now is -// because storing whatever data is coupled with a TaskInfo -// could be large and unnecessary. -// TODO(bmahler): Add executor_uuid here, and send it to the master. This will -// allow us to expose executor work directories for tasks in the webui when -// looking from the master level. Currently only the slave knows which run the -// task belongs to. -type Task struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - TaskId *TaskID `protobuf:"bytes,2,req,name=task_id" json:"task_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,3,req,name=framework_id" json:"framework_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,4,opt,name=executor_id" json:"executor_id,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,5,req,name=slave_id" json:"slave_id,omitempty"` - State *TaskState `protobuf:"varint,6,req,name=state,enum=mesosproto.TaskState" json:"state,omitempty"` - Resources []*Resource `protobuf:"bytes,7,rep,name=resources" json:"resources,omitempty"` - Statuses []*TaskStatus `protobuf:"bytes,8,rep,name=statuses" json:"statuses,omitempty"` - // These fields correspond to the state and uuid of the latest - // status update forwarded to the master. - // NOTE: Either both the fields must be set or both must be unset. - StatusUpdateState *TaskState `protobuf:"varint,9,opt,name=status_update_state,enum=mesosproto.TaskState" json:"status_update_state,omitempty"` - StatusUpdateUuid []byte `protobuf:"bytes,10,opt,name=status_update_uuid" json:"status_update_uuid,omitempty"` - Labels *Labels `protobuf:"bytes,11,opt,name=labels" json:"labels,omitempty"` - // Service discovery information for the task. It is not interpreted - // or acted upon by Mesos. It is up to a service discovery system - // to use this information as needed and to handle tasks without - // service discovery information. - Discovery *DiscoveryInfo `protobuf:"bytes,12,opt,name=discovery" json:"discovery,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Task) Reset() { *m = Task{} } -func (*Task) ProtoMessage() {} - -func (m *Task) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Task) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *Task) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *Task) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *Task) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *Task) GetState() TaskState { - if m != nil && m.State != nil { - return *m.State - } - return TaskState_TASK_STAGING -} - -func (m *Task) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -func (m *Task) GetStatuses() []*TaskStatus { - if m != nil { - return m.Statuses - } - return nil -} - -func (m *Task) GetStatusUpdateState() TaskState { - if m != nil && m.StatusUpdateState != nil { - return *m.StatusUpdateState - } - return TaskState_TASK_STAGING -} - -func (m *Task) GetStatusUpdateUuid() []byte { - if m != nil { - return m.StatusUpdateUuid - } - return nil -} - -func (m *Task) GetLabels() *Labels { - if m != nil { - return m.Labels - } - return nil -} - -func (m *Task) GetDiscovery() *DiscoveryInfo { - if m != nil { - return m.Discovery - } - return nil -} - -// TODO(vinod): Create a new UUID message type. -type StatusUpdate struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,2,opt,name=executor_id" json:"executor_id,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,3,opt,name=slave_id" json:"slave_id,omitempty"` - Status *TaskStatus `protobuf:"bytes,4,req,name=status" json:"status,omitempty"` - Timestamp *float64 `protobuf:"fixed64,5,req,name=timestamp" json:"timestamp,omitempty"` - // This is being deprecated in favor of TaskStatus.uuid. In 0.23.0, - // we set the TaskStatus 'uuid' in the executor driver for all - // retryable status updates. - Uuid []byte `protobuf:"bytes,6,opt,name=uuid" json:"uuid,omitempty"` - // This corresponds to the latest state of the task according to the - // slave. Note that this state might be different than the state in - // 'status' because status update manager queues updates. In other - // words, 'status' corresponds to the update at top of the queue and - // 'latest_state' corresponds to the update at bottom of the queue. - LatestState *TaskState `protobuf:"varint,7,opt,name=latest_state,enum=mesosproto.TaskState" json:"latest_state,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StatusUpdate) Reset() { *m = StatusUpdate{} } -func (*StatusUpdate) ProtoMessage() {} - -func (m *StatusUpdate) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *StatusUpdate) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *StatusUpdate) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *StatusUpdate) GetStatus() *TaskStatus { - if m != nil { - return m.Status - } - return nil -} - -func (m *StatusUpdate) GetTimestamp() float64 { - if m != nil && m.Timestamp != nil { - return *m.Timestamp - } - return 0 -} - -func (m *StatusUpdate) GetUuid() []byte { - if m != nil { - return m.Uuid - } - return nil -} - -func (m *StatusUpdate) GetLatestState() TaskState { - if m != nil && m.LatestState != nil { - return *m.LatestState - } - return TaskState_TASK_STAGING -} - -// This message encapsulates how we checkpoint a status update to disk. -// NOTE: If type == UPDATE, the 'update' field is required. -// NOTE: If type == ACK, the 'uuid' field is required. -type StatusUpdateRecord struct { - Type *StatusUpdateRecord_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.StatusUpdateRecord_Type" json:"type,omitempty"` - Update *StatusUpdate `protobuf:"bytes,2,opt,name=update" json:"update,omitempty"` - Uuid []byte `protobuf:"bytes,3,opt,name=uuid" json:"uuid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StatusUpdateRecord) Reset() { *m = StatusUpdateRecord{} } -func (*StatusUpdateRecord) ProtoMessage() {} - -func (m *StatusUpdateRecord) GetType() StatusUpdateRecord_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return StatusUpdateRecord_UPDATE -} - -func (m *StatusUpdateRecord) GetUpdate() *StatusUpdate { - if m != nil { - return m.Update - } - return nil -} - -func (m *StatusUpdateRecord) GetUuid() []byte { - if m != nil { - return m.Uuid - } - return nil -} - -type SubmitSchedulerRequest struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SubmitSchedulerRequest) Reset() { *m = SubmitSchedulerRequest{} } -func (*SubmitSchedulerRequest) ProtoMessage() {} - -func (m *SubmitSchedulerRequest) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -type SubmitSchedulerResponse struct { - Okay *bool `protobuf:"varint,1,req,name=okay" json:"okay,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SubmitSchedulerResponse) Reset() { *m = SubmitSchedulerResponse{} } -func (*SubmitSchedulerResponse) ProtoMessage() {} - -func (m *SubmitSchedulerResponse) GetOkay() bool { - if m != nil && m.Okay != nil { - return *m.Okay - } - return false -} - -type ExecutorToFrameworkMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,req,name=framework_id" json:"framework_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,3,req,name=executor_id" json:"executor_id,omitempty"` - Data []byte `protobuf:"bytes,4,req,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ExecutorToFrameworkMessage) Reset() { *m = ExecutorToFrameworkMessage{} } -func (*ExecutorToFrameworkMessage) ProtoMessage() {} - -func (m *ExecutorToFrameworkMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *ExecutorToFrameworkMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *ExecutorToFrameworkMessage) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *ExecutorToFrameworkMessage) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -type FrameworkToExecutorMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,req,name=framework_id" json:"framework_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,3,req,name=executor_id" json:"executor_id,omitempty"` - Data []byte `protobuf:"bytes,4,req,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FrameworkToExecutorMessage) Reset() { *m = FrameworkToExecutorMessage{} } -func (*FrameworkToExecutorMessage) ProtoMessage() {} - -func (m *FrameworkToExecutorMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *FrameworkToExecutorMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *FrameworkToExecutorMessage) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *FrameworkToExecutorMessage) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -type RegisterFrameworkMessage struct { - Framework *FrameworkInfo `protobuf:"bytes,1,req,name=framework" json:"framework,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RegisterFrameworkMessage) Reset() { *m = RegisterFrameworkMessage{} } -func (*RegisterFrameworkMessage) ProtoMessage() {} - -func (m *RegisterFrameworkMessage) GetFramework() *FrameworkInfo { - if m != nil { - return m.Framework - } - return nil -} - -type ReregisterFrameworkMessage struct { - Framework *FrameworkInfo `protobuf:"bytes,2,req,name=framework" json:"framework,omitempty"` - Failover *bool `protobuf:"varint,3,req,name=failover" json:"failover,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ReregisterFrameworkMessage) Reset() { *m = ReregisterFrameworkMessage{} } -func (*ReregisterFrameworkMessage) ProtoMessage() {} - -func (m *ReregisterFrameworkMessage) GetFramework() *FrameworkInfo { - if m != nil { - return m.Framework - } - return nil -} - -func (m *ReregisterFrameworkMessage) GetFailover() bool { - if m != nil && m.Failover != nil { - return *m.Failover - } - return false -} - -type FrameworkRegisteredMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - MasterInfo *MasterInfo `protobuf:"bytes,2,req,name=master_info" json:"master_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FrameworkRegisteredMessage) Reset() { *m = FrameworkRegisteredMessage{} } -func (*FrameworkRegisteredMessage) ProtoMessage() {} - -func (m *FrameworkRegisteredMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *FrameworkRegisteredMessage) GetMasterInfo() *MasterInfo { - if m != nil { - return m.MasterInfo - } - return nil -} - -type FrameworkReregisteredMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - MasterInfo *MasterInfo `protobuf:"bytes,2,req,name=master_info" json:"master_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FrameworkReregisteredMessage) Reset() { *m = FrameworkReregisteredMessage{} } -func (*FrameworkReregisteredMessage) ProtoMessage() {} - -func (m *FrameworkReregisteredMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *FrameworkReregisteredMessage) GetMasterInfo() *MasterInfo { - if m != nil { - return m.MasterInfo - } - return nil -} - -type UnregisterFrameworkMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *UnregisterFrameworkMessage) Reset() { *m = UnregisterFrameworkMessage{} } -func (*UnregisterFrameworkMessage) ProtoMessage() {} - -func (m *UnregisterFrameworkMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -type DeactivateFrameworkMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *DeactivateFrameworkMessage) Reset() { *m = DeactivateFrameworkMessage{} } -func (*DeactivateFrameworkMessage) ProtoMessage() {} - -func (m *DeactivateFrameworkMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -type ResourceRequestMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - Requests []*Request `protobuf:"bytes,2,rep,name=requests" json:"requests,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ResourceRequestMessage) Reset() { *m = ResourceRequestMessage{} } -func (*ResourceRequestMessage) ProtoMessage() {} - -func (m *ResourceRequestMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *ResourceRequestMessage) GetRequests() []*Request { - if m != nil { - return m.Requests - } - return nil -} - -type ResourceOffersMessage struct { - Offers []*Offer `protobuf:"bytes,1,rep,name=offers" json:"offers,omitempty"` - Pids []string `protobuf:"bytes,2,rep,name=pids" json:"pids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ResourceOffersMessage) Reset() { *m = ResourceOffersMessage{} } -func (*ResourceOffersMessage) ProtoMessage() {} - -func (m *ResourceOffersMessage) GetOffers() []*Offer { - if m != nil { - return m.Offers - } - return nil -} - -func (m *ResourceOffersMessage) GetPids() []string { - if m != nil { - return m.Pids - } - return nil -} - -type LaunchTasksMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - Tasks []*TaskInfo `protobuf:"bytes,3,rep,name=tasks" json:"tasks,omitempty"` - Filters *Filters `protobuf:"bytes,5,req,name=filters" json:"filters,omitempty"` - OfferIds []*OfferID `protobuf:"bytes,6,rep,name=offer_ids" json:"offer_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *LaunchTasksMessage) Reset() { *m = LaunchTasksMessage{} } -func (*LaunchTasksMessage) ProtoMessage() {} - -func (m *LaunchTasksMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *LaunchTasksMessage) GetTasks() []*TaskInfo { - if m != nil { - return m.Tasks - } - return nil -} - -func (m *LaunchTasksMessage) GetFilters() *Filters { - if m != nil { - return m.Filters - } - return nil -} - -func (m *LaunchTasksMessage) GetOfferIds() []*OfferID { - if m != nil { - return m.OfferIds - } - return nil -} - -type RescindResourceOfferMessage struct { - OfferId *OfferID `protobuf:"bytes,1,req,name=offer_id" json:"offer_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RescindResourceOfferMessage) Reset() { *m = RescindResourceOfferMessage{} } -func (*RescindResourceOfferMessage) ProtoMessage() {} - -func (m *RescindResourceOfferMessage) GetOfferId() *OfferID { - if m != nil { - return m.OfferId - } - return nil -} - -type ReviveOffersMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ReviveOffersMessage) Reset() { *m = ReviveOffersMessage{} } -func (*ReviveOffersMessage) ProtoMessage() {} - -func (m *ReviveOffersMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -type RunTaskMessage struct { - // TODO(karya): Remove framework_id after MESOS-2559 has shipped. - FrameworkId *FrameworkID `protobuf:"bytes,1,opt,name=framework_id" json:"framework_id,omitempty"` - Framework *FrameworkInfo `protobuf:"bytes,2,req,name=framework" json:"framework,omitempty"` - Task *TaskInfo `protobuf:"bytes,4,req,name=task" json:"task,omitempty"` - // The pid of the framework. This was moved to 'optional' in - // 0.24.0 to support schedulers using the HTTP API. For now, we - // continue to always set pid since it was required in 0.23.x. - // When 'pid' is unset, or set to empty string, the slave will - // forward executor messages through the master. For schedulers - // still using the driver, this will remain set. - Pid *string `protobuf:"bytes,3,opt,name=pid" json:"pid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RunTaskMessage) Reset() { *m = RunTaskMessage{} } -func (*RunTaskMessage) ProtoMessage() {} - -func (m *RunTaskMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *RunTaskMessage) GetFramework() *FrameworkInfo { - if m != nil { - return m.Framework - } - return nil -} - -func (m *RunTaskMessage) GetTask() *TaskInfo { - if m != nil { - return m.Task - } - return nil -} - -func (m *RunTaskMessage) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} - -type KillTaskMessage struct { - // TODO(bmahler): Include the SlaveID here to improve the Master's - // ability to respond for non-activated slaves. - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - TaskId *TaskID `protobuf:"bytes,2,req,name=task_id" json:"task_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *KillTaskMessage) Reset() { *m = KillTaskMessage{} } -func (*KillTaskMessage) ProtoMessage() {} - -func (m *KillTaskMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *KillTaskMessage) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -// NOTE: If 'pid' is present, scheduler driver sends an -// acknowledgement to the pid. -type StatusUpdateMessage struct { - Update *StatusUpdate `protobuf:"bytes,1,req,name=update" json:"update,omitempty"` - Pid *string `protobuf:"bytes,2,opt,name=pid" json:"pid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StatusUpdateMessage) Reset() { *m = StatusUpdateMessage{} } -func (*StatusUpdateMessage) ProtoMessage() {} - -func (m *StatusUpdateMessage) GetUpdate() *StatusUpdate { - if m != nil { - return m.Update - } - return nil -} - -func (m *StatusUpdateMessage) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} - -type StatusUpdateAcknowledgementMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,req,name=framework_id" json:"framework_id,omitempty"` - TaskId *TaskID `protobuf:"bytes,3,req,name=task_id" json:"task_id,omitempty"` - Uuid []byte `protobuf:"bytes,4,req,name=uuid" json:"uuid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StatusUpdateAcknowledgementMessage) Reset() { *m = StatusUpdateAcknowledgementMessage{} } -func (*StatusUpdateAcknowledgementMessage) ProtoMessage() {} - -func (m *StatusUpdateAcknowledgementMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *StatusUpdateAcknowledgementMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *StatusUpdateAcknowledgementMessage) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *StatusUpdateAcknowledgementMessage) GetUuid() []byte { - if m != nil { - return m.Uuid - } - return nil -} - -type LostSlaveMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *LostSlaveMessage) Reset() { *m = LostSlaveMessage{} } -func (*LostSlaveMessage) ProtoMessage() {} - -func (m *LostSlaveMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -// Allows the framework to query the status for non-terminal tasks. -// This causes the master to send back the latest task status for -// each task in 'statuses', if possible. Tasks that are no longer -// known will result in a TASK_LOST update. If statuses is empty, -// then the master will send the latest status for each task -// currently known. -type ReconcileTasksMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - Statuses []*TaskStatus `protobuf:"bytes,2,rep,name=statuses" json:"statuses,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ReconcileTasksMessage) Reset() { *m = ReconcileTasksMessage{} } -func (*ReconcileTasksMessage) ProtoMessage() {} - -func (m *ReconcileTasksMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *ReconcileTasksMessage) GetStatuses() []*TaskStatus { - if m != nil { - return m.Statuses - } - return nil -} - -type FrameworkErrorMessage struct { - Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *FrameworkErrorMessage) Reset() { *m = FrameworkErrorMessage{} } -func (*FrameworkErrorMessage) ProtoMessage() {} - -func (m *FrameworkErrorMessage) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -type RegisterSlaveMessage struct { - Slave *SlaveInfo `protobuf:"bytes,1,req,name=slave" json:"slave,omitempty"` - // Resources that are checkpointed by the slave (e.g., persistent - // volume or dynamic reservation). Frameworks need to release - // checkpointed resources explicitly. - CheckpointedResources []*Resource `protobuf:"bytes,3,rep,name=checkpointed_resources" json:"checkpointed_resources,omitempty"` - // NOTE: This is a hack for the master to detect the slave's - // version. If unset the slave is < 0.21.0. - // TODO(bmahler): Do proper versioning: MESOS-986. - Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RegisterSlaveMessage) Reset() { *m = RegisterSlaveMessage{} } -func (*RegisterSlaveMessage) ProtoMessage() {} - -func (m *RegisterSlaveMessage) GetSlave() *SlaveInfo { - if m != nil { - return m.Slave - } - return nil -} - -func (m *RegisterSlaveMessage) GetCheckpointedResources() []*Resource { - if m != nil { - return m.CheckpointedResources - } - return nil -} - -func (m *RegisterSlaveMessage) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -type ReregisterSlaveMessage struct { - Slave *SlaveInfo `protobuf:"bytes,2,req,name=slave" json:"slave,omitempty"` - // Resources that are checkpointed by the slave (e.g., persistent - // volume or dynamic reservation). Frameworks need to release - // checkpointed resources explicitly. - CheckpointedResources []*Resource `protobuf:"bytes,7,rep,name=checkpointed_resources" json:"checkpointed_resources,omitempty"` - ExecutorInfos []*ExecutorInfo `protobuf:"bytes,4,rep,name=executor_infos" json:"executor_infos,omitempty"` - Tasks []*Task `protobuf:"bytes,3,rep,name=tasks" json:"tasks,omitempty"` - CompletedFrameworks []*Archive_Framework `protobuf:"bytes,5,rep,name=completed_frameworks" json:"completed_frameworks,omitempty"` - // NOTE: This is a hack for the master to detect the slave's - // version. If unset the slave is < 0.21.0. - // TODO(bmahler): Do proper versioning: MESOS-986. - Version *string `protobuf:"bytes,6,opt,name=version" json:"version,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ReregisterSlaveMessage) Reset() { *m = ReregisterSlaveMessage{} } -func (*ReregisterSlaveMessage) ProtoMessage() {} - -func (m *ReregisterSlaveMessage) GetSlave() *SlaveInfo { - if m != nil { - return m.Slave - } - return nil -} - -func (m *ReregisterSlaveMessage) GetCheckpointedResources() []*Resource { - if m != nil { - return m.CheckpointedResources - } - return nil -} - -func (m *ReregisterSlaveMessage) GetExecutorInfos() []*ExecutorInfo { - if m != nil { - return m.ExecutorInfos - } - return nil -} - -func (m *ReregisterSlaveMessage) GetTasks() []*Task { - if m != nil { - return m.Tasks - } - return nil -} - -func (m *ReregisterSlaveMessage) GetCompletedFrameworks() []*Archive_Framework { - if m != nil { - return m.CompletedFrameworks - } - return nil -} - -func (m *ReregisterSlaveMessage) GetVersion() string { - if m != nil && m.Version != nil { - return *m.Version - } - return "" -} - -type SlaveRegisteredMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - Connection *MasterSlaveConnection `protobuf:"bytes,2,opt,name=connection" json:"connection,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SlaveRegisteredMessage) Reset() { *m = SlaveRegisteredMessage{} } -func (*SlaveRegisteredMessage) ProtoMessage() {} - -func (m *SlaveRegisteredMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *SlaveRegisteredMessage) GetConnection() *MasterSlaveConnection { - if m != nil { - return m.Connection - } - return nil -} - -type SlaveReregisteredMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - Reconciliations []*ReconcileTasksMessage `protobuf:"bytes,2,rep,name=reconciliations" json:"reconciliations,omitempty"` - Connection *MasterSlaveConnection `protobuf:"bytes,3,opt,name=connection" json:"connection,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SlaveReregisteredMessage) Reset() { *m = SlaveReregisteredMessage{} } -func (*SlaveReregisteredMessage) ProtoMessage() {} - -func (m *SlaveReregisteredMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *SlaveReregisteredMessage) GetReconciliations() []*ReconcileTasksMessage { - if m != nil { - return m.Reconciliations - } - return nil -} - -func (m *SlaveReregisteredMessage) GetConnection() *MasterSlaveConnection { - if m != nil { - return m.Connection - } - return nil -} - -type UnregisterSlaveMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *UnregisterSlaveMessage) Reset() { *m = UnregisterSlaveMessage{} } -func (*UnregisterSlaveMessage) ProtoMessage() {} - -func (m *UnregisterSlaveMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -type MasterSlaveConnection struct { - // Product of max_slave_ping_timeouts * slave_ping_timeout. - // If no pings are received within the total timeout, - // the master will remove the slave. - TotalPingTimeoutSeconds *float64 `protobuf:"fixed64,1,opt,name=total_ping_timeout_seconds" json:"total_ping_timeout_seconds,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MasterSlaveConnection) Reset() { *m = MasterSlaveConnection{} } -func (*MasterSlaveConnection) ProtoMessage() {} - -func (m *MasterSlaveConnection) GetTotalPingTimeoutSeconds() float64 { - if m != nil && m.TotalPingTimeoutSeconds != nil { - return *m.TotalPingTimeoutSeconds - } - return 0 -} - -// This message is periodically sent by the master to the slave. -// If the slave is connected to the master, "connected" is true. -type PingSlaveMessage struct { - Connected *bool `protobuf:"varint,1,req,name=connected" json:"connected,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *PingSlaveMessage) Reset() { *m = PingSlaveMessage{} } -func (*PingSlaveMessage) ProtoMessage() {} - -func (m *PingSlaveMessage) GetConnected() bool { - if m != nil && m.Connected != nil { - return *m.Connected - } - return false -} - -// This message is sent by the slave to the master in response to the -// PingSlaveMessage. -type PongSlaveMessage struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *PongSlaveMessage) Reset() { *m = PongSlaveMessage{} } -func (*PongSlaveMessage) ProtoMessage() {} - -// Tells a slave to shut down all executors of the given framework. -type ShutdownFrameworkMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ShutdownFrameworkMessage) Reset() { *m = ShutdownFrameworkMessage{} } -func (*ShutdownFrameworkMessage) ProtoMessage() {} - -func (m *ShutdownFrameworkMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -// Tells a slave (and consequently executor) to shutdown an executor. -type ShutdownExecutorMessage struct { - // TODO(vinod): Make these fields required. These are made optional - // for backwards compatibility between 0.23.0 slave and pre 0.23.0 - // executor driver. - ExecutorId *ExecutorID `protobuf:"bytes,1,opt,name=executor_id" json:"executor_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,opt,name=framework_id" json:"framework_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ShutdownExecutorMessage) Reset() { *m = ShutdownExecutorMessage{} } -func (*ShutdownExecutorMessage) ProtoMessage() {} - -func (m *ShutdownExecutorMessage) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *ShutdownExecutorMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -type UpdateFrameworkMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - // See the comment on RunTaskMessage.pid. - Pid *string `protobuf:"bytes,2,opt,name=pid" json:"pid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *UpdateFrameworkMessage) Reset() { *m = UpdateFrameworkMessage{} } -func (*UpdateFrameworkMessage) ProtoMessage() {} - -func (m *UpdateFrameworkMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *UpdateFrameworkMessage) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} - -// This message is sent to the slave whenever there is an update of -// the resources that need to be checkpointed (e.g., persistent volume -// or dynamic reservation). -type CheckpointResourcesMessage struct { - Resources []*Resource `protobuf:"bytes,1,rep,name=resources" json:"resources,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *CheckpointResourcesMessage) Reset() { *m = CheckpointResourcesMessage{} } -func (*CheckpointResourcesMessage) ProtoMessage() {} - -func (m *CheckpointResourcesMessage) GetResources() []*Resource { - if m != nil { - return m.Resources - } - return nil -} - -// This message is sent by the slave to the master to inform the -// master about the total amount of oversubscribed (allocated and -// allocatable) resources. -type UpdateSlaveMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - OversubscribedResources []*Resource `protobuf:"bytes,2,rep,name=oversubscribed_resources" json:"oversubscribed_resources,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *UpdateSlaveMessage) Reset() { *m = UpdateSlaveMessage{} } -func (*UpdateSlaveMessage) ProtoMessage() {} - -func (m *UpdateSlaveMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *UpdateSlaveMessage) GetOversubscribedResources() []*Resource { - if m != nil { - return m.OversubscribedResources - } - return nil -} - -type RegisterExecutorMessage struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *RegisterExecutorMessage) Reset() { *m = RegisterExecutorMessage{} } -func (*RegisterExecutorMessage) ProtoMessage() {} - -func (m *RegisterExecutorMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *RegisterExecutorMessage) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -type ExecutorRegisteredMessage struct { - ExecutorInfo *ExecutorInfo `protobuf:"bytes,2,req,name=executor_info" json:"executor_info,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,3,req,name=framework_id" json:"framework_id,omitempty"` - FrameworkInfo *FrameworkInfo `protobuf:"bytes,4,req,name=framework_info" json:"framework_info,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,5,req,name=slave_id" json:"slave_id,omitempty"` - SlaveInfo *SlaveInfo `protobuf:"bytes,6,req,name=slave_info" json:"slave_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ExecutorRegisteredMessage) Reset() { *m = ExecutorRegisteredMessage{} } -func (*ExecutorRegisteredMessage) ProtoMessage() {} - -func (m *ExecutorRegisteredMessage) GetExecutorInfo() *ExecutorInfo { - if m != nil { - return m.ExecutorInfo - } - return nil -} - -func (m *ExecutorRegisteredMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *ExecutorRegisteredMessage) GetFrameworkInfo() *FrameworkInfo { - if m != nil { - return m.FrameworkInfo - } - return nil -} - -func (m *ExecutorRegisteredMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *ExecutorRegisteredMessage) GetSlaveInfo() *SlaveInfo { - if m != nil { - return m.SlaveInfo - } - return nil -} - -type ExecutorReregisteredMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - SlaveInfo *SlaveInfo `protobuf:"bytes,2,req,name=slave_info" json:"slave_info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ExecutorReregisteredMessage) Reset() { *m = ExecutorReregisteredMessage{} } -func (*ExecutorReregisteredMessage) ProtoMessage() {} - -func (m *ExecutorReregisteredMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *ExecutorReregisteredMessage) GetSlaveInfo() *SlaveInfo { - if m != nil { - return m.SlaveInfo - } - return nil -} - -type ExitedExecutorMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,req,name=framework_id" json:"framework_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,3,req,name=executor_id" json:"executor_id,omitempty"` - Status *int32 `protobuf:"varint,4,req,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ExitedExecutorMessage) Reset() { *m = ExitedExecutorMessage{} } -func (*ExitedExecutorMessage) ProtoMessage() {} - -func (m *ExitedExecutorMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *ExitedExecutorMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *ExitedExecutorMessage) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *ExitedExecutorMessage) GetStatus() int32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -type ReconnectExecutorMessage struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ReconnectExecutorMessage) Reset() { *m = ReconnectExecutorMessage{} } -func (*ReconnectExecutorMessage) ProtoMessage() {} - -func (m *ReconnectExecutorMessage) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -type ReregisterExecutorMessage struct { - ExecutorId *ExecutorID `protobuf:"bytes,1,req,name=executor_id" json:"executor_id,omitempty"` - FrameworkId *FrameworkID `protobuf:"bytes,2,req,name=framework_id" json:"framework_id,omitempty"` - Tasks []*TaskInfo `protobuf:"bytes,3,rep,name=tasks" json:"tasks,omitempty"` - Updates []*StatusUpdate `protobuf:"bytes,4,rep,name=updates" json:"updates,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ReregisterExecutorMessage) Reset() { *m = ReregisterExecutorMessage{} } -func (*ReregisterExecutorMessage) ProtoMessage() {} - -func (m *ReregisterExecutorMessage) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *ReregisterExecutorMessage) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *ReregisterExecutorMessage) GetTasks() []*TaskInfo { - if m != nil { - return m.Tasks - } - return nil -} - -func (m *ReregisterExecutorMessage) GetUpdates() []*StatusUpdate { - if m != nil { - return m.Updates - } - return nil -} - -type ShutdownMessage struct { - Message *string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ShutdownMessage) Reset() { *m = ShutdownMessage{} } -func (*ShutdownMessage) ProtoMessage() {} - -func (m *ShutdownMessage) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -// * -// Describes Completed Frameworks, etc. for archival. -type Archive struct { - Frameworks []*Archive_Framework `protobuf:"bytes,1,rep,name=frameworks" json:"frameworks,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Archive) Reset() { *m = Archive{} } -func (*Archive) ProtoMessage() {} - -func (m *Archive) GetFrameworks() []*Archive_Framework { - if m != nil { - return m.Frameworks - } - return nil -} - -type Archive_Framework struct { - FrameworkInfo *FrameworkInfo `protobuf:"bytes,1,req,name=framework_info" json:"framework_info,omitempty"` - Pid *string `protobuf:"bytes,2,opt,name=pid" json:"pid,omitempty"` - Tasks []*Task `protobuf:"bytes,3,rep,name=tasks" json:"tasks,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Archive_Framework) Reset() { *m = Archive_Framework{} } -func (*Archive_Framework) ProtoMessage() {} - -func (m *Archive_Framework) GetFrameworkInfo() *FrameworkInfo { - if m != nil { - return m.FrameworkInfo - } - return nil -} - -func (m *Archive_Framework) GetPid() string { - if m != nil && m.Pid != nil { - return *m.Pid - } - return "" -} - -func (m *Archive_Framework) GetTasks() []*Task { - if m != nil { - return m.Tasks - } - return nil -} - -// Message describing task current health status that is sent by -// the task health checker to the command executor. -// The command executor reports the task status back to the -// on each receive. If the health checker configured faiure -// condition meets, then kill_task flag will be set to true which -// the executor on message receive will kill the task. -type TaskHealthStatus struct { - TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` - Healthy *bool `protobuf:"varint,2,req,name=healthy" json:"healthy,omitempty"` - // Flag to initiate task kill. - KillTask *bool `protobuf:"varint,3,opt,name=kill_task,def=0" json:"kill_task,omitempty"` - // Number of consecutive counts in current status. - // This will not be populated if task is healthy. - ConsecutiveFailures *int32 `protobuf:"varint,4,opt,name=consecutive_failures" json:"consecutive_failures,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *TaskHealthStatus) Reset() { *m = TaskHealthStatus{} } -func (*TaskHealthStatus) ProtoMessage() {} - -const Default_TaskHealthStatus_KillTask bool = false - -func (m *TaskHealthStatus) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *TaskHealthStatus) GetHealthy() bool { - if m != nil && m.Healthy != nil { - return *m.Healthy - } - return false -} - -func (m *TaskHealthStatus) GetKillTask() bool { - if m != nil && m.KillTask != nil { - return *m.KillTask - } - return Default_TaskHealthStatus_KillTask -} - -func (m *TaskHealthStatus) GetConsecutiveFailures() int32 { - if m != nil && m.ConsecutiveFailures != nil { - return *m.ConsecutiveFailures - } - return 0 -} - -// * -// Message to signal completion of an event within a module. -type HookExecuted struct { - Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *HookExecuted) Reset() { *m = HookExecuted{} } -func (*HookExecuted) ProtoMessage() {} - -func (m *HookExecuted) GetModule() string { - if m != nil && m.Module != nil { - return *m.Module - } - return "" -} - -func init() { - proto.RegisterEnum("mesosproto.StatusUpdateRecord_Type", StatusUpdateRecord_Type_name, StatusUpdateRecord_Type_value) -} -func (this *Task) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Task) - if !ok { - return fmt.Errorf("that is not of type *Task") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Task but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Taskbut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if this.State != nil && that1.State != nil { - if *this.State != *that1.State { - return fmt.Errorf("State this(%v) Not Equal that(%v)", *this.State, *that1.State) - } - } else if this.State != nil { - return fmt.Errorf("this.State == nil && that.State != nil") - } else if that1.State != nil { - return fmt.Errorf("State this(%v) Not Equal that(%v)", this.State, that1.State) - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if len(this.Statuses) != len(that1.Statuses) { - return fmt.Errorf("Statuses this(%v) Not Equal that(%v)", len(this.Statuses), len(that1.Statuses)) - } - for i := range this.Statuses { - if !this.Statuses[i].Equal(that1.Statuses[i]) { - return fmt.Errorf("Statuses this[%v](%v) Not Equal that[%v](%v)", i, this.Statuses[i], i, that1.Statuses[i]) - } - } - if this.StatusUpdateState != nil && that1.StatusUpdateState != nil { - if *this.StatusUpdateState != *that1.StatusUpdateState { - return fmt.Errorf("StatusUpdateState this(%v) Not Equal that(%v)", *this.StatusUpdateState, *that1.StatusUpdateState) - } - } else if this.StatusUpdateState != nil { - return fmt.Errorf("this.StatusUpdateState == nil && that.StatusUpdateState != nil") - } else if that1.StatusUpdateState != nil { - return fmt.Errorf("StatusUpdateState this(%v) Not Equal that(%v)", this.StatusUpdateState, that1.StatusUpdateState) - } - if !bytes.Equal(this.StatusUpdateUuid, that1.StatusUpdateUuid) { - return fmt.Errorf("StatusUpdateUuid this(%v) Not Equal that(%v)", this.StatusUpdateUuid, that1.StatusUpdateUuid) - } - if !this.Labels.Equal(that1.Labels) { - return fmt.Errorf("Labels this(%v) Not Equal that(%v)", this.Labels, that1.Labels) - } - if !this.Discovery.Equal(that1.Discovery) { - return fmt.Errorf("Discovery this(%v) Not Equal that(%v)", this.Discovery, that1.Discovery) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Task) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Task) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if this.State != nil && that1.State != nil { - if *this.State != *that1.State { - return false - } - } else if this.State != nil { - return false - } else if that1.State != nil { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if len(this.Statuses) != len(that1.Statuses) { - return false - } - for i := range this.Statuses { - if !this.Statuses[i].Equal(that1.Statuses[i]) { - return false - } - } - if this.StatusUpdateState != nil && that1.StatusUpdateState != nil { - if *this.StatusUpdateState != *that1.StatusUpdateState { - return false - } - } else if this.StatusUpdateState != nil { - return false - } else if that1.StatusUpdateState != nil { - return false - } - if !bytes.Equal(this.StatusUpdateUuid, that1.StatusUpdateUuid) { - return false - } - if !this.Labels.Equal(that1.Labels) { - return false - } - if !this.Discovery.Equal(that1.Discovery) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *StatusUpdate) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*StatusUpdate) - if !ok { - return fmt.Errorf("that is not of type *StatusUpdate") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *StatusUpdate but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *StatusUpdatebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.Status.Equal(that1.Status) { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", *this.Timestamp, *that1.Timestamp) - } - } else if this.Timestamp != nil { - return fmt.Errorf("this.Timestamp == nil && that.Timestamp != nil") - } else if that1.Timestamp != nil { - return fmt.Errorf("Timestamp this(%v) Not Equal that(%v)", this.Timestamp, that1.Timestamp) - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) - } - if this.LatestState != nil && that1.LatestState != nil { - if *this.LatestState != *that1.LatestState { - return fmt.Errorf("LatestState this(%v) Not Equal that(%v)", *this.LatestState, *that1.LatestState) - } - } else if this.LatestState != nil { - return fmt.Errorf("this.LatestState == nil && that.LatestState != nil") - } else if that1.LatestState != nil { - return fmt.Errorf("LatestState this(%v) Not Equal that(%v)", this.LatestState, that1.LatestState) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *StatusUpdate) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*StatusUpdate) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.Status.Equal(that1.Status) { - return false - } - if this.Timestamp != nil && that1.Timestamp != nil { - if *this.Timestamp != *that1.Timestamp { - return false - } - } else if this.Timestamp != nil { - return false - } else if that1.Timestamp != nil { - return false - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return false - } - if this.LatestState != nil && that1.LatestState != nil { - if *this.LatestState != *that1.LatestState { - return false - } - } else if this.LatestState != nil { - return false - } else if that1.LatestState != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *StatusUpdateRecord) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*StatusUpdateRecord) - if !ok { - return fmt.Errorf("that is not of type *StatusUpdateRecord") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *StatusUpdateRecord but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *StatusUpdateRecordbut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Update.Equal(that1.Update) { - return fmt.Errorf("Update this(%v) Not Equal that(%v)", this.Update, that1.Update) - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *StatusUpdateRecord) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*StatusUpdateRecord) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Update.Equal(that1.Update) { - return false - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SubmitSchedulerRequest) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*SubmitSchedulerRequest) - if !ok { - return fmt.Errorf("that is not of type *SubmitSchedulerRequest") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *SubmitSchedulerRequest but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *SubmitSchedulerRequestbut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *SubmitSchedulerRequest) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*SubmitSchedulerRequest) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SubmitSchedulerResponse) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*SubmitSchedulerResponse) - if !ok { - return fmt.Errorf("that is not of type *SubmitSchedulerResponse") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *SubmitSchedulerResponse but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *SubmitSchedulerResponsebut is not nil && this == nil") - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return fmt.Errorf("Okay this(%v) Not Equal that(%v)", *this.Okay, *that1.Okay) - } - } else if this.Okay != nil { - return fmt.Errorf("this.Okay == nil && that.Okay != nil") - } else if that1.Okay != nil { - return fmt.Errorf("Okay this(%v) Not Equal that(%v)", this.Okay, that1.Okay) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *SubmitSchedulerResponse) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*SubmitSchedulerResponse) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Okay != nil && that1.Okay != nil { - if *this.Okay != *that1.Okay { - return false - } - } else if this.Okay != nil { - return false - } else if that1.Okay != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ExecutorToFrameworkMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ExecutorToFrameworkMessage) - if !ok { - return fmt.Errorf("that is not of type *ExecutorToFrameworkMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ExecutorToFrameworkMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ExecutorToFrameworkMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ExecutorToFrameworkMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ExecutorToFrameworkMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FrameworkToExecutorMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*FrameworkToExecutorMessage) - if !ok { - return fmt.Errorf("that is not of type *FrameworkToExecutorMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *FrameworkToExecutorMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *FrameworkToExecutorMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *FrameworkToExecutorMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*FrameworkToExecutorMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RegisterFrameworkMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RegisterFrameworkMessage) - if !ok { - return fmt.Errorf("that is not of type *RegisterFrameworkMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RegisterFrameworkMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RegisterFrameworkMessagebut is not nil && this == nil") - } - if !this.Framework.Equal(that1.Framework) { - return fmt.Errorf("Framework this(%v) Not Equal that(%v)", this.Framework, that1.Framework) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RegisterFrameworkMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RegisterFrameworkMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Framework.Equal(that1.Framework) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ReregisterFrameworkMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ReregisterFrameworkMessage) - if !ok { - return fmt.Errorf("that is not of type *ReregisterFrameworkMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ReregisterFrameworkMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ReregisterFrameworkMessagebut is not nil && this == nil") - } - if !this.Framework.Equal(that1.Framework) { - return fmt.Errorf("Framework this(%v) Not Equal that(%v)", this.Framework, that1.Framework) - } - if this.Failover != nil && that1.Failover != nil { - if *this.Failover != *that1.Failover { - return fmt.Errorf("Failover this(%v) Not Equal that(%v)", *this.Failover, *that1.Failover) - } - } else if this.Failover != nil { - return fmt.Errorf("this.Failover == nil && that.Failover != nil") - } else if that1.Failover != nil { - return fmt.Errorf("Failover this(%v) Not Equal that(%v)", this.Failover, that1.Failover) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ReregisterFrameworkMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ReregisterFrameworkMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Framework.Equal(that1.Framework) { - return false - } - if this.Failover != nil && that1.Failover != nil { - if *this.Failover != *that1.Failover { - return false - } - } else if this.Failover != nil { - return false - } else if that1.Failover != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FrameworkRegisteredMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*FrameworkRegisteredMessage) - if !ok { - return fmt.Errorf("that is not of type *FrameworkRegisteredMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *FrameworkRegisteredMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *FrameworkRegisteredMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.MasterInfo.Equal(that1.MasterInfo) { - return fmt.Errorf("MasterInfo this(%v) Not Equal that(%v)", this.MasterInfo, that1.MasterInfo) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *FrameworkRegisteredMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*FrameworkRegisteredMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.MasterInfo.Equal(that1.MasterInfo) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FrameworkReregisteredMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*FrameworkReregisteredMessage) - if !ok { - return fmt.Errorf("that is not of type *FrameworkReregisteredMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *FrameworkReregisteredMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *FrameworkReregisteredMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.MasterInfo.Equal(that1.MasterInfo) { - return fmt.Errorf("MasterInfo this(%v) Not Equal that(%v)", this.MasterInfo, that1.MasterInfo) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *FrameworkReregisteredMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*FrameworkReregisteredMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.MasterInfo.Equal(that1.MasterInfo) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *UnregisterFrameworkMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*UnregisterFrameworkMessage) - if !ok { - return fmt.Errorf("that is not of type *UnregisterFrameworkMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *UnregisterFrameworkMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *UnregisterFrameworkMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *UnregisterFrameworkMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*UnregisterFrameworkMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *DeactivateFrameworkMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*DeactivateFrameworkMessage) - if !ok { - return fmt.Errorf("that is not of type *DeactivateFrameworkMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *DeactivateFrameworkMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *DeactivateFrameworkMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *DeactivateFrameworkMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*DeactivateFrameworkMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ResourceRequestMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ResourceRequestMessage) - if !ok { - return fmt.Errorf("that is not of type *ResourceRequestMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ResourceRequestMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ResourceRequestMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if len(this.Requests) != len(that1.Requests) { - return fmt.Errorf("Requests this(%v) Not Equal that(%v)", len(this.Requests), len(that1.Requests)) - } - for i := range this.Requests { - if !this.Requests[i].Equal(that1.Requests[i]) { - return fmt.Errorf("Requests this[%v](%v) Not Equal that[%v](%v)", i, this.Requests[i], i, that1.Requests[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ResourceRequestMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ResourceRequestMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if len(this.Requests) != len(that1.Requests) { - return false - } - for i := range this.Requests { - if !this.Requests[i].Equal(that1.Requests[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ResourceOffersMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ResourceOffersMessage) - if !ok { - return fmt.Errorf("that is not of type *ResourceOffersMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ResourceOffersMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ResourceOffersMessagebut is not nil && this == nil") - } - if len(this.Offers) != len(that1.Offers) { - return fmt.Errorf("Offers this(%v) Not Equal that(%v)", len(this.Offers), len(that1.Offers)) - } - for i := range this.Offers { - if !this.Offers[i].Equal(that1.Offers[i]) { - return fmt.Errorf("Offers this[%v](%v) Not Equal that[%v](%v)", i, this.Offers[i], i, that1.Offers[i]) - } - } - if len(this.Pids) != len(that1.Pids) { - return fmt.Errorf("Pids this(%v) Not Equal that(%v)", len(this.Pids), len(that1.Pids)) - } - for i := range this.Pids { - if this.Pids[i] != that1.Pids[i] { - return fmt.Errorf("Pids this[%v](%v) Not Equal that[%v](%v)", i, this.Pids[i], i, that1.Pids[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ResourceOffersMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ResourceOffersMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Offers) != len(that1.Offers) { - return false - } - for i := range this.Offers { - if !this.Offers[i].Equal(that1.Offers[i]) { - return false - } - } - if len(this.Pids) != len(that1.Pids) { - return false - } - for i := range this.Pids { - if this.Pids[i] != that1.Pids[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LaunchTasksMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*LaunchTasksMessage) - if !ok { - return fmt.Errorf("that is not of type *LaunchTasksMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *LaunchTasksMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *LaunchTasksMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if len(this.Tasks) != len(that1.Tasks) { - return fmt.Errorf("Tasks this(%v) Not Equal that(%v)", len(this.Tasks), len(that1.Tasks)) - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return fmt.Errorf("Tasks this[%v](%v) Not Equal that[%v](%v)", i, this.Tasks[i], i, that1.Tasks[i]) - } - } - if !this.Filters.Equal(that1.Filters) { - return fmt.Errorf("Filters this(%v) Not Equal that(%v)", this.Filters, that1.Filters) - } - if len(this.OfferIds) != len(that1.OfferIds) { - return fmt.Errorf("OfferIds this(%v) Not Equal that(%v)", len(this.OfferIds), len(that1.OfferIds)) - } - for i := range this.OfferIds { - if !this.OfferIds[i].Equal(that1.OfferIds[i]) { - return fmt.Errorf("OfferIds this[%v](%v) Not Equal that[%v](%v)", i, this.OfferIds[i], i, that1.OfferIds[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *LaunchTasksMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*LaunchTasksMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if len(this.Tasks) != len(that1.Tasks) { - return false - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return false - } - } - if !this.Filters.Equal(that1.Filters) { - return false - } - if len(this.OfferIds) != len(that1.OfferIds) { - return false - } - for i := range this.OfferIds { - if !this.OfferIds[i].Equal(that1.OfferIds[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RescindResourceOfferMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RescindResourceOfferMessage) - if !ok { - return fmt.Errorf("that is not of type *RescindResourceOfferMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RescindResourceOfferMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RescindResourceOfferMessagebut is not nil && this == nil") - } - if !this.OfferId.Equal(that1.OfferId) { - return fmt.Errorf("OfferId this(%v) Not Equal that(%v)", this.OfferId, that1.OfferId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RescindResourceOfferMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RescindResourceOfferMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.OfferId.Equal(that1.OfferId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ReviveOffersMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ReviveOffersMessage) - if !ok { - return fmt.Errorf("that is not of type *ReviveOffersMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ReviveOffersMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ReviveOffersMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ReviveOffersMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ReviveOffersMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RunTaskMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RunTaskMessage) - if !ok { - return fmt.Errorf("that is not of type *RunTaskMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RunTaskMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RunTaskMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.Framework.Equal(that1.Framework) { - return fmt.Errorf("Framework this(%v) Not Equal that(%v)", this.Framework, that1.Framework) - } - if !this.Task.Equal(that1.Task) { - return fmt.Errorf("Task this(%v) Not Equal that(%v)", this.Task, that1.Task) - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) - } - } else if this.Pid != nil { - return fmt.Errorf("this.Pid == nil && that.Pid != nil") - } else if that1.Pid != nil { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RunTaskMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RunTaskMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.Framework.Equal(that1.Framework) { - return false - } - if !this.Task.Equal(that1.Task) { - return false - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return false - } - } else if this.Pid != nil { - return false - } else if that1.Pid != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *KillTaskMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*KillTaskMessage) - if !ok { - return fmt.Errorf("that is not of type *KillTaskMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *KillTaskMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *KillTaskMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *KillTaskMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*KillTaskMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *StatusUpdateMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*StatusUpdateMessage) - if !ok { - return fmt.Errorf("that is not of type *StatusUpdateMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *StatusUpdateMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *StatusUpdateMessagebut is not nil && this == nil") - } - if !this.Update.Equal(that1.Update) { - return fmt.Errorf("Update this(%v) Not Equal that(%v)", this.Update, that1.Update) - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) - } - } else if this.Pid != nil { - return fmt.Errorf("this.Pid == nil && that.Pid != nil") - } else if that1.Pid != nil { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *StatusUpdateMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*StatusUpdateMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Update.Equal(that1.Update) { - return false - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return false - } - } else if this.Pid != nil { - return false - } else if that1.Pid != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *StatusUpdateAcknowledgementMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*StatusUpdateAcknowledgementMessage) - if !ok { - return fmt.Errorf("that is not of type *StatusUpdateAcknowledgementMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *StatusUpdateAcknowledgementMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *StatusUpdateAcknowledgementMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *StatusUpdateAcknowledgementMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*StatusUpdateAcknowledgementMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LostSlaveMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*LostSlaveMessage) - if !ok { - return fmt.Errorf("that is not of type *LostSlaveMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *LostSlaveMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *LostSlaveMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *LostSlaveMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*LostSlaveMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ReconcileTasksMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ReconcileTasksMessage) - if !ok { - return fmt.Errorf("that is not of type *ReconcileTasksMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ReconcileTasksMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ReconcileTasksMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if len(this.Statuses) != len(that1.Statuses) { - return fmt.Errorf("Statuses this(%v) Not Equal that(%v)", len(this.Statuses), len(that1.Statuses)) - } - for i := range this.Statuses { - if !this.Statuses[i].Equal(that1.Statuses[i]) { - return fmt.Errorf("Statuses this[%v](%v) Not Equal that[%v](%v)", i, this.Statuses[i], i, that1.Statuses[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ReconcileTasksMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ReconcileTasksMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if len(this.Statuses) != len(that1.Statuses) { - return false - } - for i := range this.Statuses { - if !this.Statuses[i].Equal(that1.Statuses[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *FrameworkErrorMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*FrameworkErrorMessage) - if !ok { - return fmt.Errorf("that is not of type *FrameworkErrorMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *FrameworkErrorMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *FrameworkErrorMessagebut is not nil && this == nil") - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) - } - } else if this.Message != nil { - return fmt.Errorf("this.Message == nil && that.Message != nil") - } else if that1.Message != nil { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *FrameworkErrorMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*FrameworkErrorMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return false - } - } else if this.Message != nil { - return false - } else if that1.Message != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RegisterSlaveMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RegisterSlaveMessage) - if !ok { - return fmt.Errorf("that is not of type *RegisterSlaveMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RegisterSlaveMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RegisterSlaveMessagebut is not nil && this == nil") - } - if !this.Slave.Equal(that1.Slave) { - return fmt.Errorf("Slave this(%v) Not Equal that(%v)", this.Slave, that1.Slave) - } - if len(this.CheckpointedResources) != len(that1.CheckpointedResources) { - return fmt.Errorf("CheckpointedResources this(%v) Not Equal that(%v)", len(this.CheckpointedResources), len(that1.CheckpointedResources)) - } - for i := range this.CheckpointedResources { - if !this.CheckpointedResources[i].Equal(that1.CheckpointedResources[i]) { - return fmt.Errorf("CheckpointedResources this[%v](%v) Not Equal that[%v](%v)", i, this.CheckpointedResources[i], i, that1.CheckpointedResources[i]) - } - } - if this.Version != nil && that1.Version != nil { - if *this.Version != *that1.Version { - return fmt.Errorf("Version this(%v) Not Equal that(%v)", *this.Version, *that1.Version) - } - } else if this.Version != nil { - return fmt.Errorf("this.Version == nil && that.Version != nil") - } else if that1.Version != nil { - return fmt.Errorf("Version this(%v) Not Equal that(%v)", this.Version, that1.Version) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RegisterSlaveMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RegisterSlaveMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Slave.Equal(that1.Slave) { - return false - } - if len(this.CheckpointedResources) != len(that1.CheckpointedResources) { - return false - } - for i := range this.CheckpointedResources { - if !this.CheckpointedResources[i].Equal(that1.CheckpointedResources[i]) { - return false - } - } - if this.Version != nil && that1.Version != nil { - if *this.Version != *that1.Version { - return false - } - } else if this.Version != nil { - return false - } else if that1.Version != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ReregisterSlaveMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ReregisterSlaveMessage) - if !ok { - return fmt.Errorf("that is not of type *ReregisterSlaveMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ReregisterSlaveMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ReregisterSlaveMessagebut is not nil && this == nil") - } - if !this.Slave.Equal(that1.Slave) { - return fmt.Errorf("Slave this(%v) Not Equal that(%v)", this.Slave, that1.Slave) - } - if len(this.CheckpointedResources) != len(that1.CheckpointedResources) { - return fmt.Errorf("CheckpointedResources this(%v) Not Equal that(%v)", len(this.CheckpointedResources), len(that1.CheckpointedResources)) - } - for i := range this.CheckpointedResources { - if !this.CheckpointedResources[i].Equal(that1.CheckpointedResources[i]) { - return fmt.Errorf("CheckpointedResources this[%v](%v) Not Equal that[%v](%v)", i, this.CheckpointedResources[i], i, that1.CheckpointedResources[i]) - } - } - if len(this.ExecutorInfos) != len(that1.ExecutorInfos) { - return fmt.Errorf("ExecutorInfos this(%v) Not Equal that(%v)", len(this.ExecutorInfos), len(that1.ExecutorInfos)) - } - for i := range this.ExecutorInfos { - if !this.ExecutorInfos[i].Equal(that1.ExecutorInfos[i]) { - return fmt.Errorf("ExecutorInfos this[%v](%v) Not Equal that[%v](%v)", i, this.ExecutorInfos[i], i, that1.ExecutorInfos[i]) - } - } - if len(this.Tasks) != len(that1.Tasks) { - return fmt.Errorf("Tasks this(%v) Not Equal that(%v)", len(this.Tasks), len(that1.Tasks)) - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return fmt.Errorf("Tasks this[%v](%v) Not Equal that[%v](%v)", i, this.Tasks[i], i, that1.Tasks[i]) - } - } - if len(this.CompletedFrameworks) != len(that1.CompletedFrameworks) { - return fmt.Errorf("CompletedFrameworks this(%v) Not Equal that(%v)", len(this.CompletedFrameworks), len(that1.CompletedFrameworks)) - } - for i := range this.CompletedFrameworks { - if !this.CompletedFrameworks[i].Equal(that1.CompletedFrameworks[i]) { - return fmt.Errorf("CompletedFrameworks this[%v](%v) Not Equal that[%v](%v)", i, this.CompletedFrameworks[i], i, that1.CompletedFrameworks[i]) - } - } - if this.Version != nil && that1.Version != nil { - if *this.Version != *that1.Version { - return fmt.Errorf("Version this(%v) Not Equal that(%v)", *this.Version, *that1.Version) - } - } else if this.Version != nil { - return fmt.Errorf("this.Version == nil && that.Version != nil") - } else if that1.Version != nil { - return fmt.Errorf("Version this(%v) Not Equal that(%v)", this.Version, that1.Version) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ReregisterSlaveMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ReregisterSlaveMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Slave.Equal(that1.Slave) { - return false - } - if len(this.CheckpointedResources) != len(that1.CheckpointedResources) { - return false - } - for i := range this.CheckpointedResources { - if !this.CheckpointedResources[i].Equal(that1.CheckpointedResources[i]) { - return false - } - } - if len(this.ExecutorInfos) != len(that1.ExecutorInfos) { - return false - } - for i := range this.ExecutorInfos { - if !this.ExecutorInfos[i].Equal(that1.ExecutorInfos[i]) { - return false - } - } - if len(this.Tasks) != len(that1.Tasks) { - return false - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return false - } - } - if len(this.CompletedFrameworks) != len(that1.CompletedFrameworks) { - return false - } - for i := range this.CompletedFrameworks { - if !this.CompletedFrameworks[i].Equal(that1.CompletedFrameworks[i]) { - return false - } - } - if this.Version != nil && that1.Version != nil { - if *this.Version != *that1.Version { - return false - } - } else if this.Version != nil { - return false - } else if that1.Version != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SlaveRegisteredMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*SlaveRegisteredMessage) - if !ok { - return fmt.Errorf("that is not of type *SlaveRegisteredMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *SlaveRegisteredMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *SlaveRegisteredMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.Connection.Equal(that1.Connection) { - return fmt.Errorf("Connection this(%v) Not Equal that(%v)", this.Connection, that1.Connection) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *SlaveRegisteredMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*SlaveRegisteredMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.Connection.Equal(that1.Connection) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *SlaveReregisteredMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*SlaveReregisteredMessage) - if !ok { - return fmt.Errorf("that is not of type *SlaveReregisteredMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *SlaveReregisteredMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *SlaveReregisteredMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if len(this.Reconciliations) != len(that1.Reconciliations) { - return fmt.Errorf("Reconciliations this(%v) Not Equal that(%v)", len(this.Reconciliations), len(that1.Reconciliations)) - } - for i := range this.Reconciliations { - if !this.Reconciliations[i].Equal(that1.Reconciliations[i]) { - return fmt.Errorf("Reconciliations this[%v](%v) Not Equal that[%v](%v)", i, this.Reconciliations[i], i, that1.Reconciliations[i]) - } - } - if !this.Connection.Equal(that1.Connection) { - return fmt.Errorf("Connection this(%v) Not Equal that(%v)", this.Connection, that1.Connection) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *SlaveReregisteredMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*SlaveReregisteredMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if len(this.Reconciliations) != len(that1.Reconciliations) { - return false - } - for i := range this.Reconciliations { - if !this.Reconciliations[i].Equal(that1.Reconciliations[i]) { - return false - } - } - if !this.Connection.Equal(that1.Connection) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *UnregisterSlaveMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*UnregisterSlaveMessage) - if !ok { - return fmt.Errorf("that is not of type *UnregisterSlaveMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *UnregisterSlaveMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *UnregisterSlaveMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *UnregisterSlaveMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*UnregisterSlaveMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *MasterSlaveConnection) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*MasterSlaveConnection) - if !ok { - return fmt.Errorf("that is not of type *MasterSlaveConnection") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *MasterSlaveConnection but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *MasterSlaveConnectionbut is not nil && this == nil") - } - if this.TotalPingTimeoutSeconds != nil && that1.TotalPingTimeoutSeconds != nil { - if *this.TotalPingTimeoutSeconds != *that1.TotalPingTimeoutSeconds { - return fmt.Errorf("TotalPingTimeoutSeconds this(%v) Not Equal that(%v)", *this.TotalPingTimeoutSeconds, *that1.TotalPingTimeoutSeconds) - } - } else if this.TotalPingTimeoutSeconds != nil { - return fmt.Errorf("this.TotalPingTimeoutSeconds == nil && that.TotalPingTimeoutSeconds != nil") - } else if that1.TotalPingTimeoutSeconds != nil { - return fmt.Errorf("TotalPingTimeoutSeconds this(%v) Not Equal that(%v)", this.TotalPingTimeoutSeconds, that1.TotalPingTimeoutSeconds) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *MasterSlaveConnection) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*MasterSlaveConnection) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.TotalPingTimeoutSeconds != nil && that1.TotalPingTimeoutSeconds != nil { - if *this.TotalPingTimeoutSeconds != *that1.TotalPingTimeoutSeconds { - return false - } - } else if this.TotalPingTimeoutSeconds != nil { - return false - } else if that1.TotalPingTimeoutSeconds != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *PingSlaveMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*PingSlaveMessage) - if !ok { - return fmt.Errorf("that is not of type *PingSlaveMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *PingSlaveMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *PingSlaveMessagebut is not nil && this == nil") - } - if this.Connected != nil && that1.Connected != nil { - if *this.Connected != *that1.Connected { - return fmt.Errorf("Connected this(%v) Not Equal that(%v)", *this.Connected, *that1.Connected) - } - } else if this.Connected != nil { - return fmt.Errorf("this.Connected == nil && that.Connected != nil") - } else if that1.Connected != nil { - return fmt.Errorf("Connected this(%v) Not Equal that(%v)", this.Connected, that1.Connected) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *PingSlaveMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PingSlaveMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Connected != nil && that1.Connected != nil { - if *this.Connected != *that1.Connected { - return false - } - } else if this.Connected != nil { - return false - } else if that1.Connected != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *PongSlaveMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*PongSlaveMessage) - if !ok { - return fmt.Errorf("that is not of type *PongSlaveMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *PongSlaveMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *PongSlaveMessagebut is not nil && this == nil") - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *PongSlaveMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*PongSlaveMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ShutdownFrameworkMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ShutdownFrameworkMessage) - if !ok { - return fmt.Errorf("that is not of type *ShutdownFrameworkMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ShutdownFrameworkMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ShutdownFrameworkMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ShutdownFrameworkMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ShutdownFrameworkMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ShutdownExecutorMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ShutdownExecutorMessage) - if !ok { - return fmt.Errorf("that is not of type *ShutdownExecutorMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ShutdownExecutorMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ShutdownExecutorMessagebut is not nil && this == nil") - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ShutdownExecutorMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ShutdownExecutorMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *UpdateFrameworkMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*UpdateFrameworkMessage) - if !ok { - return fmt.Errorf("that is not of type *UpdateFrameworkMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *UpdateFrameworkMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *UpdateFrameworkMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) - } - } else if this.Pid != nil { - return fmt.Errorf("this.Pid == nil && that.Pid != nil") - } else if that1.Pid != nil { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *UpdateFrameworkMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*UpdateFrameworkMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return false - } - } else if this.Pid != nil { - return false - } else if that1.Pid != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *CheckpointResourcesMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*CheckpointResourcesMessage) - if !ok { - return fmt.Errorf("that is not of type *CheckpointResourcesMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *CheckpointResourcesMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *CheckpointResourcesMessagebut is not nil && this == nil") - } - if len(this.Resources) != len(that1.Resources) { - return fmt.Errorf("Resources this(%v) Not Equal that(%v)", len(this.Resources), len(that1.Resources)) - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return fmt.Errorf("Resources this[%v](%v) Not Equal that[%v](%v)", i, this.Resources[i], i, that1.Resources[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *CheckpointResourcesMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*CheckpointResourcesMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Resources) != len(that1.Resources) { - return false - } - for i := range this.Resources { - if !this.Resources[i].Equal(that1.Resources[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *UpdateSlaveMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*UpdateSlaveMessage) - if !ok { - return fmt.Errorf("that is not of type *UpdateSlaveMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *UpdateSlaveMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *UpdateSlaveMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if len(this.OversubscribedResources) != len(that1.OversubscribedResources) { - return fmt.Errorf("OversubscribedResources this(%v) Not Equal that(%v)", len(this.OversubscribedResources), len(that1.OversubscribedResources)) - } - for i := range this.OversubscribedResources { - if !this.OversubscribedResources[i].Equal(that1.OversubscribedResources[i]) { - return fmt.Errorf("OversubscribedResources this[%v](%v) Not Equal that[%v](%v)", i, this.OversubscribedResources[i], i, that1.OversubscribedResources[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *UpdateSlaveMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*UpdateSlaveMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if len(this.OversubscribedResources) != len(that1.OversubscribedResources) { - return false - } - for i := range this.OversubscribedResources { - if !this.OversubscribedResources[i].Equal(that1.OversubscribedResources[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *RegisterExecutorMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*RegisterExecutorMessage) - if !ok { - return fmt.Errorf("that is not of type *RegisterExecutorMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *RegisterExecutorMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *RegisterExecutorMessagebut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *RegisterExecutorMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*RegisterExecutorMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ExecutorRegisteredMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ExecutorRegisteredMessage) - if !ok { - return fmt.Errorf("that is not of type *ExecutorRegisteredMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ExecutorRegisteredMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ExecutorRegisteredMessagebut is not nil && this == nil") - } - if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { - return fmt.Errorf("ExecutorInfo this(%v) Not Equal that(%v)", this.ExecutorInfo, that1.ExecutorInfo) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.FrameworkInfo.Equal(that1.FrameworkInfo) { - return fmt.Errorf("FrameworkInfo this(%v) Not Equal that(%v)", this.FrameworkInfo, that1.FrameworkInfo) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.SlaveInfo.Equal(that1.SlaveInfo) { - return fmt.Errorf("SlaveInfo this(%v) Not Equal that(%v)", this.SlaveInfo, that1.SlaveInfo) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ExecutorRegisteredMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ExecutorRegisteredMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ExecutorInfo.Equal(that1.ExecutorInfo) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.FrameworkInfo.Equal(that1.FrameworkInfo) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.SlaveInfo.Equal(that1.SlaveInfo) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ExecutorReregisteredMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ExecutorReregisteredMessage) - if !ok { - return fmt.Errorf("that is not of type *ExecutorReregisteredMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ExecutorReregisteredMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ExecutorReregisteredMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.SlaveInfo.Equal(that1.SlaveInfo) { - return fmt.Errorf("SlaveInfo this(%v) Not Equal that(%v)", this.SlaveInfo, that1.SlaveInfo) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ExecutorReregisteredMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ExecutorReregisteredMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.SlaveInfo.Equal(that1.SlaveInfo) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ExitedExecutorMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ExitedExecutorMessage) - if !ok { - return fmt.Errorf("that is not of type *ExitedExecutorMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ExitedExecutorMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ExitedExecutorMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ExitedExecutorMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ExitedExecutorMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false - } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ReconnectExecutorMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ReconnectExecutorMessage) - if !ok { - return fmt.Errorf("that is not of type *ReconnectExecutorMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ReconnectExecutorMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ReconnectExecutorMessagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ReconnectExecutorMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ReconnectExecutorMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ReregisterExecutorMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ReregisterExecutorMessage) - if !ok { - return fmt.Errorf("that is not of type *ReregisterExecutorMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ReregisterExecutorMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ReregisterExecutorMessagebut is not nil && this == nil") - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if len(this.Tasks) != len(that1.Tasks) { - return fmt.Errorf("Tasks this(%v) Not Equal that(%v)", len(this.Tasks), len(that1.Tasks)) - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return fmt.Errorf("Tasks this[%v](%v) Not Equal that[%v](%v)", i, this.Tasks[i], i, that1.Tasks[i]) - } - } - if len(this.Updates) != len(that1.Updates) { - return fmt.Errorf("Updates this(%v) Not Equal that(%v)", len(this.Updates), len(that1.Updates)) - } - for i := range this.Updates { - if !this.Updates[i].Equal(that1.Updates[i]) { - return fmt.Errorf("Updates this[%v](%v) Not Equal that[%v](%v)", i, this.Updates[i], i, that1.Updates[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ReregisterExecutorMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ReregisterExecutorMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if len(this.Tasks) != len(that1.Tasks) { - return false - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return false - } - } - if len(this.Updates) != len(that1.Updates) { - return false - } - for i := range this.Updates { - if !this.Updates[i].Equal(that1.Updates[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *ShutdownMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*ShutdownMessage) - if !ok { - return fmt.Errorf("that is not of type *ShutdownMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *ShutdownMessage but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *ShutdownMessagebut is not nil && this == nil") - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) - } - } else if this.Message != nil { - return fmt.Errorf("this.Message == nil && that.Message != nil") - } else if that1.Message != nil { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *ShutdownMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*ShutdownMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return false - } - } else if this.Message != nil { - return false - } else if that1.Message != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Archive) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Archive) - if !ok { - return fmt.Errorf("that is not of type *Archive") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Archive but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Archivebut is not nil && this == nil") - } - if len(this.Frameworks) != len(that1.Frameworks) { - return fmt.Errorf("Frameworks this(%v) Not Equal that(%v)", len(this.Frameworks), len(that1.Frameworks)) - } - for i := range this.Frameworks { - if !this.Frameworks[i].Equal(that1.Frameworks[i]) { - return fmt.Errorf("Frameworks this[%v](%v) Not Equal that[%v](%v)", i, this.Frameworks[i], i, that1.Frameworks[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Archive) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Archive) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Frameworks) != len(that1.Frameworks) { - return false - } - for i := range this.Frameworks { - if !this.Frameworks[i].Equal(that1.Frameworks[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Archive_Framework) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Archive_Framework) - if !ok { - return fmt.Errorf("that is not of type *Archive_Framework") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Archive_Framework but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Archive_Frameworkbut is not nil && this == nil") - } - if !this.FrameworkInfo.Equal(that1.FrameworkInfo) { - return fmt.Errorf("FrameworkInfo this(%v) Not Equal that(%v)", this.FrameworkInfo, that1.FrameworkInfo) - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", *this.Pid, *that1.Pid) - } - } else if this.Pid != nil { - return fmt.Errorf("this.Pid == nil && that.Pid != nil") - } else if that1.Pid != nil { - return fmt.Errorf("Pid this(%v) Not Equal that(%v)", this.Pid, that1.Pid) - } - if len(this.Tasks) != len(that1.Tasks) { - return fmt.Errorf("Tasks this(%v) Not Equal that(%v)", len(this.Tasks), len(that1.Tasks)) - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return fmt.Errorf("Tasks this[%v](%v) Not Equal that[%v](%v)", i, this.Tasks[i], i, that1.Tasks[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Archive_Framework) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Archive_Framework) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkInfo.Equal(that1.FrameworkInfo) { - return false - } - if this.Pid != nil && that1.Pid != nil { - if *this.Pid != *that1.Pid { - return false - } - } else if this.Pid != nil { - return false - } else if that1.Pid != nil { - return false - } - if len(this.Tasks) != len(that1.Tasks) { - return false - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *TaskHealthStatus) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*TaskHealthStatus) - if !ok { - return fmt.Errorf("that is not of type *TaskHealthStatus") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *TaskHealthStatus but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *TaskHealthStatusbut is not nil && this == nil") - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if this.Healthy != nil && that1.Healthy != nil { - if *this.Healthy != *that1.Healthy { - return fmt.Errorf("Healthy this(%v) Not Equal that(%v)", *this.Healthy, *that1.Healthy) - } - } else if this.Healthy != nil { - return fmt.Errorf("this.Healthy == nil && that.Healthy != nil") - } else if that1.Healthy != nil { - return fmt.Errorf("Healthy this(%v) Not Equal that(%v)", this.Healthy, that1.Healthy) - } - if this.KillTask != nil && that1.KillTask != nil { - if *this.KillTask != *that1.KillTask { - return fmt.Errorf("KillTask this(%v) Not Equal that(%v)", *this.KillTask, *that1.KillTask) - } - } else if this.KillTask != nil { - return fmt.Errorf("this.KillTask == nil && that.KillTask != nil") - } else if that1.KillTask != nil { - return fmt.Errorf("KillTask this(%v) Not Equal that(%v)", this.KillTask, that1.KillTask) - } - if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { - if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { - return fmt.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", *this.ConsecutiveFailures, *that1.ConsecutiveFailures) - } - } else if this.ConsecutiveFailures != nil { - return fmt.Errorf("this.ConsecutiveFailures == nil && that.ConsecutiveFailures != nil") - } else if that1.ConsecutiveFailures != nil { - return fmt.Errorf("ConsecutiveFailures this(%v) Not Equal that(%v)", this.ConsecutiveFailures, that1.ConsecutiveFailures) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *TaskHealthStatus) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*TaskHealthStatus) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if this.Healthy != nil && that1.Healthy != nil { - if *this.Healthy != *that1.Healthy { - return false - } - } else if this.Healthy != nil { - return false - } else if that1.Healthy != nil { - return false - } - if this.KillTask != nil && that1.KillTask != nil { - if *this.KillTask != *that1.KillTask { - return false - } - } else if this.KillTask != nil { - return false - } else if that1.KillTask != nil { - return false - } - if this.ConsecutiveFailures != nil && that1.ConsecutiveFailures != nil { - if *this.ConsecutiveFailures != *that1.ConsecutiveFailures { - return false - } - } else if this.ConsecutiveFailures != nil { - return false - } else if that1.ConsecutiveFailures != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *HookExecuted) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*HookExecuted) - if !ok { - return fmt.Errorf("that is not of type *HookExecuted") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *HookExecuted but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *HookExecutedbut is not nil && this == nil") - } - if this.Module != nil && that1.Module != nil { - if *this.Module != *that1.Module { - return fmt.Errorf("Module this(%v) Not Equal that(%v)", *this.Module, *that1.Module) - } - } else if this.Module != nil { - return fmt.Errorf("this.Module == nil && that.Module != nil") - } else if that1.Module != nil { - return fmt.Errorf("Module this(%v) Not Equal that(%v)", this.Module, that1.Module) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *HookExecuted) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*HookExecuted) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Module != nil && that1.Module != nil { - if *this.Module != *that1.Module { - return false - } - } else if this.Module != nil { - return false - } else if that1.Module != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Task) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 16) - s = append(s, "&mesosproto.Task{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMessages(this.Name, "string")+",\n") - } - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.State != nil { - s = append(s, "State: "+valueToGoStringMessages(this.State, "mesosproto.TaskState")+",\n") - } - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.Statuses != nil { - s = append(s, "Statuses: "+fmt.Sprintf("%#v", this.Statuses)+",\n") - } - if this.StatusUpdateState != nil { - s = append(s, "StatusUpdateState: "+valueToGoStringMessages(this.StatusUpdateState, "mesosproto.TaskState")+",\n") - } - if this.StatusUpdateUuid != nil { - s = append(s, "StatusUpdateUuid: "+valueToGoStringMessages(this.StatusUpdateUuid, "byte")+",\n") - } - if this.Labels != nil { - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - } - if this.Discovery != nil { - s = append(s, "Discovery: "+fmt.Sprintf("%#v", this.Discovery)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StatusUpdate) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&mesosproto.StatusUpdate{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.Status != nil { - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - } - if this.Timestamp != nil { - s = append(s, "Timestamp: "+valueToGoStringMessages(this.Timestamp, "float64")+",\n") - } - if this.Uuid != nil { - s = append(s, "Uuid: "+valueToGoStringMessages(this.Uuid, "byte")+",\n") - } - if this.LatestState != nil { - s = append(s, "LatestState: "+valueToGoStringMessages(this.LatestState, "mesosproto.TaskState")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StatusUpdateRecord) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.StatusUpdateRecord{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringMessages(this.Type, "mesosproto.StatusUpdateRecord_Type")+",\n") - } - if this.Update != nil { - s = append(s, "Update: "+fmt.Sprintf("%#v", this.Update)+",\n") - } - if this.Uuid != nil { - s = append(s, "Uuid: "+valueToGoStringMessages(this.Uuid, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SubmitSchedulerRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.SubmitSchedulerRequest{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringMessages(this.Name, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SubmitSchedulerResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.SubmitSchedulerResponse{") - if this.Okay != nil { - s = append(s, "Okay: "+valueToGoStringMessages(this.Okay, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ExecutorToFrameworkMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.ExecutorToFrameworkMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringMessages(this.Data, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FrameworkToExecutorMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.FrameworkToExecutorMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringMessages(this.Data, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RegisterFrameworkMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.RegisterFrameworkMessage{") - if this.Framework != nil { - s = append(s, "Framework: "+fmt.Sprintf("%#v", this.Framework)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ReregisterFrameworkMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ReregisterFrameworkMessage{") - if this.Framework != nil { - s = append(s, "Framework: "+fmt.Sprintf("%#v", this.Framework)+",\n") - } - if this.Failover != nil { - s = append(s, "Failover: "+valueToGoStringMessages(this.Failover, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FrameworkRegisteredMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.FrameworkRegisteredMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.MasterInfo != nil { - s = append(s, "MasterInfo: "+fmt.Sprintf("%#v", this.MasterInfo)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FrameworkReregisteredMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.FrameworkReregisteredMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.MasterInfo != nil { - s = append(s, "MasterInfo: "+fmt.Sprintf("%#v", this.MasterInfo)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UnregisterFrameworkMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.UnregisterFrameworkMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *DeactivateFrameworkMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.DeactivateFrameworkMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ResourceRequestMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ResourceRequestMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.Requests != nil { - s = append(s, "Requests: "+fmt.Sprintf("%#v", this.Requests)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ResourceOffersMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ResourceOffersMessage{") - if this.Offers != nil { - s = append(s, "Offers: "+fmt.Sprintf("%#v", this.Offers)+",\n") - } - if this.Pids != nil { - s = append(s, "Pids: "+fmt.Sprintf("%#v", this.Pids)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LaunchTasksMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.LaunchTasksMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.Tasks != nil { - s = append(s, "Tasks: "+fmt.Sprintf("%#v", this.Tasks)+",\n") - } - if this.Filters != nil { - s = append(s, "Filters: "+fmt.Sprintf("%#v", this.Filters)+",\n") - } - if this.OfferIds != nil { - s = append(s, "OfferIds: "+fmt.Sprintf("%#v", this.OfferIds)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RescindResourceOfferMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.RescindResourceOfferMessage{") - if this.OfferId != nil { - s = append(s, "OfferId: "+fmt.Sprintf("%#v", this.OfferId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ReviveOffersMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.ReviveOffersMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RunTaskMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.RunTaskMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.Framework != nil { - s = append(s, "Framework: "+fmt.Sprintf("%#v", this.Framework)+",\n") - } - if this.Task != nil { - s = append(s, "Task: "+fmt.Sprintf("%#v", this.Task)+",\n") - } - if this.Pid != nil { - s = append(s, "Pid: "+valueToGoStringMessages(this.Pid, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *KillTaskMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.KillTaskMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StatusUpdateMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.StatusUpdateMessage{") - if this.Update != nil { - s = append(s, "Update: "+fmt.Sprintf("%#v", this.Update)+",\n") - } - if this.Pid != nil { - s = append(s, "Pid: "+valueToGoStringMessages(this.Pid, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StatusUpdateAcknowledgementMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.StatusUpdateAcknowledgementMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.Uuid != nil { - s = append(s, "Uuid: "+valueToGoStringMessages(this.Uuid, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LostSlaveMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.LostSlaveMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ReconcileTasksMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ReconcileTasksMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.Statuses != nil { - s = append(s, "Statuses: "+fmt.Sprintf("%#v", this.Statuses)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *FrameworkErrorMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.FrameworkErrorMessage{") - if this.Message != nil { - s = append(s, "Message: "+valueToGoStringMessages(this.Message, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RegisterSlaveMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.RegisterSlaveMessage{") - if this.Slave != nil { - s = append(s, "Slave: "+fmt.Sprintf("%#v", this.Slave)+",\n") - } - if this.CheckpointedResources != nil { - s = append(s, "CheckpointedResources: "+fmt.Sprintf("%#v", this.CheckpointedResources)+",\n") - } - if this.Version != nil { - s = append(s, "Version: "+valueToGoStringMessages(this.Version, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ReregisterSlaveMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 10) - s = append(s, "&mesosproto.ReregisterSlaveMessage{") - if this.Slave != nil { - s = append(s, "Slave: "+fmt.Sprintf("%#v", this.Slave)+",\n") - } - if this.CheckpointedResources != nil { - s = append(s, "CheckpointedResources: "+fmt.Sprintf("%#v", this.CheckpointedResources)+",\n") - } - if this.ExecutorInfos != nil { - s = append(s, "ExecutorInfos: "+fmt.Sprintf("%#v", this.ExecutorInfos)+",\n") - } - if this.Tasks != nil { - s = append(s, "Tasks: "+fmt.Sprintf("%#v", this.Tasks)+",\n") - } - if this.CompletedFrameworks != nil { - s = append(s, "CompletedFrameworks: "+fmt.Sprintf("%#v", this.CompletedFrameworks)+",\n") - } - if this.Version != nil { - s = append(s, "Version: "+valueToGoStringMessages(this.Version, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SlaveRegisteredMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.SlaveRegisteredMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.Connection != nil { - s = append(s, "Connection: "+fmt.Sprintf("%#v", this.Connection)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *SlaveReregisteredMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.SlaveReregisteredMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.Reconciliations != nil { - s = append(s, "Reconciliations: "+fmt.Sprintf("%#v", this.Reconciliations)+",\n") - } - if this.Connection != nil { - s = append(s, "Connection: "+fmt.Sprintf("%#v", this.Connection)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UnregisterSlaveMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.UnregisterSlaveMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *MasterSlaveConnection) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.MasterSlaveConnection{") - if this.TotalPingTimeoutSeconds != nil { - s = append(s, "TotalPingTimeoutSeconds: "+valueToGoStringMessages(this.TotalPingTimeoutSeconds, "float64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PingSlaveMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.PingSlaveMessage{") - if this.Connected != nil { - s = append(s, "Connected: "+valueToGoStringMessages(this.Connected, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *PongSlaveMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 4) - s = append(s, "&mesosproto.PongSlaveMessage{") - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ShutdownFrameworkMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.ShutdownFrameworkMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ShutdownExecutorMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ShutdownExecutorMessage{") - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UpdateFrameworkMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.UpdateFrameworkMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.Pid != nil { - s = append(s, "Pid: "+valueToGoStringMessages(this.Pid, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *CheckpointResourcesMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.CheckpointResourcesMessage{") - if this.Resources != nil { - s = append(s, "Resources: "+fmt.Sprintf("%#v", this.Resources)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *UpdateSlaveMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.UpdateSlaveMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.OversubscribedResources != nil { - s = append(s, "OversubscribedResources: "+fmt.Sprintf("%#v", this.OversubscribedResources)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *RegisterExecutorMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.RegisterExecutorMessage{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ExecutorRegisteredMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 9) - s = append(s, "&mesosproto.ExecutorRegisteredMessage{") - if this.ExecutorInfo != nil { - s = append(s, "ExecutorInfo: "+fmt.Sprintf("%#v", this.ExecutorInfo)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.FrameworkInfo != nil { - s = append(s, "FrameworkInfo: "+fmt.Sprintf("%#v", this.FrameworkInfo)+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.SlaveInfo != nil { - s = append(s, "SlaveInfo: "+fmt.Sprintf("%#v", this.SlaveInfo)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ExecutorReregisteredMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.ExecutorReregisteredMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.SlaveInfo != nil { - s = append(s, "SlaveInfo: "+fmt.Sprintf("%#v", this.SlaveInfo)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ExitedExecutorMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.ExitedExecutorMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.Status != nil { - s = append(s, "Status: "+valueToGoStringMessages(this.Status, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ReconnectExecutorMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.ReconnectExecutorMessage{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ReregisterExecutorMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.ReregisterExecutorMessage{") - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.Tasks != nil { - s = append(s, "Tasks: "+fmt.Sprintf("%#v", this.Tasks)+",\n") - } - if this.Updates != nil { - s = append(s, "Updates: "+fmt.Sprintf("%#v", this.Updates)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ShutdownMessage) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.ShutdownMessage{") - if this.Message != nil { - s = append(s, "Message: "+valueToGoStringMessages(this.Message, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Archive) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Archive{") - if this.Frameworks != nil { - s = append(s, "Frameworks: "+fmt.Sprintf("%#v", this.Frameworks)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Archive_Framework) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Archive_Framework{") - if this.FrameworkInfo != nil { - s = append(s, "FrameworkInfo: "+fmt.Sprintf("%#v", this.FrameworkInfo)+",\n") - } - if this.Pid != nil { - s = append(s, "Pid: "+valueToGoStringMessages(this.Pid, "string")+",\n") - } - if this.Tasks != nil { - s = append(s, "Tasks: "+fmt.Sprintf("%#v", this.Tasks)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TaskHealthStatus) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.TaskHealthStatus{") - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.Healthy != nil { - s = append(s, "Healthy: "+valueToGoStringMessages(this.Healthy, "bool")+",\n") - } - if this.KillTask != nil { - s = append(s, "KillTask: "+valueToGoStringMessages(this.KillTask, "bool")+",\n") - } - if this.ConsecutiveFailures != nil { - s = append(s, "ConsecutiveFailures: "+valueToGoStringMessages(this.ConsecutiveFailures, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *HookExecuted) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.HookExecuted{") - if this.Module != nil { - s = append(s, "Module: "+valueToGoStringMessages(this.Module, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringMessages(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringMessages(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *Task) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Task) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.TaskId.Size())) - n1, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n2, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.ExecutorId != nil { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorId.Size())) - n3, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0x2a - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n4, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.State == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("state") - } else { - data[i] = 0x30 - i++ - i = encodeVarintMessages(data, i, uint64(*m.State)) - } - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0x3a - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Statuses) > 0 { - for _, msg := range m.Statuses { - data[i] = 0x42 - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.StatusUpdateState != nil { - data[i] = 0x48 - i++ - i = encodeVarintMessages(data, i, uint64(*m.StatusUpdateState)) - } - if m.StatusUpdateUuid != nil { - data[i] = 0x52 - i++ - i = encodeVarintMessages(data, i, uint64(len(m.StatusUpdateUuid))) - i += copy(data[i:], m.StatusUpdateUuid) - } - if m.Labels != nil { - data[i] = 0x5a - i++ - i = encodeVarintMessages(data, i, uint64(m.Labels.Size())) - n5, err := m.Labels.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.Discovery != nil { - data[i] = 0x62 - i++ - i = encodeVarintMessages(data, i, uint64(m.Discovery.Size())) - n6, err := m.Discovery.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *StatusUpdate) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *StatusUpdate) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n7, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.ExecutorId != nil { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorId.Size())) - n8, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.SlaveId != nil { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n9, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n9 - } - if m.Status == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } else { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(m.Status.Size())) - n10, err := m.Status.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n10 - } - if m.Timestamp == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") - } else { - data[i] = 0x29 - i++ - i = encodeFixed64Messages(data, i, uint64(math.Float64bits(*m.Timestamp))) - } - if m.Uuid != nil { - data[i] = 0x32 - i++ - i = encodeVarintMessages(data, i, uint64(len(m.Uuid))) - i += copy(data[i:], m.Uuid) - } - if m.LatestState != nil { - data[i] = 0x38 - i++ - i = encodeVarintMessages(data, i, uint64(*m.LatestState)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *StatusUpdateRecord) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *StatusUpdateRecord) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintMessages(data, i, uint64(*m.Type)) - } - if m.Update != nil { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.Update.Size())) - n11, err := m.Update.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n11 - } - if m.Uuid != nil { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(len(m.Uuid))) - i += copy(data[i:], m.Uuid) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SubmitSchedulerRequest) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *SubmitSchedulerRequest) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SubmitSchedulerResponse) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *SubmitSchedulerResponse) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Okay == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") - } else { - data[i] = 0x8 - i++ - if *m.Okay { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ExecutorToFrameworkMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ExecutorToFrameworkMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n12, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n12 - } - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n13, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorId.Size())) - n14, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n14 - } - if m.Data == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } else { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *FrameworkToExecutorMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *FrameworkToExecutorMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n15, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n16, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorId.Size())) - n17, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n17 - } - if m.Data == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } else { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RegisterFrameworkMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RegisterFrameworkMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Framework == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.Framework.Size())) - n18, err := m.Framework.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n18 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ReregisterFrameworkMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ReregisterFrameworkMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Framework == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.Framework.Size())) - n19, err := m.Framework.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n19 - } - if m.Failover == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("failover") - } else { - data[i] = 0x18 - i++ - if *m.Failover { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *FrameworkRegisteredMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *FrameworkRegisteredMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n20, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n20 - } - if m.MasterInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("master_info") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.MasterInfo.Size())) - n21, err := m.MasterInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n21 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *FrameworkReregisteredMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *FrameworkReregisteredMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n22, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if m.MasterInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("master_info") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.MasterInfo.Size())) - n23, err := m.MasterInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n23 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *UnregisterFrameworkMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *UnregisterFrameworkMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n24, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n24 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *DeactivateFrameworkMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *DeactivateFrameworkMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n25, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n25 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ResourceRequestMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ResourceRequestMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n26, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n26 - } - if len(m.Requests) > 0 { - for _, msg := range m.Requests { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ResourceOffersMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ResourceOffersMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Offers) > 0 { - for _, msg := range m.Offers { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Pids) > 0 { - for _, s := range m.Pids { - data[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *LaunchTasksMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *LaunchTasksMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n27, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n27 - } - if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Filters == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("filters") - } else { - data[i] = 0x2a - i++ - i = encodeVarintMessages(data, i, uint64(m.Filters.Size())) - n28, err := m.Filters.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n28 - } - if len(m.OfferIds) > 0 { - for _, msg := range m.OfferIds { - data[i] = 0x32 - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RescindResourceOfferMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RescindResourceOfferMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.OfferId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("offer_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.OfferId.Size())) - n29, err := m.OfferId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ReviveOffersMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ReviveOffersMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n30, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n30 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RunTaskMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RunTaskMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId != nil { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n31, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n31 - } - if m.Framework == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.Framework.Size())) - n32, err := m.Framework.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n32 - } - if m.Pid != nil { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Pid))) - i += copy(data[i:], *m.Pid) - } - if m.Task == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task") - } else { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(m.Task.Size())) - n33, err := m.Task.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n33 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *KillTaskMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *KillTaskMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n34, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n34 - } - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.TaskId.Size())) - n35, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n35 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *StatusUpdateMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *StatusUpdateMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Update == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("update") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.Update.Size())) - n36, err := m.Update.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n36 - } - if m.Pid != nil { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Pid))) - i += copy(data[i:], *m.Pid) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *StatusUpdateAcknowledgementMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *StatusUpdateAcknowledgementMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n37, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n37 - } - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n38, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n38 - } - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(m.TaskId.Size())) - n39, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n39 - } - if m.Uuid == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") - } else { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(len(m.Uuid))) - i += copy(data[i:], m.Uuid) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *LostSlaveMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *LostSlaveMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n40, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n40 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ReconcileTasksMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ReconcileTasksMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n41, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n41 - } - if len(m.Statuses) > 0 { - for _, msg := range m.Statuses { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *FrameworkErrorMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *FrameworkErrorMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Message == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Message))) - i += copy(data[i:], *m.Message) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RegisterSlaveMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RegisterSlaveMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Slave == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.Slave.Size())) - n42, err := m.Slave.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n42 - } - if m.Version != nil { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Version))) - i += copy(data[i:], *m.Version) - } - if len(m.CheckpointedResources) > 0 { - for _, msg := range m.CheckpointedResources { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ReregisterSlaveMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ReregisterSlaveMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Slave == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.Slave.Size())) - n43, err := m.Slave.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n43 - } - if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.ExecutorInfos) > 0 { - for _, msg := range m.ExecutorInfos { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.CompletedFrameworks) > 0 { - for _, msg := range m.CompletedFrameworks { - data[i] = 0x2a - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Version != nil { - data[i] = 0x32 - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Version))) - i += copy(data[i:], *m.Version) - } - if len(m.CheckpointedResources) > 0 { - for _, msg := range m.CheckpointedResources { - data[i] = 0x3a - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SlaveRegisteredMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *SlaveRegisteredMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n44, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n44 - } - if m.Connection != nil { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.Connection.Size())) - n45, err := m.Connection.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n45 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *SlaveReregisteredMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *SlaveReregisteredMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n46, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n46 - } - if len(m.Reconciliations) > 0 { - for _, msg := range m.Reconciliations { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Connection != nil { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(m.Connection.Size())) - n47, err := m.Connection.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n47 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *UnregisterSlaveMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *UnregisterSlaveMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n48, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n48 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *MasterSlaveConnection) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *MasterSlaveConnection) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.TotalPingTimeoutSeconds != nil { - data[i] = 0x9 - i++ - i = encodeFixed64Messages(data, i, uint64(math.Float64bits(*m.TotalPingTimeoutSeconds))) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *PingSlaveMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *PingSlaveMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Connected == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("connected") - } else { - data[i] = 0x8 - i++ - if *m.Connected { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *PongSlaveMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *PongSlaveMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ShutdownFrameworkMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ShutdownFrameworkMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n49, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n49 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ShutdownExecutorMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ShutdownExecutorMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ExecutorId != nil { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorId.Size())) - n50, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n50 - } - if m.FrameworkId != nil { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n51, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n51 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *UpdateFrameworkMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *UpdateFrameworkMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n52, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n52 - } - if m.Pid != nil { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Pid))) - i += copy(data[i:], *m.Pid) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *CheckpointResourcesMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *CheckpointResourcesMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Resources) > 0 { - for _, msg := range m.Resources { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *UpdateSlaveMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *UpdateSlaveMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n53, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n53 - } - if len(m.OversubscribedResources) > 0 { - for _, msg := range m.OversubscribedResources { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *RegisterExecutorMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *RegisterExecutorMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n54, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n54 - } - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorId.Size())) - n55, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n55 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ExecutorRegisteredMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ExecutorRegisteredMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ExecutorInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_info") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorInfo.Size())) - n56, err := m.ExecutorInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n56 - } - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n57, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n57 - } - if m.FrameworkInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_info") - } else { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkInfo.Size())) - n58, err := m.FrameworkInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n58 - } - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0x2a - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n59, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n59 - } - if m.SlaveInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_info") - } else { - data[i] = 0x32 - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveInfo.Size())) - n60, err := m.SlaveInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n60 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ExecutorReregisteredMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ExecutorReregisteredMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n61, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n61 - } - if m.SlaveInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_info") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveInfo.Size())) - n62, err := m.SlaveInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n62 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ExitedExecutorMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ExitedExecutorMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n63, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n63 - } - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n64, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n64 - } - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorId.Size())) - n65, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n65 - } - if m.Status == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } else { - data[i] = 0x20 - i++ - i = encodeVarintMessages(data, i, uint64(*m.Status)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ReconnectExecutorMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ReconnectExecutorMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.SlaveId.Size())) - n66, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n66 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ReregisterExecutorMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ReregisterExecutorMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.ExecutorId.Size())) - n67, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n67 - } - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkId.Size())) - n68, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n68 - } - if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Updates) > 0 { - for _, msg := range m.Updates { - data[i] = 0x22 - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ShutdownMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *ShutdownMessage) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Message != nil { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Message))) - i += copy(data[i:], *m.Message) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Archive) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Archive) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Frameworks) > 0 { - for _, msg := range m.Frameworks { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Archive_Framework) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Archive_Framework) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_info") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.FrameworkInfo.Size())) - n69, err := m.FrameworkInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n69 - } - if m.Pid != nil { - data[i] = 0x12 - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Pid))) - i += copy(data[i:], *m.Pid) - } - if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - data[i] = 0x1a - i++ - i = encodeVarintMessages(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *TaskHealthStatus) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *TaskHealthStatus) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(m.TaskId.Size())) - n70, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n70 - } - if m.Healthy == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("healthy") - } else { - data[i] = 0x10 - i++ - if *m.Healthy { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.KillTask != nil { - data[i] = 0x18 - i++ - if *m.KillTask { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.ConsecutiveFailures != nil { - data[i] = 0x20 - i++ - i = encodeVarintMessages(data, i, uint64(*m.ConsecutiveFailures)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *HookExecuted) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *HookExecuted) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Module != nil { - data[i] = 0xa - i++ - i = encodeVarintMessages(data, i, uint64(len(*m.Module))) - i += copy(data[i:], *m.Module) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Messages(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Messages(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintMessages(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedTask(r randyMessages, easy bool) *Task { - this := &Task{} - v1 := randStringMessages(r) - this.Name = &v1 - this.TaskId = NewPopulatedTaskID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) - } - this.SlaveId = NewPopulatedSlaveID(r, easy) - v2 := TaskState([]int32{6, 0, 1, 2, 3, 4, 5, 7}[r.Intn(8)]) - this.State = &v2 - if r.Intn(10) != 0 { - v3 := r.Intn(10) - this.Resources = make([]*Resource, v3) - for i := 0; i < v3; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if r.Intn(10) != 0 { - v4 := r.Intn(10) - this.Statuses = make([]*TaskStatus, v4) - for i := 0; i < v4; i++ { - this.Statuses[i] = NewPopulatedTaskStatus(r, easy) - } - } - if r.Intn(10) != 0 { - v5 := TaskState([]int32{6, 0, 1, 2, 3, 4, 5, 7}[r.Intn(8)]) - this.StatusUpdateState = &v5 - } - if r.Intn(10) != 0 { - v6 := r.Intn(100) - this.StatusUpdateUuid = make([]byte, v6) - for i := 0; i < v6; i++ { - this.StatusUpdateUuid[i] = byte(r.Intn(256)) - } - } - if r.Intn(10) != 0 { - this.Labels = NewPopulatedLabels(r, easy) - } - if r.Intn(10) != 0 { - this.Discovery = NewPopulatedDiscoveryInfo(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 13) - } - return this -} - -func NewPopulatedStatusUpdate(r randyMessages, easy bool) *StatusUpdate { - this := &StatusUpdate{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) - } - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) - } - this.Status = NewPopulatedTaskStatus(r, easy) - v7 := float64(r.Float64()) - if r.Intn(2) == 0 { - v7 *= -1 - } - this.Timestamp = &v7 - if r.Intn(10) != 0 { - v8 := r.Intn(100) - this.Uuid = make([]byte, v8) - for i := 0; i < v8; i++ { - this.Uuid[i] = byte(r.Intn(256)) - } - } - if r.Intn(10) != 0 { - v9 := TaskState([]int32{6, 0, 1, 2, 3, 4, 5, 7}[r.Intn(8)]) - this.LatestState = &v9 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 8) - } - return this -} - -func NewPopulatedStatusUpdateRecord(r randyMessages, easy bool) *StatusUpdateRecord { - this := &StatusUpdateRecord{} - v10 := StatusUpdateRecord_Type([]int32{0, 1}[r.Intn(2)]) - this.Type = &v10 - if r.Intn(10) != 0 { - this.Update = NewPopulatedStatusUpdate(r, easy) - } - if r.Intn(10) != 0 { - v11 := r.Intn(100) - this.Uuid = make([]byte, v11) - for i := 0; i < v11; i++ { - this.Uuid[i] = byte(r.Intn(256)) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 4) - } - return this -} - -func NewPopulatedSubmitSchedulerRequest(r randyMessages, easy bool) *SubmitSchedulerRequest { - this := &SubmitSchedulerRequest{} - v12 := randStringMessages(r) - this.Name = &v12 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedSubmitSchedulerResponse(r randyMessages, easy bool) *SubmitSchedulerResponse { - this := &SubmitSchedulerResponse{} - v13 := bool(bool(r.Intn(2) == 0)) - this.Okay = &v13 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedExecutorToFrameworkMessage(r randyMessages, easy bool) *ExecutorToFrameworkMessage { - this := &ExecutorToFrameworkMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.ExecutorId = NewPopulatedExecutorID(r, easy) - v14 := r.Intn(100) - this.Data = make([]byte, v14) - for i := 0; i < v14; i++ { - this.Data[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 5) - } - return this -} - -func NewPopulatedFrameworkToExecutorMessage(r randyMessages, easy bool) *FrameworkToExecutorMessage { - this := &FrameworkToExecutorMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.ExecutorId = NewPopulatedExecutorID(r, easy) - v15 := r.Intn(100) - this.Data = make([]byte, v15) - for i := 0; i < v15; i++ { - this.Data[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 5) - } - return this -} - -func NewPopulatedRegisterFrameworkMessage(r randyMessages, easy bool) *RegisterFrameworkMessage { - this := &RegisterFrameworkMessage{} - this.Framework = NewPopulatedFrameworkInfo(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedReregisterFrameworkMessage(r randyMessages, easy bool) *ReregisterFrameworkMessage { - this := &ReregisterFrameworkMessage{} - this.Framework = NewPopulatedFrameworkInfo(r, easy) - v16 := bool(bool(r.Intn(2) == 0)) - this.Failover = &v16 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 4) - } - return this -} - -func NewPopulatedFrameworkRegisteredMessage(r randyMessages, easy bool) *FrameworkRegisteredMessage { - this := &FrameworkRegisteredMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.MasterInfo = NewPopulatedMasterInfo(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedFrameworkReregisteredMessage(r randyMessages, easy bool) *FrameworkReregisteredMessage { - this := &FrameworkReregisteredMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.MasterInfo = NewPopulatedMasterInfo(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedUnregisterFrameworkMessage(r randyMessages, easy bool) *UnregisterFrameworkMessage { - this := &UnregisterFrameworkMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedDeactivateFrameworkMessage(r randyMessages, easy bool) *DeactivateFrameworkMessage { - this := &DeactivateFrameworkMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedResourceRequestMessage(r randyMessages, easy bool) *ResourceRequestMessage { - this := &ResourceRequestMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - v17 := r.Intn(10) - this.Requests = make([]*Request, v17) - for i := 0; i < v17; i++ { - this.Requests[i] = NewPopulatedRequest(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedResourceOffersMessage(r randyMessages, easy bool) *ResourceOffersMessage { - this := &ResourceOffersMessage{} - if r.Intn(10) != 0 { - v18 := r.Intn(10) - this.Offers = make([]*Offer, v18) - for i := 0; i < v18; i++ { - this.Offers[i] = NewPopulatedOffer(r, easy) - } - } - if r.Intn(10) != 0 { - v19 := r.Intn(10) - this.Pids = make([]string, v19) - for i := 0; i < v19; i++ { - this.Pids[i] = randStringMessages(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedLaunchTasksMessage(r randyMessages, easy bool) *LaunchTasksMessage { - this := &LaunchTasksMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - v20 := r.Intn(10) - this.Tasks = make([]*TaskInfo, v20) - for i := 0; i < v20; i++ { - this.Tasks[i] = NewPopulatedTaskInfo(r, easy) - } - } - this.Filters = NewPopulatedFilters(r, easy) - if r.Intn(10) != 0 { - v21 := r.Intn(10) - this.OfferIds = make([]*OfferID, v21) - for i := 0; i < v21; i++ { - this.OfferIds[i] = NewPopulatedOfferID(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 7) - } - return this -} - -func NewPopulatedRescindResourceOfferMessage(r randyMessages, easy bool) *RescindResourceOfferMessage { - this := &RescindResourceOfferMessage{} - this.OfferId = NewPopulatedOfferID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedReviveOffersMessage(r randyMessages, easy bool) *ReviveOffersMessage { - this := &ReviveOffersMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedRunTaskMessage(r randyMessages, easy bool) *RunTaskMessage { - this := &RunTaskMessage{} - if r.Intn(10) != 0 { - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - } - this.Framework = NewPopulatedFrameworkInfo(r, easy) - if r.Intn(10) != 0 { - v22 := randStringMessages(r) - this.Pid = &v22 - } - this.Task = NewPopulatedTaskInfo(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 5) - } - return this -} - -func NewPopulatedKillTaskMessage(r randyMessages, easy bool) *KillTaskMessage { - this := &KillTaskMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.TaskId = NewPopulatedTaskID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedStatusUpdateMessage(r randyMessages, easy bool) *StatusUpdateMessage { - this := &StatusUpdateMessage{} - this.Update = NewPopulatedStatusUpdate(r, easy) - if r.Intn(10) != 0 { - v23 := randStringMessages(r) - this.Pid = &v23 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedStatusUpdateAcknowledgementMessage(r randyMessages, easy bool) *StatusUpdateAcknowledgementMessage { - this := &StatusUpdateAcknowledgementMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.TaskId = NewPopulatedTaskID(r, easy) - v24 := r.Intn(100) - this.Uuid = make([]byte, v24) - for i := 0; i < v24; i++ { - this.Uuid[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 5) - } - return this -} - -func NewPopulatedLostSlaveMessage(r randyMessages, easy bool) *LostSlaveMessage { - this := &LostSlaveMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedReconcileTasksMessage(r randyMessages, easy bool) *ReconcileTasksMessage { - this := &ReconcileTasksMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - v25 := r.Intn(10) - this.Statuses = make([]*TaskStatus, v25) - for i := 0; i < v25; i++ { - this.Statuses[i] = NewPopulatedTaskStatus(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedFrameworkErrorMessage(r randyMessages, easy bool) *FrameworkErrorMessage { - this := &FrameworkErrorMessage{} - v26 := randStringMessages(r) - this.Message = &v26 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedRegisterSlaveMessage(r randyMessages, easy bool) *RegisterSlaveMessage { - this := &RegisterSlaveMessage{} - this.Slave = NewPopulatedSlaveInfo(r, easy) - if r.Intn(10) != 0 { - v27 := randStringMessages(r) - this.Version = &v27 - } - if r.Intn(10) != 0 { - v28 := r.Intn(10) - this.CheckpointedResources = make([]*Resource, v28) - for i := 0; i < v28; i++ { - this.CheckpointedResources[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 4) - } - return this -} - -func NewPopulatedReregisterSlaveMessage(r randyMessages, easy bool) *ReregisterSlaveMessage { - this := &ReregisterSlaveMessage{} - this.Slave = NewPopulatedSlaveInfo(r, easy) - if r.Intn(10) != 0 { - v29 := r.Intn(10) - this.Tasks = make([]*Task, v29) - for i := 0; i < v29; i++ { - this.Tasks[i] = NewPopulatedTask(r, easy) - } - } - if r.Intn(10) != 0 { - v30 := r.Intn(10) - this.ExecutorInfos = make([]*ExecutorInfo, v30) - for i := 0; i < v30; i++ { - this.ExecutorInfos[i] = NewPopulatedExecutorInfo(r, easy) - } - } - if r.Intn(10) != 0 { - v31 := r.Intn(10) - this.CompletedFrameworks = make([]*Archive_Framework, v31) - for i := 0; i < v31; i++ { - this.CompletedFrameworks[i] = NewPopulatedArchive_Framework(r, easy) - } - } - if r.Intn(10) != 0 { - v32 := randStringMessages(r) - this.Version = &v32 - } - if r.Intn(10) != 0 { - v33 := r.Intn(10) - this.CheckpointedResources = make([]*Resource, v33) - for i := 0; i < v33; i++ { - this.CheckpointedResources[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 8) - } - return this -} - -func NewPopulatedSlaveRegisteredMessage(r randyMessages, easy bool) *SlaveRegisteredMessage { - this := &SlaveRegisteredMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - if r.Intn(10) != 0 { - this.Connection = NewPopulatedMasterSlaveConnection(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedSlaveReregisteredMessage(r randyMessages, easy bool) *SlaveReregisteredMessage { - this := &SlaveReregisteredMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - if r.Intn(10) != 0 { - v34 := r.Intn(10) - this.Reconciliations = make([]*ReconcileTasksMessage, v34) - for i := 0; i < v34; i++ { - this.Reconciliations[i] = NewPopulatedReconcileTasksMessage(r, easy) - } - } - if r.Intn(10) != 0 { - this.Connection = NewPopulatedMasterSlaveConnection(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 4) - } - return this -} - -func NewPopulatedUnregisterSlaveMessage(r randyMessages, easy bool) *UnregisterSlaveMessage { - this := &UnregisterSlaveMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedMasterSlaveConnection(r randyMessages, easy bool) *MasterSlaveConnection { - this := &MasterSlaveConnection{} - if r.Intn(10) != 0 { - v35 := float64(r.Float64()) - if r.Intn(2) == 0 { - v35 *= -1 - } - this.TotalPingTimeoutSeconds = &v35 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedPingSlaveMessage(r randyMessages, easy bool) *PingSlaveMessage { - this := &PingSlaveMessage{} - v36 := bool(bool(r.Intn(2) == 0)) - this.Connected = &v36 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedPongSlaveMessage(r randyMessages, easy bool) *PongSlaveMessage { - this := &PongSlaveMessage{} - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 1) - } - return this -} - -func NewPopulatedShutdownFrameworkMessage(r randyMessages, easy bool) *ShutdownFrameworkMessage { - this := &ShutdownFrameworkMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedShutdownExecutorMessage(r randyMessages, easy bool) *ShutdownExecutorMessage { - this := &ShutdownExecutorMessage{} - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) - } - if r.Intn(10) != 0 { - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedUpdateFrameworkMessage(r randyMessages, easy bool) *UpdateFrameworkMessage { - this := &UpdateFrameworkMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - v37 := randStringMessages(r) - this.Pid = &v37 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedCheckpointResourcesMessage(r randyMessages, easy bool) *CheckpointResourcesMessage { - this := &CheckpointResourcesMessage{} - if r.Intn(10) != 0 { - v38 := r.Intn(10) - this.Resources = make([]*Resource, v38) - for i := 0; i < v38; i++ { - this.Resources[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedUpdateSlaveMessage(r randyMessages, easy bool) *UpdateSlaveMessage { - this := &UpdateSlaveMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - if r.Intn(10) != 0 { - v39 := r.Intn(10) - this.OversubscribedResources = make([]*Resource, v39) - for i := 0; i < v39; i++ { - this.OversubscribedResources[i] = NewPopulatedResource(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedRegisterExecutorMessage(r randyMessages, easy bool) *RegisterExecutorMessage { - this := &RegisterExecutorMessage{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.ExecutorId = NewPopulatedExecutorID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedExecutorRegisteredMessage(r randyMessages, easy bool) *ExecutorRegisteredMessage { - this := &ExecutorRegisteredMessage{} - this.ExecutorInfo = NewPopulatedExecutorInfo(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.FrameworkInfo = NewPopulatedFrameworkInfo(r, easy) - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.SlaveInfo = NewPopulatedSlaveInfo(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 7) - } - return this -} - -func NewPopulatedExecutorReregisteredMessage(r randyMessages, easy bool) *ExecutorReregisteredMessage { - this := &ExecutorReregisteredMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.SlaveInfo = NewPopulatedSlaveInfo(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 3) - } - return this -} - -func NewPopulatedExitedExecutorMessage(r randyMessages, easy bool) *ExitedExecutorMessage { - this := &ExitedExecutorMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - this.ExecutorId = NewPopulatedExecutorID(r, easy) - v40 := int32(r.Int31()) - if r.Intn(2) == 0 { - v40 *= -1 - } - this.Status = &v40 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 5) - } - return this -} - -func NewPopulatedReconnectExecutorMessage(r randyMessages, easy bool) *ReconnectExecutorMessage { - this := &ReconnectExecutorMessage{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedReregisterExecutorMessage(r randyMessages, easy bool) *ReregisterExecutorMessage { - this := &ReregisterExecutorMessage{} - this.ExecutorId = NewPopulatedExecutorID(r, easy) - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - v41 := r.Intn(10) - this.Tasks = make([]*TaskInfo, v41) - for i := 0; i < v41; i++ { - this.Tasks[i] = NewPopulatedTaskInfo(r, easy) - } - } - if r.Intn(10) != 0 { - v42 := r.Intn(10) - this.Updates = make([]*StatusUpdate, v42) - for i := 0; i < v42; i++ { - this.Updates[i] = NewPopulatedStatusUpdate(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 5) - } - return this -} - -func NewPopulatedShutdownMessage(r randyMessages, easy bool) *ShutdownMessage { - this := &ShutdownMessage{} - if r.Intn(10) != 0 { - v43 := randStringMessages(r) - this.Message = &v43 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedArchive(r randyMessages, easy bool) *Archive { - this := &Archive{} - if r.Intn(10) != 0 { - v44 := r.Intn(10) - this.Frameworks = make([]*Archive_Framework, v44) - for i := 0; i < v44; i++ { - this.Frameworks[i] = NewPopulatedArchive_Framework(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -func NewPopulatedArchive_Framework(r randyMessages, easy bool) *Archive_Framework { - this := &Archive_Framework{} - this.FrameworkInfo = NewPopulatedFrameworkInfo(r, easy) - if r.Intn(10) != 0 { - v45 := randStringMessages(r) - this.Pid = &v45 - } - if r.Intn(10) != 0 { - v46 := r.Intn(10) - this.Tasks = make([]*Task, v46) - for i := 0; i < v46; i++ { - this.Tasks[i] = NewPopulatedTask(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 4) - } - return this -} - -func NewPopulatedTaskHealthStatus(r randyMessages, easy bool) *TaskHealthStatus { - this := &TaskHealthStatus{} - this.TaskId = NewPopulatedTaskID(r, easy) - v47 := bool(bool(r.Intn(2) == 0)) - this.Healthy = &v47 - if r.Intn(10) != 0 { - v48 := bool(bool(r.Intn(2) == 0)) - this.KillTask = &v48 - } - if r.Intn(10) != 0 { - v49 := int32(r.Int31()) - if r.Intn(2) == 0 { - v49 *= -1 - } - this.ConsecutiveFailures = &v49 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 5) - } - return this -} - -func NewPopulatedHookExecuted(r randyMessages, easy bool) *HookExecuted { - this := &HookExecuted{} - if r.Intn(10) != 0 { - v50 := randStringMessages(r) - this.Module = &v50 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedMessages(r, 2) - } - return this -} - -type randyMessages interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneMessages(r randyMessages) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringMessages(r randyMessages) string { - v51 := r.Intn(100) - tmps := make([]rune, v51) - for i := 0; i < v51; i++ { - tmps[i] = randUTF8RuneMessages(r) - } - return string(tmps) -} -func randUnrecognizedMessages(r randyMessages, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldMessages(data, r, fieldNumber, wire) - } - return data -} -func randFieldMessages(data []byte, r randyMessages, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateMessages(data, uint64(key)) - v52 := r.Int63() - if r.Intn(2) == 0 { - v52 *= -1 - } - data = encodeVarintPopulateMessages(data, uint64(v52)) - case 1: - data = encodeVarintPopulateMessages(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateMessages(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateMessages(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateMessages(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateMessages(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *Task) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMessages(uint64(l)) - } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.State != nil { - n += 1 + sovMessages(uint64(*m.State)) - } - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if len(m.Statuses) > 0 { - for _, e := range m.Statuses { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.StatusUpdateState != nil { - n += 1 + sovMessages(uint64(*m.StatusUpdateState)) - } - if m.StatusUpdateUuid != nil { - l = len(m.StatusUpdateUuid) - n += 1 + l + sovMessages(uint64(l)) - } - if m.Labels != nil { - l = m.Labels.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Discovery != nil { - l = m.Discovery.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *StatusUpdate) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Timestamp != nil { - n += 9 - } - if m.Uuid != nil { - l = len(m.Uuid) - n += 1 + l + sovMessages(uint64(l)) - } - if m.LatestState != nil { - n += 1 + sovMessages(uint64(*m.LatestState)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *StatusUpdateRecord) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovMessages(uint64(*m.Type)) - } - if m.Update != nil { - l = m.Update.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Uuid != nil { - l = len(m.Uuid) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SubmitSchedulerRequest) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SubmitSchedulerResponse) Size() (n int) { - var l int - _ = l - if m.Okay != nil { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ExecutorToFrameworkMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FrameworkToExecutorMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RegisterFrameworkMessage) Size() (n int) { - var l int - _ = l - if m.Framework != nil { - l = m.Framework.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ReregisterFrameworkMessage) Size() (n int) { - var l int - _ = l - if m.Framework != nil { - l = m.Framework.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Failover != nil { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FrameworkRegisteredMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.MasterInfo != nil { - l = m.MasterInfo.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FrameworkReregisteredMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.MasterInfo != nil { - l = m.MasterInfo.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UnregisterFrameworkMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DeactivateFrameworkMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ResourceRequestMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.Requests) > 0 { - for _, e := range m.Requests { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ResourceOffersMessage) Size() (n int) { - var l int - _ = l - if len(m.Offers) > 0 { - for _, e := range m.Offers { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if len(m.Pids) > 0 { - for _, s := range m.Pids { - l = len(s) - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LaunchTasksMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.OfferIds) > 0 { - for _, e := range m.OfferIds { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RescindResourceOfferMessage) Size() (n int) { - var l int - _ = l - if m.OfferId != nil { - l = m.OfferId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ReviveOffersMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RunTaskMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Framework != nil { - l = m.Framework.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Pid != nil { - l = len(*m.Pid) - n += 1 + l + sovMessages(uint64(l)) - } - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *KillTaskMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *StatusUpdateMessage) Size() (n int) { - var l int - _ = l - if m.Update != nil { - l = m.Update.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Pid != nil { - l = len(*m.Pid) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *StatusUpdateAcknowledgementMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Uuid != nil { - l = len(m.Uuid) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LostSlaveMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ReconcileTasksMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.Statuses) > 0 { - for _, e := range m.Statuses { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FrameworkErrorMessage) Size() (n int) { - var l int - _ = l - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RegisterSlaveMessage) Size() (n int) { - var l int - _ = l - if m.Slave != nil { - l = m.Slave.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Version != nil { - l = len(*m.Version) - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.CheckpointedResources) > 0 { - for _, e := range m.CheckpointedResources { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ReregisterSlaveMessage) Size() (n int) { - var l int - _ = l - if m.Slave != nil { - l = m.Slave.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if len(m.ExecutorInfos) > 0 { - for _, e := range m.ExecutorInfos { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if len(m.CompletedFrameworks) > 0 { - for _, e := range m.CompletedFrameworks { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.Version != nil { - l = len(*m.Version) - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.CheckpointedResources) > 0 { - for _, e := range m.CheckpointedResources { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SlaveRegisteredMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Connection != nil { - l = m.Connection.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SlaveReregisteredMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.Reconciliations) > 0 { - for _, e := range m.Reconciliations { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.Connection != nil { - l = m.Connection.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UnregisterSlaveMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MasterSlaveConnection) Size() (n int) { - var l int - _ = l - if m.TotalPingTimeoutSeconds != nil { - n += 9 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PingSlaveMessage) Size() (n int) { - var l int - _ = l - if m.Connected != nil { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *PongSlaveMessage) Size() (n int) { - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ShutdownFrameworkMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ShutdownExecutorMessage) Size() (n int) { - var l int - _ = l - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UpdateFrameworkMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Pid != nil { - l = len(*m.Pid) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CheckpointResourcesMessage) Size() (n int) { - var l int - _ = l - if len(m.Resources) > 0 { - for _, e := range m.Resources { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *UpdateSlaveMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.OversubscribedResources) > 0 { - for _, e := range m.OversubscribedResources { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *RegisterExecutorMessage) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ExecutorRegisteredMessage) Size() (n int) { - var l int - _ = l - if m.ExecutorInfo != nil { - l = m.ExecutorInfo.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkInfo != nil { - l = m.FrameworkInfo.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.SlaveInfo != nil { - l = m.SlaveInfo.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ExecutorReregisteredMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.SlaveInfo != nil { - l = m.SlaveInfo.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ExitedExecutorMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Status != nil { - n += 1 + sovMessages(uint64(*m.Status)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ReconnectExecutorMessage) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ReregisterExecutorMessage) Size() (n int) { - var l int - _ = l - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if len(m.Updates) > 0 { - for _, e := range m.Updates { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ShutdownMessage) Size() (n int) { - var l int - _ = l - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Archive) Size() (n int) { - var l int - _ = l - if len(m.Frameworks) > 0 { - for _, e := range m.Frameworks { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Archive_Framework) Size() (n int) { - var l int - _ = l - if m.FrameworkInfo != nil { - l = m.FrameworkInfo.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Pid != nil { - l = len(*m.Pid) - n += 1 + l + sovMessages(uint64(l)) - } - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovMessages(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TaskHealthStatus) Size() (n int) { - var l int - _ = l - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovMessages(uint64(l)) - } - if m.Healthy != nil { - n += 2 - } - if m.KillTask != nil { - n += 2 - } - if m.ConsecutiveFailures != nil { - n += 1 + sovMessages(uint64(*m.ConsecutiveFailures)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *HookExecuted) Size() (n int) { - var l int - _ = l - if m.Module != nil { - l = len(*m.Module) - n += 1 + l + sovMessages(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovMessages(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozMessages(x uint64) (n int) { - return sovMessages(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Task) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Task{`, - `Name:` + valueToStringMessages(this.Name) + `,`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `State:` + valueToStringMessages(this.State) + `,`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `Statuses:` + strings.Replace(fmt.Sprintf("%v", this.Statuses), "TaskStatus", "TaskStatus", 1) + `,`, - `StatusUpdateState:` + valueToStringMessages(this.StatusUpdateState) + `,`, - `StatusUpdateUuid:` + valueToStringMessages(this.StatusUpdateUuid) + `,`, - `Labels:` + strings.Replace(fmt.Sprintf("%v", this.Labels), "Labels", "Labels", 1) + `,`, - `Discovery:` + strings.Replace(fmt.Sprintf("%v", this.Discovery), "DiscoveryInfo", "DiscoveryInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *StatusUpdate) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StatusUpdate{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "TaskStatus", "TaskStatus", 1) + `,`, - `Timestamp:` + valueToStringMessages(this.Timestamp) + `,`, - `Uuid:` + valueToStringMessages(this.Uuid) + `,`, - `LatestState:` + valueToStringMessages(this.LatestState) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *StatusUpdateRecord) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StatusUpdateRecord{`, - `Type:` + valueToStringMessages(this.Type) + `,`, - `Update:` + strings.Replace(fmt.Sprintf("%v", this.Update), "StatusUpdate", "StatusUpdate", 1) + `,`, - `Uuid:` + valueToStringMessages(this.Uuid) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SubmitSchedulerRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SubmitSchedulerRequest{`, - `Name:` + valueToStringMessages(this.Name) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SubmitSchedulerResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SubmitSchedulerResponse{`, - `Okay:` + valueToStringMessages(this.Okay) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorToFrameworkMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ExecutorToFrameworkMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Data:` + valueToStringMessages(this.Data) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FrameworkToExecutorMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrameworkToExecutorMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Data:` + valueToStringMessages(this.Data) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RegisterFrameworkMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RegisterFrameworkMessage{`, - `Framework:` + strings.Replace(fmt.Sprintf("%v", this.Framework), "FrameworkInfo", "FrameworkInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ReregisterFrameworkMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReregisterFrameworkMessage{`, - `Framework:` + strings.Replace(fmt.Sprintf("%v", this.Framework), "FrameworkInfo", "FrameworkInfo", 1) + `,`, - `Failover:` + valueToStringMessages(this.Failover) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FrameworkRegisteredMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrameworkRegisteredMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `MasterInfo:` + strings.Replace(fmt.Sprintf("%v", this.MasterInfo), "MasterInfo", "MasterInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FrameworkReregisteredMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrameworkReregisteredMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `MasterInfo:` + strings.Replace(fmt.Sprintf("%v", this.MasterInfo), "MasterInfo", "MasterInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UnregisterFrameworkMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UnregisterFrameworkMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *DeactivateFrameworkMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&DeactivateFrameworkMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceRequestMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceRequestMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Requests:` + strings.Replace(fmt.Sprintf("%v", this.Requests), "Request", "Request", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ResourceOffersMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourceOffersMessage{`, - `Offers:` + strings.Replace(fmt.Sprintf("%v", this.Offers), "Offer", "Offer", 1) + `,`, - `Pids:` + fmt.Sprintf("%v", this.Pids) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *LaunchTasksMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LaunchTasksMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "TaskInfo", "TaskInfo", 1) + `,`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "Filters", "Filters", 1) + `,`, - `OfferIds:` + strings.Replace(fmt.Sprintf("%v", this.OfferIds), "OfferID", "OfferID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RescindResourceOfferMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RescindResourceOfferMessage{`, - `OfferId:` + strings.Replace(fmt.Sprintf("%v", this.OfferId), "OfferID", "OfferID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ReviveOffersMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReviveOffersMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RunTaskMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RunTaskMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Framework:` + strings.Replace(fmt.Sprintf("%v", this.Framework), "FrameworkInfo", "FrameworkInfo", 1) + `,`, - `Pid:` + valueToStringMessages(this.Pid) + `,`, - `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "TaskInfo", "TaskInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *KillTaskMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&KillTaskMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *StatusUpdateMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StatusUpdateMessage{`, - `Update:` + strings.Replace(fmt.Sprintf("%v", this.Update), "StatusUpdate", "StatusUpdate", 1) + `,`, - `Pid:` + valueToStringMessages(this.Pid) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *StatusUpdateAcknowledgementMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StatusUpdateAcknowledgementMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `Uuid:` + valueToStringMessages(this.Uuid) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *LostSlaveMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LostSlaveMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ReconcileTasksMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReconcileTasksMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Statuses:` + strings.Replace(fmt.Sprintf("%v", this.Statuses), "TaskStatus", "TaskStatus", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *FrameworkErrorMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FrameworkErrorMessage{`, - `Message:` + valueToStringMessages(this.Message) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RegisterSlaveMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RegisterSlaveMessage{`, - `Slave:` + strings.Replace(fmt.Sprintf("%v", this.Slave), "SlaveInfo", "SlaveInfo", 1) + `,`, - `Version:` + valueToStringMessages(this.Version) + `,`, - `CheckpointedResources:` + strings.Replace(fmt.Sprintf("%v", this.CheckpointedResources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ReregisterSlaveMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReregisterSlaveMessage{`, - `Slave:` + strings.Replace(fmt.Sprintf("%v", this.Slave), "SlaveInfo", "SlaveInfo", 1) + `,`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`, - `ExecutorInfos:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorInfos), "ExecutorInfo", "ExecutorInfo", 1) + `,`, - `CompletedFrameworks:` + strings.Replace(fmt.Sprintf("%v", this.CompletedFrameworks), "Archive_Framework", "Archive_Framework", 1) + `,`, - `Version:` + valueToStringMessages(this.Version) + `,`, - `CheckpointedResources:` + strings.Replace(fmt.Sprintf("%v", this.CheckpointedResources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SlaveRegisteredMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SlaveRegisteredMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Connection:` + strings.Replace(fmt.Sprintf("%v", this.Connection), "MasterSlaveConnection", "MasterSlaveConnection", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *SlaveReregisteredMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SlaveReregisteredMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `Reconciliations:` + strings.Replace(fmt.Sprintf("%v", this.Reconciliations), "ReconcileTasksMessage", "ReconcileTasksMessage", 1) + `,`, - `Connection:` + strings.Replace(fmt.Sprintf("%v", this.Connection), "MasterSlaveConnection", "MasterSlaveConnection", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UnregisterSlaveMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UnregisterSlaveMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *MasterSlaveConnection) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MasterSlaveConnection{`, - `TotalPingTimeoutSeconds:` + valueToStringMessages(this.TotalPingTimeoutSeconds) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PingSlaveMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PingSlaveMessage{`, - `Connected:` + valueToStringMessages(this.Connected) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *PongSlaveMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PongSlaveMessage{`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ShutdownFrameworkMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ShutdownFrameworkMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ShutdownExecutorMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ShutdownExecutorMessage{`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateFrameworkMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateFrameworkMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Pid:` + valueToStringMessages(this.Pid) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *CheckpointResourcesMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&CheckpointResourcesMessage{`, - `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *UpdateSlaveMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UpdateSlaveMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `OversubscribedResources:` + strings.Replace(fmt.Sprintf("%v", this.OversubscribedResources), "Resource", "Resource", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *RegisterExecutorMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RegisterExecutorMessage{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorRegisteredMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ExecutorRegisteredMessage{`, - `ExecutorInfo:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorInfo), "ExecutorInfo", "ExecutorInfo", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `FrameworkInfo:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkInfo), "FrameworkInfo", "FrameworkInfo", 1) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `SlaveInfo:` + strings.Replace(fmt.Sprintf("%v", this.SlaveInfo), "SlaveInfo", "SlaveInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExecutorReregisteredMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ExecutorReregisteredMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `SlaveInfo:` + strings.Replace(fmt.Sprintf("%v", this.SlaveInfo), "SlaveInfo", "SlaveInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ExitedExecutorMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ExitedExecutorMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Status:` + valueToStringMessages(this.Status) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ReconnectExecutorMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReconnectExecutorMessage{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ReregisterExecutorMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReregisterExecutorMessage{`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "TaskInfo", "TaskInfo", 1) + `,`, - `Updates:` + strings.Replace(fmt.Sprintf("%v", this.Updates), "StatusUpdate", "StatusUpdate", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *ShutdownMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ShutdownMessage{`, - `Message:` + valueToStringMessages(this.Message) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Archive) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Archive{`, - `Frameworks:` + strings.Replace(fmt.Sprintf("%v", this.Frameworks), "Archive_Framework", "Archive_Framework", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Archive_Framework) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Archive_Framework{`, - `FrameworkInfo:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkInfo), "FrameworkInfo", "FrameworkInfo", 1) + `,`, - `Pid:` + valueToStringMessages(this.Pid) + `,`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Task", "Task", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *TaskHealthStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TaskHealthStatus{`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `Healthy:` + valueToStringMessages(this.Healthy) + `,`, - `KillTask:` + valueToStringMessages(this.KillTask) + `,`, - `ConsecutiveFailures:` + valueToStringMessages(this.ConsecutiveFailures) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *HookExecuted) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&HookExecuted{`, - `Module:` + valueToStringMessages(this.Module) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringMessages(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Task) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000008) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var v TaskState - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (TaskState(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.State = &v - hasFields[0] |= uint64(0x00000010) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Statuses = append(m.Statuses, &TaskStatus{}) - if err := m.Statuses[len(m.Statuses)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StatusUpdateState", wireType) - } - var v TaskState - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (TaskState(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.StatusUpdateState = &v - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StatusUpdateUuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StatusUpdateUuid = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Labels == nil { - m.Labels = &Labels{} - } - if err := m.Labels.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Discovery", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Discovery == nil { - m.Discovery = &DiscoveryInfo{} - } - if err := m.Discovery.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000008) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000010) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("state") - } - - return nil -} -func (m *StatusUpdate) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &TaskStatus{} - } - if err := m.Status.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 5: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.Timestamp = &v2 - hasFields[0] |= uint64(0x00000004) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LatestState", wireType) - } - var v TaskState - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (TaskState(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.LatestState = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") - } - - return nil -} -func (m *StatusUpdateRecord) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v StatusUpdateRecord_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (StatusUpdateRecord_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Update == nil { - m.Update = &StatusUpdate{} - } - if err := m.Update.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *SubmitSchedulerRequest) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - - return nil -} -func (m *SubmitSchedulerResponse) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Okay", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Okay = &b - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("okay") - } - - return nil -} -func (m *ExecutorToFrameworkMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000008) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - if hasFields[0]&uint64(0x00000008) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } - - return nil -} -func (m *FrameworkToExecutorMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000008) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - if hasFields[0]&uint64(0x00000008) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } - - return nil -} -func (m *RegisterFrameworkMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Framework", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Framework == nil { - m.Framework = &FrameworkInfo{} - } - if err := m.Framework.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework") - } - - return nil -} -func (m *ReregisterFrameworkMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Framework", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Framework == nil { - m.Framework = &FrameworkInfo{} - } - if err := m.Framework.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Failover", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Failover = &b - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("failover") - } - - return nil -} -func (m *FrameworkRegisteredMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MasterInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MasterInfo == nil { - m.MasterInfo = &MasterInfo{} - } - if err := m.MasterInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("master_info") - } - - return nil -} -func (m *FrameworkReregisteredMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MasterInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MasterInfo == nil { - m.MasterInfo = &MasterInfo{} - } - if err := m.MasterInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("master_info") - } - - return nil -} -func (m *UnregisterFrameworkMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *DeactivateFrameworkMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *ResourceRequestMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Requests = append(m.Requests, &Request{}) - if err := m.Requests[len(m.Requests)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *ResourceOffersMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Offers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Offers = append(m.Offers, &Offer{}) - if err := m.Offers[len(m.Offers)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pids", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Pids = append(m.Pids, string(data[iNdEx:postIndex])) - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *LaunchTasksMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &TaskInfo{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &Filters{} - } - if err := m.Filters.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OfferIds = append(m.OfferIds, &OfferID{}) - if err := m.OfferIds[len(m.OfferIds)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("filters") - } - - return nil -} -func (m *RescindResourceOfferMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.OfferId == nil { - m.OfferId = &OfferID{} - } - if err := m.OfferId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("offer_id") - } - - return nil -} -func (m *ReviveOffersMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *RunTaskMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Framework", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Framework == nil { - m.Framework = &FrameworkInfo{} - } - if err := m.Framework.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Pid = &s - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Task == nil { - m.Task = &TaskInfo{} - } - if err := m.Task.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task") - } - - return nil -} -func (m *KillTaskMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - - return nil -} -func (m *StatusUpdateMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Update == nil { - m.Update = &StatusUpdate{} - } - if err := m.Update.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Pid = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("update") - } - - return nil -} -func (m *StatusUpdateAcknowledgementMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000008) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - if hasFields[0]&uint64(0x00000008) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") - } - - return nil -} -func (m *LostSlaveMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - - return nil -} -func (m *ReconcileTasksMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Statuses = append(m.Statuses, &TaskStatus{}) - if err := m.Statuses[len(m.Statuses)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *FrameworkErrorMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") - } - - return nil -} -func (m *RegisterSlaveMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Slave", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Slave == nil { - m.Slave = &SlaveInfo{} - } - if err := m.Slave.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Version = &s - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckpointedResources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CheckpointedResources = append(m.CheckpointedResources, &Resource{}) - if err := m.CheckpointedResources[len(m.CheckpointedResources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave") - } - - return nil -} -func (m *ReregisterSlaveMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Slave", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Slave == nil { - m.Slave = &SlaveInfo{} - } - if err := m.Slave.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &Task{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ExecutorInfos = append(m.ExecutorInfos, &ExecutorInfo{}) - if err := m.ExecutorInfos[len(m.ExecutorInfos)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CompletedFrameworks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CompletedFrameworks = append(m.CompletedFrameworks, &Archive_Framework{}) - if err := m.CompletedFrameworks[len(m.CompletedFrameworks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Version = &s - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CheckpointedResources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CheckpointedResources = append(m.CheckpointedResources, &Resource{}) - if err := m.CheckpointedResources[len(m.CheckpointedResources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave") - } - - return nil -} -func (m *SlaveRegisteredMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Connection", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Connection == nil { - m.Connection = &MasterSlaveConnection{} - } - if err := m.Connection.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - - return nil -} -func (m *SlaveReregisteredMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reconciliations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reconciliations = append(m.Reconciliations, &ReconcileTasksMessage{}) - if err := m.Reconciliations[len(m.Reconciliations)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Connection", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Connection == nil { - m.Connection = &MasterSlaveConnection{} - } - if err := m.Connection.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - - return nil -} -func (m *UnregisterSlaveMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - - return nil -} -func (m *MasterSlaveConnection) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalPingTimeoutSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.TotalPingTimeoutSeconds = &v2 - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *PingSlaveMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Connected", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Connected = &b - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("connected") - } - - return nil -} -func (m *PongSlaveMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - switch fieldNum { - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *ShutdownFrameworkMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *ShutdownExecutorMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *UpdateFrameworkMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Pid = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *CheckpointResourcesMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resources = append(m.Resources, &Resource{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *UpdateSlaveMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OversubscribedResources", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OversubscribedResources = append(m.OversubscribedResources, &Resource{}) - if err := m.OversubscribedResources[len(m.OversubscribedResources)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - - return nil -} -func (m *RegisterExecutorMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - - return nil -} -func (m *ExecutorRegisteredMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorInfo == nil { - m.ExecutorInfo = &ExecutorInfo{} - } - if err := m.ExecutorInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkInfo == nil { - m.FrameworkInfo = &FrameworkInfo{} - } - if err := m.FrameworkInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000008) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveInfo == nil { - m.SlaveInfo = &SlaveInfo{} - } - if err := m.SlaveInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000010) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_info") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_info") - } - if hasFields[0]&uint64(0x00000008) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000010) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_info") - } - - return nil -} -func (m *ExecutorReregisteredMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveInfo == nil { - m.SlaveInfo = &SlaveInfo{} - } - if err := m.SlaveInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_info") - } - - return nil -} -func (m *ExitedExecutorMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - hasFields[0] |= uint64(0x00000008) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - if hasFields[0]&uint64(0x00000008) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } - - return nil -} -func (m *ReconnectExecutorMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - - return nil -} -func (m *ReregisterExecutorMessage) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &TaskInfo{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Updates", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Updates = append(m.Updates, &StatusUpdate{}) - if err := m.Updates[len(m.Updates)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *ShutdownMessage) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Archive) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Frameworks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Frameworks = append(m.Frameworks, &Archive_Framework{}) - if err := m.Frameworks[len(m.Frameworks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Archive_Framework) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkInfo == nil { - m.FrameworkInfo = &FrameworkInfo{} - } - if err := m.FrameworkInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Pid = &s - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &Task{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_info") - } - - return nil -} -func (m *TaskHealthStatus) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Healthy", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Healthy = &b - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KillTask", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.KillTask = &b - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsecutiveFailures", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.ConsecutiveFailures = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("healthy") - } - - return nil -} -func (m *HookExecuted) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Module = &s - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipMessages(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func skipMessages(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthMessages - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipMessages(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthMessages = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/registry.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/registry.pb.go deleted file mode 100644 index c0a60c796..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/registry.pb.go +++ /dev/null @@ -1,1268 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: registry.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type Registry struct { - // Most recent leading master. - Master *Registry_Master `protobuf:"bytes,1,opt,name=master" json:"master,omitempty"` - // All admitted slaves. - Slaves *Registry_Slaves `protobuf:"bytes,2,opt,name=slaves" json:"slaves,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Registry) Reset() { *m = Registry{} } -func (*Registry) ProtoMessage() {} - -func (m *Registry) GetMaster() *Registry_Master { - if m != nil { - return m.Master - } - return nil -} - -func (m *Registry) GetSlaves() *Registry_Slaves { - if m != nil { - return m.Slaves - } - return nil -} - -type Registry_Master struct { - Info *MasterInfo `protobuf:"bytes,1,req,name=info" json:"info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Registry_Master) Reset() { *m = Registry_Master{} } -func (*Registry_Master) ProtoMessage() {} - -func (m *Registry_Master) GetInfo() *MasterInfo { - if m != nil { - return m.Info - } - return nil -} - -type Registry_Slave struct { - Info *SlaveInfo `protobuf:"bytes,1,req,name=info" json:"info,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Registry_Slave) Reset() { *m = Registry_Slave{} } -func (*Registry_Slave) ProtoMessage() {} - -func (m *Registry_Slave) GetInfo() *SlaveInfo { - if m != nil { - return m.Info - } - return nil -} - -type Registry_Slaves struct { - Slaves []*Registry_Slave `protobuf:"bytes,1,rep,name=slaves" json:"slaves,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Registry_Slaves) Reset() { *m = Registry_Slaves{} } -func (*Registry_Slaves) ProtoMessage() {} - -func (m *Registry_Slaves) GetSlaves() []*Registry_Slave { - if m != nil { - return m.Slaves - } - return nil -} - -func (this *Registry) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Registry) - if !ok { - return fmt.Errorf("that is not of type *Registry") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Registry but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Registrybut is not nil && this == nil") - } - if !this.Master.Equal(that1.Master) { - return fmt.Errorf("Master this(%v) Not Equal that(%v)", this.Master, that1.Master) - } - if !this.Slaves.Equal(that1.Slaves) { - return fmt.Errorf("Slaves this(%v) Not Equal that(%v)", this.Slaves, that1.Slaves) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Registry) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Registry) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Master.Equal(that1.Master) { - return false - } - if !this.Slaves.Equal(that1.Slaves) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Registry_Master) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Registry_Master) - if !ok { - return fmt.Errorf("that is not of type *Registry_Master") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Registry_Master but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Registry_Masterbut is not nil && this == nil") - } - if !this.Info.Equal(that1.Info) { - return fmt.Errorf("Info this(%v) Not Equal that(%v)", this.Info, that1.Info) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Registry_Master) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Registry_Master) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Info.Equal(that1.Info) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Registry_Slave) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Registry_Slave) - if !ok { - return fmt.Errorf("that is not of type *Registry_Slave") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Registry_Slave but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Registry_Slavebut is not nil && this == nil") - } - if !this.Info.Equal(that1.Info) { - return fmt.Errorf("Info this(%v) Not Equal that(%v)", this.Info, that1.Info) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Registry_Slave) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Registry_Slave) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Info.Equal(that1.Info) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Registry_Slaves) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Registry_Slaves) - if !ok { - return fmt.Errorf("that is not of type *Registry_Slaves") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Registry_Slaves but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Registry_Slavesbut is not nil && this == nil") - } - if len(this.Slaves) != len(that1.Slaves) { - return fmt.Errorf("Slaves this(%v) Not Equal that(%v)", len(this.Slaves), len(that1.Slaves)) - } - for i := range this.Slaves { - if !this.Slaves[i].Equal(that1.Slaves[i]) { - return fmt.Errorf("Slaves this[%v](%v) Not Equal that[%v](%v)", i, this.Slaves[i], i, that1.Slaves[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Registry_Slaves) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Registry_Slaves) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Slaves) != len(that1.Slaves) { - return false - } - for i := range this.Slaves { - if !this.Slaves[i].Equal(that1.Slaves[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Registry) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Registry{") - if this.Master != nil { - s = append(s, "Master: "+fmt.Sprintf("%#v", this.Master)+",\n") - } - if this.Slaves != nil { - s = append(s, "Slaves: "+fmt.Sprintf("%#v", this.Slaves)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Registry_Master) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Registry_Master{") - if this.Info != nil { - s = append(s, "Info: "+fmt.Sprintf("%#v", this.Info)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Registry_Slave) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Registry_Slave{") - if this.Info != nil { - s = append(s, "Info: "+fmt.Sprintf("%#v", this.Info)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Registry_Slaves) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Registry_Slaves{") - if this.Slaves != nil { - s = append(s, "Slaves: "+fmt.Sprintf("%#v", this.Slaves)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringRegistry(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringRegistry(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *Registry) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Registry) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Master != nil { - data[i] = 0xa - i++ - i = encodeVarintRegistry(data, i, uint64(m.Master.Size())) - n1, err := m.Master.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.Slaves != nil { - data[i] = 0x12 - i++ - i = encodeVarintRegistry(data, i, uint64(m.Slaves.Size())) - n2, err := m.Slaves.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Registry_Master) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Registry_Master) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Info == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("info") - } else { - data[i] = 0xa - i++ - i = encodeVarintRegistry(data, i, uint64(m.Info.Size())) - n3, err := m.Info.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Registry_Slave) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Registry_Slave) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Info == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("info") - } else { - data[i] = 0xa - i++ - i = encodeVarintRegistry(data, i, uint64(m.Info.Size())) - n4, err := m.Info.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Registry_Slaves) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Registry_Slaves) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Slaves) > 0 { - for _, msg := range m.Slaves { - data[i] = 0xa - i++ - i = encodeVarintRegistry(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Registry(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Registry(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintRegistry(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedRegistry(r randyRegistry, easy bool) *Registry { - this := &Registry{} - if r.Intn(10) != 0 { - this.Master = NewPopulatedRegistry_Master(r, easy) - } - if r.Intn(10) != 0 { - this.Slaves = NewPopulatedRegistry_Slaves(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRegistry(r, 3) - } - return this -} - -func NewPopulatedRegistry_Master(r randyRegistry, easy bool) *Registry_Master { - this := &Registry_Master{} - this.Info = NewPopulatedMasterInfo(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRegistry(r, 2) - } - return this -} - -func NewPopulatedRegistry_Slave(r randyRegistry, easy bool) *Registry_Slave { - this := &Registry_Slave{} - this.Info = NewPopulatedSlaveInfo(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRegistry(r, 2) - } - return this -} - -func NewPopulatedRegistry_Slaves(r randyRegistry, easy bool) *Registry_Slaves { - this := &Registry_Slaves{} - if r.Intn(10) != 0 { - v1 := r.Intn(10) - this.Slaves = make([]*Registry_Slave, v1) - for i := 0; i < v1; i++ { - this.Slaves[i] = NewPopulatedRegistry_Slave(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedRegistry(r, 2) - } - return this -} - -type randyRegistry interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneRegistry(r randyRegistry) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringRegistry(r randyRegistry) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneRegistry(r) - } - return string(tmps) -} -func randUnrecognizedRegistry(r randyRegistry, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldRegistry(data, r, fieldNumber, wire) - } - return data -} -func randFieldRegistry(data []byte, r randyRegistry, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateRegistry(data, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - data = encodeVarintPopulateRegistry(data, uint64(v3)) - case 1: - data = encodeVarintPopulateRegistry(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateRegistry(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateRegistry(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateRegistry(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateRegistry(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *Registry) Size() (n int) { - var l int - _ = l - if m.Master != nil { - l = m.Master.Size() - n += 1 + l + sovRegistry(uint64(l)) - } - if m.Slaves != nil { - l = m.Slaves.Size() - n += 1 + l + sovRegistry(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Registry_Master) Size() (n int) { - var l int - _ = l - if m.Info != nil { - l = m.Info.Size() - n += 1 + l + sovRegistry(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Registry_Slave) Size() (n int) { - var l int - _ = l - if m.Info != nil { - l = m.Info.Size() - n += 1 + l + sovRegistry(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Registry_Slaves) Size() (n int) { - var l int - _ = l - if len(m.Slaves) > 0 { - for _, e := range m.Slaves { - l = e.Size() - n += 1 + l + sovRegistry(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovRegistry(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozRegistry(x uint64) (n int) { - return sovRegistry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Registry) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Registry{`, - `Master:` + strings.Replace(fmt.Sprintf("%v", this.Master), "Registry_Master", "Registry_Master", 1) + `,`, - `Slaves:` + strings.Replace(fmt.Sprintf("%v", this.Slaves), "Registry_Slaves", "Registry_Slaves", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Registry_Master) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Registry_Master{`, - `Info:` + strings.Replace(fmt.Sprintf("%v", this.Info), "MasterInfo", "MasterInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Registry_Slave) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Registry_Slave{`, - `Info:` + strings.Replace(fmt.Sprintf("%v", this.Info), "SlaveInfo", "SlaveInfo", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Registry_Slaves) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Registry_Slaves{`, - `Slaves:` + strings.Replace(fmt.Sprintf("%v", this.Slaves), "Registry_Slave", "Registry_Slave", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringRegistry(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Registry) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Master", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRegistry - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Master == nil { - m.Master = &Registry_Master{} - } - if err := m.Master.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Slaves", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRegistry - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Slaves == nil { - m.Slaves = &Registry_Slaves{} - } - if err := m.Slaves.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipRegistry(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRegistry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Registry_Master) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRegistry - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Info == nil { - m.Info = &MasterInfo{} - } - if err := m.Info.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipRegistry(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRegistry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("info") - } - - return nil -} -func (m *Registry_Slave) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRegistry - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Info == nil { - m.Info = &SlaveInfo{} - } - if err := m.Info.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipRegistry(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRegistry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("info") - } - - return nil -} -func (m *Registry_Slaves) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Slaves", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRegistry - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Slaves = append(m.Slaves, &Registry_Slave{}) - if err := m.Slaves[len(m.Slaves)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipRegistry(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRegistry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func skipRegistry(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthRegistry - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRegistry(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthRegistry = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go deleted file mode 100644 index 067183466..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/scheduler.pb.go +++ /dev/null @@ -1,7176 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: scheduler.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// Possible event types, followed by message definitions if -// applicable. -type Event_Type int32 - -const ( - Event_SUBSCRIBED Event_Type = 1 - Event_OFFERS Event_Type = 2 - Event_RESCIND Event_Type = 3 - Event_UPDATE Event_Type = 4 - Event_MESSAGE Event_Type = 5 - Event_FAILURE Event_Type = 6 - Event_ERROR Event_Type = 7 - // Periodic message sent by the Mesos master according to - // 'Subscribed.heartbeat_interval_seconds'. If the scheduler does - // not receive any events (including heartbeats) for an extended - // period of time (e.g., 5 x heartbeat_interval_seconds), there is - // likely a network partition. In such a case the scheduler should - // close the existing subscription connection and resubscribe - // using a backoff strategy. - Event_HEARTBEAT Event_Type = 8 -) - -var Event_Type_name = map[int32]string{ - 1: "SUBSCRIBED", - 2: "OFFERS", - 3: "RESCIND", - 4: "UPDATE", - 5: "MESSAGE", - 6: "FAILURE", - 7: "ERROR", - 8: "HEARTBEAT", -} -var Event_Type_value = map[string]int32{ - "SUBSCRIBED": 1, - "OFFERS": 2, - "RESCIND": 3, - "UPDATE": 4, - "MESSAGE": 5, - "FAILURE": 6, - "ERROR": 7, - "HEARTBEAT": 8, -} - -func (x Event_Type) Enum() *Event_Type { - p := new(Event_Type) - *p = x - return p -} -func (x Event_Type) String() string { - return proto.EnumName(Event_Type_name, int32(x)) -} -func (x *Event_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Event_Type_value, data, "Event_Type") - if err != nil { - return err - } - *x = Event_Type(value) - return nil -} - -// Possible call types, followed by message definitions if -// applicable. -type Call_Type int32 - -const ( - Call_SUBSCRIBE Call_Type = 1 - Call_TEARDOWN Call_Type = 2 - Call_ACCEPT Call_Type = 3 - Call_DECLINE Call_Type = 4 - Call_REVIVE Call_Type = 5 - Call_KILL Call_Type = 6 - Call_SHUTDOWN Call_Type = 7 - Call_ACKNOWLEDGE Call_Type = 8 - Call_RECONCILE Call_Type = 9 - Call_MESSAGE Call_Type = 10 - Call_REQUEST Call_Type = 11 -) - -var Call_Type_name = map[int32]string{ - 1: "SUBSCRIBE", - 2: "TEARDOWN", - 3: "ACCEPT", - 4: "DECLINE", - 5: "REVIVE", - 6: "KILL", - 7: "SHUTDOWN", - 8: "ACKNOWLEDGE", - 9: "RECONCILE", - 10: "MESSAGE", - 11: "REQUEST", -} -var Call_Type_value = map[string]int32{ - "SUBSCRIBE": 1, - "TEARDOWN": 2, - "ACCEPT": 3, - "DECLINE": 4, - "REVIVE": 5, - "KILL": 6, - "SHUTDOWN": 7, - "ACKNOWLEDGE": 8, - "RECONCILE": 9, - "MESSAGE": 10, - "REQUEST": 11, -} - -func (x Call_Type) Enum() *Call_Type { - p := new(Call_Type) - *p = x - return p -} -func (x Call_Type) String() string { - return proto.EnumName(Call_Type_name, int32(x)) -} -func (x *Call_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Call_Type_value, data, "Call_Type") - if err != nil { - return err - } - *x = Call_Type(value) - return nil -} - -// * -// Scheduler event API. -// -// An event is described using the standard protocol buffer "union" -// trick, see: -// https://developers.google.com/protocol-buffers/docs/techniques#union. -type Event struct { - // Type of the event, indicates which optional field below should be - // present if that type has a nested message definition. - Type *Event_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Event_Type" json:"type,omitempty"` - Subscribed *Event_Subscribed `protobuf:"bytes,2,opt,name=subscribed" json:"subscribed,omitempty"` - Offers *Event_Offers `protobuf:"bytes,3,opt,name=offers" json:"offers,omitempty"` - Rescind *Event_Rescind `protobuf:"bytes,4,opt,name=rescind" json:"rescind,omitempty"` - Update *Event_Update `protobuf:"bytes,5,opt,name=update" json:"update,omitempty"` - Message *Event_Message `protobuf:"bytes,6,opt,name=message" json:"message,omitempty"` - Failure *Event_Failure `protobuf:"bytes,7,opt,name=failure" json:"failure,omitempty"` - Error *Event_Error `protobuf:"bytes,8,opt,name=error" json:"error,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event) Reset() { *m = Event{} } -func (*Event) ProtoMessage() {} - -func (m *Event) GetType() Event_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Event_SUBSCRIBED -} - -func (m *Event) GetSubscribed() *Event_Subscribed { - if m != nil { - return m.Subscribed - } - return nil -} - -func (m *Event) GetOffers() *Event_Offers { - if m != nil { - return m.Offers - } - return nil -} - -func (m *Event) GetRescind() *Event_Rescind { - if m != nil { - return m.Rescind - } - return nil -} - -func (m *Event) GetUpdate() *Event_Update { - if m != nil { - return m.Update - } - return nil -} - -func (m *Event) GetMessage() *Event_Message { - if m != nil { - return m.Message - } - return nil -} - -func (m *Event) GetFailure() *Event_Failure { - if m != nil { - return m.Failure - } - return nil -} - -func (m *Event) GetError() *Event_Error { - if m != nil { - return m.Error - } - return nil -} - -// First event received when the scheduler subscribes. -type Event_Subscribed struct { - FrameworkId *FrameworkID `protobuf:"bytes,1,req,name=framework_id" json:"framework_id,omitempty"` - // This value will be set if the master is sending heartbeats. See - // the comment above on 'HEARTBEAT' for more details. - // TODO(vinod): Implement heartbeats in the master once the master - // can send HTTP events. - HeartbeatIntervalSeconds *float64 `protobuf:"fixed64,2,opt,name=heartbeat_interval_seconds" json:"heartbeat_interval_seconds,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Subscribed) Reset() { *m = Event_Subscribed{} } -func (*Event_Subscribed) ProtoMessage() {} - -func (m *Event_Subscribed) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *Event_Subscribed) GetHeartbeatIntervalSeconds() float64 { - if m != nil && m.HeartbeatIntervalSeconds != nil { - return *m.HeartbeatIntervalSeconds - } - return 0 -} - -// Received whenever there are new resources that are offered to the -// scheduler. Each offer corresponds to a set of resources on a -// slave. Until the scheduler accepts or declines an offer the -// resources are considered allocated to the scheduler. -type Event_Offers struct { - Offers []*Offer `protobuf:"bytes,1,rep,name=offers" json:"offers,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Offers) Reset() { *m = Event_Offers{} } -func (*Event_Offers) ProtoMessage() {} - -func (m *Event_Offers) GetOffers() []*Offer { - if m != nil { - return m.Offers - } - return nil -} - -// Received when a particular offer is no longer valid (e.g., the -// slave corresponding to the offer has been removed) and hence -// needs to be rescinded. Any future calls ('Accept' / 'Decline') made -// by the scheduler regarding this offer will be invalid. -type Event_Rescind struct { - OfferId *OfferID `protobuf:"bytes,1,req,name=offer_id" json:"offer_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Rescind) Reset() { *m = Event_Rescind{} } -func (*Event_Rescind) ProtoMessage() {} - -func (m *Event_Rescind) GetOfferId() *OfferID { - if m != nil { - return m.OfferId - } - return nil -} - -// Received whenever there is a status update that is generated by -// the executor or slave or master. Status updates should be used by -// executors to reliably communicate the status of the tasks that -// they manage. It is crucial that a terminal update (see TaskState -// in mesos.proto) is sent by the executor as soon as the task -// terminates, in order for Mesos to release the resources allocated -// to the task. It is also the responsibility of the scheduler to -// explicitly acknowledge the receipt of a status update. See -// 'Acknowledge' in the 'Call' section below for the semantics. -type Event_Update struct { - Status *TaskStatus `protobuf:"bytes,1,req,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Update) Reset() { *m = Event_Update{} } -func (*Event_Update) ProtoMessage() {} - -func (m *Event_Update) GetStatus() *TaskStatus { - if m != nil { - return m.Status - } - return nil -} - -// Received when a custom message generated by the executor is -// forwarded by the master. Note that this message is not -// interpreted by Mesos and is only forwarded (without reliability -// guarantees) to the scheduler. It is up to the executor to retry -// if the message is dropped for any reason. -type Event_Message struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` - Data []byte `protobuf:"bytes,3,req,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Message) Reset() { *m = Event_Message{} } -func (*Event_Message) ProtoMessage() {} - -func (m *Event_Message) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *Event_Message) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *Event_Message) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// Received when a slave is removed from the cluster (e.g., failed -// health checks) or when an executor is terminated. Note that, this -// event coincides with receipt of terminal UPDATE events for any -// active tasks belonging to the slave or executor and receipt of -// 'Rescind' events for any outstanding offers belonging to the -// slave. Note that there is no guaranteed order between the -// 'Failure', 'Update' and 'Rescind' events when a slave or executor -// is removed. -// TODO(vinod): Consider splitting the lost slave and terminated -// executor into separate events and ensure it's reliably generated. -type Event_Failure struct { - SlaveId *SlaveID `protobuf:"bytes,1,opt,name=slave_id" json:"slave_id,omitempty"` - // If this was just a failure of an executor on a slave then - // 'executor_id' will be set and possibly 'status' (if we were - // able to determine the exit status). - ExecutorId *ExecutorID `protobuf:"bytes,2,opt,name=executor_id" json:"executor_id,omitempty"` - Status *int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Failure) Reset() { *m = Event_Failure{} } -func (*Event_Failure) ProtoMessage() {} - -func (m *Event_Failure) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *Event_Failure) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *Event_Failure) GetStatus() int32 { - if m != nil && m.Status != nil { - return *m.Status - } - return 0 -} - -// Received when an invalid framework (e.g., unauthenticated, -// unauthorized) attempts to subscribe with the master. Error can -// also be received if scheduler sends invalid Calls (e.g., not -// properly initialized). -// TODO(vinod): Remove this once the old scheduler driver is no -// longer supported. With HTTP API all errors will be signaled via -// HTTP response codes. -type Event_Error struct { - Message *string `protobuf:"bytes,1,req,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Event_Error) Reset() { *m = Event_Error{} } -func (*Event_Error) ProtoMessage() {} - -func (m *Event_Error) GetMessage() string { - if m != nil && m.Message != nil { - return *m.Message - } - return "" -} - -// * -// Scheduler call API. -// -// Like Event, a Call is described using the standard protocol buffer -// "union" trick (see above). -type Call struct { - // Identifies who generated this call. Master assigns a framework id - // when a new scheduler subscribes for the first time. Once assigned, - // the scheduler must set the 'framework_id' here and within its - // FrameworkInfo (in any further 'Subscribe' calls). This allows the - // master to identify a scheduler correctly across disconnections, - // failovers, etc. - FrameworkId *FrameworkID `protobuf:"bytes,1,opt,name=framework_id" json:"framework_id,omitempty"` - // Type of the call, indicates which optional field below should be - // present if that type has a nested message definition. - Type *Call_Type `protobuf:"varint,2,req,name=type,enum=mesosproto.Call_Type" json:"type,omitempty"` - Subscribe *Call_Subscribe `protobuf:"bytes,3,opt,name=subscribe" json:"subscribe,omitempty"` - Accept *Call_Accept `protobuf:"bytes,4,opt,name=accept" json:"accept,omitempty"` - Decline *Call_Decline `protobuf:"bytes,5,opt,name=decline" json:"decline,omitempty"` - Kill *Call_Kill `protobuf:"bytes,6,opt,name=kill" json:"kill,omitempty"` - Shutdown *Call_Shutdown `protobuf:"bytes,7,opt,name=shutdown" json:"shutdown,omitempty"` - Acknowledge *Call_Acknowledge `protobuf:"bytes,8,opt,name=acknowledge" json:"acknowledge,omitempty"` - Reconcile *Call_Reconcile `protobuf:"bytes,9,opt,name=reconcile" json:"reconcile,omitempty"` - Message *Call_Message `protobuf:"bytes,10,opt,name=message" json:"message,omitempty"` - Request *Call_Request `protobuf:"bytes,11,opt,name=request" json:"request,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call) Reset() { *m = Call{} } -func (*Call) ProtoMessage() {} - -func (m *Call) GetFrameworkId() *FrameworkID { - if m != nil { - return m.FrameworkId - } - return nil -} - -func (m *Call) GetType() Call_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Call_SUBSCRIBE -} - -func (m *Call) GetSubscribe() *Call_Subscribe { - if m != nil { - return m.Subscribe - } - return nil -} - -func (m *Call) GetAccept() *Call_Accept { - if m != nil { - return m.Accept - } - return nil -} - -func (m *Call) GetDecline() *Call_Decline { - if m != nil { - return m.Decline - } - return nil -} - -func (m *Call) GetKill() *Call_Kill { - if m != nil { - return m.Kill - } - return nil -} - -func (m *Call) GetShutdown() *Call_Shutdown { - if m != nil { - return m.Shutdown - } - return nil -} - -func (m *Call) GetAcknowledge() *Call_Acknowledge { - if m != nil { - return m.Acknowledge - } - return nil -} - -func (m *Call) GetReconcile() *Call_Reconcile { - if m != nil { - return m.Reconcile - } - return nil -} - -func (m *Call) GetMessage() *Call_Message { - if m != nil { - return m.Message - } - return nil -} - -func (m *Call) GetRequest() *Call_Request { - if m != nil { - return m.Request - } - return nil -} - -// Subscribes the scheduler with the master to receive events. A -// scheduler must send other calls only after it has received the -// SUBCRIBED event. -type Call_Subscribe struct { - // See the comments below on 'framework_id' on the semantics for - // 'framework_info.id'. - FrameworkInfo *FrameworkInfo `protobuf:"bytes,1,req,name=framework_info" json:"framework_info,omitempty"` - // 'force' field is only relevant when 'framework_info.id' is set. - // It tells the master what to do in case an instance of the - // scheduler attempts to subscribe when another instance of it is - // already connected (e.g., split brain due to network partition). - // If 'force' is true, this scheduler instance is allowed and the - // old connected scheduler instance is disconnected. If false, - // this scheduler instance is disallowed subscription in favor of - // the already connected scheduler instance. - // - // It is recommended to set this to true only when a newly elected - // scheduler instance is attempting to subscribe but not when a - // scheduler is retrying subscription (e.g., disconnection or - // master failover; see sched/sched.cpp for an example). - Force *bool `protobuf:"varint,2,opt,name=force" json:"force,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Subscribe) Reset() { *m = Call_Subscribe{} } -func (*Call_Subscribe) ProtoMessage() {} - -func (m *Call_Subscribe) GetFrameworkInfo() *FrameworkInfo { - if m != nil { - return m.FrameworkInfo - } - return nil -} - -func (m *Call_Subscribe) GetForce() bool { - if m != nil && m.Force != nil { - return *m.Force - } - return false -} - -// Accepts an offer, performing the specified operations -// in a sequential manner. -// -// E.g. Launch a task with a newly reserved persistent volume: -// -// Accept { -// offer_ids: [ ... ] -// operations: [ -// { type: RESERVE, -// reserve: { resources: [ disk(role):2 ] } } -// { type: CREATE, -// create: { volumes: [ disk(role):1+persistence ] } } -// { type: LAUNCH, -// launch: { task_infos ... disk(role):1;disk(role):1+persistence } } -// ] -// } -// -// Note that any of the offer’s resources not used in the 'Accept' -// call (e.g., to launch a task) are considered unused and might be -// reoffered to other frameworks. In other words, the same OfferID -// cannot be used in more than one 'Accept' call. -type Call_Accept struct { - OfferIds []*OfferID `protobuf:"bytes,1,rep,name=offer_ids" json:"offer_ids,omitempty"` - Operations []*Offer_Operation `protobuf:"bytes,2,rep,name=operations" json:"operations,omitempty"` - Filters *Filters `protobuf:"bytes,3,opt,name=filters" json:"filters,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Accept) Reset() { *m = Call_Accept{} } -func (*Call_Accept) ProtoMessage() {} - -func (m *Call_Accept) GetOfferIds() []*OfferID { - if m != nil { - return m.OfferIds - } - return nil -} - -func (m *Call_Accept) GetOperations() []*Offer_Operation { - if m != nil { - return m.Operations - } - return nil -} - -func (m *Call_Accept) GetFilters() *Filters { - if m != nil { - return m.Filters - } - return nil -} - -// Declines an offer, signaling the master to potentially reoffer -// the resources to a different framework. Note that this is same -// as sending an Accept call with no operations. See comments on -// top of 'Accept' for semantics. -type Call_Decline struct { - OfferIds []*OfferID `protobuf:"bytes,1,rep,name=offer_ids" json:"offer_ids,omitempty"` - Filters *Filters `protobuf:"bytes,2,opt,name=filters" json:"filters,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Decline) Reset() { *m = Call_Decline{} } -func (*Call_Decline) ProtoMessage() {} - -func (m *Call_Decline) GetOfferIds() []*OfferID { - if m != nil { - return m.OfferIds - } - return nil -} - -func (m *Call_Decline) GetFilters() *Filters { - if m != nil { - return m.Filters - } - return nil -} - -// Kills a specific task. If the scheduler has a custom executor, -// the kill is forwarded to the executor and it is up to the -// executor to kill the task and send a TASK_KILLED (or TASK_FAILED) -// update. Note that Mesos releases the resources for a task once it -// receives a terminal update (See TaskState in mesos.proto) for it. -// If the task is unknown to the master, a TASK_LOST update is -// generated. -type Call_Kill struct { - TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,2,opt,name=slave_id" json:"slave_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Kill) Reset() { *m = Call_Kill{} } -func (*Call_Kill) ProtoMessage() {} - -func (m *Call_Kill) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *Call_Kill) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -// Shuts down a custom executor. When the executor gets a shutdown -// event, it is expected to kill all its tasks (and send TASK_KILLED -// updates) and terminate. If the executor doesn’t terminate within -// a certain timeout (configurable via -// '--executor_shutdown_grace_period' slave flag), the slave will -// forcefully destroy the container (executor and its tasks) and -// transition its active tasks to TASK_LOST. -type Call_Shutdown struct { - ExecutorId *ExecutorID `protobuf:"bytes,1,req,name=executor_id" json:"executor_id,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,2,req,name=slave_id" json:"slave_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Shutdown) Reset() { *m = Call_Shutdown{} } -func (*Call_Shutdown) ProtoMessage() {} - -func (m *Call_Shutdown) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *Call_Shutdown) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -// Acknowledges the receipt of status update. Schedulers are -// responsible for explicitly acknowledging the receipt of status -// updates that have 'Update.status().uuid()' field set. Such status -// updates are retried by the slave until they are acknowledged by -// the scheduler. -type Call_Acknowledge struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - TaskId *TaskID `protobuf:"bytes,2,req,name=task_id" json:"task_id,omitempty"` - Uuid []byte `protobuf:"bytes,3,req,name=uuid" json:"uuid,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Acknowledge) Reset() { *m = Call_Acknowledge{} } -func (*Call_Acknowledge) ProtoMessage() {} - -func (m *Call_Acknowledge) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *Call_Acknowledge) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *Call_Acknowledge) GetUuid() []byte { - if m != nil { - return m.Uuid - } - return nil -} - -// Allows the scheduler to query the status for non-terminal tasks. -// This causes the master to send back the latest task status for -// each task in 'tasks', if possible. Tasks that are no longer known -// will result in a TASK_LOST update. If 'statuses' is empty, then -// the master will send the latest status for each task currently -// known. -type Call_Reconcile struct { - Tasks []*Call_Reconcile_Task `protobuf:"bytes,1,rep,name=tasks" json:"tasks,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Reconcile) Reset() { *m = Call_Reconcile{} } -func (*Call_Reconcile) ProtoMessage() {} - -func (m *Call_Reconcile) GetTasks() []*Call_Reconcile_Task { - if m != nil { - return m.Tasks - } - return nil -} - -// TODO(vinod): Support arbitrary queries than just state of tasks. -type Call_Reconcile_Task struct { - TaskId *TaskID `protobuf:"bytes,1,req,name=task_id" json:"task_id,omitempty"` - SlaveId *SlaveID `protobuf:"bytes,2,opt,name=slave_id" json:"slave_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Reconcile_Task) Reset() { *m = Call_Reconcile_Task{} } -func (*Call_Reconcile_Task) ProtoMessage() {} - -func (m *Call_Reconcile_Task) GetTaskId() *TaskID { - if m != nil { - return m.TaskId - } - return nil -} - -func (m *Call_Reconcile_Task) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -// Sends arbitrary binary data to the executor. Note that Mesos -// neither interprets this data nor makes any guarantees about the -// delivery of this message to the executor. -type Call_Message struct { - SlaveId *SlaveID `protobuf:"bytes,1,req,name=slave_id" json:"slave_id,omitempty"` - ExecutorId *ExecutorID `protobuf:"bytes,2,req,name=executor_id" json:"executor_id,omitempty"` - Data []byte `protobuf:"bytes,3,req,name=data" json:"data,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Message) Reset() { *m = Call_Message{} } -func (*Call_Message) ProtoMessage() {} - -func (m *Call_Message) GetSlaveId() *SlaveID { - if m != nil { - return m.SlaveId - } - return nil -} - -func (m *Call_Message) GetExecutorId() *ExecutorID { - if m != nil { - return m.ExecutorId - } - return nil -} - -func (m *Call_Message) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// Requests a specific set of resources from Mesos's allocator. If -// the allocator has support for this, corresponding offers will be -// sent asynchronously via the OFFERS event(s). -// -// NOTE: The built-in hierarchical allocator doesn't have support -// for this call and hence simply ignores it. -type Call_Request struct { - Requests []*Request `protobuf:"bytes,1,rep,name=requests" json:"requests,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Call_Request) Reset() { *m = Call_Request{} } -func (*Call_Request) ProtoMessage() {} - -func (m *Call_Request) GetRequests() []*Request { - if m != nil { - return m.Requests - } - return nil -} - -func init() { - proto.RegisterEnum("mesosproto.Event_Type", Event_Type_name, Event_Type_value) - proto.RegisterEnum("mesosproto.Call_Type", Call_Type_name, Call_Type_value) -} -func (this *Event) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Event) - if !ok { - return fmt.Errorf("that is not of type *Event") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Event but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Eventbut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Subscribed.Equal(that1.Subscribed) { - return fmt.Errorf("Subscribed this(%v) Not Equal that(%v)", this.Subscribed, that1.Subscribed) - } - if !this.Offers.Equal(that1.Offers) { - return fmt.Errorf("Offers this(%v) Not Equal that(%v)", this.Offers, that1.Offers) - } - if !this.Rescind.Equal(that1.Rescind) { - return fmt.Errorf("Rescind this(%v) Not Equal that(%v)", this.Rescind, that1.Rescind) - } - if !this.Update.Equal(that1.Update) { - return fmt.Errorf("Update this(%v) Not Equal that(%v)", this.Update, that1.Update) - } - if !this.Message.Equal(that1.Message) { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if !this.Failure.Equal(that1.Failure) { - return fmt.Errorf("Failure this(%v) Not Equal that(%v)", this.Failure, that1.Failure) - } - if !this.Error.Equal(that1.Error) { - return fmt.Errorf("Error this(%v) Not Equal that(%v)", this.Error, that1.Error) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Event) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Event) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Subscribed.Equal(that1.Subscribed) { - return false - } - if !this.Offers.Equal(that1.Offers) { - return false - } - if !this.Rescind.Equal(that1.Rescind) { - return false - } - if !this.Update.Equal(that1.Update) { - return false - } - if !this.Message.Equal(that1.Message) { - return false - } - if !this.Failure.Equal(that1.Failure) { - return false - } - if !this.Error.Equal(that1.Error) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Event_Subscribed) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Event_Subscribed) - if !ok { - return fmt.Errorf("that is not of type *Event_Subscribed") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Event_Subscribed but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Event_Subscribedbut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if this.HeartbeatIntervalSeconds != nil && that1.HeartbeatIntervalSeconds != nil { - if *this.HeartbeatIntervalSeconds != *that1.HeartbeatIntervalSeconds { - return fmt.Errorf("HeartbeatIntervalSeconds this(%v) Not Equal that(%v)", *this.HeartbeatIntervalSeconds, *that1.HeartbeatIntervalSeconds) - } - } else if this.HeartbeatIntervalSeconds != nil { - return fmt.Errorf("this.HeartbeatIntervalSeconds == nil && that.HeartbeatIntervalSeconds != nil") - } else if that1.HeartbeatIntervalSeconds != nil { - return fmt.Errorf("HeartbeatIntervalSeconds this(%v) Not Equal that(%v)", this.HeartbeatIntervalSeconds, that1.HeartbeatIntervalSeconds) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Event_Subscribed) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Event_Subscribed) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if this.HeartbeatIntervalSeconds != nil && that1.HeartbeatIntervalSeconds != nil { - if *this.HeartbeatIntervalSeconds != *that1.HeartbeatIntervalSeconds { - return false - } - } else if this.HeartbeatIntervalSeconds != nil { - return false - } else if that1.HeartbeatIntervalSeconds != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Event_Offers) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Event_Offers) - if !ok { - return fmt.Errorf("that is not of type *Event_Offers") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Event_Offers but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Event_Offersbut is not nil && this == nil") - } - if len(this.Offers) != len(that1.Offers) { - return fmt.Errorf("Offers this(%v) Not Equal that(%v)", len(this.Offers), len(that1.Offers)) - } - for i := range this.Offers { - if !this.Offers[i].Equal(that1.Offers[i]) { - return fmt.Errorf("Offers this[%v](%v) Not Equal that[%v](%v)", i, this.Offers[i], i, that1.Offers[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Event_Offers) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Event_Offers) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Offers) != len(that1.Offers) { - return false - } - for i := range this.Offers { - if !this.Offers[i].Equal(that1.Offers[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Event_Rescind) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Event_Rescind) - if !ok { - return fmt.Errorf("that is not of type *Event_Rescind") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Event_Rescind but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Event_Rescindbut is not nil && this == nil") - } - if !this.OfferId.Equal(that1.OfferId) { - return fmt.Errorf("OfferId this(%v) Not Equal that(%v)", this.OfferId, that1.OfferId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Event_Rescind) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Event_Rescind) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.OfferId.Equal(that1.OfferId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Event_Update) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Event_Update) - if !ok { - return fmt.Errorf("that is not of type *Event_Update") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Event_Update but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Event_Updatebut is not nil && this == nil") - } - if !this.Status.Equal(that1.Status) { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Event_Update) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Event_Update) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Status.Equal(that1.Status) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Event_Message) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Event_Message) - if !ok { - return fmt.Errorf("that is not of type *Event_Message") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Event_Message but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Event_Messagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Event_Message) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Event_Message) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Event_Failure) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Event_Failure) - if !ok { - return fmt.Errorf("that is not of type *Event_Failure") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Event_Failure but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Event_Failurebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", *this.Status, *that1.Status) - } - } else if this.Status != nil { - return fmt.Errorf("this.Status == nil && that.Status != nil") - } else if that1.Status != nil { - return fmt.Errorf("Status this(%v) Not Equal that(%v)", this.Status, that1.Status) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Event_Failure) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Event_Failure) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if this.Status != nil && that1.Status != nil { - if *this.Status != *that1.Status { - return false - } - } else if this.Status != nil { - return false - } else if that1.Status != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Event_Error) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Event_Error) - if !ok { - return fmt.Errorf("that is not of type *Event_Error") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Event_Error but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Event_Errorbut is not nil && this == nil") - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", *this.Message, *that1.Message) - } - } else if this.Message != nil { - return fmt.Errorf("this.Message == nil && that.Message != nil") - } else if that1.Message != nil { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Event_Error) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Event_Error) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Message != nil && that1.Message != nil { - if *this.Message != *that1.Message { - return false - } - } else if this.Message != nil { - return false - } else if that1.Message != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call) - if !ok { - return fmt.Errorf("that is not of type *Call") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Callbut is not nil && this == nil") - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return fmt.Errorf("FrameworkId this(%v) Not Equal that(%v)", this.FrameworkId, that1.FrameworkId) - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Subscribe.Equal(that1.Subscribe) { - return fmt.Errorf("Subscribe this(%v) Not Equal that(%v)", this.Subscribe, that1.Subscribe) - } - if !this.Accept.Equal(that1.Accept) { - return fmt.Errorf("Accept this(%v) Not Equal that(%v)", this.Accept, that1.Accept) - } - if !this.Decline.Equal(that1.Decline) { - return fmt.Errorf("Decline this(%v) Not Equal that(%v)", this.Decline, that1.Decline) - } - if !this.Kill.Equal(that1.Kill) { - return fmt.Errorf("Kill this(%v) Not Equal that(%v)", this.Kill, that1.Kill) - } - if !this.Shutdown.Equal(that1.Shutdown) { - return fmt.Errorf("Shutdown this(%v) Not Equal that(%v)", this.Shutdown, that1.Shutdown) - } - if !this.Acknowledge.Equal(that1.Acknowledge) { - return fmt.Errorf("Acknowledge this(%v) Not Equal that(%v)", this.Acknowledge, that1.Acknowledge) - } - if !this.Reconcile.Equal(that1.Reconcile) { - return fmt.Errorf("Reconcile this(%v) Not Equal that(%v)", this.Reconcile, that1.Reconcile) - } - if !this.Message.Equal(that1.Message) { - return fmt.Errorf("Message this(%v) Not Equal that(%v)", this.Message, that1.Message) - } - if !this.Request.Equal(that1.Request) { - return fmt.Errorf("Request this(%v) Not Equal that(%v)", this.Request, that1.Request) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkId.Equal(that1.FrameworkId) { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Subscribe.Equal(that1.Subscribe) { - return false - } - if !this.Accept.Equal(that1.Accept) { - return false - } - if !this.Decline.Equal(that1.Decline) { - return false - } - if !this.Kill.Equal(that1.Kill) { - return false - } - if !this.Shutdown.Equal(that1.Shutdown) { - return false - } - if !this.Acknowledge.Equal(that1.Acknowledge) { - return false - } - if !this.Reconcile.Equal(that1.Reconcile) { - return false - } - if !this.Message.Equal(that1.Message) { - return false - } - if !this.Request.Equal(that1.Request) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Subscribe) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Subscribe) - if !ok { - return fmt.Errorf("that is not of type *Call_Subscribe") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Subscribe but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Subscribebut is not nil && this == nil") - } - if !this.FrameworkInfo.Equal(that1.FrameworkInfo) { - return fmt.Errorf("FrameworkInfo this(%v) Not Equal that(%v)", this.FrameworkInfo, that1.FrameworkInfo) - } - if this.Force != nil && that1.Force != nil { - if *this.Force != *that1.Force { - return fmt.Errorf("Force this(%v) Not Equal that(%v)", *this.Force, *that1.Force) - } - } else if this.Force != nil { - return fmt.Errorf("this.Force == nil && that.Force != nil") - } else if that1.Force != nil { - return fmt.Errorf("Force this(%v) Not Equal that(%v)", this.Force, that1.Force) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Subscribe) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Subscribe) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.FrameworkInfo.Equal(that1.FrameworkInfo) { - return false - } - if this.Force != nil && that1.Force != nil { - if *this.Force != *that1.Force { - return false - } - } else if this.Force != nil { - return false - } else if that1.Force != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Accept) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Accept) - if !ok { - return fmt.Errorf("that is not of type *Call_Accept") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Accept but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Acceptbut is not nil && this == nil") - } - if len(this.OfferIds) != len(that1.OfferIds) { - return fmt.Errorf("OfferIds this(%v) Not Equal that(%v)", len(this.OfferIds), len(that1.OfferIds)) - } - for i := range this.OfferIds { - if !this.OfferIds[i].Equal(that1.OfferIds[i]) { - return fmt.Errorf("OfferIds this[%v](%v) Not Equal that[%v](%v)", i, this.OfferIds[i], i, that1.OfferIds[i]) - } - } - if len(this.Operations) != len(that1.Operations) { - return fmt.Errorf("Operations this(%v) Not Equal that(%v)", len(this.Operations), len(that1.Operations)) - } - for i := range this.Operations { - if !this.Operations[i].Equal(that1.Operations[i]) { - return fmt.Errorf("Operations this[%v](%v) Not Equal that[%v](%v)", i, this.Operations[i], i, that1.Operations[i]) - } - } - if !this.Filters.Equal(that1.Filters) { - return fmt.Errorf("Filters this(%v) Not Equal that(%v)", this.Filters, that1.Filters) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Accept) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Accept) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.OfferIds) != len(that1.OfferIds) { - return false - } - for i := range this.OfferIds { - if !this.OfferIds[i].Equal(that1.OfferIds[i]) { - return false - } - } - if len(this.Operations) != len(that1.Operations) { - return false - } - for i := range this.Operations { - if !this.Operations[i].Equal(that1.Operations[i]) { - return false - } - } - if !this.Filters.Equal(that1.Filters) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Decline) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Decline) - if !ok { - return fmt.Errorf("that is not of type *Call_Decline") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Decline but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Declinebut is not nil && this == nil") - } - if len(this.OfferIds) != len(that1.OfferIds) { - return fmt.Errorf("OfferIds this(%v) Not Equal that(%v)", len(this.OfferIds), len(that1.OfferIds)) - } - for i := range this.OfferIds { - if !this.OfferIds[i].Equal(that1.OfferIds[i]) { - return fmt.Errorf("OfferIds this[%v](%v) Not Equal that[%v](%v)", i, this.OfferIds[i], i, that1.OfferIds[i]) - } - } - if !this.Filters.Equal(that1.Filters) { - return fmt.Errorf("Filters this(%v) Not Equal that(%v)", this.Filters, that1.Filters) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Decline) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Decline) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.OfferIds) != len(that1.OfferIds) { - return false - } - for i := range this.OfferIds { - if !this.OfferIds[i].Equal(that1.OfferIds[i]) { - return false - } - } - if !this.Filters.Equal(that1.Filters) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Kill) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Kill) - if !ok { - return fmt.Errorf("that is not of type *Call_Kill") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Kill but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Killbut is not nil && this == nil") - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Kill) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Kill) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Shutdown) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Shutdown) - if !ok { - return fmt.Errorf("that is not of type *Call_Shutdown") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Shutdown but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Shutdownbut is not nil && this == nil") - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Shutdown) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Shutdown) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Acknowledge) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Acknowledge) - if !ok { - return fmt.Errorf("that is not of type *Call_Acknowledge") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Acknowledge but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Acknowledgebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Acknowledge) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Acknowledge) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Reconcile) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Reconcile) - if !ok { - return fmt.Errorf("that is not of type *Call_Reconcile") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Reconcile but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Reconcilebut is not nil && this == nil") - } - if len(this.Tasks) != len(that1.Tasks) { - return fmt.Errorf("Tasks this(%v) Not Equal that(%v)", len(this.Tasks), len(that1.Tasks)) - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return fmt.Errorf("Tasks this[%v](%v) Not Equal that[%v](%v)", i, this.Tasks[i], i, that1.Tasks[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Reconcile) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Reconcile) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Tasks) != len(that1.Tasks) { - return false - } - for i := range this.Tasks { - if !this.Tasks[i].Equal(that1.Tasks[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Reconcile_Task) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Reconcile_Task) - if !ok { - return fmt.Errorf("that is not of type *Call_Reconcile_Task") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Reconcile_Task but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Reconcile_Taskbut is not nil && this == nil") - } - if !this.TaskId.Equal(that1.TaskId) { - return fmt.Errorf("TaskId this(%v) Not Equal that(%v)", this.TaskId, that1.TaskId) - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Reconcile_Task) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Reconcile_Task) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.TaskId.Equal(that1.TaskId) { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Message) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Message) - if !ok { - return fmt.Errorf("that is not of type *Call_Message") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Message but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Messagebut is not nil && this == nil") - } - if !this.SlaveId.Equal(that1.SlaveId) { - return fmt.Errorf("SlaveId this(%v) Not Equal that(%v)", this.SlaveId, that1.SlaveId) - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return fmt.Errorf("ExecutorId this(%v) Not Equal that(%v)", this.ExecutorId, that1.ExecutorId) - } - if !bytes.Equal(this.Data, that1.Data) { - return fmt.Errorf("Data this(%v) Not Equal that(%v)", this.Data, that1.Data) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Message) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Message) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.SlaveId.Equal(that1.SlaveId) { - return false - } - if !this.ExecutorId.Equal(that1.ExecutorId) { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Call_Request) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Call_Request) - if !ok { - return fmt.Errorf("that is not of type *Call_Request") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Call_Request but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Call_Requestbut is not nil && this == nil") - } - if len(this.Requests) != len(that1.Requests) { - return fmt.Errorf("Requests this(%v) Not Equal that(%v)", len(this.Requests), len(that1.Requests)) - } - for i := range this.Requests { - if !this.Requests[i].Equal(that1.Requests[i]) { - return fmt.Errorf("Requests this[%v](%v) Not Equal that[%v](%v)", i, this.Requests[i], i, that1.Requests[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Call_Request) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Call_Request) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Requests) != len(that1.Requests) { - return false - } - for i := range this.Requests { - if !this.Requests[i].Equal(that1.Requests[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Event) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 12) - s = append(s, "&mesosproto.Event{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringScheduler(this.Type, "mesosproto.Event_Type")+",\n") - } - if this.Subscribed != nil { - s = append(s, "Subscribed: "+fmt.Sprintf("%#v", this.Subscribed)+",\n") - } - if this.Offers != nil { - s = append(s, "Offers: "+fmt.Sprintf("%#v", this.Offers)+",\n") - } - if this.Rescind != nil { - s = append(s, "Rescind: "+fmt.Sprintf("%#v", this.Rescind)+",\n") - } - if this.Update != nil { - s = append(s, "Update: "+fmt.Sprintf("%#v", this.Update)+",\n") - } - if this.Message != nil { - s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") - } - if this.Failure != nil { - s = append(s, "Failure: "+fmt.Sprintf("%#v", this.Failure)+",\n") - } - if this.Error != nil { - s = append(s, "Error: "+fmt.Sprintf("%#v", this.Error)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Event_Subscribed) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Event_Subscribed{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.HeartbeatIntervalSeconds != nil { - s = append(s, "HeartbeatIntervalSeconds: "+valueToGoStringScheduler(this.HeartbeatIntervalSeconds, "float64")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Event_Offers) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Event_Offers{") - if this.Offers != nil { - s = append(s, "Offers: "+fmt.Sprintf("%#v", this.Offers)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Event_Rescind) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Event_Rescind{") - if this.OfferId != nil { - s = append(s, "OfferId: "+fmt.Sprintf("%#v", this.OfferId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Event_Update) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Event_Update{") - if this.Status != nil { - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Event_Message) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Event_Message{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringScheduler(this.Data, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Event_Failure) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Event_Failure{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.Status != nil { - s = append(s, "Status: "+valueToGoStringScheduler(this.Status, "int32")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Event_Error) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Event_Error{") - if this.Message != nil { - s = append(s, "Message: "+valueToGoStringScheduler(this.Message, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 15) - s = append(s, "&mesosproto.Call{") - if this.FrameworkId != nil { - s = append(s, "FrameworkId: "+fmt.Sprintf("%#v", this.FrameworkId)+",\n") - } - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringScheduler(this.Type, "mesosproto.Call_Type")+",\n") - } - if this.Subscribe != nil { - s = append(s, "Subscribe: "+fmt.Sprintf("%#v", this.Subscribe)+",\n") - } - if this.Accept != nil { - s = append(s, "Accept: "+fmt.Sprintf("%#v", this.Accept)+",\n") - } - if this.Decline != nil { - s = append(s, "Decline: "+fmt.Sprintf("%#v", this.Decline)+",\n") - } - if this.Kill != nil { - s = append(s, "Kill: "+fmt.Sprintf("%#v", this.Kill)+",\n") - } - if this.Shutdown != nil { - s = append(s, "Shutdown: "+fmt.Sprintf("%#v", this.Shutdown)+",\n") - } - if this.Acknowledge != nil { - s = append(s, "Acknowledge: "+fmt.Sprintf("%#v", this.Acknowledge)+",\n") - } - if this.Reconcile != nil { - s = append(s, "Reconcile: "+fmt.Sprintf("%#v", this.Reconcile)+",\n") - } - if this.Message != nil { - s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") - } - if this.Request != nil { - s = append(s, "Request: "+fmt.Sprintf("%#v", this.Request)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Subscribe) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Call_Subscribe{") - if this.FrameworkInfo != nil { - s = append(s, "FrameworkInfo: "+fmt.Sprintf("%#v", this.FrameworkInfo)+",\n") - } - if this.Force != nil { - s = append(s, "Force: "+valueToGoStringScheduler(this.Force, "bool")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Accept) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Call_Accept{") - if this.OfferIds != nil { - s = append(s, "OfferIds: "+fmt.Sprintf("%#v", this.OfferIds)+",\n") - } - if this.Operations != nil { - s = append(s, "Operations: "+fmt.Sprintf("%#v", this.Operations)+",\n") - } - if this.Filters != nil { - s = append(s, "Filters: "+fmt.Sprintf("%#v", this.Filters)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Decline) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Call_Decline{") - if this.OfferIds != nil { - s = append(s, "OfferIds: "+fmt.Sprintf("%#v", this.OfferIds)+",\n") - } - if this.Filters != nil { - s = append(s, "Filters: "+fmt.Sprintf("%#v", this.Filters)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Kill) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Call_Kill{") - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Shutdown) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Call_Shutdown{") - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Acknowledge) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Call_Acknowledge{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.Uuid != nil { - s = append(s, "Uuid: "+valueToGoStringScheduler(this.Uuid, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Reconcile) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Call_Reconcile{") - if this.Tasks != nil { - s = append(s, "Tasks: "+fmt.Sprintf("%#v", this.Tasks)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Reconcile_Task) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mesosproto.Call_Reconcile_Task{") - if this.TaskId != nil { - s = append(s, "TaskId: "+fmt.Sprintf("%#v", this.TaskId)+",\n") - } - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Message) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Call_Message{") - if this.SlaveId != nil { - s = append(s, "SlaveId: "+fmt.Sprintf("%#v", this.SlaveId)+",\n") - } - if this.ExecutorId != nil { - s = append(s, "ExecutorId: "+fmt.Sprintf("%#v", this.ExecutorId)+",\n") - } - if this.Data != nil { - s = append(s, "Data: "+valueToGoStringScheduler(this.Data, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Call_Request) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Call_Request{") - if this.Requests != nil { - s = append(s, "Requests: "+fmt.Sprintf("%#v", this.Requests)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringScheduler(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringScheduler(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *Event) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Event) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintScheduler(data, i, uint64(*m.Type)) - } - if m.Subscribed != nil { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Subscribed.Size())) - n1, err := m.Subscribed.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.Offers != nil { - data[i] = 0x1a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Offers.Size())) - n2, err := m.Offers.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.Rescind != nil { - data[i] = 0x22 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Rescind.Size())) - n3, err := m.Rescind.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.Update != nil { - data[i] = 0x2a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Update.Size())) - n4, err := m.Update.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.Message != nil { - data[i] = 0x32 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Message.Size())) - n5, err := m.Message.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.Failure != nil { - data[i] = 0x3a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Failure.Size())) - n6, err := m.Failure.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n6 - } - if m.Error != nil { - data[i] = 0x42 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Error.Size())) - n7, err := m.Error.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n7 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Event_Subscribed) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Event_Subscribed) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.FrameworkId.Size())) - n8, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n8 - } - if m.HeartbeatIntervalSeconds != nil { - data[i] = 0x11 - i++ - i = encodeFixed64Scheduler(data, i, uint64(math.Float64bits(*m.HeartbeatIntervalSeconds))) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Event_Offers) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Event_Offers) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Offers) > 0 { - for _, msg := range m.Offers { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Event_Rescind) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Event_Rescind) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.OfferId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("offer_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.OfferId.Size())) - n9, err := m.OfferId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n9 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Event_Update) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Event_Update) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Status == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.Status.Size())) - n10, err := m.Status.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n10 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Event_Message) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Event_Message) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.SlaveId.Size())) - n11, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n11 - } - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.ExecutorId.Size())) - n12, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n12 - } - if m.Data == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } else { - data[i] = 0x1a - i++ - i = encodeVarintScheduler(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Event_Failure) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Event_Failure) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId != nil { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.SlaveId.Size())) - n13, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n13 - } - if m.ExecutorId != nil { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.ExecutorId.Size())) - n14, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n14 - } - if m.Status != nil { - data[i] = 0x18 - i++ - i = encodeVarintScheduler(data, i, uint64(*m.Status)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Event_Error) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Event_Error) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Message == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(len(*m.Message))) - i += copy(data[i:], *m.Message) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkId != nil { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.FrameworkId.Size())) - n15, err := m.FrameworkId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n15 - } - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x10 - i++ - i = encodeVarintScheduler(data, i, uint64(*m.Type)) - } - if m.Subscribe != nil { - data[i] = 0x1a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Subscribe.Size())) - n16, err := m.Subscribe.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n16 - } - if m.Accept != nil { - data[i] = 0x22 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Accept.Size())) - n17, err := m.Accept.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n17 - } - if m.Decline != nil { - data[i] = 0x2a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Decline.Size())) - n18, err := m.Decline.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n18 - } - if m.Kill != nil { - data[i] = 0x32 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Kill.Size())) - n19, err := m.Kill.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n19 - } - if m.Shutdown != nil { - data[i] = 0x3a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Shutdown.Size())) - n20, err := m.Shutdown.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n20 - } - if m.Acknowledge != nil { - data[i] = 0x42 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Acknowledge.Size())) - n21, err := m.Acknowledge.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n21 - } - if m.Reconcile != nil { - data[i] = 0x4a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Reconcile.Size())) - n22, err := m.Reconcile.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n22 - } - if m.Message != nil { - data[i] = 0x52 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Message.Size())) - n23, err := m.Message.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n23 - } - if m.Request != nil { - data[i] = 0x5a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Request.Size())) - n24, err := m.Request.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n24 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Subscribe) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Subscribe) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.FrameworkInfo == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_info") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.FrameworkInfo.Size())) - n25, err := m.FrameworkInfo.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n25 - } - if m.Force != nil { - data[i] = 0x10 - i++ - if *m.Force { - data[i] = 1 - } else { - data[i] = 0 - } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Accept) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Accept) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.OfferIds) > 0 { - for _, msg := range m.OfferIds { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if len(m.Operations) > 0 { - for _, msg := range m.Operations { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Filters != nil { - data[i] = 0x1a - i++ - i = encodeVarintScheduler(data, i, uint64(m.Filters.Size())) - n26, err := m.Filters.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n26 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Decline) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Decline) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.OfferIds) > 0 { - for _, msg := range m.OfferIds { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.Filters != nil { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.Filters.Size())) - n27, err := m.Filters.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n27 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Kill) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Kill) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.TaskId.Size())) - n28, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n28 - } - if m.SlaveId != nil { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.SlaveId.Size())) - n29, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n29 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Shutdown) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Shutdown) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.ExecutorId.Size())) - n30, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n30 - } - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.SlaveId.Size())) - n31, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n31 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Acknowledge) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Acknowledge) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.SlaveId.Size())) - n32, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n32 - } - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.TaskId.Size())) - n33, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n33 - } - if m.Uuid == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") - } else { - data[i] = 0x1a - i++ - i = encodeVarintScheduler(data, i, uint64(len(m.Uuid))) - i += copy(data[i:], m.Uuid) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Reconcile) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Reconcile) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Tasks) > 0 { - for _, msg := range m.Tasks { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Reconcile_Task) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Reconcile_Task) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.TaskId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.TaskId.Size())) - n34, err := m.TaskId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n34 - } - if m.SlaveId != nil { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.SlaveId.Size())) - n35, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n35 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Message) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Message) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.SlaveId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } else { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(m.SlaveId.Size())) - n36, err := m.SlaveId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n36 - } - if m.ExecutorId == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } else { - data[i] = 0x12 - i++ - i = encodeVarintScheduler(data, i, uint64(m.ExecutorId.Size())) - n37, err := m.ExecutorId.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n37 - } - if m.Data == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } else { - data[i] = 0x1a - i++ - i = encodeVarintScheduler(data, i, uint64(len(m.Data))) - i += copy(data[i:], m.Data) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Call_Request) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Call_Request) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Requests) > 0 { - for _, msg := range m.Requests { - data[i] = 0xa - i++ - i = encodeVarintScheduler(data, i, uint64(msg.Size())) - n, err := msg.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Scheduler(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Scheduler(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintScheduler(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedEvent(r randyScheduler, easy bool) *Event { - this := &Event{} - v1 := Event_Type([]int32{1, 2, 3, 4, 5, 6, 7, 8}[r.Intn(8)]) - this.Type = &v1 - if r.Intn(10) != 0 { - this.Subscribed = NewPopulatedEvent_Subscribed(r, easy) - } - if r.Intn(10) != 0 { - this.Offers = NewPopulatedEvent_Offers(r, easy) - } - if r.Intn(10) != 0 { - this.Rescind = NewPopulatedEvent_Rescind(r, easy) - } - if r.Intn(10) != 0 { - this.Update = NewPopulatedEvent_Update(r, easy) - } - if r.Intn(10) != 0 { - this.Message = NewPopulatedEvent_Message(r, easy) - } - if r.Intn(10) != 0 { - this.Failure = NewPopulatedEvent_Failure(r, easy) - } - if r.Intn(10) != 0 { - this.Error = NewPopulatedEvent_Error(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 9) - } - return this -} - -func NewPopulatedEvent_Subscribed(r randyScheduler, easy bool) *Event_Subscribed { - this := &Event_Subscribed{} - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - if r.Intn(10) != 0 { - v2 := float64(r.Float64()) - if r.Intn(2) == 0 { - v2 *= -1 - } - this.HeartbeatIntervalSeconds = &v2 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 3) - } - return this -} - -func NewPopulatedEvent_Offers(r randyScheduler, easy bool) *Event_Offers { - this := &Event_Offers{} - if r.Intn(10) != 0 { - v3 := r.Intn(10) - this.Offers = make([]*Offer, v3) - for i := 0; i < v3; i++ { - this.Offers[i] = NewPopulatedOffer(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 2) - } - return this -} - -func NewPopulatedEvent_Rescind(r randyScheduler, easy bool) *Event_Rescind { - this := &Event_Rescind{} - this.OfferId = NewPopulatedOfferID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 2) - } - return this -} - -func NewPopulatedEvent_Update(r randyScheduler, easy bool) *Event_Update { - this := &Event_Update{} - this.Status = NewPopulatedTaskStatus(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 2) - } - return this -} - -func NewPopulatedEvent_Message(r randyScheduler, easy bool) *Event_Message { - this := &Event_Message{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.ExecutorId = NewPopulatedExecutorID(r, easy) - v4 := r.Intn(100) - this.Data = make([]byte, v4) - for i := 0; i < v4; i++ { - this.Data[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 4) - } - return this -} - -func NewPopulatedEvent_Failure(r randyScheduler, easy bool) *Event_Failure { - this := &Event_Failure{} - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) - } - if r.Intn(10) != 0 { - this.ExecutorId = NewPopulatedExecutorID(r, easy) - } - if r.Intn(10) != 0 { - v5 := int32(r.Int31()) - if r.Intn(2) == 0 { - v5 *= -1 - } - this.Status = &v5 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 4) - } - return this -} - -func NewPopulatedEvent_Error(r randyScheduler, easy bool) *Event_Error { - this := &Event_Error{} - v6 := randStringScheduler(r) - this.Message = &v6 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 2) - } - return this -} - -func NewPopulatedCall(r randyScheduler, easy bool) *Call { - this := &Call{} - if r.Intn(10) != 0 { - this.FrameworkId = NewPopulatedFrameworkID(r, easy) - } - v7 := Call_Type([]int32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}[r.Intn(11)]) - this.Type = &v7 - if r.Intn(10) != 0 { - this.Subscribe = NewPopulatedCall_Subscribe(r, easy) - } - if r.Intn(10) != 0 { - this.Accept = NewPopulatedCall_Accept(r, easy) - } - if r.Intn(10) != 0 { - this.Decline = NewPopulatedCall_Decline(r, easy) - } - if r.Intn(10) != 0 { - this.Kill = NewPopulatedCall_Kill(r, easy) - } - if r.Intn(10) != 0 { - this.Shutdown = NewPopulatedCall_Shutdown(r, easy) - } - if r.Intn(10) != 0 { - this.Acknowledge = NewPopulatedCall_Acknowledge(r, easy) - } - if r.Intn(10) != 0 { - this.Reconcile = NewPopulatedCall_Reconcile(r, easy) - } - if r.Intn(10) != 0 { - this.Message = NewPopulatedCall_Message(r, easy) - } - if r.Intn(10) != 0 { - this.Request = NewPopulatedCall_Request(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 12) - } - return this -} - -func NewPopulatedCall_Subscribe(r randyScheduler, easy bool) *Call_Subscribe { - this := &Call_Subscribe{} - this.FrameworkInfo = NewPopulatedFrameworkInfo(r, easy) - if r.Intn(10) != 0 { - v8 := bool(bool(r.Intn(2) == 0)) - this.Force = &v8 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 3) - } - return this -} - -func NewPopulatedCall_Accept(r randyScheduler, easy bool) *Call_Accept { - this := &Call_Accept{} - if r.Intn(10) != 0 { - v9 := r.Intn(10) - this.OfferIds = make([]*OfferID, v9) - for i := 0; i < v9; i++ { - this.OfferIds[i] = NewPopulatedOfferID(r, easy) - } - } - if r.Intn(10) != 0 { - v10 := r.Intn(10) - this.Operations = make([]*Offer_Operation, v10) - for i := 0; i < v10; i++ { - this.Operations[i] = NewPopulatedOffer_Operation(r, easy) - } - } - if r.Intn(10) != 0 { - this.Filters = NewPopulatedFilters(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 4) - } - return this -} - -func NewPopulatedCall_Decline(r randyScheduler, easy bool) *Call_Decline { - this := &Call_Decline{} - if r.Intn(10) != 0 { - v11 := r.Intn(10) - this.OfferIds = make([]*OfferID, v11) - for i := 0; i < v11; i++ { - this.OfferIds[i] = NewPopulatedOfferID(r, easy) - } - } - if r.Intn(10) != 0 { - this.Filters = NewPopulatedFilters(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 3) - } - return this -} - -func NewPopulatedCall_Kill(r randyScheduler, easy bool) *Call_Kill { - this := &Call_Kill{} - this.TaskId = NewPopulatedTaskID(r, easy) - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 3) - } - return this -} - -func NewPopulatedCall_Shutdown(r randyScheduler, easy bool) *Call_Shutdown { - this := &Call_Shutdown{} - this.ExecutorId = NewPopulatedExecutorID(r, easy) - this.SlaveId = NewPopulatedSlaveID(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 3) - } - return this -} - -func NewPopulatedCall_Acknowledge(r randyScheduler, easy bool) *Call_Acknowledge { - this := &Call_Acknowledge{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.TaskId = NewPopulatedTaskID(r, easy) - v12 := r.Intn(100) - this.Uuid = make([]byte, v12) - for i := 0; i < v12; i++ { - this.Uuid[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 4) - } - return this -} - -func NewPopulatedCall_Reconcile(r randyScheduler, easy bool) *Call_Reconcile { - this := &Call_Reconcile{} - if r.Intn(10) != 0 { - v13 := r.Intn(10) - this.Tasks = make([]*Call_Reconcile_Task, v13) - for i := 0; i < v13; i++ { - this.Tasks[i] = NewPopulatedCall_Reconcile_Task(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 2) - } - return this -} - -func NewPopulatedCall_Reconcile_Task(r randyScheduler, easy bool) *Call_Reconcile_Task { - this := &Call_Reconcile_Task{} - this.TaskId = NewPopulatedTaskID(r, easy) - if r.Intn(10) != 0 { - this.SlaveId = NewPopulatedSlaveID(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 3) - } - return this -} - -func NewPopulatedCall_Message(r randyScheduler, easy bool) *Call_Message { - this := &Call_Message{} - this.SlaveId = NewPopulatedSlaveID(r, easy) - this.ExecutorId = NewPopulatedExecutorID(r, easy) - v14 := r.Intn(100) - this.Data = make([]byte, v14) - for i := 0; i < v14; i++ { - this.Data[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 4) - } - return this -} - -func NewPopulatedCall_Request(r randyScheduler, easy bool) *Call_Request { - this := &Call_Request{} - if r.Intn(10) != 0 { - v15 := r.Intn(10) - this.Requests = make([]*Request, v15) - for i := 0; i < v15; i++ { - this.Requests[i] = NewPopulatedRequest(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedScheduler(r, 2) - } - return this -} - -type randyScheduler interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneScheduler(r randyScheduler) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringScheduler(r randyScheduler) string { - v16 := r.Intn(100) - tmps := make([]rune, v16) - for i := 0; i < v16; i++ { - tmps[i] = randUTF8RuneScheduler(r) - } - return string(tmps) -} -func randUnrecognizedScheduler(r randyScheduler, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldScheduler(data, r, fieldNumber, wire) - } - return data -} -func randFieldScheduler(data []byte, r randyScheduler, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateScheduler(data, uint64(key)) - v17 := r.Int63() - if r.Intn(2) == 0 { - v17 *= -1 - } - data = encodeVarintPopulateScheduler(data, uint64(v17)) - case 1: - data = encodeVarintPopulateScheduler(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateScheduler(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateScheduler(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateScheduler(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateScheduler(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *Event) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovScheduler(uint64(*m.Type)) - } - if m.Subscribed != nil { - l = m.Subscribed.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Offers != nil { - l = m.Offers.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Rescind != nil { - l = m.Rescind.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Update != nil { - l = m.Update.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Message != nil { - l = m.Message.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Failure != nil { - l = m.Failure.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event_Subscribed) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.HeartbeatIntervalSeconds != nil { - n += 9 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event_Offers) Size() (n int) { - var l int - _ = l - if len(m.Offers) > 0 { - for _, e := range m.Offers { - l = e.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event_Rescind) Size() (n int) { - var l int - _ = l - if m.OfferId != nil { - l = m.OfferId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event_Update) Size() (n int) { - var l int - _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event_Message) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event_Failure) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Status != nil { - n += 1 + sovScheduler(uint64(*m.Status)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event_Error) Size() (n int) { - var l int - _ = l - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call) Size() (n int) { - var l int - _ = l - if m.FrameworkId != nil { - l = m.FrameworkId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Type != nil { - n += 1 + sovScheduler(uint64(*m.Type)) - } - if m.Subscribe != nil { - l = m.Subscribe.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Accept != nil { - l = m.Accept.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Decline != nil { - l = m.Decline.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Kill != nil { - l = m.Kill.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Shutdown != nil { - l = m.Shutdown.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Acknowledge != nil { - l = m.Acknowledge.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Reconcile != nil { - l = m.Reconcile.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Message != nil { - l = m.Message.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Request != nil { - l = m.Request.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Subscribe) Size() (n int) { - var l int - _ = l - if m.FrameworkInfo != nil { - l = m.FrameworkInfo.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Force != nil { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Accept) Size() (n int) { - var l int - _ = l - if len(m.OfferIds) > 0 { - for _, e := range m.OfferIds { - l = e.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - } - if len(m.Operations) > 0 { - for _, e := range m.Operations { - l = e.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - } - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Decline) Size() (n int) { - var l int - _ = l - if len(m.OfferIds) > 0 { - for _, e := range m.OfferIds { - l = e.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - } - if m.Filters != nil { - l = m.Filters.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Kill) Size() (n int) { - var l int - _ = l - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Shutdown) Size() (n int) { - var l int - _ = l - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Acknowledge) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Uuid != nil { - l = len(m.Uuid) - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Reconcile) Size() (n int) { - var l int - _ = l - if len(m.Tasks) > 0 { - for _, e := range m.Tasks { - l = e.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Reconcile_Task) Size() (n int) { - var l int - _ = l - if m.TaskId != nil { - l = m.TaskId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Message) Size() (n int) { - var l int - _ = l - if m.SlaveId != nil { - l = m.SlaveId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.ExecutorId != nil { - l = m.ExecutorId.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - if m.Data != nil { - l = len(m.Data) - n += 1 + l + sovScheduler(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Call_Request) Size() (n int) { - var l int - _ = l - if len(m.Requests) > 0 { - for _, e := range m.Requests { - l = e.Size() - n += 1 + l + sovScheduler(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovScheduler(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozScheduler(x uint64) (n int) { - return sovScheduler(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Event) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Event{`, - `Type:` + valueToStringScheduler(this.Type) + `,`, - `Subscribed:` + strings.Replace(fmt.Sprintf("%v", this.Subscribed), "Event_Subscribed", "Event_Subscribed", 1) + `,`, - `Offers:` + strings.Replace(fmt.Sprintf("%v", this.Offers), "Event_Offers", "Event_Offers", 1) + `,`, - `Rescind:` + strings.Replace(fmt.Sprintf("%v", this.Rescind), "Event_Rescind", "Event_Rescind", 1) + `,`, - `Update:` + strings.Replace(fmt.Sprintf("%v", this.Update), "Event_Update", "Event_Update", 1) + `,`, - `Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Event_Message", "Event_Message", 1) + `,`, - `Failure:` + strings.Replace(fmt.Sprintf("%v", this.Failure), "Event_Failure", "Event_Failure", 1) + `,`, - `Error:` + strings.Replace(fmt.Sprintf("%v", this.Error), "Event_Error", "Event_Error", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Event_Subscribed) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Event_Subscribed{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `HeartbeatIntervalSeconds:` + valueToStringScheduler(this.HeartbeatIntervalSeconds) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Event_Offers) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Event_Offers{`, - `Offers:` + strings.Replace(fmt.Sprintf("%v", this.Offers), "Offer", "Offer", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Event_Rescind) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Event_Rescind{`, - `OfferId:` + strings.Replace(fmt.Sprintf("%v", this.OfferId), "OfferID", "OfferID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Event_Update) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Event_Update{`, - `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "TaskStatus", "TaskStatus", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Event_Message) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Event_Message{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Data:` + valueToStringScheduler(this.Data) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Event_Failure) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Event_Failure{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Status:` + valueToStringScheduler(this.Status) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Event_Error) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Event_Error{`, - `Message:` + valueToStringScheduler(this.Message) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call{`, - `FrameworkId:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkId), "FrameworkID", "FrameworkID", 1) + `,`, - `Type:` + valueToStringScheduler(this.Type) + `,`, - `Subscribe:` + strings.Replace(fmt.Sprintf("%v", this.Subscribe), "Call_Subscribe", "Call_Subscribe", 1) + `,`, - `Accept:` + strings.Replace(fmt.Sprintf("%v", this.Accept), "Call_Accept", "Call_Accept", 1) + `,`, - `Decline:` + strings.Replace(fmt.Sprintf("%v", this.Decline), "Call_Decline", "Call_Decline", 1) + `,`, - `Kill:` + strings.Replace(fmt.Sprintf("%v", this.Kill), "Call_Kill", "Call_Kill", 1) + `,`, - `Shutdown:` + strings.Replace(fmt.Sprintf("%v", this.Shutdown), "Call_Shutdown", "Call_Shutdown", 1) + `,`, - `Acknowledge:` + strings.Replace(fmt.Sprintf("%v", this.Acknowledge), "Call_Acknowledge", "Call_Acknowledge", 1) + `,`, - `Reconcile:` + strings.Replace(fmt.Sprintf("%v", this.Reconcile), "Call_Reconcile", "Call_Reconcile", 1) + `,`, - `Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Call_Message", "Call_Message", 1) + `,`, - `Request:` + strings.Replace(fmt.Sprintf("%v", this.Request), "Call_Request", "Call_Request", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Subscribe) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Subscribe{`, - `FrameworkInfo:` + strings.Replace(fmt.Sprintf("%v", this.FrameworkInfo), "FrameworkInfo", "FrameworkInfo", 1) + `,`, - `Force:` + valueToStringScheduler(this.Force) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Accept) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Accept{`, - `OfferIds:` + strings.Replace(fmt.Sprintf("%v", this.OfferIds), "OfferID", "OfferID", 1) + `,`, - `Operations:` + strings.Replace(fmt.Sprintf("%v", this.Operations), "Offer_Operation", "Offer_Operation", 1) + `,`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "Filters", "Filters", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Decline) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Decline{`, - `OfferIds:` + strings.Replace(fmt.Sprintf("%v", this.OfferIds), "OfferID", "OfferID", 1) + `,`, - `Filters:` + strings.Replace(fmt.Sprintf("%v", this.Filters), "Filters", "Filters", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Kill) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Kill{`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Shutdown) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Shutdown{`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Acknowledge) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Acknowledge{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `Uuid:` + valueToStringScheduler(this.Uuid) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Reconcile) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Reconcile{`, - `Tasks:` + strings.Replace(fmt.Sprintf("%v", this.Tasks), "Call_Reconcile_Task", "Call_Reconcile_Task", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Reconcile_Task) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Reconcile_Task{`, - `TaskId:` + strings.Replace(fmt.Sprintf("%v", this.TaskId), "TaskID", "TaskID", 1) + `,`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Message) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Message{`, - `SlaveId:` + strings.Replace(fmt.Sprintf("%v", this.SlaveId), "SlaveID", "SlaveID", 1) + `,`, - `ExecutorId:` + strings.Replace(fmt.Sprintf("%v", this.ExecutorId), "ExecutorID", "ExecutorID", 1) + `,`, - `Data:` + valueToStringScheduler(this.Data) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Call_Request) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Call_Request{`, - `Requests:` + strings.Replace(fmt.Sprintf("%v", this.Requests), "Request", "Request", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringScheduler(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Event) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Event_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Event_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscribed", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Subscribed == nil { - m.Subscribed = &Event_Subscribed{} - } - if err := m.Subscribed.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Offers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Offers == nil { - m.Offers = &Event_Offers{} - } - if err := m.Offers.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rescind", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Rescind == nil { - m.Rescind = &Event_Rescind{} - } - if err := m.Rescind.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Update == nil { - m.Update = &Event_Update{} - } - if err := m.Update.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Message == nil { - m.Message = &Event_Message{} - } - if err := m.Message.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Failure == nil { - m.Failure = &Event_Failure{} - } - if err := m.Failure.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &Event_Error{} - } - if err := m.Error.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *Event_Subscribed) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field HeartbeatIntervalSeconds", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - iNdEx += 8 - v = uint64(data[iNdEx-8]) - v |= uint64(data[iNdEx-7]) << 8 - v |= uint64(data[iNdEx-6]) << 16 - v |= uint64(data[iNdEx-5]) << 24 - v |= uint64(data[iNdEx-4]) << 32 - v |= uint64(data[iNdEx-3]) << 40 - v |= uint64(data[iNdEx-2]) << 48 - v |= uint64(data[iNdEx-1]) << 56 - v2 := float64(math.Float64frombits(v)) - m.HeartbeatIntervalSeconds = &v2 - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_id") - } - - return nil -} -func (m *Event_Offers) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Offers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Offers = append(m.Offers, &Offer{}) - if err := m.Offers[len(m.Offers)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Event_Rescind) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.OfferId == nil { - m.OfferId = &OfferID{} - } - if err := m.OfferId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("offer_id") - } - - return nil -} -func (m *Event_Update) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &TaskStatus{} - } - if err := m.Status.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("status") - } - - return nil -} -func (m *Event_Message) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } - - return nil -} -func (m *Event_Failure) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Status = &v - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Event_Error) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") - } - - return nil -} -func (m *Call) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkId == nil { - m.FrameworkId = &FrameworkID{} - } - if err := m.FrameworkId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Call_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Call_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscribe", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Subscribe == nil { - m.Subscribe = &Call_Subscribe{} - } - if err := m.Subscribe.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accept", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Accept == nil { - m.Accept = &Call_Accept{} - } - if err := m.Accept.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Decline", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Decline == nil { - m.Decline = &Call_Decline{} - } - if err := m.Decline.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kill", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Kill == nil { - m.Kill = &Call_Kill{} - } - if err := m.Kill.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shutdown", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Shutdown == nil { - m.Shutdown = &Call_Shutdown{} - } - if err := m.Shutdown.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Acknowledge", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Acknowledge == nil { - m.Acknowledge = &Call_Acknowledge{} - } - if err := m.Acknowledge.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reconcile", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Reconcile == nil { - m.Reconcile = &Call_Reconcile{} - } - if err := m.Reconcile.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Message == nil { - m.Message = &Call_Message{} - } - if err := m.Message.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Request == nil { - m.Request = &Call_Request{} - } - if err := m.Request.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *Call_Subscribe) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FrameworkInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FrameworkInfo == nil { - m.FrameworkInfo = &FrameworkInfo{} - } - if err := m.FrameworkInfo.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.Force = &b - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("framework_info") - } - - return nil -} -func (m *Call_Accept) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OfferIds = append(m.OfferIds, &OfferID{}) - if err := m.OfferIds[len(m.OfferIds)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operations = append(m.Operations, &Offer_Operation{}) - if err := m.Operations[len(m.Operations)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &Filters{} - } - if err := m.Filters.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Call_Decline) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OfferIds", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OfferIds = append(m.OfferIds, &OfferID{}) - if err := m.OfferIds[len(m.OfferIds)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Filters == nil { - m.Filters = &Filters{} - } - if err := m.Filters.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Call_Kill) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - - return nil -} -func (m *Call_Shutdown) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - - return nil -} -func (m *Call_Acknowledge) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") - } - - return nil -} -func (m *Call_Reconcile) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tasks = append(m.Tasks, &Call_Reconcile_Task{}) - if err := m.Tasks[len(m.Tasks)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func (m *Call_Reconcile_Task) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TaskId == nil { - m.TaskId = &TaskID{} - } - if err := m.TaskId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("task_id") - } - - return nil -} -func (m *Call_Message) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlaveId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SlaveId == nil { - m.SlaveId = &SlaveID{} - } - if err := m.SlaveId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExecutorId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ExecutorId == nil { - m.ExecutorId = &ExecutorID{} - } - if err := m.ExecutorId.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("slave_id") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("executor_id") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("data") - } - - return nil -} -func (m *Call_Request) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthScheduler - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Requests = append(m.Requests, &Request{}) - if err := m.Requests[len(m.Requests)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipScheduler(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthScheduler - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - return nil -} -func skipScheduler(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthScheduler - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipScheduler(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthScheduler = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosproto/state.pb.go b/vendor/github.com/mesos/mesos-go/mesosproto/state.pb.go deleted file mode 100644 index db42a71b3..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosproto/state.pb.go +++ /dev/null @@ -1,1803 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: state.proto -// DO NOT EDIT! - -package mesosproto - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto" - -import bytes "bytes" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type Operation_Type int32 - -const ( - Operation_SNAPSHOT Operation_Type = 1 - Operation_DIFF Operation_Type = 3 - Operation_EXPUNGE Operation_Type = 2 -) - -var Operation_Type_name = map[int32]string{ - 1: "SNAPSHOT", - 3: "DIFF", - 2: "EXPUNGE", -} -var Operation_Type_value = map[string]int32{ - "SNAPSHOT": 1, - "DIFF": 3, - "EXPUNGE": 2, -} - -func (x Operation_Type) Enum() *Operation_Type { - p := new(Operation_Type) - *p = x - return p -} -func (x Operation_Type) String() string { - return proto.EnumName(Operation_Type_name, int32(x)) -} -func (x *Operation_Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Operation_Type_value, data, "Operation_Type") - if err != nil { - return err - } - *x = Operation_Type(value) - return nil -} - -// Describes a state entry, a versioned (via a UUID) key/value pair. -type Entry struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - Uuid []byte `protobuf:"bytes,2,req,name=uuid" json:"uuid,omitempty"` - Value []byte `protobuf:"bytes,3,req,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Entry) Reset() { *m = Entry{} } -func (*Entry) ProtoMessage() {} - -func (m *Entry) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Entry) GetUuid() []byte { - if m != nil { - return m.Uuid - } - return nil -} - -func (m *Entry) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -// Describes an operation used in the log storage implementation. -type Operation struct { - Type *Operation_Type `protobuf:"varint,1,req,name=type,enum=mesosproto.Operation_Type" json:"type,omitempty"` - Snapshot *Operation_Snapshot `protobuf:"bytes,2,opt,name=snapshot" json:"snapshot,omitempty"` - Diff *Operation_Diff `protobuf:"bytes,4,opt,name=diff" json:"diff,omitempty"` - Expunge *Operation_Expunge `protobuf:"bytes,3,opt,name=expunge" json:"expunge,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Operation) Reset() { *m = Operation{} } -func (*Operation) ProtoMessage() {} - -func (m *Operation) GetType() Operation_Type { - if m != nil && m.Type != nil { - return *m.Type - } - return Operation_SNAPSHOT -} - -func (m *Operation) GetSnapshot() *Operation_Snapshot { - if m != nil { - return m.Snapshot - } - return nil -} - -func (m *Operation) GetDiff() *Operation_Diff { - if m != nil { - return m.Diff - } - return nil -} - -func (m *Operation) GetExpunge() *Operation_Expunge { - if m != nil { - return m.Expunge - } - return nil -} - -// Describes a "snapshot" operation. -type Operation_Snapshot struct { - Entry *Entry `protobuf:"bytes,1,req,name=entry" json:"entry,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Operation_Snapshot) Reset() { *m = Operation_Snapshot{} } -func (*Operation_Snapshot) ProtoMessage() {} - -func (m *Operation_Snapshot) GetEntry() *Entry { - if m != nil { - return m.Entry - } - return nil -} - -// Describes a "diff" operation where the 'value' of the entry is -// just the diff itself, but the 'uuid' represents the UUID of the -// entry after applying this diff. -type Operation_Diff struct { - Entry *Entry `protobuf:"bytes,1,req,name=entry" json:"entry,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Operation_Diff) Reset() { *m = Operation_Diff{} } -func (*Operation_Diff) ProtoMessage() {} - -func (m *Operation_Diff) GetEntry() *Entry { - if m != nil { - return m.Entry - } - return nil -} - -// Describes an "expunge" operation. -type Operation_Expunge struct { - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Operation_Expunge) Reset() { *m = Operation_Expunge{} } -func (*Operation_Expunge) ProtoMessage() {} - -func (m *Operation_Expunge) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func init() { - proto.RegisterEnum("mesosproto.Operation_Type", Operation_Type_name, Operation_Type_value) -} -func (this *Entry) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Entry) - if !ok { - return fmt.Errorf("that is not of type *Entry") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Entry but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Entrybut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return fmt.Errorf("Uuid this(%v) Not Equal that(%v)", this.Uuid, that1.Uuid) - } - if !bytes.Equal(this.Value, that1.Value) { - return fmt.Errorf("Value this(%v) Not Equal that(%v)", this.Value, that1.Value) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Entry) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Entry) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !bytes.Equal(this.Uuid, that1.Uuid) { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Operation) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Operation) - if !ok { - return fmt.Errorf("that is not of type *Operation") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Operation but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Operationbut is not nil && this == nil") - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", *this.Type, *that1.Type) - } - } else if this.Type != nil { - return fmt.Errorf("this.Type == nil && that.Type != nil") - } else if that1.Type != nil { - return fmt.Errorf("Type this(%v) Not Equal that(%v)", this.Type, that1.Type) - } - if !this.Snapshot.Equal(that1.Snapshot) { - return fmt.Errorf("Snapshot this(%v) Not Equal that(%v)", this.Snapshot, that1.Snapshot) - } - if !this.Diff.Equal(that1.Diff) { - return fmt.Errorf("Diff this(%v) Not Equal that(%v)", this.Diff, that1.Diff) - } - if !this.Expunge.Equal(that1.Expunge) { - return fmt.Errorf("Expunge this(%v) Not Equal that(%v)", this.Expunge, that1.Expunge) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Operation) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Operation) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Type != nil && that1.Type != nil { - if *this.Type != *that1.Type { - return false - } - } else if this.Type != nil { - return false - } else if that1.Type != nil { - return false - } - if !this.Snapshot.Equal(that1.Snapshot) { - return false - } - if !this.Diff.Equal(that1.Diff) { - return false - } - if !this.Expunge.Equal(that1.Expunge) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Operation_Snapshot) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Operation_Snapshot) - if !ok { - return fmt.Errorf("that is not of type *Operation_Snapshot") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Operation_Snapshot but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Operation_Snapshotbut is not nil && this == nil") - } - if !this.Entry.Equal(that1.Entry) { - return fmt.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Operation_Snapshot) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Operation_Snapshot) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Entry.Equal(that1.Entry) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Operation_Diff) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Operation_Diff) - if !ok { - return fmt.Errorf("that is not of type *Operation_Diff") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Operation_Diff but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Operation_Diffbut is not nil && this == nil") - } - if !this.Entry.Equal(that1.Entry) { - return fmt.Errorf("Entry this(%v) Not Equal that(%v)", this.Entry, that1.Entry) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Operation_Diff) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Operation_Diff) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if !this.Entry.Equal(that1.Entry) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Operation_Expunge) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*Operation_Expunge) - if !ok { - return fmt.Errorf("that is not of type *Operation_Expunge") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt.Errorf("that is type *Operation_Expunge but is nil && this != nil") - } else if this == nil { - return fmt.Errorf("that is type *Operation_Expungebut is not nil && this == nil") - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", *this.Name, *that1.Name) - } - } else if this.Name != nil { - return fmt.Errorf("this.Name == nil && that.Name != nil") - } else if that1.Name != nil { - return fmt.Errorf("Name this(%v) Not Equal that(%v)", this.Name, that1.Name) - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *Operation_Expunge) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Operation_Expunge) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Name != nil && that1.Name != nil { - if *this.Name != *that1.Name { - return false - } - } else if this.Name != nil { - return false - } else if that1.Name != nil { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Entry) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&mesosproto.Entry{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringState(this.Name, "string")+",\n") - } - if this.Uuid != nil { - s = append(s, "Uuid: "+valueToGoStringState(this.Uuid, "byte")+",\n") - } - if this.Value != nil { - s = append(s, "Value: "+valueToGoStringState(this.Value, "byte")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Operation) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&mesosproto.Operation{") - if this.Type != nil { - s = append(s, "Type: "+valueToGoStringState(this.Type, "mesosproto.Operation_Type")+",\n") - } - if this.Snapshot != nil { - s = append(s, "Snapshot: "+fmt.Sprintf("%#v", this.Snapshot)+",\n") - } - if this.Diff != nil { - s = append(s, "Diff: "+fmt.Sprintf("%#v", this.Diff)+",\n") - } - if this.Expunge != nil { - s = append(s, "Expunge: "+fmt.Sprintf("%#v", this.Expunge)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Operation_Snapshot) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Operation_Snapshot{") - if this.Entry != nil { - s = append(s, "Entry: "+fmt.Sprintf("%#v", this.Entry)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Operation_Diff) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Operation_Diff{") - if this.Entry != nil { - s = append(s, "Entry: "+fmt.Sprintf("%#v", this.Entry)+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Operation_Expunge) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&mesosproto.Operation_Expunge{") - if this.Name != nil { - s = append(s, "Name: "+valueToGoStringState(this.Name, "string")+",\n") - } - if this.XXX_unrecognized != nil { - s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringState(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringState(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *Entry) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Entry) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintState(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.Uuid == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") - } else { - data[i] = 0x12 - i++ - i = encodeVarintState(data, i, uint64(len(m.Uuid))) - i += copy(data[i:], m.Uuid) - } - if m.Value == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } else { - data[i] = 0x1a - i++ - i = encodeVarintState(data, i, uint64(len(m.Value))) - i += copy(data[i:], m.Value) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Operation) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Operation) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Type == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } else { - data[i] = 0x8 - i++ - i = encodeVarintState(data, i, uint64(*m.Type)) - } - if m.Snapshot != nil { - data[i] = 0x12 - i++ - i = encodeVarintState(data, i, uint64(m.Snapshot.Size())) - n1, err := m.Snapshot.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if m.Expunge != nil { - data[i] = 0x1a - i++ - i = encodeVarintState(data, i, uint64(m.Expunge.Size())) - n2, err := m.Expunge.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n2 - } - if m.Diff != nil { - data[i] = 0x22 - i++ - i = encodeVarintState(data, i, uint64(m.Diff.Size())) - n3, err := m.Diff.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n3 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Operation_Snapshot) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Operation_Snapshot) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Entry == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") - } else { - data[i] = 0xa - i++ - i = encodeVarintState(data, i, uint64(m.Entry.Size())) - n4, err := m.Entry.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n4 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Operation_Diff) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Operation_Diff) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Entry == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") - } else { - data[i] = 0xa - i++ - i = encodeVarintState(data, i, uint64(m.Entry.Size())) - n5, err := m.Entry.MarshalTo(data[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *Operation_Expunge) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Operation_Expunge) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - data[i] = 0xa - i++ - i = encodeVarintState(data, i, uint64(len(*m.Name))) - i += copy(data[i:], *m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64State(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32State(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintState(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func NewPopulatedEntry(r randyState, easy bool) *Entry { - this := &Entry{} - v1 := randStringState(r) - this.Name = &v1 - v2 := r.Intn(100) - this.Uuid = make([]byte, v2) - for i := 0; i < v2; i++ { - this.Uuid[i] = byte(r.Intn(256)) - } - v3 := r.Intn(100) - this.Value = make([]byte, v3) - for i := 0; i < v3; i++ { - this.Value[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 4) - } - return this -} - -func NewPopulatedOperation(r randyState, easy bool) *Operation { - this := &Operation{} - v4 := Operation_Type([]int32{1, 3, 2}[r.Intn(3)]) - this.Type = &v4 - if r.Intn(10) != 0 { - this.Snapshot = NewPopulatedOperation_Snapshot(r, easy) - } - if r.Intn(10) != 0 { - this.Expunge = NewPopulatedOperation_Expunge(r, easy) - } - if r.Intn(10) != 0 { - this.Diff = NewPopulatedOperation_Diff(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 5) - } - return this -} - -func NewPopulatedOperation_Snapshot(r randyState, easy bool) *Operation_Snapshot { - this := &Operation_Snapshot{} - this.Entry = NewPopulatedEntry(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) - } - return this -} - -func NewPopulatedOperation_Diff(r randyState, easy bool) *Operation_Diff { - this := &Operation_Diff{} - this.Entry = NewPopulatedEntry(r, easy) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) - } - return this -} - -func NewPopulatedOperation_Expunge(r randyState, easy bool) *Operation_Expunge { - this := &Operation_Expunge{} - v5 := randStringState(r) - this.Name = &v5 - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedState(r, 2) - } - return this -} - -type randyState interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneState(r randyState) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringState(r randyState) string { - v6 := r.Intn(100) - tmps := make([]rune, v6) - for i := 0; i < v6; i++ { - tmps[i] = randUTF8RuneState(r) - } - return string(tmps) -} -func randUnrecognizedState(r randyState, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldState(data, r, fieldNumber, wire) - } - return data -} -func randFieldState(data []byte, r randyState, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateState(data, uint64(key)) - v7 := r.Int63() - if r.Intn(2) == 0 { - v7 *= -1 - } - data = encodeVarintPopulateState(data, uint64(v7)) - case 1: - data = encodeVarintPopulateState(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateState(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateState(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateState(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateState(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *Entry) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovState(uint64(l)) - } - if m.Uuid != nil { - l = len(m.Uuid) - n += 1 + l + sovState(uint64(l)) - } - if m.Value != nil { - l = len(m.Value) - n += 1 + l + sovState(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation) Size() (n int) { - var l int - _ = l - if m.Type != nil { - n += 1 + sovState(uint64(*m.Type)) - } - if m.Snapshot != nil { - l = m.Snapshot.Size() - n += 1 + l + sovState(uint64(l)) - } - if m.Expunge != nil { - l = m.Expunge.Size() - n += 1 + l + sovState(uint64(l)) - } - if m.Diff != nil { - l = m.Diff.Size() - n += 1 + l + sovState(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Snapshot) Size() (n int) { - var l int - _ = l - if m.Entry != nil { - l = m.Entry.Size() - n += 1 + l + sovState(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Diff) Size() (n int) { - var l int - _ = l - if m.Entry != nil { - l = m.Entry.Size() - n += 1 + l + sovState(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation_Expunge) Size() (n int) { - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovState(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovState(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozState(x uint64) (n int) { - return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Entry) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Entry{`, - `Name:` + valueToStringState(this.Name) + `,`, - `Uuid:` + valueToStringState(this.Uuid) + `,`, - `Value:` + valueToStringState(this.Value) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Operation{`, - `Type:` + valueToStringState(this.Type) + `,`, - `Snapshot:` + strings.Replace(fmt.Sprintf("%v", this.Snapshot), "Operation_Snapshot", "Operation_Snapshot", 1) + `,`, - `Expunge:` + strings.Replace(fmt.Sprintf("%v", this.Expunge), "Operation_Expunge", "Operation_Expunge", 1) + `,`, - `Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Operation_Diff", "Operation_Diff", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation_Snapshot) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Operation_Snapshot{`, - `Entry:` + strings.Replace(fmt.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation_Diff) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Operation_Diff{`, - `Entry:` + strings.Replace(fmt.Sprintf("%v", this.Entry), "Entry", "Entry", 1) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *Operation_Expunge) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Operation_Expunge{`, - `Name:` + valueToStringState(this.Name) + `,`, - `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringState(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Entry) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uuid = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append([]byte{}, data[iNdEx:postIndex]...) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipState(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("uuid") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") - } - - return nil -} -func (m *Operation) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var v Operation_Type - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (Operation_Type(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Type = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Snapshot == nil { - m.Snapshot = &Operation_Snapshot{} - } - if err := m.Snapshot.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Expunge", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Expunge == nil { - m.Expunge = &Operation_Expunge{} - } - if err := m.Expunge.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Diff", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Diff == nil { - m.Diff = &Operation_Diff{} - } - if err := m.Diff.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipState(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("type") - } - - return nil -} -func (m *Operation_Snapshot) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Entry == nil { - m.Entry = &Entry{} - } - if err := m.Entry.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipState(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") - } - - return nil -} -func (m *Operation_Diff) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Entry == nil { - m.Entry = &Entry{} - } - if err := m.Entry.Unmarshal(data[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipState(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("entry") - } - - return nil -} -func (m *Operation_Expunge) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - iNdEx -= sizeOfWire - skippy, err := skipState(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthState - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - - return nil -} -func skipState(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthState - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipState(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") -) diff --git a/vendor/github.com/mesos/mesos-go/mesosutil/constants.go b/vendor/github.com/mesos/mesos-go/mesosutil/constants.go deleted file mode 100644 index a1a3085f8..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosutil/constants.go +++ /dev/null @@ -1,6 +0,0 @@ -package mesosutil - -const ( - // MesosVersion indicates the supported mesos version. - MesosVersion = "0.24.0" -) diff --git a/vendor/github.com/mesos/mesos-go/mesosutil/mesosprotoutil.go b/vendor/github.com/mesos/mesos-go/mesosutil/mesosprotoutil.go deleted file mode 100644 index 5fafaaae2..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosutil/mesosprotoutil.go +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mesosutil - -import ( - "github.com/gogo/protobuf/proto" - mesos "github.com/mesos/mesos-go/mesosproto" -) - -func NewValueRange(begin, end uint64) *mesos.Value_Range { - return &mesos.Value_Range{Begin: proto.Uint64(begin), End: proto.Uint64(end)} -} - -func FilterResources(resources []*mesos.Resource, filter func(*mesos.Resource) bool) (result []*mesos.Resource) { - for _, resource := range resources { - if filter(resource) { - result = append(result, resource) - } - } - return result -} - -func NewScalarResource(name string, val float64) *mesos.Resource { - return &mesos.Resource{ - Name: proto.String(name), - Type: mesos.Value_SCALAR.Enum(), - Scalar: &mesos.Value_Scalar{Value: proto.Float64(val)}, - } -} - -func NewRangesResource(name string, ranges []*mesos.Value_Range) *mesos.Resource { - return &mesos.Resource{ - Name: proto.String(name), - Type: mesos.Value_RANGES.Enum(), - Ranges: &mesos.Value_Ranges{Range: ranges}, - } -} - -func NewSetResource(name string, items []string) *mesos.Resource { - return &mesos.Resource{ - Name: proto.String(name), - Type: mesos.Value_SET.Enum(), - Set: &mesos.Value_Set{Item: items}, - } - -} - -func NewFrameworkID(id string) *mesos.FrameworkID { - return &mesos.FrameworkID{Value: proto.String(id)} -} - -func NewFrameworkInfo(user, name string, frameworkId *mesos.FrameworkID) *mesos.FrameworkInfo { - return &mesos.FrameworkInfo{ - User: proto.String(user), - Name: proto.String(name), - Id: frameworkId, - } -} - -func NewMasterInfo(id string, ip, port uint32) *mesos.MasterInfo { - return &mesos.MasterInfo{ - Id: proto.String(id), - Ip: proto.Uint32(ip), - Port: proto.Uint32(port), - } -} - -func NewOfferID(id string) *mesos.OfferID { - return &mesos.OfferID{Value: proto.String(id)} -} - -func NewOffer(offerId *mesos.OfferID, frameworkId *mesos.FrameworkID, slaveId *mesos.SlaveID, hostname string) *mesos.Offer { - return &mesos.Offer{ - Id: offerId, - FrameworkId: frameworkId, - SlaveId: slaveId, - Hostname: proto.String(hostname), - } -} - -func FilterOffersResources(offers []*mesos.Offer, filter func(*mesos.Resource) bool) (result []*mesos.Resource) { - for _, offer := range offers { - result = FilterResources(offer.Resources, filter) - } - return result -} - -func NewSlaveID(id string) *mesos.SlaveID { - return &mesos.SlaveID{Value: proto.String(id)} -} - -func NewTaskID(id string) *mesos.TaskID { - return &mesos.TaskID{Value: proto.String(id)} -} - -func NewTaskInfo( - name string, - taskId *mesos.TaskID, - slaveId *mesos.SlaveID, - resources []*mesos.Resource, -) *mesos.TaskInfo { - return &mesos.TaskInfo{ - Name: proto.String(name), - TaskId: taskId, - SlaveId: slaveId, - Resources: resources, - } -} - -func NewTaskStatus(taskId *mesos.TaskID, state mesos.TaskState) *mesos.TaskStatus { - return &mesos.TaskStatus{ - TaskId: taskId, - State: mesos.TaskState(state).Enum(), - } -} - -func NewStatusUpdate(frameworkId *mesos.FrameworkID, taskStatus *mesos.TaskStatus, timestamp float64, uuid []byte) *mesos.StatusUpdate { - return &mesos.StatusUpdate{ - FrameworkId: frameworkId, - Status: taskStatus, - Timestamp: proto.Float64(timestamp), - Uuid: uuid, - } -} - -func NewCommandInfo(command string) *mesos.CommandInfo { - return &mesos.CommandInfo{Value: proto.String(command)} -} - -func NewExecutorID(id string) *mesos.ExecutorID { - return &mesos.ExecutorID{Value: proto.String(id)} -} - -func NewExecutorInfo(execId *mesos.ExecutorID, command *mesos.CommandInfo) *mesos.ExecutorInfo { - return &mesos.ExecutorInfo{ - ExecutorId: execId, - Command: command, - } -} diff --git a/vendor/github.com/mesos/mesos-go/mesosutil/node.go b/vendor/github.com/mesos/mesos-go/mesosutil/node.go deleted file mode 100644 index ac17d47e4..000000000 --- a/vendor/github.com/mesos/mesos-go/mesosutil/node.go +++ /dev/null @@ -1,23 +0,0 @@ -package mesosutil - -import ( - "os/exec" - "strings" - - log "github.com/golang/glog" -) - -//TODO(jdef) copied from kubernetes/pkg/util/node.go -func GetHostname(hostnameOverride string) string { - hostname := []byte(hostnameOverride) - if string(hostname) == "" { - // Note: We use exec here instead of os.Hostname() because we - // want the FQDN, and this is the easiest way to get it. - fqdn, err := exec.Command("hostname", "-f").Output() - if err != nil { - log.Fatalf("Couldn't determine hostname: %v", err) - } - hostname = fqdn - } - return strings.TrimSpace(string(hostname)) -} diff --git a/vendor/github.com/mesos/mesos-go/upid/doc.go b/vendor/github.com/mesos/mesos-go/upid/doc.go deleted file mode 100644 index d3538c0f7..000000000 --- a/vendor/github.com/mesos/mesos-go/upid/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -/* -Package upid defines the UPID type and some utilities of the UPID. -*/ -package upid diff --git a/vendor/github.com/mesos/mesos-go/upid/upid.go b/vendor/github.com/mesos/mesos-go/upid/upid.go deleted file mode 100644 index 74f9ebbd8..000000000 --- a/vendor/github.com/mesos/mesos-go/upid/upid.go +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package upid - -import ( - "fmt" - "net" - "strings" -) - -// UPID is a equivalent of the UPID in libprocess. -type UPID struct { - ID string - Host string - Port string -} - -// Parse parses the UPID from the input string. -func Parse(input string) (*UPID, error) { - upid := new(UPID) - - splits := strings.Split(input, "@") - if len(splits) != 2 { - return nil, fmt.Errorf("Expect one `@' in the input") - } - upid.ID = splits[0] - - if _, err := net.ResolveTCPAddr("tcp4", splits[1]); err != nil { - return nil, err - } - upid.Host, upid.Port, _ = net.SplitHostPort(splits[1]) - return upid, nil -} - -// String returns the string representation. -func (u UPID) String() string { - return fmt.Sprintf("%s@%s:%s", u.ID, u.Host, u.Port) -} - -// Equal returns true if two upid is equal -func (u *UPID) Equal(upid *UPID) bool { - if u == nil { - return upid == nil - } else { - return upid != nil && u.ID == upid.ID && u.Host == upid.Host && u.Port == upid.Port - } -} diff --git a/vendor/github.com/mesosphere/mesos-dns/LICENSE b/vendor/github.com/mesosphere/mesos-dns/LICENSE deleted file mode 100644 index 8e10c3ab4..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright 2015 Mesosphere - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/vendor/github.com/mesosphere/mesos-dns/detect/masters.go b/vendor/github.com/mesosphere/mesos-dns/detect/masters.go deleted file mode 100644 index 6363e5c05..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/detect/masters.go +++ /dev/null @@ -1,115 +0,0 @@ -package detect - -import ( - "encoding/binary" - "net" - "strconv" - "unsafe" - - "github.com/mesos/mesos-go/detector" - mesos "github.com/mesos/mesos-go/mesosproto" - - "github.com/mesosphere/mesos-dns/logging" -) - -var ( - _ detector.MasterChanged = (*Masters)(nil) - _ detector.AllMasters = (*Masters)(nil) -) - -// Masters detects changes of leader and/or master elections -// and sends these changes to a channel. -type Masters struct { - // current masters list, - // 1st item represents the leader, - // the rest remaining masters - masters []string - - // the channel leader/master changes are being sent to - changed chan<- []string -} - -// NewMasters returns a new Masters detector with the given initial masters -// and the given changed channel to which master changes will be sent to. -// Initially the leader is unknown which is represented by -// setting the first item of the sent masters slice to be empty. -func NewMasters(masters []string, changed chan<- []string) *Masters { - return &Masters{ - masters: append([]string{""}, masters...), - changed: changed, - } -} - -// OnMasterChanged sets the given MasterInfo as the current leader -// leaving the remaining masters unchanged and emits the current masters state. -// It implements the detector.MasterChanged interface. -func (ms *Masters) OnMasterChanged(leader *mesos.MasterInfo) { - logging.VeryVerbose.Println("Updated leader: ", leader) - ms.masters = ordered(masterAddr(leader), ms.masters[1:]) - emit(ms.changed, ms.masters) -} - -// UpdatedMasters sets the given slice of MasterInfo as the current remaining masters -// leaving the current leader unchanged and emits the current masters state. -// It implements the detector.AllMasters interface. -func (ms *Masters) UpdatedMasters(infos []*mesos.MasterInfo) { - logging.VeryVerbose.Println("Updated masters: ", infos) - masters := make([]string, 0, len(infos)) - for _, info := range infos { - if addr := masterAddr(info); addr != "" { - masters = append(masters, addr) - } - } - ms.masters = ordered(ms.masters[0], masters) - emit(ms.changed, ms.masters) -} - -func emit(ch chan<- []string, s []string) { - ch <- append(make([]string, 0, len(s)), s...) -} - -// ordered returns a slice of masters with the given leader in the first position -func ordered(leader string, masters []string) []string { - ms := append(make([]string, 0, len(masters)+1), leader) - for _, m := range masters { - if m != leader { - ms = append(ms, m) - } - } - return ms -} - -// masterAddr returns an address (ip:port) from the given *mesos.MasterInfo or -// an empty string if it nil. -// -// BUG(tsenart): The byte order of the `ip` field in MasterInfo is platform -// dependent. We assume that Mesos is compiled with the same architecture as -// Mesos-DNS and hence same byte order. If this isn't the case, the address -// returned will be wrong. This only affects Mesos versions < 0.24.0 -func masterAddr(info *mesos.MasterInfo) string { - if info == nil { - return "" - } - ip, port := "", int64(0) - if addr := info.GetAddress(); addr != nil { // Mesos >= 0.24.0 - ip, port = addr.GetIp(), int64(addr.GetPort()) - } else { // Mesos < 0.24.0 - ipv4 := make([]byte, net.IPv4len) - byteOrder.PutUint32(ipv4, info.GetIp()) - ip, port = net.IP(ipv4).String(), int64(info.GetPort()) - } - return net.JoinHostPort(ip, strconv.FormatInt(port, 10)) -} - -// byteOrder is instantiated at package initialization time to the -// binary.ByteOrder of the running process. -// https://groups.google.com/d/msg/golang-nuts/zmh64YkqOV8/iJe-TrTTeREJ -var byteOrder = func() binary.ByteOrder { - switch x := uint32(0x01020304); *(*byte)(unsafe.Pointer(&x)) { - case 0x01: - return binary.BigEndian - case 0x04: - return binary.LittleEndian - } - panic("unknown byte order") -}() diff --git a/vendor/github.com/mesosphere/mesos-dns/errorutil/errorutil.go b/vendor/github.com/mesosphere/mesos-dns/errorutil/errorutil.go deleted file mode 100644 index 13202075f..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/errorutil/errorutil.go +++ /dev/null @@ -1,12 +0,0 @@ -package errorutil - -// ErrorFunction A function definition that returns an error -// to be passed to the Ignore or Panic error handler -type ErrorFunction func() error - -// Ignore Calls an ErrorFunction, and ignores the result. -// This allows us to be more explicit when there is no error -// handling to be done, for example in defers -func Ignore(f ErrorFunction) { - _ = f() -} diff --git a/vendor/github.com/mesosphere/mesos-dns/logging/logging.go b/vendor/github.com/mesosphere/mesos-dns/logging/logging.go deleted file mode 100644 index 0abd8f070..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/logging/logging.go +++ /dev/null @@ -1,104 +0,0 @@ -package logging - -import ( - "io/ioutil" - "log" - "os" - "strconv" - "sync/atomic" - - "github.com/golang/glog" -) - -var ( - // VerboseFlag enables verbose logging if set to true. - VerboseFlag bool - // VeryVerboseFlag enables very verbose logging if set to true. - VeryVerboseFlag bool - // Verbose is this package's verbose Logger. - Verbose *log.Logger - // VeryVerbose is this package's very verbose Logger. - VeryVerbose *log.Logger - // Error is this package's error Logger. - Error *log.Logger -) - -// Counter defines an interface for a monotonically incrementing value. -type Counter interface { - Inc() -} - -// LogCounter implements the Counter interface with a uint64 register. -// It's safe for concurrent use. -type LogCounter struct { - value uint64 -} - -// Inc increments the counter by one. -func (lc *LogCounter) Inc() { - atomic.AddUint64(&lc.value, 1) -} - -// String returns a string represention of the counter. -func (lc *LogCounter) String() string { - return strconv.FormatUint(atomic.LoadUint64(&lc.value), 10) -} - -// LogOut holds metrics captured in an instrumented runtime. -type LogOut struct { - MesosRequests Counter - MesosSuccess Counter - MesosNXDomain Counter - MesosFailed Counter - NonMesosRequests Counter - NonMesosSuccess Counter - NonMesosNXDomain Counter - NonMesosFailed Counter - NonMesosForwarded Counter -} - -// CurLog is the default package level LogOut. -var CurLog = LogOut{ - MesosRequests: &LogCounter{}, - MesosSuccess: &LogCounter{}, - MesosNXDomain: &LogCounter{}, - MesosFailed: &LogCounter{}, - NonMesosRequests: &LogCounter{}, - NonMesosSuccess: &LogCounter{}, - NonMesosNXDomain: &LogCounter{}, - NonMesosFailed: &LogCounter{}, - NonMesosForwarded: &LogCounter{}, -} - -// PrintCurLog prints out the current LogOut and then resets -func PrintCurLog() { - VeryVerbose.Printf("%+v\n", CurLog) -} - -// SetupLogs provides the following logs -// Verbose = optional verbosity -// VeryVerbose = optional verbosity -// Error = stderr -func SetupLogs() { - // initialize logging flags - if glog.V(2) { - VeryVerboseFlag = true - } else if glog.V(1) { - VerboseFlag = true - } - - logopts := log.Ldate | log.Ltime | log.Lshortfile - - if VerboseFlag { - Verbose = log.New(os.Stdout, "VERBOSE: ", logopts) - VeryVerbose = log.New(ioutil.Discard, "VERY VERBOSE: ", logopts) - } else if VeryVerboseFlag { - Verbose = log.New(os.Stdout, "VERY VERBOSE: ", logopts) - VeryVerbose = Verbose - } else { - Verbose = log.New(ioutil.Discard, "VERBOSE: ", logopts) - VeryVerbose = log.New(ioutil.Discard, "VERY VERBOSE: ", logopts) - } - - Error = log.New(os.Stderr, "ERROR: ", logopts) -} diff --git a/vendor/github.com/mesosphere/mesos-dns/models/models.go b/vendor/github.com/mesosphere/mesos-dns/models/models.go deleted file mode 100644 index e0c2a65b5..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/models/models.go +++ /dev/null @@ -1,26 +0,0 @@ -package models - -// AXFRResourceRecordSet is a representation of record name -> string -type AXFRResourceRecordSet map[string][]string - -// Even though it would be nice to have the model map to something better than a string -// (a la an actual SRV, or A struct). -// This is the internal structure of how mesos-dns works today and the transformation of string -> DNS Struct -// happens on actual query time. Why this logic happens at query time? Who knows. - -// AXFRRecords are the As, and SRVs that actually make up the Mesos-DNS zone -type AXFRRecords struct { - As AXFRResourceRecordSet - SRVs AXFRResourceRecordSet -} - -// AXFR is a rough representation of a "transfer" of the Mesos-DNS data -type AXFR struct { - TTL int32 // DNS TTL according to config - Serial uint32 // Current DNS zone version / serial number - RefreshSeconds int // How often we try to poll Mesos for updates -- minimum downstream poll interval - Mname string // primary name server - Rname string // email of admin esponsible - Domain string // Domain: name of the domain used (default "mesos", ie .mesos domain) - Records AXFRRecords -} diff --git a/vendor/github.com/mesosphere/mesos-dns/records/chains.go b/vendor/github.com/mesosphere/mesos-dns/records/chains.go deleted file mode 100644 index 279acb39f..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/records/chains.go +++ /dev/null @@ -1,80 +0,0 @@ -package records - -import ( - "github.com/mesosphere/mesos-dns/records/labels" -) - -// chain is a generation func that consumes record-like strings and does -// something with them -type chain func(...string) - -const ( - protocolNone = "" // for readability - domainNone = "" // for readability -) - -// withProtocol appends `._{protocol}.{framework}` to records. if protocol is "" then -// the protocols "tcp" and "udp" are assumed. -func withProtocol(protocol, framework string, spec labels.Func, gen chain) chain { - return func(records ...string) { - protocol = spec(protocol) - if protocol != protocolNone { - for i := range records { - records[i] += "._" + protocol + "." + framework - } - } else { - records = append(records, records...) - for i, j := 0, len(records)/2; j < len(records); { - records[i] += "._tcp." + framework - records[j] += "._udp." + framework - i++ - j++ - } - } - gen(records...) - } -} - -// withSubdomains appends `.{subdomain}` (for each subdomain spec'd) to records. -// the empty subdomain "" indicates to generate records w/o a subdomain fragment. -func withSubdomains(subdomains []string, gen chain) chain { - if len(subdomains) == 0 { - return gen - } - return func(records ...string) { - var ( - recordLen = len(records) - tmp = make([]string, recordLen*len(subdomains)) - offset = 0 - ) - for s := range subdomains { - if subdomains[s] == domainNone { - copy(tmp[offset:], records) - } else { - for i := range records { - tmp[offset+i] = records[i] + "." + subdomains[s] - } - } - offset += recordLen - } - gen(tmp...) - } -} - -// withNamedPort prepends a `_{discoveryInfo port name}.` to records -func withNamedPort(portName string, spec labels.Func, gen chain) chain { - portName = spec(portName) - if portName == "" { - return gen - } - return func(records ...string) { - // generate without port-name prefix - gen(records...) - - // generate with port-name prefix - for i := range records { - records[i] = "_" + portName + "." + records[i] - } - gen(records...) - } -} diff --git a/vendor/github.com/mesosphere/mesos-dns/records/config.go b/vendor/github.com/mesosphere/mesos-dns/records/config.go deleted file mode 100644 index 2973147be..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/records/config.go +++ /dev/null @@ -1,261 +0,0 @@ -package records - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net" - "os" - "path/filepath" - "strings" - "time" - - "github.com/mesosphere/mesos-dns/logging" - "github.com/miekg/dns" -) - -// Config holds mesos dns configuration -type Config struct { - // Refresh frequency: the frequency in seconds of regenerating records (default 60) - RefreshSeconds int - // Resolver port: port used to listen for slave requests (default 53) - Port int - // Timeout is the default connect/read/write timeout for outbound - // queries - Timeout int - // Timeout in seconds waiting for the master to return data from StateJson - StateTimeoutSeconds int - // Zookeeper Detection Timeout: how long in seconds to wait for Zookeeper to - // be initially responsive. Default is 30 and 0 means no timeout. - ZkDetectionTimeout int - // NOTE(tsenart): HTTPPort, DNSOn and HTTPOn have defined JSON keys for - // backwards compatibility with external API clients. - HTTPPort int `json:"HttpPort"` - // TTL: the TTL value used for SRV and A records (default 60) - TTL int32 - // SOA record fields (see http://tools.ietf.org/html/rfc1035#page-18) - SOASerial uint32 // initial version number (incremented on refresh) - SOARefresh uint32 // refresh interval - SOARetry uint32 // retry interval - SOAExpire uint32 // expiration time - SOAMinttl uint32 // minimum TTL - SOAMname string // primary name server - SOARname string // email of admin esponsible - // Mesos master(s): a list of IP:port pairs for one or more Mesos masters - Masters []string - // DNS server: IP address of the DNS server for forwarded accesses - Resolvers []string - // IPSources is the prioritized list of task IP sources - IPSources []string // e.g. ["host", "docker", "mesos", "rkt"] - // Zookeeper: a single Zk url - Zk string - // Domain: name of the domain used (default "mesos", ie .mesos domain) - Domain string - // File is the location of the config.json file - File string - // Listen is the server DNS listener IP address - Listener string - // HTTPListen is the server HTTP listener IP address - HTTPListener string - // Value of RecursionAvailable for responses in Mesos domain - RecurseOn bool - // Enable serving DSN and HTTP requests - DNSOn bool `json:"DnsOn"` - HTTPOn bool `json:"HttpOn"` - // Enable replies for external requests - ExternalOn bool - // EnforceRFC952 will enforce an older, more strict set of rules for DNS labels - EnforceRFC952 bool - // Enumeration enabled via the API enumeration endpoint - EnumerationOn bool -} - -// NewConfig return the default config of the resolver -func NewConfig() Config { - return Config{ - ZkDetectionTimeout: 30, - RefreshSeconds: 60, - TTL: 60, - Domain: "mesos", - Port: 53, - Timeout: 5, - StateTimeoutSeconds: 300, - SOARname: "root.ns1.mesos", - SOAMname: "ns1.mesos", - SOARefresh: 60, - SOARetry: 600, - SOAExpire: 86400, - SOAMinttl: 60, - Resolvers: []string{"8.8.8.8"}, - Listener: "0.0.0.0", - HTTPListener: "0.0.0.0", - HTTPPort: 8123, - DNSOn: true, - HTTPOn: true, - ExternalOn: true, - RecurseOn: true, - IPSources: []string{"netinfo", "mesos", "host"}, - EnumerationOn: true, - } -} - -// SetConfig instantiates a Config struct read in from config.json -func SetConfig(cjson string) Config { - c, err := readConfig(cjson) - if err != nil { - logging.Error.Fatal(err) - } - logging.Verbose.Printf("config loaded from %q", c.File) - // validate and complete configuration file - err = validateEnabledServices(c) - if err != nil { - logging.Error.Fatalf("service validation failed: %v", err) - } - if err = validateMasters(c.Masters); err != nil { - logging.Error.Fatalf("Masters validation failed: %v", err) - } - - if c.ExternalOn { - if len(c.Resolvers) == 0 { - c.Resolvers = GetLocalDNS() - } - if err = validateResolvers(c.Resolvers); err != nil { - logging.Error.Fatalf("Resolvers validation failed: %v", err) - } - } - - if err = validateIPSources(c.IPSources); err != nil { - logging.Error.Fatalf("IPSources validation failed: %v", err) - } - - c.Domain = strings.ToLower(c.Domain) - - // SOA record fields - c.SOARname = strings.TrimRight(strings.Replace(c.SOARname, "@", ".", -1), ".") + "." - c.SOAMname = strings.TrimRight(c.SOAMname, ".") + "." - c.SOASerial = uint32(time.Now().Unix()) - - // print configuration file - logging.Verbose.Println("Mesos-DNS configuration:") - logging.Verbose.Println(" - Masters: " + strings.Join(c.Masters, ", ")) - logging.Verbose.Println(" - Zookeeper: ", c.Zk) - logging.Verbose.Println(" - ZookeeperDetectionTimeout: ", c.ZkDetectionTimeout) - logging.Verbose.Println(" - RefreshSeconds: ", c.RefreshSeconds) - logging.Verbose.Println(" - Domain: " + c.Domain) - logging.Verbose.Println(" - Listener: " + c.Listener) - logging.Verbose.Println(" - HTTPListener: " + c.HTTPListener) - logging.Verbose.Println(" - Port: ", c.Port) - logging.Verbose.Println(" - DnsOn: ", c.DNSOn) - logging.Verbose.Println(" - TTL: ", c.TTL) - logging.Verbose.Println(" - Timeout: ", c.Timeout) - logging.Verbose.Println(" - StateTimeoutSeconds: ", c.StateTimeoutSeconds) - logging.Verbose.Println(" - Resolvers: " + strings.Join(c.Resolvers, ", ")) - logging.Verbose.Println(" - ExternalOn: ", c.ExternalOn) - logging.Verbose.Println(" - SOAMname: " + c.SOAMname) - logging.Verbose.Println(" - SOARname: " + c.SOARname) - logging.Verbose.Println(" - SOASerial: ", c.SOASerial) - logging.Verbose.Println(" - SOARefresh: ", c.SOARefresh) - logging.Verbose.Println(" - SOARetry: ", c.SOARetry) - logging.Verbose.Println(" - SOAExpire: ", c.SOAExpire) - logging.Verbose.Println(" - SOAExpire: ", c.SOAMinttl) - logging.Verbose.Println(" - RecurseOn: ", c.RecurseOn) - logging.Verbose.Println(" - HttpPort: ", c.HTTPPort) - logging.Verbose.Println(" - HttpOn: ", c.HTTPOn) - logging.Verbose.Println(" - ConfigFile: ", c.File) - logging.Verbose.Println(" - EnforceRFC952: ", c.EnforceRFC952) - logging.Verbose.Println(" - IPSources: ", c.IPSources) - logging.Verbose.Println(" - EnumerationOn", c.EnumerationOn) - - return *c -} - -func readConfig(file string) (*Config, error) { - c := NewConfig() - - workingDir := "." - for _, name := range []string{"HOME", "USERPROFILE"} { // *nix, windows - if dir := os.Getenv(name); dir != "" { - workingDir = dir - } - } - - var err error - c.File, err = filepath.Abs(strings.Replace(file, "~/", workingDir+"/", 1)) - if err != nil { - return nil, fmt.Errorf("cannot find configuration file") - } else if bs, err := ioutil.ReadFile(c.File); err != nil { - return nil, fmt.Errorf("missing configuration file: %q", c.File) - } else if err = json.Unmarshal(bs, &c); err != nil { - return nil, fmt.Errorf("failed to unmarshal config file %q: %v", c.File, err) - } - - return &c, nil -} - -func unique(ss []string) []string { - set := make(map[string]struct{}, len(ss)) - out := make([]string, 0, len(ss)) - for _, s := range ss { - if _, ok := set[s]; !ok { - set[s] = struct{}{} - out = append(out, s) - } - } - return out -} - -// GetLocalDNS returns the first nameserver in /etc/resolv.conf -// Used for non-Mesos queries. -func GetLocalDNS() []string { - conf, err := dns.ClientConfigFromFile("/etc/resolv.conf") - if err != nil { - logging.Error.Fatalf("%v", err) - } - - return nonLocalAddies(conf.Servers) -} - -// Returns non-local nameserver entries -func nonLocalAddies(cservers []string) []string { - bad := localAddies() - - good := []string{} - - for i := 0; i < len(cservers); i++ { - local := false - for x := 0; x < len(bad); x++ { - if cservers[i] == bad[x] { - local = true - } - } - - if !local { - good = append(good, cservers[i]) - } - } - - return good -} - -// Returns an array of local ipv4 addresses -func localAddies() []string { - addies, err := net.InterfaceAddrs() - if err != nil { - logging.Error.Println(err) - } - - bad := []string{} - - for i := 0; i < len(addies); i++ { - ip, _, err := net.ParseCIDR(addies[i].String()) - if err != nil { - logging.Error.Println(err) - } - t4 := ip.To4() - if t4 != nil { - bad = append(bad, t4.String()) - } - } - - return bad -} diff --git a/vendor/github.com/mesosphere/mesos-dns/records/generator.go b/vendor/github.com/mesosphere/mesos-dns/records/generator.go deleted file mode 100644 index 548f107d6..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/records/generator.go +++ /dev/null @@ -1,655 +0,0 @@ -// Package records contains functions to generate resource records from -// mesos master states to serve through a dns server -package records - -import ( - "crypto/sha1" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "strconv" - "strings" - "time" - - "github.com/mesosphere/mesos-dns/errorutil" - "github.com/mesosphere/mesos-dns/logging" - "github.com/mesosphere/mesos-dns/models" - "github.com/mesosphere/mesos-dns/records/labels" - "github.com/mesosphere/mesos-dns/records/state" - "github.com/tv42/zbase32" -) - -// Map host/service name to DNS answer -// REFACTOR - when discoveryinfo is integrated -// Will likely become map[string][]discoveryinfo -// Effectively we're (ab)using the map type as a set -// It used to have the type: rrs map[string][]string -type rrs map[string]map[string]struct{} - -func (r rrs) add(name, host string) bool { - if host == "" { - return false - } - v, ok := r[name] - if !ok { - v = make(map[string]struct{}) - r[name] = v - } else { - // don't overwrite existing values - _, ok = v[host] - if ok { - return false - } - } - v[host] = struct{}{} - return true -} - -func (r rrs) First(name string) (string, bool) { - for host := range r[name] { - return host, true - } - return "", false -} - -// Transform the record set into something exportable via the REST API -func (r rrs) ToAXFRResourceRecordSet() models.AXFRResourceRecordSet { - ret := make(models.AXFRResourceRecordSet, len(r)) - for host, values := range r { - ret[host] = make([]string, 0, len(values)) - for record := range values { - ret[host] = append(ret[host], record) - } - } - return ret -} - -type rrsKind string - -const ( - // A record types - A rrsKind = "A" - // SRV record types - SRV = "SRV" -) - -func (kind rrsKind) rrs(rg *RecordGenerator) rrs { - switch kind { - case A: - return rg.As - case SRV: - return rg.SRVs - default: - return nil - } -} - -// RecordGenerator contains DNS records and methods to access and manipulate -// them. TODO(kozyraki): Refactor when discovery id is available. -type RecordGenerator struct { - As rrs - SRVs rrs - SlaveIPs map[string]string - EnumData EnumerationData - httpClient http.Client -} - -// EnumerableRecord is the lowest level object, and should map 1:1 with DNS records -type EnumerableRecord struct { - Name string `json:"name"` - Host string `json:"host"` - Rtype string `json:"rtype"` -} - -// EnumerableTask consists of the records derived from a task -type EnumerableTask struct { - Name string `json:"name"` - ID string `json:"id"` - Records []EnumerableRecord `json:"records"` -} - -// EnumerableFramework is consistent of enumerable tasks, and include the name of the framework -type EnumerableFramework struct { - Tasks []*EnumerableTask `json:"tasks"` - Name string `json:"name"` -} - -// EnumerationData is the top level container pointing to the -// enumerable frameworks containing enumerable tasks -type EnumerationData struct { - Frameworks []*EnumerableFramework `json:"frameworks"` -} - -// NewRecordGenerator returns a RecordGenerator that's been configured with a timeout. -func NewRecordGenerator(httpTimeout time.Duration) *RecordGenerator { - enumData := EnumerationData{ - Frameworks: []*EnumerableFramework{}, - } - rg := &RecordGenerator{ - httpClient: http.Client{Timeout: httpTimeout}, - EnumData: enumData, - } - return rg -} - -// ParseState retrieves and parses the Mesos master /state.json and converts it -// into DNS records. -func (rg *RecordGenerator) ParseState(c Config, masters ...string) error { - // find master -- return if error - sj, err := rg.FindMaster(masters...) - if err != nil { - logging.Error.Println("no master") - return err - } - if sj.Leader == "" { - logging.Error.Println("Unexpected error") - err = errors.New("empty master") - return err - } - - hostSpec := labels.RFC1123 - if c.EnforceRFC952 { - hostSpec = labels.RFC952 - } - - return rg.InsertState(sj, c.Domain, c.SOARname, c.Listener, masters, c.IPSources, hostSpec) -} - -// Tries each master and looks for the leader -// if no leader responds it errors -func (rg *RecordGenerator) FindMaster(masters ...string) (state.State, error) { - var sj state.State - var leader string - - if len(masters) > 0 { - leader, masters = masters[0], masters[1:] - } - - // Check if ZK leader is correct - if leader != "" { - logging.VeryVerbose.Println("Zookeeper says the leader is: ", leader) - ip, port, err := getProto(leader) - if err != nil { - logging.Error.Println(err) - } - - if sj, err = rg.loadWrap(ip, port); err == nil && sj.Leader != "" { - return sj, nil - } - logging.Verbose.Println("Warning: Zookeeper is wrong about leader") - if len(masters) == 0 { - return sj, errors.New("no master") - } - logging.Verbose.Println("Warning: falling back to Masters config field: ", masters) - } - - // try each listed mesos master before dying - for i, master := range masters { - ip, port, err := getProto(master) - if err != nil { - logging.Error.Println(err) - } - - if sj, err = rg.loadWrap(ip, port); err == nil && sj.Leader == "" { - logging.VeryVerbose.Println("Warning: not a leader - trying next one") - if len(masters)-1 == i { - return sj, errors.New("no master") - } - } else { - return sj, nil - } - - } - - return sj, errors.New("no master") -} - -// Loads state.json from mesos master -func (rg *RecordGenerator) loadFromMaster(ip string, port string) (state.State, error) { - // REFACTOR: state.json security - - var sj state.State - u := url.URL{ - Scheme: "http", - Host: net.JoinHostPort(ip, port), - Path: "/master/state.json", - } - - req, err := http.NewRequest("GET", u.String(), nil) - if err != nil { - logging.Error.Println(err) - return state.State{}, err - } - - req.Header.Set("Content-Type", "application/json") - - resp, err := rg.httpClient.Do(req) - if err != nil { - logging.Error.Println(err) - return state.State{}, err - } - - defer errorutil.Ignore(resp.Body.Close) - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - logging.Error.Println(err) - return state.State{}, err - } - - err = json.Unmarshal(body, &sj) - if err != nil { - logging.Error.Println(err) - return state.State{}, err - } - - return sj, nil -} - -// Catches an attempt to load state.json from a mesos master -// attempts can fail from down server or mesos master secondary -// it also reloads from a different master if the master it attempted to -// load from was not the leader -func (rg *RecordGenerator) loadWrap(ip string, port string) (state.State, error) { - var err error - var sj state.State - - logging.VeryVerbose.Println("reloading from master " + ip) - sj, err = rg.loadFromMaster(ip, port) - if err != nil { - return state.State{}, err - } - if rip := leaderIP(sj.Leader); rip != ip { - logging.VeryVerbose.Println("Warning: master changed to " + ip) - sj, err = rg.loadFromMaster(rip, port) - return sj, err - } - return sj, nil -} - -// hashes a given name using a truncated sha1 hash -// 5 characters extracted from the zbase32 encoded hash provides -// enough entropy to avoid collisions -// zbase32: http://philzimmermann.com/docs/human-oriented-base-32-encoding.txt -// is used to promote human-readable names -func hashString(s string) string { - hash := sha1.Sum([]byte(s)) - return zbase32.EncodeToString(hash[:])[:5] -} - -// attempt to translate the hostname into an IPv4 address. logs an error if IP -// lookup fails. if an IP address cannot be found, returns the same hostname -// that was given. upon success returns the IP address as a string. -func hostToIP4(hostname string) (string, bool) { - ip := net.ParseIP(hostname) - if ip == nil { - t, err := net.ResolveIPAddr("ip4", hostname) - if err != nil { - logging.Error.Printf("cannot translate hostname %q into an ip4 address", hostname) - return hostname, false - } - ip = t.IP - } - return ip.String(), true -} - -// InsertState transforms a StateJSON into RecordGenerator RRs -func (rg *RecordGenerator) InsertState(sj state.State, domain, ns, listener string, masters, ipSources []string, spec labels.Func) error { - - rg.SlaveIPs = map[string]string{} - rg.SRVs = rrs{} - rg.As = rrs{} - rg.frameworkRecords(sj, domain, spec) - rg.slaveRecords(sj, domain, spec) - rg.listenerRecord(listener, ns) - rg.masterRecord(domain, masters, sj.Leader) - rg.taskRecords(sj, domain, spec, ipSources) - - return nil -} - -// frameworkRecords injects A and SRV records into the generator store: -// frameworkname.domain. // resolves to IPs of each framework -// _framework._tcp.frameworkname.domain. // resolves to the driver port and IP of each framework -func (rg *RecordGenerator) frameworkRecords(sj state.State, domain string, spec labels.Func) { - for _, f := range sj.Frameworks { - fname := labels.DomainFrag(f.Name, labels.Sep, spec) - host, port := f.HostPort() - if address, ok := hostToIP4(host); ok { - a := fname + "." + domain + "." - rg.insertRR(a, address, A) - if port != "" { - srvAddress := net.JoinHostPort(a, port) - rg.insertRR("_framework._tcp."+a, srvAddress, SRV) - } - } - } -} - -// slaveRecords injects A and SRV records into the generator store: -// slave.domain. // resolves to IPs of all slaves -// _slave._tc.domain. // resolves to the driver port and IP of all slaves -func (rg *RecordGenerator) slaveRecords(sj state.State, domain string, spec labels.Func) { - for _, slave := range sj.Slaves { - address, ok := hostToIP4(slave.PID.Host) - if ok { - a := "slave." + domain + "." - rg.insertRR(a, address, A) - srv := net.JoinHostPort(a, slave.PID.Port) - rg.insertRR("_slave._tcp."+domain+".", srv, SRV) - } else { - logging.VeryVerbose.Printf("string '%q' for slave with id %q is not a valid IP address", address, slave.ID) - address = labels.DomainFrag(address, labels.Sep, spec) - } - rg.SlaveIPs[slave.ID] = address - } -} - -// masterRecord injects A and SRV records into the generator store: -// master.domain. // resolves to IPs of all masters -// masterN.domain. // one IP address for each master -// leader.domain. // one IP address for the leading master -// -// The current func implementation makes an assumption about the order of masters: -// it's the order in which you expect the enumerated masterN records to be created. -// This is probably important: if a new leader is elected, you may not want it to -// become master0 simply because it's the leader. You probably want your DNS records -// to change as little as possible. And this func should have the least impact on -// enumeration order, or name/IP mappings - it's just creating the records. So let -// the caller do the work of ordering/sorting (if desired) the masters list if a -// different outcome is desired. -// -// Another consequence of the current overall mesos-dns app implementation is that -// the leader may not even be in the masters list at some point in time. masters is -// really fallback-masters (only consider these to be masters if I can't find a -// leader via ZK). At some point in time, they may not actually be masters any more. -// Consider a cluster of 3 nodes that suffers the loss of a member, and gains a new -// member (VM crashed, was replaced by another VM). And the cycle repeats several -// times. You end up with a set of running masters (and leader) that's different -// than the set of statically configured fallback masters. -// -// So the func tries to index the masters as they're listed and begrudgingly assigns -// the leading master an index out-of-band if it's not actually listed in the masters -// list. There are probably better ways to do it. -func (rg *RecordGenerator) masterRecord(domain string, masters []string, leader string) { - // create records for leader - // A records - h := strings.Split(leader, "@") - if len(h) < 2 { - logging.Error.Println(leader) - return // avoid a panic later - } - leaderAddress := h[1] - ip, port, err := getProto(leaderAddress) - if err != nil { - logging.Error.Println(err) - return - } - arec := "leader." + domain + "." - rg.insertRR(arec, ip, A) - arec = "master." + domain + "." - rg.insertRR(arec, ip, A) - - // SRV records - tcp := "_leader._tcp." + domain + "." - udp := "_leader._udp." + domain + "." - host := "leader." + domain + "." + ":" + port - rg.insertRR(tcp, host, SRV) - rg.insertRR(udp, host, SRV) - - // if there is a list of masters, insert that as well - addedLeaderMasterN := false - idx := 0 - for _, master := range masters { - masterIP, _, err := getProto(master) - if err != nil { - logging.Error.Println(err) - continue - } - - // A records (master and masterN) - if master != leaderAddress { - arec := "master." + domain + "." - added := rg.insertRR(arec, masterIP, A) - if !added { - // duplicate master?! - continue - } - } - - if master == leaderAddress && addedLeaderMasterN { - // duplicate leader in masters list?! - continue - } - - arec := "master" + strconv.Itoa(idx) + "." + domain + "." - rg.insertRR(arec, masterIP, A) - idx++ - - if master == leaderAddress { - addedLeaderMasterN = true - } - } - // flake: we ended up with a leader that's not in the list of all masters? - if !addedLeaderMasterN { - // only a flake if there were fallback masters configured - if len(masters) > 0 { - logging.Error.Printf("warning: leader %q is not in master list", leader) - } - arec = "master" + strconv.Itoa(idx) + "." + domain + "." - rg.insertRR(arec, ip, A) - } -} - -// A record for mesos-dns (the name is listed in SOA replies) -func (rg *RecordGenerator) listenerRecord(listener string, ns string) { - if listener == "0.0.0.0" { - rg.setFromLocal(listener, ns) - } else if listener == "127.0.0.1" { - rg.insertRR(ns, "127.0.0.1", A) - } else { - rg.insertRR(ns, listener, A) - } -} - -func (rg *RecordGenerator) taskRecords(sj state.State, domain string, spec labels.Func, ipSources []string) { - for _, f := range sj.Frameworks { - enumerableFramework := &EnumerableFramework{ - Name: f.Name, - Tasks: []*EnumerableTask{}, - } - rg.EnumData.Frameworks = append(rg.EnumData.Frameworks, enumerableFramework) - - for _, task := range f.Tasks { - var ok bool - task.SlaveIP, ok = rg.SlaveIPs[task.SlaveID] - - // only do running and discoverable tasks - if ok && (task.State == "TASK_RUNNING") { - rg.taskRecord(task, f, domain, spec, ipSources, enumerableFramework) - } - } - } -} - -type context struct { - taskName, - taskID, - slaveID, - taskIP, - slaveIP string -} - -func (rg *RecordGenerator) taskRecord(task state.Task, f state.Framework, domain string, spec labels.Func, ipSources []string, enumFW *EnumerableFramework) { - - newTask := &EnumerableTask{ID: task.ID, Name: task.Name} - - enumFW.Tasks = append(enumFW.Tasks, newTask) - - // define context - ctx := context{ - spec(task.Name), - hashString(task.ID), - slaveIDTail(task.SlaveID), - task.IP(ipSources...), - task.SlaveIP, - } - - // use DiscoveryInfo name if defined instead of task name - if task.HasDiscoveryInfo() { - // LEGACY TODO: REMOVE - ctx.taskName = task.DiscoveryInfo.Name - rg.taskContextRecord(ctx, task, f, domain, spec, newTask) - // LEGACY, TODO: REMOVE - - ctx.taskName = spec(task.DiscoveryInfo.Name) - rg.taskContextRecord(ctx, task, f, domain, spec, newTask) - } else { - rg.taskContextRecord(ctx, task, f, domain, spec, newTask) - } - -} -func (rg *RecordGenerator) taskContextRecord(ctx context, task state.Task, f state.Framework, domain string, spec labels.Func, enumTask *EnumerableTask) { - fname := labels.DomainFrag(f.Name, labels.Sep, spec) - - tail := "." + domain + "." - - // insert canonical A records - canonical := ctx.taskName + "-" + ctx.taskID + "-" + ctx.slaveID + "." + fname - arec := ctx.taskName + "." + fname - - rg.insertTaskRR(arec+tail, ctx.taskIP, A, enumTask) - rg.insertTaskRR(canonical+tail, ctx.taskIP, A, enumTask) - - rg.insertTaskRR(arec+".slave"+tail, ctx.slaveIP, A, enumTask) - rg.insertTaskRR(canonical+".slave"+tail, ctx.slaveIP, A, enumTask) - - // recordName generates records for ctx.taskName, given some generation chain - recordName := func(gen chain) { gen("_" + ctx.taskName) } - - // asSRV is always the last link in a chain, it must insert RR's - asSRV := func(target string) chain { - return func(records ...string) { - for i := range records { - name := records[i] + tail - rg.insertTaskRR(name, target, SRV, enumTask) - } - } - } - - // Add RFC 2782 SRV records - var subdomains []string - if task.HasDiscoveryInfo() { - subdomains = []string{"slave"} - } else { - subdomains = []string{"slave", domainNone} - } - - slaveHost := canonical + ".slave" + tail - for _, port := range task.Ports() { - slaveTarget := slaveHost + ":" + port - recordName(withProtocol(protocolNone, fname, spec, - withSubdomains(subdomains, asSRV(slaveTarget)))) - } - - if !task.HasDiscoveryInfo() { - return - } - - for _, port := range task.DiscoveryInfo.Ports.DiscoveryPorts { - target := canonical + tail + ":" + strconv.Itoa(port.Number) - recordName(withProtocol(port.Protocol, fname, spec, - withNamedPort(port.Name, spec, asSRV(target)))) - } -} - -// A records for each local interface -// If this causes problems you should explicitly set the -// listener address in config.json -func (rg *RecordGenerator) setFromLocal(host string, ns string) { - - ifaces, err := net.Interfaces() - if err != nil { - logging.Error.Println(err) - } - - // handle err - for _, i := range ifaces { - - addrs, err := i.Addrs() - if err != nil { - logging.Error.Println(err) - } - - for _, addr := range addrs { - var ip net.IP - switch v := addr.(type) { - case *net.IPNet: - ip = v.IP - case *net.IPAddr: - ip = v.IP - } - - if ip == nil || ip.IsLoopback() { - continue - } - - ip = ip.To4() - if ip == nil { - continue - } - - rg.insertRR(ns, ip.String(), A) - } - } -} - -// insertRR adds a record to the appropriate record map for the given name/host pair, -// but only if the pair is unique. returns true if added, false otherwise. -// TODO(???): REFACTOR when storage is updated -func (rg *RecordGenerator) insertTaskRR(name, host string, kind rrsKind, enumTask *EnumerableTask) bool { - if rg.insertRR(name, host, kind) { - enumRecord := EnumerableRecord{Name: name, Host: host, Rtype: string(kind)} - enumTask.Records = append(enumTask.Records, enumRecord) - return true - } - return false -} - -func (rg *RecordGenerator) insertRR(name, host string, kind rrsKind) (added bool) { - if rrs := kind.rrs(rg); rrs != nil { - if added = rrs.add(name, host); added { - logging.VeryVerbose.Println("[" + string(kind) + "]\t" + name + ": " + host) - } - } - return -} - -// leaderIP returns the ip for the mesos master -// input format master@ip:port -func leaderIP(leader string) string { - pair := strings.Split(leader, "@")[1] - return strings.Split(pair, ":")[0] -} - -// return the slave number from a Mesos slave id -func slaveIDTail(slaveID string) string { - fields := strings.Split(slaveID, "-") - return strings.ToLower(fields[len(fields)-1]) -} - -// should be able to accept -// ip:port -// zk://host1:port1,host2:port2,.../path -// zk://username:password@host1:port1,host2:port2,.../path -// file:///path/to/file (where file contains one of the above) -func getProto(pair string) (string, string, error) { - h := strings.SplitN(pair, ":", 2) - if len(h) != 2 { - return "", "", fmt.Errorf("unable to parse proto from %q", pair) - } - return h[0], h[1], nil -} diff --git a/vendor/github.com/mesosphere/mesos-dns/records/labels/labels.go b/vendor/github.com/mesosphere/mesos-dns/records/labels/labels.go deleted file mode 100644 index 1615e6185..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/records/labels/labels.go +++ /dev/null @@ -1,83 +0,0 @@ -package labels - -import ( - "bytes" - "strings" -) - -// Sep is the default domain fragment separator. -const Sep = "." - -// DomainFrag mangles the given name in order to produce a valid domain fragment. -// A valid domain fragment will consist of one or more host name labels -// concatenated by the given separator. -func DomainFrag(name, sep string, label Func) string { - var labels []string - for _, part := range strings.Split(name, sep) { - if lab := label(part); lab != "" { - labels = append(labels, lab) - } - } - return strings.Join(labels, sep) -} - -// Func is a function type representing label functions. -type Func func(string) string - -// RFC952 mangles a name to conform to the DNS label rules specified in RFC952. -// See http://www.rfc-base.org/txt/rfc-952.txt -func RFC952(name string) string { - return string(label([]byte(name), 24, "-0123456789", "-")) -} - -// RFC1123 mangles a name to conform to the DNS label rules specified in RFC1123. -// See http://www.rfc-base.org/txt/rfc-1123.txt -func RFC1123(name string) string { - return string(label([]byte(name), 63, "-", "-")) -} - -// label computes a label from the given name with maxlen length and the -// left and right cutsets trimmed from their respective ends. -func label(name []byte, maxlen int, left, right string) []byte { - return trimCut(bytes.Map(mapping, name), maxlen, left, right) -} - -// mapping maps a given rune to its valid DNS label counterpart. -func mapping(r rune) rune { - switch { - case r >= 'A' && r <= 'Z': - return r - ('A' - 'a') - case r >= 'a' && r <= 'z': - fallthrough - case r >= '0' && r <= '9': - return r - case r == '-' || r == '.' || r == '_': - return '-' - default: - return -1 - } -} - -// trimCut cuts the given label at min(maxlen, len(label)) and ensures the left -// and right cutsets are trimmed from their respective ends. -func trimCut(label []byte, maxlen int, left, right string) []byte { - trim := bytes.TrimLeft(label, left) - size := min(len(trim), maxlen) - head := bytes.TrimRight(trim[:size], right) - if len(head) == size { - return head - } - tail := bytes.TrimLeft(trim[size:], right) - if len(tail) > 0 { - return append(head, tail[:size-len(head)]...) - } - return head -} - -// min returns the minimum of two ints -func min(a, b int) int { - if a < b { - return a - } - return b -} diff --git a/vendor/github.com/mesosphere/mesos-dns/records/state/state.go b/vendor/github.com/mesosphere/mesos-dns/records/state/state.go deleted file mode 100644 index c15536b01..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/records/state/state.go +++ /dev/null @@ -1,271 +0,0 @@ -package state - -import ( - "bytes" - "github.com/mesos/mesos-go/upid" - "net" - "strconv" - "strings" -) - -// Resources holds resources as defined in the /state.json Mesos HTTP endpoint. -type Resources struct { - PortRanges string `json:"ports"` -} - -// Ports returns a slice of individual ports expanded from PortRanges. -func (r Resources) Ports() []string { - if r.PortRanges == "" || r.PortRanges == "[]" { - return []string{} - } - - rhs := strings.Split(r.PortRanges, "[")[1] - lhs := strings.Split(rhs, "]")[0] - - yports := []string{} - - mports := strings.Split(lhs, ",") - for _, port := range mports { - tmp := strings.TrimSpace(port) - pz := strings.Split(tmp, "-") - lo, _ := strconv.Atoi(pz[0]) - hi, _ := strconv.Atoi(pz[1]) - - for t := lo; t <= hi; t++ { - yports = append(yports, strconv.Itoa(t)) - } - } - return yports -} - -// Label holds a label as defined in the /state.json Mesos HTTP endpoint. -type Label struct { - Key string `json:"key"` - Value string `json:"value"` -} - -// Status holds a task status as defined in the /state.json Mesos HTTP endpoint. -type Status struct { - Timestamp float64 `json:"timestamp"` - State string `json:"state"` - Labels []Label `json:"labels,omitempty"` - ContainerStatus ContainerStatus `json:"container_status,omitempty"` - Healthy *bool `json:"healthy"` -} - -// ContainerStatus holds container metadata as defined in the /state.json -// Mesos HTTP endpoint. -type ContainerStatus struct { - NetworkInfos []NetworkInfo `json:"network_infos,omitempty"` -} - -// NetworkInfo holds the network configuration for a single interface -// as defined in the /state.json Mesos HTTP endpoint. -type NetworkInfo struct { - IPAddresses []IPAddress `json:"ip_addresses,omitempty"` - // back-compat with 0.25 IPAddress format - IPAddress string `json:"ip_address,omitempty"` -} - -// IPAddress holds a single IP address configured on an interface, -// as defined in the /state.json Mesos HTTP endpoint. -type IPAddress struct { - IPAddress string `json:"ip_address,omitempty"` -} - -// Task holds a task as defined in the /state.json Mesos HTTP endpoint. -type Task struct { - FrameworkID string `json:"framework_id"` - ID string `json:"id"` - Name string `json:"name"` - SlaveID string `json:"slave_id"` - State string `json:"state"` - Statuses []Status `json:"statuses"` - Resources `json:"resources"` - DiscoveryInfo DiscoveryInfo `json:"discovery"` - - SlaveIP string `json:"-"` - Labels []Label `json:"labels,omitempty"` -} - -// HasDiscoveryInfo return whether the DiscoveryInfo was provided in the state.json -func (t *Task) HasDiscoveryInfo() bool { - return t.DiscoveryInfo.Name != "" -} - -// IP returns the first Task IP found in the given sources. -func (t *Task) IP(srcs ...string) string { - if ips := t.IPs(srcs...); len(ips) > 0 { - return ips[0].String() - } - return "" -} - -// IPs returns a slice of IPs sourced from the given sources with ascending -// priority. -func (t *Task) IPs(srcs ...string) (ips []net.IP) { - if t == nil { - return nil - } - for i := range srcs { - if src, ok := sources[srcs[i]]; ok { - for _, srcIP := range src(t) { - if ip := net.ParseIP(srcIP); len(ip) > 0 { - ips = append(ips, ip) - } - } - } - } - return ips -} - -// sources maps the string representation of IP sources to their functions. -var sources = map[string]func(*Task) []string{ - "host": hostIPs, - "mesos": mesosIPs, - "docker": dockerIPs, - "netinfo": networkInfoIPs, -} - -// hostIPs is an IPSource which returns the IP addresses of the slave a Task -// runs on. -func hostIPs(t *Task) []string { return []string{t.SlaveIP} } - -// networkInfoIPs returns IP addresses from a given Task's -// []Status.ContainerStatus.[]NetworkInfos.[]IPAddresses.IPAddress -func networkInfoIPs(t *Task) []string { - return statusIPs(t.Statuses, func(s *Status) []string { - ips := make([]string, len(s.ContainerStatus.NetworkInfos)) - for _, netinfo := range s.ContainerStatus.NetworkInfos { - if len(netinfo.IPAddresses) > 0 { - // In v0.26, we use the IPAddresses field. - for _, ipAddress := range netinfo.IPAddresses { - ips = append(ips, ipAddress.IPAddress) - } - } else { - // Fall back to v0.25 syntax of single IPAddress if that's being used. - if netinfo.IPAddress != "" { - ips = append(ips, netinfo.IPAddress) - } - } - } - return ips - }) -} - -const ( - // DockerIPLabel is the key of the Label which holds the Docker containerizer IP value. - DockerIPLabel = "Docker.NetworkSettings.IPAddress" - // MesosIPLabel is the key of the label which holds the Mesos containerizer IP value. - MesosIPLabel = "MesosContainerizer.NetworkSettings.IPAddress" -) - -// dockerIPs returns IP addresses from the values of all -// Task.[]Status.[]Labels whose keys are equal to "Docker.NetworkSettings.IPAddress". -func dockerIPs(t *Task) []string { - return statusIPs(t.Statuses, labels(DockerIPLabel)) -} - -// mesosIPs returns IP addresses from the values of all -// Task.[]Status.[]Labels whose keys are equal to -// "MesosContainerizer.NetworkSettings.IPAddress". -func mesosIPs(t *Task) []string { - return statusIPs(t.Statuses, labels(MesosIPLabel)) -} - -// statusIPs returns the latest running status IPs extracted with the given src -func statusIPs(st []Status, src func(*Status) []string) []string { - // the state.json we extract from mesos makes no guarantees re: the order - // of the task statuses so we should check the timestamps to avoid problems - // down the line. we can't rely on seeing the same sequence. (@joris) - // https://github.com/apache/mesos/blob/0.24.0/src/slave/slave.cpp#L5226-L5238 - ts, j := -1.0, -1 - for i := range st { - if st[i].State == "TASK_RUNNING" && st[i].Timestamp > ts { - ts, j = st[i].Timestamp, i - } - } - if j >= 0 { - return src(&st[j]) - } - return nil -} - -// labels returns all given Status.[]Labels' values whose keys are equal -// to the given key -func labels(key string) func(*Status) []string { - return func(s *Status) []string { - vs := make([]string, 0, len(s.Labels)) - for _, l := range s.Labels { - if l.Key == key { - vs = append(vs, l.Value) - } - } - return vs - } -} - -// Framework holds a framework as defined in the /state.json Mesos HTTP endpoint. -type Framework struct { - Tasks []Task `json:"tasks"` - PID PID `json:"pid"` - Name string `json:"name"` - Hostname string `json:"hostname"` -} - -// HostPort returns the hostname and port where a framework's scheduler is -// listening on. -func (f Framework) HostPort() (string, string) { - if f.PID.UPID != nil { - return f.PID.Host, f.PID.Port - } - return f.Hostname, "" -} - -// Slave holds a slave as defined in the /state.json Mesos HTTP endpoint. -type Slave struct { - ID string `json:"id"` - Hostname string `json:"hostname"` - PID PID `json:"pid"` -} - -// PID holds a Mesos PID and implements the json.Unmarshaler interface. -type PID struct{ *upid.UPID } - -// UnmarshalJSON implements the json.Unmarshaler interface for PIDs. -func (p *PID) UnmarshalJSON(data []byte) (err error) { - p.UPID, err = upid.Parse(string(bytes.Trim(data, `" `))) - return err -} - -// State holds the state defined in the /state.json Mesos HTTP endpoint. -type State struct { - Frameworks []Framework `json:"frameworks"` - Slaves []Slave `json:"slaves"` - Leader string `json:"leader"` -} - -// DiscoveryInfo holds the discovery meta data for a task defined in the /state.json Mesos HTTP endpoint. -type DiscoveryInfo struct { - Visibilty string `json:"visibility"` - Version string `json:"version,omitempty"` - Name string `json:"name,omitempty"` - Location string `json:"location,omitempty"` - Environment string `json:"environment,omitempty"` - Labels struct { - Labels []Label `json:"labels"` - } `json:"labels"` - Ports Ports `json:"ports"` -} - -// Ports holds a list of DiscoveryPort -type Ports struct { - DiscoveryPorts []DiscoveryPort `json:"ports"` -} - -// DiscoveryPort holds a port for a task defined in the /state.json Mesos HTTP endpoint. -type DiscoveryPort struct { - Protocol string `json:"protocol"` - Number int `json:"number"` - Name string `json:"name"` -} diff --git a/vendor/github.com/mesosphere/mesos-dns/records/validation.go b/vendor/github.com/mesosphere/mesos-dns/records/validation.go deleted file mode 100644 index 4017dce70..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/records/validation.go +++ /dev/null @@ -1,84 +0,0 @@ -package records - -import ( - "fmt" - "net" -) - -func validateEnabledServices(c *Config) error { - if !c.DNSOn && !c.HTTPOn { - return fmt.Errorf("Either DNS or HTTP server should be on") - } - if len(c.Masters) == 0 && c.Zk == "" { - return fmt.Errorf("specify mesos masters or zookeeper in config.json") - } - return nil -} - -// validateMasters checks that each master in the list is a properly formatted host:ip pair. -// duplicate masters in the list are not allowed. -// returns nil if the masters list is empty, or else all masters in the list are valid. -func validateMasters(ms []string) error { - if len(ms) == 0 { - return nil - } - valid := make(map[string]struct{}, len(ms)) - for i, m := range ms { - h, p, err := net.SplitHostPort(m) - if err != nil { - return fmt.Errorf("illegal host:port specified for master %q", ms[i]) - } - // normalize ipv6 addresses - if ip := net.ParseIP(h); ip != nil { - h = ip.String() - m = h + "_" + p - } - //TODO(jdef) distinguish between intended hostnames and invalid ip addresses - if _, found := valid[m]; found { - return fmt.Errorf("duplicate master specified: %v", ms[i]) - } - valid[m] = struct{}{} - } - return nil -} - -// validateResolvers checks that each resolver in the list is a properly formatted IP address. -// duplicate resolvers in the list are not allowed. -// returns nil if the resolver list is empty, or else all resolvers in the list are valid. -func validateResolvers(rs []string) error { - if len(rs) == 0 { - return nil - } - ips := make(map[string]struct{}, len(rs)) - for _, r := range rs { - ip := net.ParseIP(r) - if ip == nil { - return fmt.Errorf("illegal IP specified for resolver %q", r) - } - ipstr := ip.String() - if _, found := ips[ipstr]; found { - return fmt.Errorf("duplicate resolver IP specified: %v", r) - } - ips[ipstr] = struct{}{} - } - return nil -} - -// validateIPSources checks validity of ip sources -func validateIPSources(srcs []string) error { - if len(srcs) == 0 { - return fmt.Errorf("empty ip sources") - } - if len(srcs) != len(unique(srcs)) { - return fmt.Errorf("duplicate ip source specified") - } - for _, src := range srcs { - switch src { - case "host", "docker", "mesos", "netinfo": - default: - return fmt.Errorf("invalid ip source %q", src) - } - } - - return nil -} diff --git a/vendor/github.com/mesosphere/mesos-dns/util/util.go b/vendor/github.com/mesosphere/mesos-dns/util/util.go deleted file mode 100644 index 856b3e55a..000000000 --- a/vendor/github.com/mesosphere/mesos-dns/util/util.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2014 Google Inc. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package util - -import ( - "fmt" - "log" - "runtime" -) - -// ReallyCrash is for testing, to bypass HandleCrash. -var ReallyCrash bool - -// PanicHandlers is a list of functions which will be invoked when a panic happens. -var PanicHandlers = []func(interface{}){logPanic} - -// HandleCrash simply catches a crash and logs an error. Meant to be called via defer. -func HandleCrash() { - if ReallyCrash { - return - } - if r := recover(); r != nil { - for _, fn := range PanicHandlers { - fn(r) - } - } -} - -// logPanic logs the caller tree when a panic occurs. -func logPanic(r interface{}) { - callers := "" - for i := 0; true; i++ { - _, file, line, ok := runtime.Caller(i) - if !ok { - break - } - callers = callers + fmt.Sprintf("%v:%v\n", file, line) - } - log.Printf("Recovered from panic: %#v (%v)\n%v", r, r, callers) -} diff --git a/vendor/github.com/rancher/go-rancher-metadata/metadata/change.go b/vendor/github.com/rancher/go-rancher-metadata/metadata/change.go deleted file mode 100644 index d3b1e7914..000000000 --- a/vendor/github.com/rancher/go-rancher-metadata/metadata/change.go +++ /dev/null @@ -1,64 +0,0 @@ -package metadata - -import ( - "encoding/json" - "fmt" - "time" - - "github.com/sirupsen/logrus" -) - -func (m *client) OnChangeWithError(intervalSeconds int, do func(string)) error { - return m.onChangeFromVersionWithError("init", intervalSeconds, do) -} - -func (m *client) onChangeFromVersionWithError(version string, intervalSeconds int, do func(string)) error { - for { - newVersion, err := m.waitVersion(intervalSeconds, version) - if err != nil { - return err - } else if version == newVersion { - logrus.Debug("No changes in metadata version") - } else { - logrus.Debugf("Metadata Version has been changed. Old version: %s. New version: %s.", version, newVersion) - version = newVersion - do(newVersion) - } - } - - return nil -} - -func (m *client) OnChange(intervalSeconds int, do func(string)) { - version := "init" - updateVersionAndDo := func(v string) { - version = v - do(version) - } - interval := time.Duration(intervalSeconds) - for { - if err := m.onChangeFromVersionWithError(version, intervalSeconds, updateVersionAndDo); err != nil { - logrus.Errorf("Error reading metadata version: %v", err) - } - time.Sleep(interval * time.Second) - } -} - -type timeout interface { - Timeout() bool -} - -func (m *client) waitVersion(maxWait int, version string) (string, error) { - for { - resp, err := m.SendRequest(fmt.Sprintf("/version?wait=true&value=%s&maxWait=%d", version, maxWait)) - if err != nil { - t, ok := err.(timeout) - if ok && t.Timeout() { - continue - } - return "", err - } - err = json.Unmarshal(resp, &version) - return version, err - } -} diff --git a/vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go b/vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go deleted file mode 100644 index d536d686b..000000000 --- a/vendor/github.com/rancher/go-rancher-metadata/metadata/metadata.go +++ /dev/null @@ -1,277 +0,0 @@ -package metadata - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "time" -) - -type Client interface { - OnChangeWithError(int, func(string)) error - OnChange(int, func(string)) - SendRequest(string) ([]byte, error) - GetVersion() (string, error) - GetSelfHost() (Host, error) - GetSelfContainer() (Container, error) - GetSelfServiceByName(string) (Service, error) - GetSelfService() (Service, error) - GetSelfStack() (Stack, error) - GetServices() ([]Service, error) - GetStacks() ([]Stack, error) - GetStackByName(string) (Stack, error) - GetContainers() ([]Container, error) - GetServiceContainers(string, string) ([]Container, error) - GetHosts() ([]Host, error) - GetHost(string) (Host, error) - GetNetworks() ([]Network, error) -} - -type client struct { - url string - ip string - client *http.Client -} - -func newClient(url, ip string) *client { - return &client{url, ip, &http.Client{Timeout: 10 * time.Second}} -} - -func NewClient(url string) Client { - ip := "" - return newClient(url, ip) -} - -func NewClientWithIPAndWait(url, ip string) (Client, error) { - client := newClient(url, ip) - - if err := testConnection(client); err != nil { - return nil, err - } - - return client, nil -} - -func NewClientAndWait(url string) (Client, error) { - ip := "" - client := newClient(url, ip) - - if err := testConnection(client); err != nil { - return nil, err - } - - return client, nil -} - -func (m *client) SendRequest(path string) ([]byte, error) { - req, err := http.NewRequest("GET", m.url+path, nil) - req.Header.Add("Accept", "application/json") - if m.ip != "" { - req.Header.Add("X-Forwarded-For", m.ip) - } - resp, err := m.client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return nil, fmt.Errorf("Error %v accessing %v path", resp.StatusCode, path) - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, err - } - return body, nil -} - -func (m *client) GetVersion() (string, error) { - resp, err := m.SendRequest("/version") - if err != nil { - return "", err - } - return string(resp[:]), nil -} - -func (m *client) GetSelfHost() (Host, error) { - resp, err := m.SendRequest("/self/host") - var host Host - if err != nil { - return host, err - } - - if err = json.Unmarshal(resp, &host); err != nil { - return host, err - } - - return host, nil -} - -func (m *client) GetSelfContainer() (Container, error) { - resp, err := m.SendRequest("/self/container") - var container Container - if err != nil { - return container, err - } - - if err = json.Unmarshal(resp, &container); err != nil { - return container, err - } - - return container, nil -} - -func (m *client) GetSelfServiceByName(name string) (Service, error) { - resp, err := m.SendRequest("/self/stack/services/" + name) - var service Service - if err != nil { - return service, err - } - - if err = json.Unmarshal(resp, &service); err != nil { - return service, err - } - - return service, nil -} - -func (m *client) GetSelfService() (Service, error) { - resp, err := m.SendRequest("/self/service") - var service Service - if err != nil { - return service, err - } - - if err = json.Unmarshal(resp, &service); err != nil { - return service, err - } - - return service, nil -} - -func (m *client) GetSelfStack() (Stack, error) { - resp, err := m.SendRequest("/self/stack") - var stack Stack - if err != nil { - return stack, err - } - - if err = json.Unmarshal(resp, &stack); err != nil { - return stack, err - } - - return stack, nil -} - -func (m *client) GetServices() ([]Service, error) { - resp, err := m.SendRequest("/services") - var services []Service - if err != nil { - return services, err - } - - if err = json.Unmarshal(resp, &services); err != nil { - return services, err - } - return services, nil -} - -func (m *client) GetStacks() ([]Stack, error) { - resp, err := m.SendRequest("/stacks") - var stacks []Stack - if err != nil { - return stacks, err - } - - if err = json.Unmarshal(resp, &stacks); err != nil { - return stacks, err - } - return stacks, nil -} - -func (m *client) GetStackByName(name string) (Stack, error) { - resp, err := m.SendRequest("/stacks/" + name) - var stack Stack - if err != nil { - return stack, err - } - - if err = json.Unmarshal(resp, &stack); err != nil { - return stack, err - } - - return stack, nil -} - -func (m *client) GetContainers() ([]Container, error) { - resp, err := m.SendRequest("/containers") - var containers []Container - if err != nil { - return containers, err - } - - if err = json.Unmarshal(resp, &containers); err != nil { - return containers, err - } - return containers, nil -} - -func (m *client) GetServiceContainers(serviceName string, stackName string) ([]Container, error) { - var serviceContainers = []Container{} - containers, err := m.GetContainers() - if err != nil { - return serviceContainers, err - } - - for _, container := range containers { - if container.StackName == stackName && container.ServiceName == serviceName { - serviceContainers = append(serviceContainers, container) - } - } - - return serviceContainers, nil -} - -func (m *client) GetHosts() ([]Host, error) { - resp, err := m.SendRequest("/hosts") - var hosts []Host - if err != nil { - return hosts, err - } - - if err = json.Unmarshal(resp, &hosts); err != nil { - return hosts, err - } - return hosts, nil -} - -func (m *client) GetHost(UUID string) (Host, error) { - var host Host - hosts, err := m.GetHosts() - if err != nil { - return host, err - } - for _, host := range hosts { - if host.UUID == UUID { - return host, nil - } - } - - return host, fmt.Errorf("could not find host by UUID %v", UUID) -} - -func (m *client) GetNetworks() ([]Network, error) { - resp, err := m.SendRequest("/networks") - var networks []Network - if err != nil { - return networks, err - } - - if err = json.Unmarshal(resp, &networks); err != nil { - return networks, err - } - - return networks, nil -} diff --git a/vendor/github.com/rancher/go-rancher-metadata/metadata/types.go b/vendor/github.com/rancher/go-rancher-metadata/metadata/types.go deleted file mode 100644 index d07999150..000000000 --- a/vendor/github.com/rancher/go-rancher-metadata/metadata/types.go +++ /dev/null @@ -1,156 +0,0 @@ -package metadata - -type Stack struct { - EnvironmentName string `json:"environment_name"` - EnvironmentUUID string `json:"environment_uuid"` - Name string `json:"name"` - UUID string `json:"uuid"` - Services []Service `json:"services"` - System bool `json:"system"` -} - -type HealthCheck struct { - HealthyThreshold int `json:"healthy_threshold"` - Interval int `json:"interval"` - Port int `json:"port"` - RequestLine string `json:"request_line"` - ResponseTimeout int `json:"response_timeout"` - UnhealthyThreshold int `json:"unhealthy_threshold"` -} - -type Service struct { - Scale int `json:"scale"` - Name string `json:"name"` - StackName string `json:"stack_name"` - StackUUID string `json:"stack_uuid"` - Kind string `json:"kind"` - Hostname string `json:"hostname"` - Vip string `json:"vip"` - CreateIndex int `json:"create_index"` - UUID string `json:"uuid"` - ExternalIps []string `json:"external_ips"` - Sidekicks []string `json:"sidekicks"` - Containers []Container `json:"containers"` - Ports []string `json:"ports"` - Labels map[string]string `json:"labels"` - Links map[string]string `json:"links"` - Metadata map[string]interface{} `json:"metadata"` - Token string `json:"token"` - Fqdn string `json:"fqdn"` - HealthCheck HealthCheck `json:"health_check"` - PrimaryServiceName string `json:"primary_service_name"` - LBConfig LBConfig `json:"lb_config"` - EnvironmentUUID string `json:"environment_uuid"` - State string `json:"state"` - System bool `json:"system"` - EnvironmentName string `json:"environment_name"` - Selector string `json:"selector"` -} - -type Container struct { - Name string `json:"name"` - PrimaryIp string `json:"primary_ip"` - PrimaryMacAddress string `json:"primary_mac_address"` - Ips []string `json:"ips"` - Ports []string `json:"ports"` - ServiceName string `json:"service_name"` - ServiceIndex string `json:"service_index"` - StackName string `json:"stack_name"` - StackUUID string `json:"stack_uuid"` - Labels map[string]string `json:"labels"` - CreateIndex int `json:"create_index"` - HostUUID string `json:"host_uuid"` - UUID string `json:"uuid"` - State string `json:"state"` - HealthState string `json:"health_state"` - ExternalId string `json:"external_id"` - StartCount int `json:"start_count"` - MemoryReservation int64 `json:"memory_reservation"` - MilliCPUReservation int64 `json:"milli_cpu_reservation"` - Dns []string `json:"dns"` - DnsSearch []string `json:"dns_search"` - HealthCheckHosts []string `json:"health_check_hosts"` - NetworkFromContainerUUID string `json:"network_from_container_uuid"` - NetworkUUID string `json:"network_uuid"` - Links map[string]string `json:"links"` - System bool `json:"system"` - EnvironmentUUID string `json:"environment_uuid"` - HealthCheck HealthCheck `json:"health_check"` - EnvironmentName string `json:"environment_name"` - ServiceUUID string `json:"service_uuid"` -} - -type Network struct { - Name string `json:"name"` - UUID string `json:"uuid"` - EnvironmentUUID string `json:"environment_uuid"` - Metadata map[string]interface{} `json:"metadata"` - HostPorts bool `json:"host_ports"` - Default bool `json:"is_default"` - Policy []NetworkPolicyRule `json:"policy,omitempty"` - DefaultPolicyAction string `json:"default_policy_action"` -} - -type Host struct { - Name string `json:"name"` - AgentIP string `json:"agent_ip"` - HostId int `json:"host_id"` - Labels map[string]string `json:"labels"` - UUID string `json:"uuid"` - Hostname string `json:"hostname"` - Memory int64 `json:"memory"` - MilliCPU int64 `json:"milli_cpu"` - LocalStorageMb int64 `json:"local_storage_mb"` - EnvironmentUUID string `json:"environment_uuid"` - State string `json:"state"` -} - -type PortRule struct { - SourcePort int `json:"source_port"` - Protocol string `json:"protocol"` - Path string `json:"path"` - Hostname string `json:"hostname"` - Service string `json:"service"` - TargetPort int `json:"target_port"` - Priority int `json:"priority"` - BackendName string `json:"backend_name"` - Selector string `json:"selector"` - Container string `json:"container"` - ContainerUUID string `json:"container_uuid"` -} - -type LBConfig struct { - CertificateIDs []string `json:"certificate_ids"` - DefaultCertificateID string `json:"default_certificate_id"` - PortRules []PortRule `json:"port_rules"` - Config string `json:"config"` - StickinessPolicy LBStickinessPolicy `json:"stickiness_policy"` -} - -type LBStickinessPolicy struct { - Name string `json:"name"` - Cookie string `json:"cookie"` - Domain string `json:"domain"` - Indirect bool `json:"indirect"` - Nocache bool `json:"nocache"` - Postonly bool `json:"postonly"` - Mode string `json:"mode"` -} - -type NetworkPolicyRuleBetween struct { - Selector string `yaml:"selector,omitempty"` - GroupBy string `yaml:"groupBy,omitempty"` -} - -type NetworkPolicyRuleMember struct { - Selector string `yaml:"selector,omitempty"` -} - -type NetworkPolicyRule struct { - From *NetworkPolicyRuleMember `yaml:"from"` - To *NetworkPolicyRuleMember `yaml:"to"` - Ports []string `yaml:"ports"` - Within string `yaml:"within"` - Between *NetworkPolicyRuleBetween `yaml:"between"` - Action string `yaml:"action"` -} diff --git a/vendor/github.com/rancher/go-rancher-metadata/metadata/utils.go b/vendor/github.com/rancher/go-rancher-metadata/metadata/utils.go deleted file mode 100644 index 509a53016..000000000 --- a/vendor/github.com/rancher/go-rancher-metadata/metadata/utils.go +++ /dev/null @@ -1,19 +0,0 @@ -package metadata - -import ( - "time" -) - -func testConnection(mdClient Client) error { - var err error - maxTime := 20 * time.Second - - for i := 1 * time.Second; i < maxTime; i *= time.Duration(2) { - if _, err = mdClient.GetVersion(); err != nil { - time.Sleep(i) - } else { - return nil - } - } - return err -} diff --git a/vendor/github.com/rancher/go-rancher/LICENSE b/vendor/github.com/rancher/go-rancher/LICENSE deleted file mode 100644 index f433b1a53..000000000 --- a/vendor/github.com/rancher/go-rancher/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/vendor/github.com/rancher/go-rancher/v2/client.go b/vendor/github.com/rancher/go-rancher/v2/client.go deleted file mode 100644 index fef9e40fa..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/client.go +++ /dev/null @@ -1,39 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/gorilla/websocket" -) - -type RancherBaseClientImpl struct { - Opts *ClientOpts - Schemas *Schemas - Types map[string]Schema -} - -type RancherBaseClient interface { - Websocket(string, map[string][]string) (*websocket.Conn, *http.Response, error) - List(string, *ListOpts, interface{}) error - Post(string, interface{}, interface{}) error - GetLink(Resource, string, interface{}) error - Create(string, interface{}, interface{}) error - Update(string, *Resource, interface{}, interface{}) error - ById(string, string, interface{}) error - Delete(*Resource) error - Reload(*Resource, interface{}) error - Action(string, string, *Resource, interface{}, interface{}) error - GetOpts() *ClientOpts - GetSchemas() *Schemas - GetTypes() map[string]Schema - - doGet(string, *ListOpts, interface{}) error - doList(string, *ListOpts, interface{}) error - doNext(string, interface{}) error - doModify(string, string, interface{}, interface{}) error - doCreate(string, interface{}, interface{}) error - doUpdate(string, *Resource, interface{}, interface{}) error - doById(string, string, interface{}) error - doResourceDelete(string, *Resource) error - doAction(string, string, *Resource, interface{}, interface{}) error -} diff --git a/vendor/github.com/rancher/go-rancher/v2/common.go b/vendor/github.com/rancher/go-rancher/v2/common.go deleted file mode 100644 index 977016582..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/common.go +++ /dev/null @@ -1,620 +0,0 @@ -package client - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "os" - "regexp" - "strings" - "time" - - "github.com/gorilla/websocket" - "github.com/pkg/errors" -) - -const ( - SELF = "self" - COLLECTION = "collection" -) - -var ( - debug = false - dialer = &websocket.Dialer{} - privateFieldRegex = regexp.MustCompile("^[[:lower:]]") -) - -type ClientOpts struct { - Url string - AccessKey string - SecretKey string - Timeout time.Duration -} - -type ApiError struct { - StatusCode int - Url string - Msg string - Status string - Body string -} - -func (e *ApiError) Error() string { - return e.Msg -} - -func IsNotFound(err error) bool { - apiError, ok := err.(*ApiError) - if !ok { - return false - } - - return apiError.StatusCode == http.StatusNotFound -} - -func newApiError(resp *http.Response, url string) *ApiError { - contents, err := ioutil.ReadAll(resp.Body) - var body string - if err != nil { - body = "Unreadable body." - } else { - body = string(contents) - } - - data := map[string]interface{}{} - if json.Unmarshal(contents, &data) == nil { - delete(data, "id") - delete(data, "links") - delete(data, "actions") - delete(data, "type") - delete(data, "status") - buf := &bytes.Buffer{} - for k, v := range data { - if v == nil { - continue - } - if buf.Len() > 0 { - buf.WriteString(", ") - } - fmt.Fprintf(buf, "%s=%v", k, v) - } - body = buf.String() - } - formattedMsg := fmt.Sprintf("Bad response statusCode [%d]. Status [%s]. Body: [%s] from [%s]", - resp.StatusCode, resp.Status, body, url) - return &ApiError{ - Url: url, - Msg: formattedMsg, - StatusCode: resp.StatusCode, - Status: resp.Status, - Body: body, - } -} - -func contains(array []string, item string) bool { - for _, check := range array { - if check == item { - return true - } - } - - return false -} - -func appendFilters(urlString string, filters map[string]interface{}) (string, error) { - if len(filters) == 0 { - return urlString, nil - } - - u, err := url.Parse(urlString) - if err != nil { - return "", err - } - - q := u.Query() - for k, v := range filters { - if l, ok := v.([]string); ok { - for _, v := range l { - q.Add(k, v) - } - } else { - q.Add(k, fmt.Sprintf("%v", v)) - } - } - - u.RawQuery = q.Encode() - return u.String(), nil -} - -func NormalizeUrl(existingUrl string) (string, error) { - u, err := url.Parse(existingUrl) - if err != nil { - return "", err - } - - if u.Path == "" || u.Path == "/" { - u.Path = "v2-beta" - } else if u.Path == "/v1" || strings.HasPrefix(u.Path, "/v1/") { - u.Path = strings.Replace(u.Path, "/v1", "/v2-beta", 1) - } - - return u.String(), nil -} - -func setupRancherBaseClient(rancherClient *RancherBaseClientImpl, opts *ClientOpts) error { - var err error - opts.Url, err = NormalizeUrl(opts.Url) - if err != nil { - return err - } - - if opts.Timeout == 0 { - opts.Timeout = time.Second * 10 - } - client := &http.Client{Timeout: opts.Timeout} - req, err := http.NewRequest("GET", opts.Url, nil) - if err != nil { - return err - } - - req.SetBasicAuth(opts.AccessKey, opts.SecretKey) - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return newApiError(resp, opts.Url) - } - - schemasUrls := resp.Header.Get("X-API-Schemas") - if len(schemasUrls) == 0 { - return errors.New("Failed to find schema at [" + opts.Url + "]") - } - - if schemasUrls != opts.Url { - req, err = http.NewRequest("GET", schemasUrls, nil) - req.SetBasicAuth(opts.AccessKey, opts.SecretKey) - if err != nil { - return err - } - - resp, err = client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return newApiError(resp, opts.Url) - } - } - - var schemas Schemas - bytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - err = json.Unmarshal(bytes, &schemas) - if err != nil { - return err - } - - rancherClient.Opts = opts - rancherClient.Schemas = &schemas - - for _, schema := range schemas.Data { - rancherClient.Types[schema.Id] = schema - } - - return nil -} - -func NewListOpts() *ListOpts { - return &ListOpts{ - Filters: map[string]interface{}{}, - } -} - -func (rancherClient *RancherBaseClientImpl) setupRequest(req *http.Request) { - req.SetBasicAuth(rancherClient.Opts.AccessKey, rancherClient.Opts.SecretKey) -} - -func (rancherClient *RancherBaseClientImpl) newHttpClient() *http.Client { - if rancherClient.Opts.Timeout == 0 { - rancherClient.Opts.Timeout = time.Second * 10 - } - return &http.Client{Timeout: rancherClient.Opts.Timeout} -} - -func (rancherClient *RancherBaseClientImpl) doDelete(url string) error { - client := rancherClient.newHttpClient() - req, err := http.NewRequest("DELETE", url, nil) - if err != nil { - return err - } - - rancherClient.setupRequest(req) - - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - io.Copy(ioutil.Discard, resp.Body) - - if resp.StatusCode >= 300 { - return newApiError(resp, url) - } - - return nil -} - -func (rancherClient *RancherBaseClientImpl) Websocket(url string, headers map[string][]string) (*websocket.Conn, *http.Response, error) { - httpHeaders := http.Header{} - for k, v := range httpHeaders { - httpHeaders[k] = v - } - - if rancherClient.Opts != nil { - s := rancherClient.Opts.AccessKey + ":" + rancherClient.Opts.SecretKey - httpHeaders.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(s))) - } - - return dialer.Dial(url, http.Header(httpHeaders)) -} - -func (rancherClient *RancherBaseClientImpl) doGet(url string, opts *ListOpts, respObject interface{}) error { - if opts == nil { - opts = NewListOpts() - } - url, err := appendFilters(url, opts.Filters) - if err != nil { - return err - } - - if debug { - fmt.Println("GET " + url) - } - - client := rancherClient.newHttpClient() - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return err - } - - rancherClient.setupRequest(req) - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return newApiError(resp, url) - } - - byteContent, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - if debug { - fmt.Println("Response <= " + string(byteContent)) - } - - if err := json.Unmarshal(byteContent, respObject); err != nil { - return errors.Wrap(err, fmt.Sprintf("Failed to parse: %s", byteContent)) - } - - return nil -} - -func (rancherClient *RancherBaseClientImpl) List(schemaType string, opts *ListOpts, respObject interface{}) error { - return rancherClient.doList(schemaType, opts, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doList(schemaType string, opts *ListOpts, respObject interface{}) error { - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.CollectionMethods, "GET") { - return errors.New("Resource type [" + schemaType + "] is not listable") - } - - collectionUrl, ok := schema.Links[COLLECTION] - if !ok { - return errors.New("Failed to find collection URL for [" + schemaType + "]") - } - - return rancherClient.doGet(collectionUrl, opts, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doNext(nextUrl string, respObject interface{}) error { - return rancherClient.doGet(nextUrl, nil, respObject) -} - -func (rancherClient *RancherBaseClientImpl) Post(url string, createObj interface{}, respObject interface{}) error { - return rancherClient.doModify("POST", url, createObj, respObject) -} - -func (rancherClient *RancherBaseClientImpl) GetLink(resource Resource, link string, respObject interface{}) error { - url := resource.Links[link] - if url == "" { - return fmt.Errorf("Failed to find link: %s", link) - } - - return rancherClient.doGet(url, &ListOpts{}, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doModify(method string, url string, createObj interface{}, respObject interface{}) error { - bodyContent, err := json.Marshal(createObj) - if err != nil { - return err - } - - if debug { - fmt.Println(method + " " + url) - fmt.Println("Request => " + string(bodyContent)) - } - - client := rancherClient.newHttpClient() - req, err := http.NewRequest(method, url, bytes.NewBuffer(bodyContent)) - if err != nil { - return err - } - - rancherClient.setupRequest(req) - req.Header.Set("Content-Type", "application/json") - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return newApiError(resp, url) - } - - byteContent, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - if len(byteContent) > 0 { - if debug { - fmt.Println("Response <= " + string(byteContent)) - } - return json.Unmarshal(byteContent, respObject) - } - - return nil -} - -func (rancherClient *RancherBaseClientImpl) Create(schemaType string, createObj interface{}, respObject interface{}) error { - return rancherClient.doCreate(schemaType, createObj, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doCreate(schemaType string, createObj interface{}, respObject interface{}) error { - if createObj == nil { - createObj = map[string]string{} - } - if respObject == nil { - respObject = &map[string]interface{}{} - } - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.CollectionMethods, "POST") { - return errors.New("Resource type [" + schemaType + "] is not creatable") - } - - var collectionUrl string - collectionUrl, ok = schema.Links[COLLECTION] - if !ok { - // return errors.New("Failed to find collection URL for [" + schemaType + "]") - // This is a hack to address https://github.com/rancher/cattle/issues/254 - re := regexp.MustCompile("schemas.*") - collectionUrl = re.ReplaceAllString(schema.Links[SELF], schema.PluralName) - } - - return rancherClient.doModify("POST", collectionUrl, createObj, respObject) -} - -func (rancherClient *RancherBaseClientImpl) Update(schemaType string, existing *Resource, updates interface{}, respObject interface{}) error { - return rancherClient.doUpdate(schemaType, existing, updates, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doUpdate(schemaType string, existing *Resource, updates interface{}, respObject interface{}) error { - if existing == nil { - return errors.New("Existing object is nil") - } - - selfUrl, ok := existing.Links[SELF] - if !ok { - return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) - } - - if updates == nil { - updates = map[string]string{} - } - - if respObject == nil { - respObject = &map[string]interface{}{} - } - - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "PUT") { - return errors.New("Resource type [" + schemaType + "] is not updatable") - } - - return rancherClient.doModify("PUT", selfUrl, updates, respObject) -} - -func (rancherClient *RancherBaseClientImpl) ById(schemaType string, id string, respObject interface{}) error { - return rancherClient.doById(schemaType, id, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doById(schemaType string, id string, respObject interface{}) error { - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "GET") { - return errors.New("Resource type [" + schemaType + "] can not be looked up by ID") - } - - collectionUrl, ok := schema.Links[COLLECTION] - if !ok { - return errors.New("Failed to find collection URL for [" + schemaType + "]") - } - - err := rancherClient.doGet(collectionUrl+"/"+id, nil, respObject) - //TODO check for 404 and return nil, nil - return err -} - -func (rancherClient *RancherBaseClientImpl) Delete(existing *Resource) error { - if existing == nil { - return nil - } - return rancherClient.doResourceDelete(existing.Type, existing) -} - -func (rancherClient *RancherBaseClientImpl) doResourceDelete(schemaType string, existing *Resource) error { - schema, ok := rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - if !contains(schema.ResourceMethods, "DELETE") { - return errors.New("Resource type [" + schemaType + "] can not be deleted") - } - - selfUrl, ok := existing.Links[SELF] - if !ok { - return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) - } - - return rancherClient.doDelete(selfUrl) -} - -func (rancherClient *RancherBaseClientImpl) Reload(existing *Resource, output interface{}) error { - selfUrl, ok := existing.Links[SELF] - if !ok { - return errors.New(fmt.Sprintf("Failed to find self URL of [%v]", existing)) - } - - return rancherClient.doGet(selfUrl, NewListOpts(), output) -} - -func (rancherClient *RancherBaseClientImpl) Action(schemaType string, action string, - existing *Resource, inputObject, respObject interface{}) error { - return rancherClient.doAction(schemaType, action, existing, inputObject, respObject) -} - -func (rancherClient *RancherBaseClientImpl) doAction(schemaType string, action string, - existing *Resource, inputObject, respObject interface{}) error { - - if existing == nil { - return errors.New("Existing object is nil") - } - - actionUrl, ok := existing.Actions[action] - if !ok { - return errors.New(fmt.Sprintf("Action [%v] not available on [%v]", action, existing)) - } - - _, ok = rancherClient.Types[schemaType] - if !ok { - return errors.New("Unknown schema type [" + schemaType + "]") - } - - var input io.Reader - - if inputObject != nil { - bodyContent, err := json.Marshal(inputObject) - if err != nil { - return err - } - if debug { - fmt.Println("Request => " + string(bodyContent)) - } - input = bytes.NewBuffer(bodyContent) - } - - client := rancherClient.newHttpClient() - req, err := http.NewRequest("POST", actionUrl, input) - if err != nil { - return err - } - - rancherClient.setupRequest(req) - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Content-Length", "0") - - resp, err := client.Do(req) - if err != nil { - return err - } - - defer resp.Body.Close() - - if resp.StatusCode >= 300 { - return newApiError(resp, actionUrl) - } - - byteContent, err := ioutil.ReadAll(resp.Body) - if err != nil { - return err - } - - if debug { - fmt.Println("Response <= " + string(byteContent)) - } - - return json.Unmarshal(byteContent, respObject) -} - -func (rancherClient *RancherBaseClientImpl) GetOpts() *ClientOpts { - return rancherClient.Opts -} - -func (rancherClient *RancherBaseClientImpl) GetSchemas() *Schemas { - return rancherClient.Schemas -} - -func (rancherClient *RancherBaseClientImpl) GetTypes() map[string]Schema { - return rancherClient.Types -} - -func init() { - debug = os.Getenv("RANCHER_CLIENT_DEBUG") == "true" - if debug { - fmt.Println("Rancher client debug on") - } -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_account.go b/vendor/github.com/rancher/go-rancher/v2/generated_account.go deleted file mode 100644 index c4b86be32..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_account.go +++ /dev/null @@ -1,186 +0,0 @@ -package client - -const ( - ACCOUNT_TYPE = "account" -) - -type Account struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` - - Identity string `json:"identity,omitempty" yaml:"identity,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} - -type AccountCollection struct { - Collection - Data []Account `json:"data,omitempty"` - client *AccountClient -} - -type AccountClient struct { - rancherClient *RancherClient -} - -type AccountOperations interface { - List(opts *ListOpts) (*AccountCollection, error) - Create(opts *Account) (*Account, error) - Update(existing *Account, updates interface{}) (*Account, error) - ById(id string) (*Account, error) - Delete(container *Account) error - - ActionActivate(*Account) (*Account, error) - - ActionCreate(*Account) (*Account, error) - - ActionDeactivate(*Account) (*Account, error) - - ActionPurge(*Account) (*Account, error) - - ActionRemove(*Account) (*Account, error) - - ActionUpdate(*Account) (*Account, error) - - ActionUpgrade(*Account) (*Account, error) -} - -func newAccountClient(rancherClient *RancherClient) *AccountClient { - return &AccountClient{ - rancherClient: rancherClient, - } -} - -func (c *AccountClient) Create(container *Account) (*Account, error) { - resp := &Account{} - err := c.rancherClient.doCreate(ACCOUNT_TYPE, container, resp) - return resp, err -} - -func (c *AccountClient) Update(existing *Account, updates interface{}) (*Account, error) { - resp := &Account{} - err := c.rancherClient.doUpdate(ACCOUNT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AccountClient) List(opts *ListOpts) (*AccountCollection, error) { - resp := &AccountCollection{} - err := c.rancherClient.doList(ACCOUNT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AccountCollection) Next() (*AccountCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AccountCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AccountClient) ById(id string) (*Account, error) { - resp := &Account{} - err := c.rancherClient.doById(ACCOUNT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AccountClient) Delete(container *Account) error { - return c.rancherClient.doResourceDelete(ACCOUNT_TYPE, &container.Resource) -} - -func (c *AccountClient) ActionActivate(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionCreate(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionDeactivate(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionPurge(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionRemove(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionUpdate(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AccountClient) ActionUpgrade(resource *Account) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(ACCOUNT_TYPE, "upgrade", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go deleted file mode 100644 index b1799a31d..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_active_setting.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - ACTIVE_SETTING_TYPE = "activeSetting" -) - -type ActiveSetting struct { - Resource - - ActiveValue interface{} `json:"activeValue,omitempty" yaml:"active_value,omitempty"` - - InDb bool `json:"inDb,omitempty" yaml:"in_db,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Source string `json:"source,omitempty" yaml:"source,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type ActiveSettingCollection struct { - Collection - Data []ActiveSetting `json:"data,omitempty"` - client *ActiveSettingClient -} - -type ActiveSettingClient struct { - rancherClient *RancherClient -} - -type ActiveSettingOperations interface { - List(opts *ListOpts) (*ActiveSettingCollection, error) - Create(opts *ActiveSetting) (*ActiveSetting, error) - Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) - ById(id string) (*ActiveSetting, error) - Delete(container *ActiveSetting) error -} - -func newActiveSettingClient(rancherClient *RancherClient) *ActiveSettingClient { - return &ActiveSettingClient{ - rancherClient: rancherClient, - } -} - -func (c *ActiveSettingClient) Create(container *ActiveSetting) (*ActiveSetting, error) { - resp := &ActiveSetting{} - err := c.rancherClient.doCreate(ACTIVE_SETTING_TYPE, container, resp) - return resp, err -} - -func (c *ActiveSettingClient) Update(existing *ActiveSetting, updates interface{}) (*ActiveSetting, error) { - resp := &ActiveSetting{} - err := c.rancherClient.doUpdate(ACTIVE_SETTING_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ActiveSettingClient) List(opts *ListOpts) (*ActiveSettingCollection, error) { - resp := &ActiveSettingCollection{} - err := c.rancherClient.doList(ACTIVE_SETTING_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ActiveSettingCollection) Next() (*ActiveSettingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ActiveSettingCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ActiveSettingClient) ById(id string) (*ActiveSetting, error) { - resp := &ActiveSetting{} - err := c.rancherClient.doById(ACTIVE_SETTING_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ActiveSettingClient) Delete(container *ActiveSetting) error { - return c.rancherClient.doResourceDelete(ACTIVE_SETTING_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go deleted file mode 100644 index 88bf4a7eb..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_add_outputs_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - ADD_OUTPUTS_INPUT_TYPE = "addOutputsInput" -) - -type AddOutputsInput struct { - Resource - - Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"` -} - -type AddOutputsInputCollection struct { - Collection - Data []AddOutputsInput `json:"data,omitempty"` - client *AddOutputsInputClient -} - -type AddOutputsInputClient struct { - rancherClient *RancherClient -} - -type AddOutputsInputOperations interface { - List(opts *ListOpts) (*AddOutputsInputCollection, error) - Create(opts *AddOutputsInput) (*AddOutputsInput, error) - Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) - ById(id string) (*AddOutputsInput, error) - Delete(container *AddOutputsInput) error -} - -func newAddOutputsInputClient(rancherClient *RancherClient) *AddOutputsInputClient { - return &AddOutputsInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddOutputsInputClient) Create(container *AddOutputsInput) (*AddOutputsInput, error) { - resp := &AddOutputsInput{} - err := c.rancherClient.doCreate(ADD_OUTPUTS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddOutputsInputClient) Update(existing *AddOutputsInput, updates interface{}) (*AddOutputsInput, error) { - resp := &AddOutputsInput{} - err := c.rancherClient.doUpdate(ADD_OUTPUTS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddOutputsInputClient) List(opts *ListOpts) (*AddOutputsInputCollection, error) { - resp := &AddOutputsInputCollection{} - err := c.rancherClient.doList(ADD_OUTPUTS_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AddOutputsInputCollection) Next() (*AddOutputsInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AddOutputsInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AddOutputsInputClient) ById(id string) (*AddOutputsInput, error) { - resp := &AddOutputsInput{} - err := c.rancherClient.doById(ADD_OUTPUTS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddOutputsInputClient) Delete(container *AddOutputsInput) error { - return c.rancherClient.doResourceDelete(ADD_OUTPUTS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go deleted file mode 100644 index 5366b4841..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_add_remove_service_link_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - ADD_REMOVE_SERVICE_LINK_INPUT_TYPE = "addRemoveServiceLinkInput" -) - -type AddRemoveServiceLinkInput struct { - Resource - - ServiceLink ServiceLink `json:"serviceLink,omitempty" yaml:"service_link,omitempty"` -} - -type AddRemoveServiceLinkInputCollection struct { - Collection - Data []AddRemoveServiceLinkInput `json:"data,omitempty"` - client *AddRemoveServiceLinkInputClient -} - -type AddRemoveServiceLinkInputClient struct { - rancherClient *RancherClient -} - -type AddRemoveServiceLinkInputOperations interface { - List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error) - Create(opts *AddRemoveServiceLinkInput) (*AddRemoveServiceLinkInput, error) - Update(existing *AddRemoveServiceLinkInput, updates interface{}) (*AddRemoveServiceLinkInput, error) - ById(id string) (*AddRemoveServiceLinkInput, error) - Delete(container *AddRemoveServiceLinkInput) error -} - -func newAddRemoveServiceLinkInputClient(rancherClient *RancherClient) *AddRemoveServiceLinkInputClient { - return &AddRemoveServiceLinkInputClient{ - rancherClient: rancherClient, - } -} - -func (c *AddRemoveServiceLinkInputClient) Create(container *AddRemoveServiceLinkInput) (*AddRemoveServiceLinkInput, error) { - resp := &AddRemoveServiceLinkInput{} - err := c.rancherClient.doCreate(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *AddRemoveServiceLinkInputClient) Update(existing *AddRemoveServiceLinkInput, updates interface{}) (*AddRemoveServiceLinkInput, error) { - resp := &AddRemoveServiceLinkInput{} - err := c.rancherClient.doUpdate(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AddRemoveServiceLinkInputClient) List(opts *ListOpts) (*AddRemoveServiceLinkInputCollection, error) { - resp := &AddRemoveServiceLinkInputCollection{} - err := c.rancherClient.doList(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AddRemoveServiceLinkInputCollection) Next() (*AddRemoveServiceLinkInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AddRemoveServiceLinkInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AddRemoveServiceLinkInputClient) ById(id string) (*AddRemoveServiceLinkInput, error) { - resp := &AddRemoveServiceLinkInput{} - err := c.rancherClient.doById(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AddRemoveServiceLinkInputClient) Delete(container *AddRemoveServiceLinkInput) error { - return c.rancherClient.doResourceDelete(ADD_REMOVE_SERVICE_LINK_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_agent.go b/vendor/github.com/rancher/go-rancher/v2/generated_agent.go deleted file mode 100644 index d38463117..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_agent.go +++ /dev/null @@ -1,206 +0,0 @@ -package client - -const ( - AGENT_TYPE = "agent" -) - -type Agent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ManagedConfig bool `json:"managedConfig,omitempty" yaml:"managed_config,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type AgentCollection struct { - Collection - Data []Agent `json:"data,omitempty"` - client *AgentClient -} - -type AgentClient struct { - rancherClient *RancherClient -} - -type AgentOperations interface { - List(opts *ListOpts) (*AgentCollection, error) - Create(opts *Agent) (*Agent, error) - Update(existing *Agent, updates interface{}) (*Agent, error) - ById(id string) (*Agent, error) - Delete(container *Agent) error - - ActionActivate(*Agent) (*Agent, error) - - ActionCreate(*Agent) (*Agent, error) - - ActionDeactivate(*Agent) (*Agent, error) - - ActionDisconnect(*Agent) (*Agent, error) - - ActionFinishreconnect(*Agent) (*Agent, error) - - ActionPurge(*Agent) (*Agent, error) - - ActionReconnect(*Agent) (*Agent, error) - - ActionRemove(*Agent) (*Agent, error) - - ActionUpdate(*Agent) (*Agent, error) -} - -func newAgentClient(rancherClient *RancherClient) *AgentClient { - return &AgentClient{ - rancherClient: rancherClient, - } -} - -func (c *AgentClient) Create(container *Agent) (*Agent, error) { - resp := &Agent{} - err := c.rancherClient.doCreate(AGENT_TYPE, container, resp) - return resp, err -} - -func (c *AgentClient) Update(existing *Agent, updates interface{}) (*Agent, error) { - resp := &Agent{} - err := c.rancherClient.doUpdate(AGENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AgentClient) List(opts *ListOpts) (*AgentCollection, error) { - resp := &AgentCollection{} - err := c.rancherClient.doList(AGENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AgentCollection) Next() (*AgentCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AgentCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AgentClient) ById(id string) (*Agent, error) { - resp := &Agent{} - err := c.rancherClient.doById(AGENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AgentClient) Delete(container *Agent) error { - return c.rancherClient.doResourceDelete(AGENT_TYPE, &container.Resource) -} - -func (c *AgentClient) ActionActivate(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionCreate(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionDeactivate(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionDisconnect(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "disconnect", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionFinishreconnect(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "finishreconnect", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionPurge(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionReconnect(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "reconnect", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionRemove(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *AgentClient) ActionUpdate(resource *Agent) (*Agent, error) { - - resp := &Agent{} - - err := c.rancherClient.doAction(AGENT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go b/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go deleted file mode 100644 index d75359519..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_amazonec2config.go +++ /dev/null @@ -1,137 +0,0 @@ -package client - -const ( - AMAZONEC2CONFIG_TYPE = "amazonec2Config" -) - -type Amazonec2Config struct { - Resource - - AccessKey string `json:"accessKey,omitempty" yaml:"access_key,omitempty"` - - Ami string `json:"ami,omitempty" yaml:"ami,omitempty"` - - BlockDurationMinutes string `json:"blockDurationMinutes,omitempty" yaml:"block_duration_minutes,omitempty"` - - DeviceName string `json:"deviceName,omitempty" yaml:"device_name,omitempty"` - - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - - IamInstanceProfile string `json:"iamInstanceProfile,omitempty" yaml:"iam_instance_profile,omitempty"` - - InsecureTransport bool `json:"insecureTransport,omitempty" yaml:"insecure_transport,omitempty"` - - InstanceType string `json:"instanceType,omitempty" yaml:"instance_type,omitempty"` - - KeypairName string `json:"keypairName,omitempty" yaml:"keypair_name,omitempty"` - - Monitoring bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` - - OpenPort []string `json:"openPort,omitempty" yaml:"open_port,omitempty"` - - PrivateAddressOnly bool `json:"privateAddressOnly,omitempty" yaml:"private_address_only,omitempty"` - - Region string `json:"region,omitempty" yaml:"region,omitempty"` - - RequestSpotInstance bool `json:"requestSpotInstance,omitempty" yaml:"request_spot_instance,omitempty"` - - Retries string `json:"retries,omitempty" yaml:"retries,omitempty"` - - RootSize string `json:"rootSize,omitempty" yaml:"root_size,omitempty"` - - SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` - - SecurityGroup []string `json:"securityGroup,omitempty" yaml:"security_group,omitempty"` - - SessionToken string `json:"sessionToken,omitempty" yaml:"session_token,omitempty"` - - SpotPrice string `json:"spotPrice,omitempty" yaml:"spot_price,omitempty"` - - SshKeypath string `json:"sshKeypath,omitempty" yaml:"ssh_keypath,omitempty"` - - SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - - SubnetId string `json:"subnetId,omitempty" yaml:"subnet_id,omitempty"` - - Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` - - UseEbsOptimizedInstance bool `json:"useEbsOptimizedInstance,omitempty" yaml:"use_ebs_optimized_instance,omitempty"` - - UsePrivateAddress bool `json:"usePrivateAddress,omitempty" yaml:"use_private_address,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - - VolumeType string `json:"volumeType,omitempty" yaml:"volume_type,omitempty"` - - VpcId string `json:"vpcId,omitempty" yaml:"vpc_id,omitempty"` - - Zone string `json:"zone,omitempty" yaml:"zone,omitempty"` -} - -type Amazonec2ConfigCollection struct { - Collection - Data []Amazonec2Config `json:"data,omitempty"` - client *Amazonec2ConfigClient -} - -type Amazonec2ConfigClient struct { - rancherClient *RancherClient -} - -type Amazonec2ConfigOperations interface { - List(opts *ListOpts) (*Amazonec2ConfigCollection, error) - Create(opts *Amazonec2Config) (*Amazonec2Config, error) - Update(existing *Amazonec2Config, updates interface{}) (*Amazonec2Config, error) - ById(id string) (*Amazonec2Config, error) - Delete(container *Amazonec2Config) error -} - -func newAmazonec2ConfigClient(rancherClient *RancherClient) *Amazonec2ConfigClient { - return &Amazonec2ConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *Amazonec2ConfigClient) Create(container *Amazonec2Config) (*Amazonec2Config, error) { - resp := &Amazonec2Config{} - err := c.rancherClient.doCreate(AMAZONEC2CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *Amazonec2ConfigClient) Update(existing *Amazonec2Config, updates interface{}) (*Amazonec2Config, error) { - resp := &Amazonec2Config{} - err := c.rancherClient.doUpdate(AMAZONEC2CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *Amazonec2ConfigClient) List(opts *ListOpts) (*Amazonec2ConfigCollection, error) { - resp := &Amazonec2ConfigCollection{} - err := c.rancherClient.doList(AMAZONEC2CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *Amazonec2ConfigCollection) Next() (*Amazonec2ConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &Amazonec2ConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *Amazonec2ConfigClient) ById(id string) (*Amazonec2Config, error) { - resp := &Amazonec2Config{} - err := c.rancherClient.doById(AMAZONEC2CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *Amazonec2ConfigClient) Delete(container *Amazonec2Config) error { - return c.rancherClient.doResourceDelete(AMAZONEC2CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go b/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go deleted file mode 100644 index 91dc09dca..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_api_key.go +++ /dev/null @@ -1,173 +0,0 @@ -package client - -const ( - API_KEY_TYPE = "apiKey" -) - -type ApiKey struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ApiKeyCollection struct { - Collection - Data []ApiKey `json:"data,omitempty"` - client *ApiKeyClient -} - -type ApiKeyClient struct { - rancherClient *RancherClient -} - -type ApiKeyOperations interface { - List(opts *ListOpts) (*ApiKeyCollection, error) - Create(opts *ApiKey) (*ApiKey, error) - Update(existing *ApiKey, updates interface{}) (*ApiKey, error) - ById(id string) (*ApiKey, error) - Delete(container *ApiKey) error - - ActionActivate(*ApiKey) (*Credential, error) - - ActionCreate(*ApiKey) (*Credential, error) - - ActionDeactivate(*ApiKey) (*Credential, error) - - ActionPurge(*ApiKey) (*Credential, error) - - ActionRemove(*ApiKey) (*Credential, error) - - ActionUpdate(*ApiKey) (*Credential, error) -} - -func newApiKeyClient(rancherClient *RancherClient) *ApiKeyClient { - return &ApiKeyClient{ - rancherClient: rancherClient, - } -} - -func (c *ApiKeyClient) Create(container *ApiKey) (*ApiKey, error) { - resp := &ApiKey{} - err := c.rancherClient.doCreate(API_KEY_TYPE, container, resp) - return resp, err -} - -func (c *ApiKeyClient) Update(existing *ApiKey, updates interface{}) (*ApiKey, error) { - resp := &ApiKey{} - err := c.rancherClient.doUpdate(API_KEY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ApiKeyClient) List(opts *ListOpts) (*ApiKeyCollection, error) { - resp := &ApiKeyCollection{} - err := c.rancherClient.doList(API_KEY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ApiKeyCollection) Next() (*ApiKeyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ApiKeyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ApiKeyClient) ById(id string) (*ApiKey, error) { - resp := &ApiKey{} - err := c.rancherClient.doById(API_KEY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ApiKeyClient) Delete(container *ApiKey) error { - return c.rancherClient.doResourceDelete(API_KEY_TYPE, &container.Resource) -} - -func (c *ApiKeyClient) ActionActivate(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionCreate(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionDeactivate(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionPurge(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionRemove(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ApiKeyClient) ActionUpdate(resource *ApiKey) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(API_KEY_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go deleted file mode 100644 index 1c9d4ae0e..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_audit_log.go +++ /dev/null @@ -1,105 +0,0 @@ -package client - -const ( - AUDIT_LOG_TYPE = "auditLog" -) - -type AuditLog struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AuthType string `json:"authType,omitempty" yaml:"auth_type,omitempty"` - - AuthenticatedAsAccountId string `json:"authenticatedAsAccountId,omitempty" yaml:"authenticated_as_account_id,omitempty"` - - AuthenticatedAsIdentityId string `json:"authenticatedAsIdentityId,omitempty" yaml:"authenticated_as_identity_id,omitempty"` - - ClientIp string `json:"clientIp,omitempty" yaml:"client_ip,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - RequestObject string `json:"requestObject,omitempty" yaml:"request_object,omitempty"` - - ResourceId int64 `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` - - ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - - ResponseCode string `json:"responseCode,omitempty" yaml:"response_code,omitempty"` - - ResponseObject string `json:"responseObject,omitempty" yaml:"response_object,omitempty"` -} - -type AuditLogCollection struct { - Collection - Data []AuditLog `json:"data,omitempty"` - client *AuditLogClient -} - -type AuditLogClient struct { - rancherClient *RancherClient -} - -type AuditLogOperations interface { - List(opts *ListOpts) (*AuditLogCollection, error) - Create(opts *AuditLog) (*AuditLog, error) - Update(existing *AuditLog, updates interface{}) (*AuditLog, error) - ById(id string) (*AuditLog, error) - Delete(container *AuditLog) error -} - -func newAuditLogClient(rancherClient *RancherClient) *AuditLogClient { - return &AuditLogClient{ - rancherClient: rancherClient, - } -} - -func (c *AuditLogClient) Create(container *AuditLog) (*AuditLog, error) { - resp := &AuditLog{} - err := c.rancherClient.doCreate(AUDIT_LOG_TYPE, container, resp) - return resp, err -} - -func (c *AuditLogClient) Update(existing *AuditLog, updates interface{}) (*AuditLog, error) { - resp := &AuditLog{} - err := c.rancherClient.doUpdate(AUDIT_LOG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AuditLogClient) List(opts *ListOpts) (*AuditLogCollection, error) { - resp := &AuditLogCollection{} - err := c.rancherClient.doList(AUDIT_LOG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AuditLogCollection) Next() (*AuditLogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AuditLogCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AuditLogClient) ById(id string) (*AuditLog, error) { - resp := &AuditLog{} - err := c.rancherClient.doById(AUDIT_LOG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AuditLogClient) Delete(container *AuditLog) error { - return c.rancherClient.doResourceDelete(AUDIT_LOG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go deleted file mode 100644 index 12d1b30d5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_azure_config.go +++ /dev/null @@ -1,121 +0,0 @@ -package client - -const ( - AZURE_CONFIG_TYPE = "azureConfig" -) - -type AzureConfig struct { - Resource - - AvailabilitySet string `json:"availabilitySet,omitempty" yaml:"availability_set,omitempty"` - - ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` - - ClientSecret string `json:"clientSecret,omitempty" yaml:"client_secret,omitempty"` - - CustomData string `json:"customData,omitempty" yaml:"custom_data,omitempty"` - - Dns string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DockerPort string `json:"dockerPort,omitempty" yaml:"docker_port,omitempty"` - - Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - Location string `json:"location,omitempty" yaml:"location,omitempty"` - - NoPublicIp bool `json:"noPublicIp,omitempty" yaml:"no_public_ip,omitempty"` - - OpenPort []string `json:"openPort,omitempty" yaml:"open_port,omitempty"` - - PrivateIpAddress string `json:"privateIpAddress,omitempty" yaml:"private_ip_address,omitempty"` - - ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resource_group,omitempty"` - - Size string `json:"size,omitempty" yaml:"size,omitempty"` - - SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - - StaticPublicIp bool `json:"staticPublicIp,omitempty" yaml:"static_public_ip,omitempty"` - - StorageType string `json:"storageType,omitempty" yaml:"storage_type,omitempty"` - - Subnet string `json:"subnet,omitempty" yaml:"subnet,omitempty"` - - SubnetPrefix string `json:"subnetPrefix,omitempty" yaml:"subnet_prefix,omitempty"` - - SubscriptionId string `json:"subscriptionId,omitempty" yaml:"subscription_id,omitempty"` - - UsePrivateIp bool `json:"usePrivateIp,omitempty" yaml:"use_private_ip,omitempty"` - - Vnet string `json:"vnet,omitempty" yaml:"vnet,omitempty"` -} - -type AzureConfigCollection struct { - Collection - Data []AzureConfig `json:"data,omitempty"` - client *AzureConfigClient -} - -type AzureConfigClient struct { - rancherClient *RancherClient -} - -type AzureConfigOperations interface { - List(opts *ListOpts) (*AzureConfigCollection, error) - Create(opts *AzureConfig) (*AzureConfig, error) - Update(existing *AzureConfig, updates interface{}) (*AzureConfig, error) - ById(id string) (*AzureConfig, error) - Delete(container *AzureConfig) error -} - -func newAzureConfigClient(rancherClient *RancherClient) *AzureConfigClient { - return &AzureConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *AzureConfigClient) Create(container *AzureConfig) (*AzureConfig, error) { - resp := &AzureConfig{} - err := c.rancherClient.doCreate(AZURE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *AzureConfigClient) Update(existing *AzureConfig, updates interface{}) (*AzureConfig, error) { - resp := &AzureConfig{} - err := c.rancherClient.doUpdate(AZURE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AzureConfigClient) List(opts *ListOpts) (*AzureConfigCollection, error) { - resp := &AzureConfigCollection{} - err := c.rancherClient.doList(AZURE_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AzureConfigCollection) Next() (*AzureConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AzureConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AzureConfigClient) ById(id string) (*AzureConfig, error) { - resp := &AzureConfig{} - err := c.rancherClient.doById(AZURE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AzureConfigClient) Delete(container *AzureConfig) error { - return c.rancherClient.doResourceDelete(AZURE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go deleted file mode 100644 index 5b3117fc8..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_azureadconfig.go +++ /dev/null @@ -1,93 +0,0 @@ -package client - -const ( - AZUREADCONFIG_TYPE = "azureadconfig" -) - -type Azureadconfig struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - AdminAccountPassword string `json:"adminAccountPassword,omitempty" yaml:"admin_account_password,omitempty"` - - AdminAccountUsername string `json:"adminAccountUsername,omitempty" yaml:"admin_account_username,omitempty"` - - ClientId string `json:"clientId,omitempty" yaml:"client_id,omitempty"` - - Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - TenantId string `json:"tenantId,omitempty" yaml:"tenant_id,omitempty"` -} - -type AzureadconfigCollection struct { - Collection - Data []Azureadconfig `json:"data,omitempty"` - client *AzureadconfigClient -} - -type AzureadconfigClient struct { - rancherClient *RancherClient -} - -type AzureadconfigOperations interface { - List(opts *ListOpts) (*AzureadconfigCollection, error) - Create(opts *Azureadconfig) (*Azureadconfig, error) - Update(existing *Azureadconfig, updates interface{}) (*Azureadconfig, error) - ById(id string) (*Azureadconfig, error) - Delete(container *Azureadconfig) error -} - -func newAzureadconfigClient(rancherClient *RancherClient) *AzureadconfigClient { - return &AzureadconfigClient{ - rancherClient: rancherClient, - } -} - -func (c *AzureadconfigClient) Create(container *Azureadconfig) (*Azureadconfig, error) { - resp := &Azureadconfig{} - err := c.rancherClient.doCreate(AZUREADCONFIG_TYPE, container, resp) - return resp, err -} - -func (c *AzureadconfigClient) Update(existing *Azureadconfig, updates interface{}) (*Azureadconfig, error) { - resp := &Azureadconfig{} - err := c.rancherClient.doUpdate(AZUREADCONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *AzureadconfigClient) List(opts *ListOpts) (*AzureadconfigCollection, error) { - resp := &AzureadconfigCollection{} - err := c.rancherClient.doList(AZUREADCONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *AzureadconfigCollection) Next() (*AzureadconfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &AzureadconfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *AzureadconfigClient) ById(id string) (*Azureadconfig, error) { - resp := &Azureadconfig{} - err := c.rancherClient.doById(AZUREADCONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *AzureadconfigClient) Delete(container *Azureadconfig) error { - return c.rancherClient.doResourceDelete(AZUREADCONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_backup.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup.go deleted file mode 100644 index 755605eb0..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_backup.go +++ /dev/null @@ -1,133 +0,0 @@ -package client - -const ( - BACKUP_TYPE = "backup" -) - -type Backup struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BackupTargetId string `json:"backupTargetId,omitempty" yaml:"backup_target_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SnapshotId string `json:"snapshotId,omitempty" yaml:"snapshot_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` -} - -type BackupCollection struct { - Collection - Data []Backup `json:"data,omitempty"` - client *BackupClient -} - -type BackupClient struct { - rancherClient *RancherClient -} - -type BackupOperations interface { - List(opts *ListOpts) (*BackupCollection, error) - Create(opts *Backup) (*Backup, error) - Update(existing *Backup, updates interface{}) (*Backup, error) - ById(id string) (*Backup, error) - Delete(container *Backup) error - - ActionCreate(*Backup) (*Backup, error) - - ActionRemove(*Backup) (*Backup, error) -} - -func newBackupClient(rancherClient *RancherClient) *BackupClient { - return &BackupClient{ - rancherClient: rancherClient, - } -} - -func (c *BackupClient) Create(container *Backup) (*Backup, error) { - resp := &Backup{} - err := c.rancherClient.doCreate(BACKUP_TYPE, container, resp) - return resp, err -} - -func (c *BackupClient) Update(existing *Backup, updates interface{}) (*Backup, error) { - resp := &Backup{} - err := c.rancherClient.doUpdate(BACKUP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BackupClient) List(opts *ListOpts) (*BackupCollection, error) { - resp := &BackupCollection{} - err := c.rancherClient.doList(BACKUP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BackupCollection) Next() (*BackupCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BackupCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BackupClient) ById(id string) (*Backup, error) { - resp := &Backup{} - err := c.rancherClient.doById(BACKUP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BackupClient) Delete(container *Backup) error { - return c.rancherClient.doResourceDelete(BACKUP_TYPE, &container.Resource) -} - -func (c *BackupClient) ActionCreate(resource *Backup) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(BACKUP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *BackupClient) ActionRemove(resource *Backup) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(BACKUP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go b/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go deleted file mode 100644 index a00f2bc89..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_backup_target.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - BACKUP_TARGET_TYPE = "backupTarget" -) - -type BackupTarget struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NfsConfig *NfsConfig `json:"nfsConfig,omitempty" yaml:"nfs_config,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type BackupTargetCollection struct { - Collection - Data []BackupTarget `json:"data,omitempty"` - client *BackupTargetClient -} - -type BackupTargetClient struct { - rancherClient *RancherClient -} - -type BackupTargetOperations interface { - List(opts *ListOpts) (*BackupTargetCollection, error) - Create(opts *BackupTarget) (*BackupTarget, error) - Update(existing *BackupTarget, updates interface{}) (*BackupTarget, error) - ById(id string) (*BackupTarget, error) - Delete(container *BackupTarget) error - - ActionCreate(*BackupTarget) (*BackupTarget, error) - - ActionRemove(*BackupTarget) (*BackupTarget, error) -} - -func newBackupTargetClient(rancherClient *RancherClient) *BackupTargetClient { - return &BackupTargetClient{ - rancherClient: rancherClient, - } -} - -func (c *BackupTargetClient) Create(container *BackupTarget) (*BackupTarget, error) { - resp := &BackupTarget{} - err := c.rancherClient.doCreate(BACKUP_TARGET_TYPE, container, resp) - return resp, err -} - -func (c *BackupTargetClient) Update(existing *BackupTarget, updates interface{}) (*BackupTarget, error) { - resp := &BackupTarget{} - err := c.rancherClient.doUpdate(BACKUP_TARGET_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BackupTargetClient) List(opts *ListOpts) (*BackupTargetCollection, error) { - resp := &BackupTargetCollection{} - err := c.rancherClient.doList(BACKUP_TARGET_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BackupTargetCollection) Next() (*BackupTargetCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BackupTargetCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BackupTargetClient) ById(id string) (*BackupTarget, error) { - resp := &BackupTarget{} - err := c.rancherClient.doById(BACKUP_TARGET_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BackupTargetClient) Delete(container *BackupTarget) error { - return c.rancherClient.doResourceDelete(BACKUP_TARGET_TYPE, &container.Resource) -} - -func (c *BackupTargetClient) ActionCreate(resource *BackupTarget) (*BackupTarget, error) { - - resp := &BackupTarget{} - - err := c.rancherClient.doAction(BACKUP_TARGET_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *BackupTargetClient) ActionRemove(resource *BackupTarget) (*BackupTarget, error) { - - resp := &BackupTarget{} - - err := c.rancherClient.doAction(BACKUP_TARGET_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go deleted file mode 100644 index 0c0112de4..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_base_machine_config.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - BASE_MACHINE_CONFIG_TYPE = "baseMachineConfig" -) - -type BaseMachineConfig struct { - Resource -} - -type BaseMachineConfigCollection struct { - Collection - Data []BaseMachineConfig `json:"data,omitempty"` - client *BaseMachineConfigClient -} - -type BaseMachineConfigClient struct { - rancherClient *RancherClient -} - -type BaseMachineConfigOperations interface { - List(opts *ListOpts) (*BaseMachineConfigCollection, error) - Create(opts *BaseMachineConfig) (*BaseMachineConfig, error) - Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) - ById(id string) (*BaseMachineConfig, error) - Delete(container *BaseMachineConfig) error -} - -func newBaseMachineConfigClient(rancherClient *RancherClient) *BaseMachineConfigClient { - return &BaseMachineConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *BaseMachineConfigClient) Create(container *BaseMachineConfig) (*BaseMachineConfig, error) { - resp := &BaseMachineConfig{} - err := c.rancherClient.doCreate(BASE_MACHINE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *BaseMachineConfigClient) Update(existing *BaseMachineConfig, updates interface{}) (*BaseMachineConfig, error) { - resp := &BaseMachineConfig{} - err := c.rancherClient.doUpdate(BASE_MACHINE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BaseMachineConfigClient) List(opts *ListOpts) (*BaseMachineConfigCollection, error) { - resp := &BaseMachineConfigCollection{} - err := c.rancherClient.doList(BASE_MACHINE_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BaseMachineConfigCollection) Next() (*BaseMachineConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BaseMachineConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BaseMachineConfigClient) ById(id string) (*BaseMachineConfig, error) { - resp := &BaseMachineConfig{} - err := c.rancherClient.doById(BASE_MACHINE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BaseMachineConfigClient) Delete(container *BaseMachineConfig) error { - return c.rancherClient.doResourceDelete(BASE_MACHINE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_binding.go b/vendor/github.com/rancher/go-rancher/v2/generated_binding.go deleted file mode 100644 index 9cb4e1758..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_binding.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - BINDING_TYPE = "binding" -) - -type Binding struct { - Resource - - Services map[string]interface{} `json:"services,omitempty" yaml:"services,omitempty"` -} - -type BindingCollection struct { - Collection - Data []Binding `json:"data,omitempty"` - client *BindingClient -} - -type BindingClient struct { - rancherClient *RancherClient -} - -type BindingOperations interface { - List(opts *ListOpts) (*BindingCollection, error) - Create(opts *Binding) (*Binding, error) - Update(existing *Binding, updates interface{}) (*Binding, error) - ById(id string) (*Binding, error) - Delete(container *Binding) error -} - -func newBindingClient(rancherClient *RancherClient) *BindingClient { - return &BindingClient{ - rancherClient: rancherClient, - } -} - -func (c *BindingClient) Create(container *Binding) (*Binding, error) { - resp := &Binding{} - err := c.rancherClient.doCreate(BINDING_TYPE, container, resp) - return resp, err -} - -func (c *BindingClient) Update(existing *Binding, updates interface{}) (*Binding, error) { - resp := &Binding{} - err := c.rancherClient.doUpdate(BINDING_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BindingClient) List(opts *ListOpts) (*BindingCollection, error) { - resp := &BindingCollection{} - err := c.rancherClient.doList(BINDING_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BindingCollection) Next() (*BindingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BindingCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BindingClient) ById(id string) (*Binding, error) { - resp := &Binding{} - err := c.rancherClient.doById(BINDING_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BindingClient) Delete(container *Binding) error { - return c.rancherClient.doResourceDelete(BINDING_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go b/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go deleted file mode 100644 index bc33c7c11..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_blkio_device_option.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - BLKIO_DEVICE_OPTION_TYPE = "blkioDeviceOption" -) - -type BlkioDeviceOption struct { - Resource - - ReadBps int64 `json:"readBps,omitempty" yaml:"read_bps,omitempty"` - - ReadIops int64 `json:"readIops,omitempty" yaml:"read_iops,omitempty"` - - Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` - - WriteBps int64 `json:"writeBps,omitempty" yaml:"write_bps,omitempty"` - - WriteIops int64 `json:"writeIops,omitempty" yaml:"write_iops,omitempty"` -} - -type BlkioDeviceOptionCollection struct { - Collection - Data []BlkioDeviceOption `json:"data,omitempty"` - client *BlkioDeviceOptionClient -} - -type BlkioDeviceOptionClient struct { - rancherClient *RancherClient -} - -type BlkioDeviceOptionOperations interface { - List(opts *ListOpts) (*BlkioDeviceOptionCollection, error) - Create(opts *BlkioDeviceOption) (*BlkioDeviceOption, error) - Update(existing *BlkioDeviceOption, updates interface{}) (*BlkioDeviceOption, error) - ById(id string) (*BlkioDeviceOption, error) - Delete(container *BlkioDeviceOption) error -} - -func newBlkioDeviceOptionClient(rancherClient *RancherClient) *BlkioDeviceOptionClient { - return &BlkioDeviceOptionClient{ - rancherClient: rancherClient, - } -} - -func (c *BlkioDeviceOptionClient) Create(container *BlkioDeviceOption) (*BlkioDeviceOption, error) { - resp := &BlkioDeviceOption{} - err := c.rancherClient.doCreate(BLKIO_DEVICE_OPTION_TYPE, container, resp) - return resp, err -} - -func (c *BlkioDeviceOptionClient) Update(existing *BlkioDeviceOption, updates interface{}) (*BlkioDeviceOption, error) { - resp := &BlkioDeviceOption{} - err := c.rancherClient.doUpdate(BLKIO_DEVICE_OPTION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *BlkioDeviceOptionClient) List(opts *ListOpts) (*BlkioDeviceOptionCollection, error) { - resp := &BlkioDeviceOptionCollection{} - err := c.rancherClient.doList(BLKIO_DEVICE_OPTION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *BlkioDeviceOptionCollection) Next() (*BlkioDeviceOptionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &BlkioDeviceOptionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *BlkioDeviceOptionClient) ById(id string) (*BlkioDeviceOption, error) { - resp := &BlkioDeviceOption{} - err := c.rancherClient.doById(BLKIO_DEVICE_OPTION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *BlkioDeviceOptionClient) Delete(container *BlkioDeviceOption) error { - return c.rancherClient.doResourceDelete(BLKIO_DEVICE_OPTION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go deleted file mode 100644 index 67d073e16..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_catalog_template.go +++ /dev/null @@ -1,93 +0,0 @@ -package client - -const ( - CATALOG_TEMPLATE_TYPE = "catalogTemplate" -) - -type CatalogTemplate struct { - Resource - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Binding Binding `json:"binding,omitempty" yaml:"binding,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` - - TemplateId string `json:"templateId,omitempty" yaml:"template_id,omitempty"` - - TemplateVersionId string `json:"templateVersionId,omitempty" yaml:"template_version_id,omitempty"` -} - -type CatalogTemplateCollection struct { - Collection - Data []CatalogTemplate `json:"data,omitempty"` - client *CatalogTemplateClient -} - -type CatalogTemplateClient struct { - rancherClient *RancherClient -} - -type CatalogTemplateOperations interface { - List(opts *ListOpts) (*CatalogTemplateCollection, error) - Create(opts *CatalogTemplate) (*CatalogTemplate, error) - Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) - ById(id string) (*CatalogTemplate, error) - Delete(container *CatalogTemplate) error -} - -func newCatalogTemplateClient(rancherClient *RancherClient) *CatalogTemplateClient { - return &CatalogTemplateClient{ - rancherClient: rancherClient, - } -} - -func (c *CatalogTemplateClient) Create(container *CatalogTemplate) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.rancherClient.doCreate(CATALOG_TEMPLATE_TYPE, container, resp) - return resp, err -} - -func (c *CatalogTemplateClient) Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.rancherClient.doUpdate(CATALOG_TEMPLATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CatalogTemplateClient) List(opts *ListOpts) (*CatalogTemplateCollection, error) { - resp := &CatalogTemplateCollection{} - err := c.rancherClient.doList(CATALOG_TEMPLATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *CatalogTemplateCollection) Next() (*CatalogTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CatalogTemplateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CatalogTemplateClient) ById(id string) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.rancherClient.doById(CATALOG_TEMPLATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *CatalogTemplateClient) Delete(container *CatalogTemplate) error { - return c.rancherClient.doResourceDelete(CATALOG_TEMPLATE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go b/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go deleted file mode 100644 index fc407e8af..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_certificate.go +++ /dev/null @@ -1,162 +0,0 @@ -package client - -const ( - CERTIFICATE_TYPE = "certificate" -) - -type Certificate struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Algorithm string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"` - - CN string `json:"cN,omitempty" yaml:"cn,omitempty"` - - Cert string `json:"cert,omitempty" yaml:"cert,omitempty"` - - CertChain string `json:"certChain,omitempty" yaml:"cert_chain,omitempty"` - - CertFingerprint string `json:"certFingerprint,omitempty" yaml:"cert_fingerprint,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExpiresAt string `json:"expiresAt,omitempty" yaml:"expires_at,omitempty"` - - IssuedAt string `json:"issuedAt,omitempty" yaml:"issued_at,omitempty"` - - Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - KeySize int64 `json:"keySize,omitempty" yaml:"key_size,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SerialNumber string `json:"serialNumber,omitempty" yaml:"serial_number,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty" yaml:"subject_alternative_names,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} - -type CertificateCollection struct { - Collection - Data []Certificate `json:"data,omitempty"` - client *CertificateClient -} - -type CertificateClient struct { - rancherClient *RancherClient -} - -type CertificateOperations interface { - List(opts *ListOpts) (*CertificateCollection, error) - Create(opts *Certificate) (*Certificate, error) - Update(existing *Certificate, updates interface{}) (*Certificate, error) - ById(id string) (*Certificate, error) - Delete(container *Certificate) error - - ActionCreate(*Certificate) (*Certificate, error) - - ActionRemove(*Certificate) (*Certificate, error) - - ActionUpdate(*Certificate) (*Certificate, error) -} - -func newCertificateClient(rancherClient *RancherClient) *CertificateClient { - return &CertificateClient{ - rancherClient: rancherClient, - } -} - -func (c *CertificateClient) Create(container *Certificate) (*Certificate, error) { - resp := &Certificate{} - err := c.rancherClient.doCreate(CERTIFICATE_TYPE, container, resp) - return resp, err -} - -func (c *CertificateClient) Update(existing *Certificate, updates interface{}) (*Certificate, error) { - resp := &Certificate{} - err := c.rancherClient.doUpdate(CERTIFICATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CertificateClient) List(opts *ListOpts) (*CertificateCollection, error) { - resp := &CertificateCollection{} - err := c.rancherClient.doList(CERTIFICATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *CertificateCollection) Next() (*CertificateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CertificateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CertificateClient) ById(id string) (*Certificate, error) { - resp := &Certificate{} - err := c.rancherClient.doById(CERTIFICATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *CertificateClient) Delete(container *Certificate) error { - return c.rancherClient.doResourceDelete(CERTIFICATE_TYPE, &container.Resource) -} - -func (c *CertificateClient) ActionCreate(resource *Certificate) (*Certificate, error) { - - resp := &Certificate{} - - err := c.rancherClient.doAction(CERTIFICATE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CertificateClient) ActionRemove(resource *Certificate) (*Certificate, error) { - - resp := &Certificate{} - - err := c.rancherClient.doAction(CERTIFICATE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CertificateClient) ActionUpdate(resource *Certificate) (*Certificate, error) { - - resp := &Certificate{} - - err := c.rancherClient.doAction(CERTIFICATE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go deleted file mode 100644 index 3f866812a..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_change_secret_input.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - CHANGE_SECRET_INPUT_TYPE = "changeSecretInput" -) - -type ChangeSecretInput struct { - Resource - - NewSecret string `json:"newSecret,omitempty" yaml:"new_secret,omitempty"` - - OldSecret string `json:"oldSecret,omitempty" yaml:"old_secret,omitempty"` -} - -type ChangeSecretInputCollection struct { - Collection - Data []ChangeSecretInput `json:"data,omitempty"` - client *ChangeSecretInputClient -} - -type ChangeSecretInputClient struct { - rancherClient *RancherClient -} - -type ChangeSecretInputOperations interface { - List(opts *ListOpts) (*ChangeSecretInputCollection, error) - Create(opts *ChangeSecretInput) (*ChangeSecretInput, error) - Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) - ById(id string) (*ChangeSecretInput, error) - Delete(container *ChangeSecretInput) error -} - -func newChangeSecretInputClient(rancherClient *RancherClient) *ChangeSecretInputClient { - return &ChangeSecretInputClient{ - rancherClient: rancherClient, - } -} - -func (c *ChangeSecretInputClient) Create(container *ChangeSecretInput) (*ChangeSecretInput, error) { - resp := &ChangeSecretInput{} - err := c.rancherClient.doCreate(CHANGE_SECRET_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *ChangeSecretInputClient) Update(existing *ChangeSecretInput, updates interface{}) (*ChangeSecretInput, error) { - resp := &ChangeSecretInput{} - err := c.rancherClient.doUpdate(CHANGE_SECRET_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ChangeSecretInputClient) List(opts *ListOpts) (*ChangeSecretInputCollection, error) { - resp := &ChangeSecretInputCollection{} - err := c.rancherClient.doList(CHANGE_SECRET_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ChangeSecretInputCollection) Next() (*ChangeSecretInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ChangeSecretInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ChangeSecretInputClient) ById(id string) (*ChangeSecretInput, error) { - resp := &ChangeSecretInput{} - err := c.rancherClient.doById(CHANGE_SECRET_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ChangeSecretInputClient) Delete(container *ChangeSecretInput) error { - return c.rancherClient.doResourceDelete(CHANGE_SECRET_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_client.go b/vendor/github.com/rancher/go-rancher/v2/generated_client.go deleted file mode 100644 index 244ddb752..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_client.go +++ /dev/null @@ -1,353 +0,0 @@ -package client - -type RancherClient struct { - RancherBaseClient - - Account AccountOperations - ActiveSetting ActiveSettingOperations - AddOutputsInput AddOutputsInputOperations - AddRemoveServiceLinkInput AddRemoveServiceLinkInputOperations - Agent AgentOperations - Amazonec2Config Amazonec2ConfigOperations - ApiKey ApiKeyOperations - AuditLog AuditLogOperations - AzureConfig AzureConfigOperations - Azureadconfig AzureadconfigOperations - Backup BackupOperations - BackupTarget BackupTargetOperations - BaseMachineConfig BaseMachineConfigOperations - Binding BindingOperations - BlkioDeviceOption BlkioDeviceOptionOperations - CatalogTemplate CatalogTemplateOperations - Certificate CertificateOperations - ChangeSecretInput ChangeSecretInputOperations - ClusterMembership ClusterMembershipOperations - ComposeConfig ComposeConfigOperations - ComposeConfigInput ComposeConfigInputOperations - ComposeProject ComposeProjectOperations - ComposeService ComposeServiceOperations - ConfigItem ConfigItemOperations - ConfigItemStatus ConfigItemStatusOperations - Container ContainerOperations - ContainerEvent ContainerEventOperations - ContainerExec ContainerExecOperations - ContainerLogs ContainerLogsOperations - ContainerProxy ContainerProxyOperations - Credential CredentialOperations - Databasechangelog DatabasechangelogOperations - Databasechangeloglock DatabasechangeloglockOperations - DefaultNetwork DefaultNetworkOperations - DigitaloceanConfig DigitaloceanConfigOperations - DnsService DnsServiceOperations - DockerBuild DockerBuildOperations - ExtensionImplementation ExtensionImplementationOperations - ExtensionPoint ExtensionPointOperations - ExternalDnsEvent ExternalDnsEventOperations - ExternalEvent ExternalEventOperations - ExternalHandler ExternalHandlerOperations - ExternalHandlerExternalHandlerProcessMap ExternalHandlerExternalHandlerProcessMapOperations - ExternalHandlerProcess ExternalHandlerProcessOperations - ExternalHandlerProcessConfig ExternalHandlerProcessConfigOperations - ExternalHostEvent ExternalHostEventOperations - ExternalService ExternalServiceOperations - ExternalServiceEvent ExternalServiceEventOperations - ExternalStoragePoolEvent ExternalStoragePoolEventOperations - ExternalVolumeEvent ExternalVolumeEventOperations - FieldDocumentation FieldDocumentationOperations - GenericObject GenericObjectOperations - HaConfig HaConfigOperations - HaConfigInput HaConfigInputOperations - HealthcheckInstanceHostMap HealthcheckInstanceHostMapOperations - Host HostOperations - HostAccess HostAccessOperations - HostApiProxyToken HostApiProxyTokenOperations - HostTemplate HostTemplateOperations - Identity IdentityOperations - Image ImageOperations - InServiceUpgradeStrategy InServiceUpgradeStrategyOperations - Instance InstanceOperations - InstanceConsole InstanceConsoleOperations - InstanceConsoleInput InstanceConsoleInputOperations - InstanceHealthCheck InstanceHealthCheckOperations - InstanceLink InstanceLinkOperations - InstanceStop InstanceStopOperations - IpAddress IpAddressOperations - KubernetesService KubernetesServiceOperations - KubernetesStack KubernetesStackOperations - KubernetesStackUpgrade KubernetesStackUpgradeOperations - Label LabelOperations - LaunchConfig LaunchConfigOperations - LbConfig LbConfigOperations - LbTargetConfig LbTargetConfigOperations - LoadBalancerCookieStickinessPolicy LoadBalancerCookieStickinessPolicyOperations - LoadBalancerService LoadBalancerServiceOperations - LocalAuthConfig LocalAuthConfigOperations - LogConfig LogConfigOperations - Machine MachineOperations - MachineDriver MachineDriverOperations - Mount MountOperations - MountEntry MountEntryOperations - Network NetworkOperations - NetworkDriver NetworkDriverOperations - NetworkDriverService NetworkDriverServiceOperations - NetworkPolicyRule NetworkPolicyRuleOperations - NetworkPolicyRuleBetween NetworkPolicyRuleBetweenOperations - NetworkPolicyRuleMember NetworkPolicyRuleMemberOperations - NetworkPolicyRuleWithin NetworkPolicyRuleWithinOperations - NfsConfig NfsConfigOperations - Openldapconfig OpenldapconfigOperations - PacketConfig PacketConfigOperations - Password PasswordOperations - PhysicalHost PhysicalHostOperations - Port PortOperations - PortRule PortRuleOperations - ProcessDefinition ProcessDefinitionOperations - ProcessExecution ProcessExecutionOperations - ProcessInstance ProcessInstanceOperations - ProcessPool ProcessPoolOperations - ProcessSummary ProcessSummaryOperations - Project ProjectOperations - ProjectMember ProjectMemberOperations - ProjectTemplate ProjectTemplateOperations - PublicEndpoint PublicEndpointOperations - Publish PublishOperations - PullTask PullTaskOperations - RecreateOnQuorumStrategyConfig RecreateOnQuorumStrategyConfigOperations - Register RegisterOperations - RegistrationToken RegistrationTokenOperations - Registry RegistryOperations - RegistryCredential RegistryCredentialOperations - ResourceDefinition ResourceDefinitionOperations - RestartPolicy RestartPolicyOperations - RestoreFromBackupInput RestoreFromBackupInputOperations - RevertToSnapshotInput RevertToSnapshotInputOperations - RollingRestartStrategy RollingRestartStrategyOperations - ScalePolicy ScalePolicyOperations - ScheduledUpgrade ScheduledUpgradeOperations - SecondaryLaunchConfig SecondaryLaunchConfigOperations - Secret SecretOperations - SecretReference SecretReferenceOperations - Service ServiceOperations - ServiceBinding ServiceBindingOperations - ServiceConsumeMap ServiceConsumeMapOperations - ServiceEvent ServiceEventOperations - ServiceExposeMap ServiceExposeMapOperations - ServiceLink ServiceLinkOperations - ServiceLog ServiceLogOperations - ServiceProxy ServiceProxyOperations - ServiceRestart ServiceRestartOperations - ServiceUpgrade ServiceUpgradeOperations - ServiceUpgradeStrategy ServiceUpgradeStrategyOperations - ServicesPortRange ServicesPortRangeOperations - SetProjectMembersInput SetProjectMembersInputOperations - SetServiceLinksInput SetServiceLinksInputOperations - Setting SettingOperations - Snapshot SnapshotOperations - SnapshotBackupInput SnapshotBackupInputOperations - Stack StackOperations - StackUpgrade StackUpgradeOperations - StateTransition StateTransitionOperations - StatsAccess StatsAccessOperations - StorageDriver StorageDriverOperations - StorageDriverService StorageDriverServiceOperations - StoragePool StoragePoolOperations - Subnet SubnetOperations - TargetPortRule TargetPortRuleOperations - Task TaskOperations - TaskInstance TaskInstanceOperations - ToServiceUpgradeStrategy ToServiceUpgradeStrategyOperations - TypeDocumentation TypeDocumentationOperations - Ulimit UlimitOperations - UserPreference UserPreferenceOperations - VirtualMachine VirtualMachineOperations - VirtualMachineDisk VirtualMachineDiskOperations - Volume VolumeOperations - VolumeActivateInput VolumeActivateInputOperations - VolumeSnapshotInput VolumeSnapshotInputOperations - VolumeTemplate VolumeTemplateOperations -} - -func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient { - client := &RancherClient{ - RancherBaseClient: rancherBaseClient, - } - - client.Account = newAccountClient(client) - client.ActiveSetting = newActiveSettingClient(client) - client.AddOutputsInput = newAddOutputsInputClient(client) - client.AddRemoveServiceLinkInput = newAddRemoveServiceLinkInputClient(client) - client.Agent = newAgentClient(client) - client.Amazonec2Config = newAmazonec2ConfigClient(client) - client.ApiKey = newApiKeyClient(client) - client.AuditLog = newAuditLogClient(client) - client.AzureConfig = newAzureConfigClient(client) - client.Azureadconfig = newAzureadconfigClient(client) - client.Backup = newBackupClient(client) - client.BackupTarget = newBackupTargetClient(client) - client.BaseMachineConfig = newBaseMachineConfigClient(client) - client.Binding = newBindingClient(client) - client.BlkioDeviceOption = newBlkioDeviceOptionClient(client) - client.CatalogTemplate = newCatalogTemplateClient(client) - client.Certificate = newCertificateClient(client) - client.ChangeSecretInput = newChangeSecretInputClient(client) - client.ClusterMembership = newClusterMembershipClient(client) - client.ComposeConfig = newComposeConfigClient(client) - client.ComposeConfigInput = newComposeConfigInputClient(client) - client.ComposeProject = newComposeProjectClient(client) - client.ComposeService = newComposeServiceClient(client) - client.ConfigItem = newConfigItemClient(client) - client.ConfigItemStatus = newConfigItemStatusClient(client) - client.Container = newContainerClient(client) - client.ContainerEvent = newContainerEventClient(client) - client.ContainerExec = newContainerExecClient(client) - client.ContainerLogs = newContainerLogsClient(client) - client.ContainerProxy = newContainerProxyClient(client) - client.Credential = newCredentialClient(client) - client.Databasechangelog = newDatabasechangelogClient(client) - client.Databasechangeloglock = newDatabasechangeloglockClient(client) - client.DefaultNetwork = newDefaultNetworkClient(client) - client.DigitaloceanConfig = newDigitaloceanConfigClient(client) - client.DnsService = newDnsServiceClient(client) - client.DockerBuild = newDockerBuildClient(client) - client.ExtensionImplementation = newExtensionImplementationClient(client) - client.ExtensionPoint = newExtensionPointClient(client) - client.ExternalDnsEvent = newExternalDnsEventClient(client) - client.ExternalEvent = newExternalEventClient(client) - client.ExternalHandler = newExternalHandlerClient(client) - client.ExternalHandlerExternalHandlerProcessMap = newExternalHandlerExternalHandlerProcessMapClient(client) - client.ExternalHandlerProcess = newExternalHandlerProcessClient(client) - client.ExternalHandlerProcessConfig = newExternalHandlerProcessConfigClient(client) - client.ExternalHostEvent = newExternalHostEventClient(client) - client.ExternalService = newExternalServiceClient(client) - client.ExternalServiceEvent = newExternalServiceEventClient(client) - client.ExternalStoragePoolEvent = newExternalStoragePoolEventClient(client) - client.ExternalVolumeEvent = newExternalVolumeEventClient(client) - client.FieldDocumentation = newFieldDocumentationClient(client) - client.GenericObject = newGenericObjectClient(client) - client.HaConfig = newHaConfigClient(client) - client.HaConfigInput = newHaConfigInputClient(client) - client.HealthcheckInstanceHostMap = newHealthcheckInstanceHostMapClient(client) - client.Host = newHostClient(client) - client.HostAccess = newHostAccessClient(client) - client.HostApiProxyToken = newHostApiProxyTokenClient(client) - client.HostTemplate = newHostTemplateClient(client) - client.Identity = newIdentityClient(client) - client.Image = newImageClient(client) - client.InServiceUpgradeStrategy = newInServiceUpgradeStrategyClient(client) - client.Instance = newInstanceClient(client) - client.InstanceConsole = newInstanceConsoleClient(client) - client.InstanceConsoleInput = newInstanceConsoleInputClient(client) - client.InstanceHealthCheck = newInstanceHealthCheckClient(client) - client.InstanceLink = newInstanceLinkClient(client) - client.InstanceStop = newInstanceStopClient(client) - client.IpAddress = newIpAddressClient(client) - client.KubernetesService = newKubernetesServiceClient(client) - client.KubernetesStack = newKubernetesStackClient(client) - client.KubernetesStackUpgrade = newKubernetesStackUpgradeClient(client) - client.Label = newLabelClient(client) - client.LaunchConfig = newLaunchConfigClient(client) - client.LbConfig = newLbConfigClient(client) - client.LbTargetConfig = newLbTargetConfigClient(client) - client.LoadBalancerCookieStickinessPolicy = newLoadBalancerCookieStickinessPolicyClient(client) - client.LoadBalancerService = newLoadBalancerServiceClient(client) - client.LocalAuthConfig = newLocalAuthConfigClient(client) - client.LogConfig = newLogConfigClient(client) - client.Machine = newMachineClient(client) - client.MachineDriver = newMachineDriverClient(client) - client.Mount = newMountClient(client) - client.MountEntry = newMountEntryClient(client) - client.Network = newNetworkClient(client) - client.NetworkDriver = newNetworkDriverClient(client) - client.NetworkDriverService = newNetworkDriverServiceClient(client) - client.NetworkPolicyRule = newNetworkPolicyRuleClient(client) - client.NetworkPolicyRuleBetween = newNetworkPolicyRuleBetweenClient(client) - client.NetworkPolicyRuleMember = newNetworkPolicyRuleMemberClient(client) - client.NetworkPolicyRuleWithin = newNetworkPolicyRuleWithinClient(client) - client.NfsConfig = newNfsConfigClient(client) - client.Openldapconfig = newOpenldapconfigClient(client) - client.PacketConfig = newPacketConfigClient(client) - client.Password = newPasswordClient(client) - client.PhysicalHost = newPhysicalHostClient(client) - client.Port = newPortClient(client) - client.PortRule = newPortRuleClient(client) - client.ProcessDefinition = newProcessDefinitionClient(client) - client.ProcessExecution = newProcessExecutionClient(client) - client.ProcessInstance = newProcessInstanceClient(client) - client.ProcessPool = newProcessPoolClient(client) - client.ProcessSummary = newProcessSummaryClient(client) - client.Project = newProjectClient(client) - client.ProjectMember = newProjectMemberClient(client) - client.ProjectTemplate = newProjectTemplateClient(client) - client.PublicEndpoint = newPublicEndpointClient(client) - client.Publish = newPublishClient(client) - client.PullTask = newPullTaskClient(client) - client.RecreateOnQuorumStrategyConfig = newRecreateOnQuorumStrategyConfigClient(client) - client.Register = newRegisterClient(client) - client.RegistrationToken = newRegistrationTokenClient(client) - client.Registry = newRegistryClient(client) - client.RegistryCredential = newRegistryCredentialClient(client) - client.ResourceDefinition = newResourceDefinitionClient(client) - client.RestartPolicy = newRestartPolicyClient(client) - client.RestoreFromBackupInput = newRestoreFromBackupInputClient(client) - client.RevertToSnapshotInput = newRevertToSnapshotInputClient(client) - client.RollingRestartStrategy = newRollingRestartStrategyClient(client) - client.ScalePolicy = newScalePolicyClient(client) - client.ScheduledUpgrade = newScheduledUpgradeClient(client) - client.SecondaryLaunchConfig = newSecondaryLaunchConfigClient(client) - client.Secret = newSecretClient(client) - client.SecretReference = newSecretReferenceClient(client) - client.Service = newServiceClient(client) - client.ServiceBinding = newServiceBindingClient(client) - client.ServiceConsumeMap = newServiceConsumeMapClient(client) - client.ServiceEvent = newServiceEventClient(client) - client.ServiceExposeMap = newServiceExposeMapClient(client) - client.ServiceLink = newServiceLinkClient(client) - client.ServiceLog = newServiceLogClient(client) - client.ServiceProxy = newServiceProxyClient(client) - client.ServiceRestart = newServiceRestartClient(client) - client.ServiceUpgrade = newServiceUpgradeClient(client) - client.ServiceUpgradeStrategy = newServiceUpgradeStrategyClient(client) - client.ServicesPortRange = newServicesPortRangeClient(client) - client.SetProjectMembersInput = newSetProjectMembersInputClient(client) - client.SetServiceLinksInput = newSetServiceLinksInputClient(client) - client.Setting = newSettingClient(client) - client.Snapshot = newSnapshotClient(client) - client.SnapshotBackupInput = newSnapshotBackupInputClient(client) - client.Stack = newStackClient(client) - client.StackUpgrade = newStackUpgradeClient(client) - client.StateTransition = newStateTransitionClient(client) - client.StatsAccess = newStatsAccessClient(client) - client.StorageDriver = newStorageDriverClient(client) - client.StorageDriverService = newStorageDriverServiceClient(client) - client.StoragePool = newStoragePoolClient(client) - client.Subnet = newSubnetClient(client) - client.TargetPortRule = newTargetPortRuleClient(client) - client.Task = newTaskClient(client) - client.TaskInstance = newTaskInstanceClient(client) - client.ToServiceUpgradeStrategy = newToServiceUpgradeStrategyClient(client) - client.TypeDocumentation = newTypeDocumentationClient(client) - client.Ulimit = newUlimitClient(client) - client.UserPreference = newUserPreferenceClient(client) - client.VirtualMachine = newVirtualMachineClient(client) - client.VirtualMachineDisk = newVirtualMachineDiskClient(client) - client.Volume = newVolumeClient(client) - client.VolumeActivateInput = newVolumeActivateInputClient(client) - client.VolumeSnapshotInput = newVolumeSnapshotInputClient(client) - client.VolumeTemplate = newVolumeTemplateClient(client) - - return client -} - -func NewRancherClient(opts *ClientOpts) (*RancherClient, error) { - rancherBaseClient := &RancherBaseClientImpl{ - Types: map[string]Schema{}, - } - client := constructClient(rancherBaseClient) - - err := setupRancherBaseClient(rancherBaseClient, opts) - if err != nil { - return nil, err - } - - return client, nil -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go b/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go deleted file mode 100644 index f5848633e..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_cluster_membership.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - CLUSTER_MEMBERSHIP_TYPE = "clusterMembership" -) - -type ClusterMembership struct { - Resource - - Clustered bool `json:"clustered,omitempty" yaml:"clustered,omitempty"` - - Config string `json:"config,omitempty" yaml:"config,omitempty"` - - Heartbeat int64 `json:"heartbeat,omitempty" yaml:"heartbeat,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ClusterMembershipCollection struct { - Collection - Data []ClusterMembership `json:"data,omitempty"` - client *ClusterMembershipClient -} - -type ClusterMembershipClient struct { - rancherClient *RancherClient -} - -type ClusterMembershipOperations interface { - List(opts *ListOpts) (*ClusterMembershipCollection, error) - Create(opts *ClusterMembership) (*ClusterMembership, error) - Update(existing *ClusterMembership, updates interface{}) (*ClusterMembership, error) - ById(id string) (*ClusterMembership, error) - Delete(container *ClusterMembership) error -} - -func newClusterMembershipClient(rancherClient *RancherClient) *ClusterMembershipClient { - return &ClusterMembershipClient{ - rancherClient: rancherClient, - } -} - -func (c *ClusterMembershipClient) Create(container *ClusterMembership) (*ClusterMembership, error) { - resp := &ClusterMembership{} - err := c.rancherClient.doCreate(CLUSTER_MEMBERSHIP_TYPE, container, resp) - return resp, err -} - -func (c *ClusterMembershipClient) Update(existing *ClusterMembership, updates interface{}) (*ClusterMembership, error) { - resp := &ClusterMembership{} - err := c.rancherClient.doUpdate(CLUSTER_MEMBERSHIP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterMembershipClient) List(opts *ListOpts) (*ClusterMembershipCollection, error) { - resp := &ClusterMembershipCollection{} - err := c.rancherClient.doList(CLUSTER_MEMBERSHIP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ClusterMembershipCollection) Next() (*ClusterMembershipCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterMembershipCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterMembershipClient) ById(id string) (*ClusterMembership, error) { - resp := &ClusterMembership{} - err := c.rancherClient.doById(CLUSTER_MEMBERSHIP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ClusterMembershipClient) Delete(container *ClusterMembership) error { - return c.rancherClient.doResourceDelete(CLUSTER_MEMBERSHIP_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go deleted file mode 100644 index b9bc013c0..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - COMPOSE_CONFIG_TYPE = "composeConfig" -) - -type ComposeConfig struct { - Resource - - DockerComposeConfig string `json:"dockerComposeConfig,omitempty" yaml:"docker_compose_config,omitempty"` - - RancherComposeConfig string `json:"rancherComposeConfig,omitempty" yaml:"rancher_compose_config,omitempty"` -} - -type ComposeConfigCollection struct { - Collection - Data []ComposeConfig `json:"data,omitempty"` - client *ComposeConfigClient -} - -type ComposeConfigClient struct { - rancherClient *RancherClient -} - -type ComposeConfigOperations interface { - List(opts *ListOpts) (*ComposeConfigCollection, error) - Create(opts *ComposeConfig) (*ComposeConfig, error) - Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) - ById(id string) (*ComposeConfig, error) - Delete(container *ComposeConfig) error -} - -func newComposeConfigClient(rancherClient *RancherClient) *ComposeConfigClient { - return &ComposeConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *ComposeConfigClient) Create(container *ComposeConfig) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.rancherClient.doCreate(COMPOSE_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *ComposeConfigClient) Update(existing *ComposeConfig, updates interface{}) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.rancherClient.doUpdate(COMPOSE_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeConfigClient) List(opts *ListOpts) (*ComposeConfigCollection, error) { - resp := &ComposeConfigCollection{} - err := c.rancherClient.doList(COMPOSE_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ComposeConfigCollection) Next() (*ComposeConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeConfigClient) ById(id string) (*ComposeConfig, error) { - resp := &ComposeConfig{} - err := c.rancherClient.doById(COMPOSE_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ComposeConfigClient) Delete(container *ComposeConfig) error { - return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go deleted file mode 100644 index 3d03d923b..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_compose_config_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - COMPOSE_CONFIG_INPUT_TYPE = "composeConfigInput" -) - -type ComposeConfigInput struct { - Resource - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` -} - -type ComposeConfigInputCollection struct { - Collection - Data []ComposeConfigInput `json:"data,omitempty"` - client *ComposeConfigInputClient -} - -type ComposeConfigInputClient struct { - rancherClient *RancherClient -} - -type ComposeConfigInputOperations interface { - List(opts *ListOpts) (*ComposeConfigInputCollection, error) - Create(opts *ComposeConfigInput) (*ComposeConfigInput, error) - Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) - ById(id string) (*ComposeConfigInput, error) - Delete(container *ComposeConfigInput) error -} - -func newComposeConfigInputClient(rancherClient *RancherClient) *ComposeConfigInputClient { - return &ComposeConfigInputClient{ - rancherClient: rancherClient, - } -} - -func (c *ComposeConfigInputClient) Create(container *ComposeConfigInput) (*ComposeConfigInput, error) { - resp := &ComposeConfigInput{} - err := c.rancherClient.doCreate(COMPOSE_CONFIG_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *ComposeConfigInputClient) Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) { - resp := &ComposeConfigInput{} - err := c.rancherClient.doUpdate(COMPOSE_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeConfigInputClient) List(opts *ListOpts) (*ComposeConfigInputCollection, error) { - resp := &ComposeConfigInputCollection{} - err := c.rancherClient.doList(COMPOSE_CONFIG_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ComposeConfigInputCollection) Next() (*ComposeConfigInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeConfigInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeConfigInputClient) ById(id string) (*ComposeConfigInput, error) { - resp := &ComposeConfigInput{} - err := c.rancherClient.doById(COMPOSE_CONFIG_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ComposeConfigInputClient) Delete(container *ComposeConfigInput) error { - return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go deleted file mode 100644 index b191a887d..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_compose_project.go +++ /dev/null @@ -1,191 +0,0 @@ -package client - -const ( - COMPOSE_PROJECT_TYPE = "composeProject" -) - -type ComposeProject struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Group string `json:"group,omitempty" yaml:"group,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` - - PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ComposeProjectCollection struct { - Collection - Data []ComposeProject `json:"data,omitempty"` - client *ComposeProjectClient -} - -type ComposeProjectClient struct { - rancherClient *RancherClient -} - -type ComposeProjectOperations interface { - List(opts *ListOpts) (*ComposeProjectCollection, error) - Create(opts *ComposeProject) (*ComposeProject, error) - Update(existing *ComposeProject, updates interface{}) (*ComposeProject, error) - ById(id string) (*ComposeProject, error) - Delete(container *ComposeProject) error - - ActionCancelupgrade(*ComposeProject) (*Stack, error) - - ActionCreate(*ComposeProject) (*Stack, error) - - ActionError(*ComposeProject) (*Stack, error) - - ActionFinishupgrade(*ComposeProject) (*Stack, error) - - ActionRemove(*ComposeProject) (*Stack, error) - - ActionRollback(*ComposeProject) (*Stack, error) -} - -func newComposeProjectClient(rancherClient *RancherClient) *ComposeProjectClient { - return &ComposeProjectClient{ - rancherClient: rancherClient, - } -} - -func (c *ComposeProjectClient) Create(container *ComposeProject) (*ComposeProject, error) { - resp := &ComposeProject{} - err := c.rancherClient.doCreate(COMPOSE_PROJECT_TYPE, container, resp) - return resp, err -} - -func (c *ComposeProjectClient) Update(existing *ComposeProject, updates interface{}) (*ComposeProject, error) { - resp := &ComposeProject{} - err := c.rancherClient.doUpdate(COMPOSE_PROJECT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeProjectClient) List(opts *ListOpts) (*ComposeProjectCollection, error) { - resp := &ComposeProjectCollection{} - err := c.rancherClient.doList(COMPOSE_PROJECT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ComposeProjectCollection) Next() (*ComposeProjectCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeProjectCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeProjectClient) ById(id string) (*ComposeProject, error) { - resp := &ComposeProject{} - err := c.rancherClient.doById(COMPOSE_PROJECT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ComposeProjectClient) Delete(container *ComposeProject) error { - return c.rancherClient.doResourceDelete(COMPOSE_PROJECT_TYPE, &container.Resource) -} - -func (c *ComposeProjectClient) ActionCancelupgrade(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionCreate(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionError(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionFinishupgrade(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionRemove(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeProjectClient) ActionRollback(resource *ComposeProject) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(COMPOSE_PROJECT_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go deleted file mode 100644 index ca7a297f4..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_compose_service.go +++ /dev/null @@ -1,212 +0,0 @@ -package client - -const ( - COMPOSE_SERVICE_TYPE = "composeService" -) - -type ComposeService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type ComposeServiceCollection struct { - Collection - Data []ComposeService `json:"data,omitempty"` - client *ComposeServiceClient -} - -type ComposeServiceClient struct { - rancherClient *RancherClient -} - -type ComposeServiceOperations interface { - List(opts *ListOpts) (*ComposeServiceCollection, error) - Create(opts *ComposeService) (*ComposeService, error) - Update(existing *ComposeService, updates interface{}) (*ComposeService, error) - ById(id string) (*ComposeService, error) - Delete(container *ComposeService) error - - ActionActivate(*ComposeService) (*Service, error) - - ActionCancelupgrade(*ComposeService) (*Service, error) - - ActionContinueupgrade(*ComposeService) (*Service, error) - - ActionCreate(*ComposeService) (*Service, error) - - ActionFinishupgrade(*ComposeService) (*Service, error) - - ActionRemove(*ComposeService) (*Service, error) - - ActionRollback(*ComposeService) (*Service, error) -} - -func newComposeServiceClient(rancherClient *RancherClient) *ComposeServiceClient { - return &ComposeServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *ComposeServiceClient) Create(container *ComposeService) (*ComposeService, error) { - resp := &ComposeService{} - err := c.rancherClient.doCreate(COMPOSE_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *ComposeServiceClient) Update(existing *ComposeService, updates interface{}) (*ComposeService, error) { - resp := &ComposeService{} - err := c.rancherClient.doUpdate(COMPOSE_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ComposeServiceClient) List(opts *ListOpts) (*ComposeServiceCollection, error) { - resp := &ComposeServiceCollection{} - err := c.rancherClient.doList(COMPOSE_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ComposeServiceCollection) Next() (*ComposeServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ComposeServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ComposeServiceClient) ById(id string) (*ComposeService, error) { - resp := &ComposeService{} - err := c.rancherClient.doById(COMPOSE_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ComposeServiceClient) Delete(container *ComposeService) error { - return c.rancherClient.doResourceDelete(COMPOSE_SERVICE_TYPE, &container.Resource) -} - -func (c *ComposeServiceClient) ActionActivate(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionCancelupgrade(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionContinueupgrade(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionCreate(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionFinishupgrade(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionRemove(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ComposeServiceClient) ActionRollback(resource *ComposeService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(COMPOSE_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go deleted file mode 100644 index b97306669..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_config_item.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - CONFIG_ITEM_TYPE = "configItem" -) - -type ConfigItem struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - SourceVersion string `json:"sourceVersion,omitempty" yaml:"source_version,omitempty"` -} - -type ConfigItemCollection struct { - Collection - Data []ConfigItem `json:"data,omitempty"` - client *ConfigItemClient -} - -type ConfigItemClient struct { - rancherClient *RancherClient -} - -type ConfigItemOperations interface { - List(opts *ListOpts) (*ConfigItemCollection, error) - Create(opts *ConfigItem) (*ConfigItem, error) - Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) - ById(id string) (*ConfigItem, error) - Delete(container *ConfigItem) error -} - -func newConfigItemClient(rancherClient *RancherClient) *ConfigItemClient { - return &ConfigItemClient{ - rancherClient: rancherClient, - } -} - -func (c *ConfigItemClient) Create(container *ConfigItem) (*ConfigItem, error) { - resp := &ConfigItem{} - err := c.rancherClient.doCreate(CONFIG_ITEM_TYPE, container, resp) - return resp, err -} - -func (c *ConfigItemClient) Update(existing *ConfigItem, updates interface{}) (*ConfigItem, error) { - resp := &ConfigItem{} - err := c.rancherClient.doUpdate(CONFIG_ITEM_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ConfigItemClient) List(opts *ListOpts) (*ConfigItemCollection, error) { - resp := &ConfigItemCollection{} - err := c.rancherClient.doList(CONFIG_ITEM_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ConfigItemCollection) Next() (*ConfigItemCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ConfigItemCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ConfigItemClient) ById(id string) (*ConfigItem, error) { - resp := &ConfigItem{} - err := c.rancherClient.doById(CONFIG_ITEM_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ConfigItemClient) Delete(container *ConfigItem) error { - return c.rancherClient.doResourceDelete(CONFIG_ITEM_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go b/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go deleted file mode 100644 index 2ce32ca97..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_config_item_status.go +++ /dev/null @@ -1,93 +0,0 @@ -package client - -const ( - CONFIG_ITEM_STATUS_TYPE = "configItemStatus" -) - -type ConfigItemStatus struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AppliedUpdated string `json:"appliedUpdated,omitempty" yaml:"applied_updated,omitempty"` - - AppliedVersion int64 `json:"appliedVersion,omitempty" yaml:"applied_version,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RequestedUpdated string `json:"requestedUpdated,omitempty" yaml:"requested_updated,omitempty"` - - RequestedVersion int64 `json:"requestedVersion,omitempty" yaml:"requested_version,omitempty"` - - SourceVersion string `json:"sourceVersion,omitempty" yaml:"source_version,omitempty"` -} - -type ConfigItemStatusCollection struct { - Collection - Data []ConfigItemStatus `json:"data,omitempty"` - client *ConfigItemStatusClient -} - -type ConfigItemStatusClient struct { - rancherClient *RancherClient -} - -type ConfigItemStatusOperations interface { - List(opts *ListOpts) (*ConfigItemStatusCollection, error) - Create(opts *ConfigItemStatus) (*ConfigItemStatus, error) - Update(existing *ConfigItemStatus, updates interface{}) (*ConfigItemStatus, error) - ById(id string) (*ConfigItemStatus, error) - Delete(container *ConfigItemStatus) error -} - -func newConfigItemStatusClient(rancherClient *RancherClient) *ConfigItemStatusClient { - return &ConfigItemStatusClient{ - rancherClient: rancherClient, - } -} - -func (c *ConfigItemStatusClient) Create(container *ConfigItemStatus) (*ConfigItemStatus, error) { - resp := &ConfigItemStatus{} - err := c.rancherClient.doCreate(CONFIG_ITEM_STATUS_TYPE, container, resp) - return resp, err -} - -func (c *ConfigItemStatusClient) Update(existing *ConfigItemStatus, updates interface{}) (*ConfigItemStatus, error) { - resp := &ConfigItemStatus{} - err := c.rancherClient.doUpdate(CONFIG_ITEM_STATUS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ConfigItemStatusClient) List(opts *ListOpts) (*ConfigItemStatusCollection, error) { - resp := &ConfigItemStatusCollection{} - err := c.rancherClient.doList(CONFIG_ITEM_STATUS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ConfigItemStatusCollection) Next() (*ConfigItemStatusCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ConfigItemStatusCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ConfigItemStatusClient) ById(id string) (*ConfigItemStatus, error) { - resp := &ConfigItemStatus{} - err := c.rancherClient.doById(CONFIG_ITEM_STATUS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ConfigItemStatusClient) Delete(container *ConfigItemStatus) error { - return c.rancherClient.doResourceDelete(CONFIG_ITEM_STATUS_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container.go b/vendor/github.com/rancher/go-rancher/v2/generated_container.go deleted file mode 100644 index 4cdf2a4e4..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container.go +++ /dev/null @@ -1,517 +0,0 @@ -package client - -const ( - CONTAINER_TYPE = "container" -) - -type Container struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` - - BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` - - BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` - - Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` - - CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` - - CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` - - CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` - - CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` - - CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` - - CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` - - CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` - - CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` - - CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` - - CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` - - CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` - - DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` - - DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` - - DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - - DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` - - FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` - - GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` - - HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` - - HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` - - InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` - - InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` - - IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` - - IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` - - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - - Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` - - IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` - - Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` - - KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` - - LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` - - MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` - - MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` - - MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` - - NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` - - NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` - - NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` - - NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` - - OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` - - OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` - - PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` - - PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` - - PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` - - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - - PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` - - RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` - - RestartPolicy *RestartPolicy `json:"restartPolicy,omitempty" yaml:"restart_policy,omitempty"` - - RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` - - Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` - - SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - - StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` - - StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` - - StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` - - Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` - - Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` - - User string `json:"user,omitempty" yaml:"user,omitempty"` - - UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` - - UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` - - Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` - - WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` -} - -type ContainerCollection struct { - Collection - Data []Container `json:"data,omitempty"` - client *ContainerClient -} - -type ContainerClient struct { - rancherClient *RancherClient -} - -type ContainerOperations interface { - List(opts *ListOpts) (*ContainerCollection, error) - Create(opts *Container) (*Container, error) - Update(existing *Container, updates interface{}) (*Container, error) - ById(id string) (*Container, error) - Delete(container *Container) error - - ActionAllocate(*Container) (*Instance, error) - - ActionConsole(*Container, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*Container) (*Instance, error) - - ActionDeallocate(*Container) (*Instance, error) - - ActionError(*Container) (*Instance, error) - - ActionExecute(*Container, *ContainerExec) (*HostAccess, error) - - ActionLogs(*Container, *ContainerLogs) (*HostAccess, error) - - ActionMigrate(*Container) (*Instance, error) - - ActionProxy(*Container, *ContainerProxy) (*HostAccess, error) - - ActionPurge(*Container) (*Instance, error) - - ActionRemove(*Container) (*Instance, error) - - ActionRestart(*Container) (*Instance, error) - - ActionStart(*Container) (*Instance, error) - - ActionStop(*Container, *InstanceStop) (*Instance, error) - - ActionUpdate(*Container) (*Instance, error) - - ActionUpdatehealthy(*Container) (*Instance, error) - - ActionUpdatereinitializing(*Container) (*Instance, error) - - ActionUpdateunhealthy(*Container) (*Instance, error) -} - -func newContainerClient(rancherClient *RancherClient) *ContainerClient { - return &ContainerClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerClient) Create(container *Container) (*Container, error) { - resp := &Container{} - err := c.rancherClient.doCreate(CONTAINER_TYPE, container, resp) - return resp, err -} - -func (c *ContainerClient) Update(existing *Container, updates interface{}) (*Container, error) { - resp := &Container{} - err := c.rancherClient.doUpdate(CONTAINER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerClient) List(opts *ListOpts) (*ContainerCollection, error) { - resp := &ContainerCollection{} - err := c.rancherClient.doList(CONTAINER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerCollection) Next() (*ContainerCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerClient) ById(id string) (*Container, error) { - resp := &Container{} - err := c.rancherClient.doById(CONTAINER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerClient) Delete(container *Container) error { - return c.rancherClient.doResourceDelete(CONTAINER_TYPE, &container.Resource) -} - -func (c *ContainerClient) ActionAllocate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionConsole(resource *Container, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionCreate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionDeallocate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionError(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionExecute(resource *Container, input *ContainerExec) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "execute", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionLogs(resource *Container, input *ContainerLogs) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "logs", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionMigrate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionProxy(resource *Container, input *ContainerProxy) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "proxy", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionPurge(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionRemove(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionRestart(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionStart(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionStop(resource *Container, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ContainerClient) ActionUpdate(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionUpdatehealthy(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionUpdatereinitializing(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerClient) ActionUpdateunhealthy(resource *Container) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(CONTAINER_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go deleted file mode 100644 index 8b95651c9..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container_event.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - CONTAINER_EVENT_TYPE = "containerEvent" -) - -type ContainerEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DockerInspect interface{} `json:"dockerInspect,omitempty" yaml:"docker_inspect,omitempty"` - - ExternalFrom string `json:"externalFrom,omitempty" yaml:"external_from,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalStatus string `json:"externalStatus,omitempty" yaml:"external_status,omitempty"` - - ExternalTimestamp int64 `json:"externalTimestamp,omitempty" yaml:"external_timestamp,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedHostUuid string `json:"reportedHostUuid,omitempty" yaml:"reported_host_uuid,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` -} - -type ContainerEventCollection struct { - Collection - Data []ContainerEvent `json:"data,omitempty"` - client *ContainerEventClient -} - -type ContainerEventClient struct { - rancherClient *RancherClient -} - -type ContainerEventOperations interface { - List(opts *ListOpts) (*ContainerEventCollection, error) - Create(opts *ContainerEvent) (*ContainerEvent, error) - Update(existing *ContainerEvent, updates interface{}) (*ContainerEvent, error) - ById(id string) (*ContainerEvent, error) - Delete(container *ContainerEvent) error - - ActionCreate(*ContainerEvent) (*ContainerEvent, error) - - ActionRemove(*ContainerEvent) (*ContainerEvent, error) -} - -func newContainerEventClient(rancherClient *RancherClient) *ContainerEventClient { - return &ContainerEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerEventClient) Create(container *ContainerEvent) (*ContainerEvent, error) { - resp := &ContainerEvent{} - err := c.rancherClient.doCreate(CONTAINER_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ContainerEventClient) Update(existing *ContainerEvent, updates interface{}) (*ContainerEvent, error) { - resp := &ContainerEvent{} - err := c.rancherClient.doUpdate(CONTAINER_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerEventClient) List(opts *ListOpts) (*ContainerEventCollection, error) { - resp := &ContainerEventCollection{} - err := c.rancherClient.doList(CONTAINER_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerEventCollection) Next() (*ContainerEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerEventClient) ById(id string) (*ContainerEvent, error) { - resp := &ContainerEvent{} - err := c.rancherClient.doById(CONTAINER_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerEventClient) Delete(container *ContainerEvent) error { - return c.rancherClient.doResourceDelete(CONTAINER_EVENT_TYPE, &container.Resource) -} - -func (c *ContainerEventClient) ActionCreate(resource *ContainerEvent) (*ContainerEvent, error) { - - resp := &ContainerEvent{} - - err := c.rancherClient.doAction(CONTAINER_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ContainerEventClient) ActionRemove(resource *ContainerEvent) (*ContainerEvent, error) { - - resp := &ContainerEvent{} - - err := c.rancherClient.doAction(CONTAINER_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go deleted file mode 100644 index 196199b5c..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container_exec.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - CONTAINER_EXEC_TYPE = "containerExec" -) - -type ContainerExec struct { - Resource - - AttachStdin bool `json:"attachStdin,omitempty" yaml:"attach_stdin,omitempty"` - - AttachStdout bool `json:"attachStdout,omitempty" yaml:"attach_stdout,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` -} - -type ContainerExecCollection struct { - Collection - Data []ContainerExec `json:"data,omitempty"` - client *ContainerExecClient -} - -type ContainerExecClient struct { - rancherClient *RancherClient -} - -type ContainerExecOperations interface { - List(opts *ListOpts) (*ContainerExecCollection, error) - Create(opts *ContainerExec) (*ContainerExec, error) - Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) - ById(id string) (*ContainerExec, error) - Delete(container *ContainerExec) error -} - -func newContainerExecClient(rancherClient *RancherClient) *ContainerExecClient { - return &ContainerExecClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerExecClient) Create(container *ContainerExec) (*ContainerExec, error) { - resp := &ContainerExec{} - err := c.rancherClient.doCreate(CONTAINER_EXEC_TYPE, container, resp) - return resp, err -} - -func (c *ContainerExecClient) Update(existing *ContainerExec, updates interface{}) (*ContainerExec, error) { - resp := &ContainerExec{} - err := c.rancherClient.doUpdate(CONTAINER_EXEC_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerExecClient) List(opts *ListOpts) (*ContainerExecCollection, error) { - resp := &ContainerExecCollection{} - err := c.rancherClient.doList(CONTAINER_EXEC_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerExecCollection) Next() (*ContainerExecCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerExecCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerExecClient) ById(id string) (*ContainerExec, error) { - resp := &ContainerExec{} - err := c.rancherClient.doById(CONTAINER_EXEC_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerExecClient) Delete(container *ContainerExec) error { - return c.rancherClient.doResourceDelete(CONTAINER_EXEC_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go deleted file mode 100644 index 2149df19f..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container_logs.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - CONTAINER_LOGS_TYPE = "containerLogs" -) - -type ContainerLogs struct { - Resource - - Follow bool `json:"follow,omitempty" yaml:"follow,omitempty"` - - Lines int64 `json:"lines,omitempty" yaml:"lines,omitempty"` -} - -type ContainerLogsCollection struct { - Collection - Data []ContainerLogs `json:"data,omitempty"` - client *ContainerLogsClient -} - -type ContainerLogsClient struct { - rancherClient *RancherClient -} - -type ContainerLogsOperations interface { - List(opts *ListOpts) (*ContainerLogsCollection, error) - Create(opts *ContainerLogs) (*ContainerLogs, error) - Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) - ById(id string) (*ContainerLogs, error) - Delete(container *ContainerLogs) error -} - -func newContainerLogsClient(rancherClient *RancherClient) *ContainerLogsClient { - return &ContainerLogsClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerLogsClient) Create(container *ContainerLogs) (*ContainerLogs, error) { - resp := &ContainerLogs{} - err := c.rancherClient.doCreate(CONTAINER_LOGS_TYPE, container, resp) - return resp, err -} - -func (c *ContainerLogsClient) Update(existing *ContainerLogs, updates interface{}) (*ContainerLogs, error) { - resp := &ContainerLogs{} - err := c.rancherClient.doUpdate(CONTAINER_LOGS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerLogsClient) List(opts *ListOpts) (*ContainerLogsCollection, error) { - resp := &ContainerLogsCollection{} - err := c.rancherClient.doList(CONTAINER_LOGS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerLogsCollection) Next() (*ContainerLogsCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerLogsCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerLogsClient) ById(id string) (*ContainerLogs, error) { - resp := &ContainerLogs{} - err := c.rancherClient.doById(CONTAINER_LOGS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerLogsClient) Delete(container *ContainerLogs) error { - return c.rancherClient.doResourceDelete(CONTAINER_LOGS_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go deleted file mode 100644 index 84d7670ea..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_container_proxy.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - CONTAINER_PROXY_TYPE = "containerProxy" -) - -type ContainerProxy struct { - Resource - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` -} - -type ContainerProxyCollection struct { - Collection - Data []ContainerProxy `json:"data,omitempty"` - client *ContainerProxyClient -} - -type ContainerProxyClient struct { - rancherClient *RancherClient -} - -type ContainerProxyOperations interface { - List(opts *ListOpts) (*ContainerProxyCollection, error) - Create(opts *ContainerProxy) (*ContainerProxy, error) - Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) - ById(id string) (*ContainerProxy, error) - Delete(container *ContainerProxy) error -} - -func newContainerProxyClient(rancherClient *RancherClient) *ContainerProxyClient { - return &ContainerProxyClient{ - rancherClient: rancherClient, - } -} - -func (c *ContainerProxyClient) Create(container *ContainerProxy) (*ContainerProxy, error) { - resp := &ContainerProxy{} - err := c.rancherClient.doCreate(CONTAINER_PROXY_TYPE, container, resp) - return resp, err -} - -func (c *ContainerProxyClient) Update(existing *ContainerProxy, updates interface{}) (*ContainerProxy, error) { - resp := &ContainerProxy{} - err := c.rancherClient.doUpdate(CONTAINER_PROXY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ContainerProxyClient) List(opts *ListOpts) (*ContainerProxyCollection, error) { - resp := &ContainerProxyCollection{} - err := c.rancherClient.doList(CONTAINER_PROXY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ContainerProxyCollection) Next() (*ContainerProxyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ContainerProxyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ContainerProxyClient) ById(id string) (*ContainerProxy, error) { - resp := &ContainerProxy{} - err := c.rancherClient.doById(CONTAINER_PROXY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ContainerProxyClient) Delete(container *ContainerProxy) error { - return c.rancherClient.doResourceDelete(CONTAINER_PROXY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_credential.go deleted file mode 100644 index f34a563df..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_credential.go +++ /dev/null @@ -1,173 +0,0 @@ -package client - -const ( - CREDENTIAL_TYPE = "credential" -) - -type Credential struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type CredentialCollection struct { - Collection - Data []Credential `json:"data,omitempty"` - client *CredentialClient -} - -type CredentialClient struct { - rancherClient *RancherClient -} - -type CredentialOperations interface { - List(opts *ListOpts) (*CredentialCollection, error) - Create(opts *Credential) (*Credential, error) - Update(existing *Credential, updates interface{}) (*Credential, error) - ById(id string) (*Credential, error) - Delete(container *Credential) error - - ActionActivate(*Credential) (*Credential, error) - - ActionCreate(*Credential) (*Credential, error) - - ActionDeactivate(*Credential) (*Credential, error) - - ActionPurge(*Credential) (*Credential, error) - - ActionRemove(*Credential) (*Credential, error) - - ActionUpdate(*Credential) (*Credential, error) -} - -func newCredentialClient(rancherClient *RancherClient) *CredentialClient { - return &CredentialClient{ - rancherClient: rancherClient, - } -} - -func (c *CredentialClient) Create(container *Credential) (*Credential, error) { - resp := &Credential{} - err := c.rancherClient.doCreate(CREDENTIAL_TYPE, container, resp) - return resp, err -} - -func (c *CredentialClient) Update(existing *Credential, updates interface{}) (*Credential, error) { - resp := &Credential{} - err := c.rancherClient.doUpdate(CREDENTIAL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CredentialClient) List(opts *ListOpts) (*CredentialCollection, error) { - resp := &CredentialCollection{} - err := c.rancherClient.doList(CREDENTIAL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *CredentialCollection) Next() (*CredentialCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CredentialCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CredentialClient) ById(id string) (*Credential, error) { - resp := &Credential{} - err := c.rancherClient.doById(CREDENTIAL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *CredentialClient) Delete(container *Credential) error { - return c.rancherClient.doResourceDelete(CREDENTIAL_TYPE, &container.Resource) -} - -func (c *CredentialClient) ActionActivate(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionCreate(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionDeactivate(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionPurge(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionRemove(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *CredentialClient) ActionUpdate(resource *Credential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(CREDENTIAL_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go deleted file mode 100644 index 0d935f8a5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangelog.go +++ /dev/null @@ -1,97 +0,0 @@ -package client - -const ( - DATABASECHANGELOG_TYPE = "databasechangelog" -) - -type Databasechangelog struct { - Resource - - Author string `json:"author,omitempty" yaml:"author,omitempty"` - - Comments string `json:"comments,omitempty" yaml:"comments,omitempty"` - - Dateexecuted string `json:"dateexecuted,omitempty" yaml:"dateexecuted,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Exectype string `json:"exectype,omitempty" yaml:"exectype,omitempty"` - - Filename string `json:"filename,omitempty" yaml:"filename,omitempty"` - - Liquibase string `json:"liquibase,omitempty" yaml:"liquibase,omitempty"` - - Md5sum string `json:"md5sum,omitempty" yaml:"md5sum,omitempty"` - - Orderexecuted int64 `json:"orderexecuted,omitempty" yaml:"orderexecuted,omitempty"` - - Tag string `json:"tag,omitempty" yaml:"tag,omitempty"` -} - -type DatabasechangelogCollection struct { - Collection - Data []Databasechangelog `json:"data,omitempty"` - client *DatabasechangelogClient -} - -type DatabasechangelogClient struct { - rancherClient *RancherClient -} - -type DatabasechangelogOperations interface { - List(opts *ListOpts) (*DatabasechangelogCollection, error) - Create(opts *Databasechangelog) (*Databasechangelog, error) - Update(existing *Databasechangelog, updates interface{}) (*Databasechangelog, error) - ById(id string) (*Databasechangelog, error) - Delete(container *Databasechangelog) error -} - -func newDatabasechangelogClient(rancherClient *RancherClient) *DatabasechangelogClient { - return &DatabasechangelogClient{ - rancherClient: rancherClient, - } -} - -func (c *DatabasechangelogClient) Create(container *Databasechangelog) (*Databasechangelog, error) { - resp := &Databasechangelog{} - err := c.rancherClient.doCreate(DATABASECHANGELOG_TYPE, container, resp) - return resp, err -} - -func (c *DatabasechangelogClient) Update(existing *Databasechangelog, updates interface{}) (*Databasechangelog, error) { - resp := &Databasechangelog{} - err := c.rancherClient.doUpdate(DATABASECHANGELOG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DatabasechangelogClient) List(opts *ListOpts) (*DatabasechangelogCollection, error) { - resp := &DatabasechangelogCollection{} - err := c.rancherClient.doList(DATABASECHANGELOG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DatabasechangelogCollection) Next() (*DatabasechangelogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DatabasechangelogCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DatabasechangelogClient) ById(id string) (*Databasechangelog, error) { - resp := &Databasechangelog{} - err := c.rancherClient.doById(DATABASECHANGELOG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DatabasechangelogClient) Delete(container *Databasechangelog) error { - return c.rancherClient.doResourceDelete(DATABASECHANGELOG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go b/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go deleted file mode 100644 index a93c015a0..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_databasechangeloglock.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - DATABASECHANGELOGLOCK_TYPE = "databasechangeloglock" -) - -type Databasechangeloglock struct { - Resource - - Locked bool `json:"locked,omitempty" yaml:"locked,omitempty"` - - Lockedby string `json:"lockedby,omitempty" yaml:"lockedby,omitempty"` - - Lockgranted string `json:"lockgranted,omitempty" yaml:"lockgranted,omitempty"` -} - -type DatabasechangeloglockCollection struct { - Collection - Data []Databasechangeloglock `json:"data,omitempty"` - client *DatabasechangeloglockClient -} - -type DatabasechangeloglockClient struct { - rancherClient *RancherClient -} - -type DatabasechangeloglockOperations interface { - List(opts *ListOpts) (*DatabasechangeloglockCollection, error) - Create(opts *Databasechangeloglock) (*Databasechangeloglock, error) - Update(existing *Databasechangeloglock, updates interface{}) (*Databasechangeloglock, error) - ById(id string) (*Databasechangeloglock, error) - Delete(container *Databasechangeloglock) error -} - -func newDatabasechangeloglockClient(rancherClient *RancherClient) *DatabasechangeloglockClient { - return &DatabasechangeloglockClient{ - rancherClient: rancherClient, - } -} - -func (c *DatabasechangeloglockClient) Create(container *Databasechangeloglock) (*Databasechangeloglock, error) { - resp := &Databasechangeloglock{} - err := c.rancherClient.doCreate(DATABASECHANGELOGLOCK_TYPE, container, resp) - return resp, err -} - -func (c *DatabasechangeloglockClient) Update(existing *Databasechangeloglock, updates interface{}) (*Databasechangeloglock, error) { - resp := &Databasechangeloglock{} - err := c.rancherClient.doUpdate(DATABASECHANGELOGLOCK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DatabasechangeloglockClient) List(opts *ListOpts) (*DatabasechangeloglockCollection, error) { - resp := &DatabasechangeloglockCollection{} - err := c.rancherClient.doList(DATABASECHANGELOGLOCK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DatabasechangeloglockCollection) Next() (*DatabasechangeloglockCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DatabasechangeloglockCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DatabasechangeloglockClient) ById(id string) (*Databasechangeloglock, error) { - resp := &Databasechangeloglock{} - err := c.rancherClient.doById(DATABASECHANGELOGLOCK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DatabasechangeloglockClient) Delete(container *Databasechangeloglock) error { - return c.rancherClient.doResourceDelete(DATABASECHANGELOGLOCK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go deleted file mode 100644 index 8cdb206fc..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_default_network.go +++ /dev/null @@ -1,183 +0,0 @@ -package client - -const ( - DEFAULT_NETWORK_TYPE = "defaultNetwork" -) - -type DefaultNetwork struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultPolicyAction string `json:"defaultPolicyAction,omitempty" yaml:"default_policy_action,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - HostPorts bool `json:"hostPorts,omitempty" yaml:"host_ports,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Policy []NetworkPolicyRule `json:"policy,omitempty" yaml:"policy,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Subnets []Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type DefaultNetworkCollection struct { - Collection - Data []DefaultNetwork `json:"data,omitempty"` - client *DefaultNetworkClient -} - -type DefaultNetworkClient struct { - rancherClient *RancherClient -} - -type DefaultNetworkOperations interface { - List(opts *ListOpts) (*DefaultNetworkCollection, error) - Create(opts *DefaultNetwork) (*DefaultNetwork, error) - Update(existing *DefaultNetwork, updates interface{}) (*DefaultNetwork, error) - ById(id string) (*DefaultNetwork, error) - Delete(container *DefaultNetwork) error - - ActionActivate(*DefaultNetwork) (*Network, error) - - ActionCreate(*DefaultNetwork) (*Network, error) - - ActionDeactivate(*DefaultNetwork) (*Network, error) - - ActionPurge(*DefaultNetwork) (*Network, error) - - ActionRemove(*DefaultNetwork) (*Network, error) - - ActionUpdate(*DefaultNetwork) (*Network, error) -} - -func newDefaultNetworkClient(rancherClient *RancherClient) *DefaultNetworkClient { - return &DefaultNetworkClient{ - rancherClient: rancherClient, - } -} - -func (c *DefaultNetworkClient) Create(container *DefaultNetwork) (*DefaultNetwork, error) { - resp := &DefaultNetwork{} - err := c.rancherClient.doCreate(DEFAULT_NETWORK_TYPE, container, resp) - return resp, err -} - -func (c *DefaultNetworkClient) Update(existing *DefaultNetwork, updates interface{}) (*DefaultNetwork, error) { - resp := &DefaultNetwork{} - err := c.rancherClient.doUpdate(DEFAULT_NETWORK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DefaultNetworkClient) List(opts *ListOpts) (*DefaultNetworkCollection, error) { - resp := &DefaultNetworkCollection{} - err := c.rancherClient.doList(DEFAULT_NETWORK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DefaultNetworkCollection) Next() (*DefaultNetworkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DefaultNetworkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DefaultNetworkClient) ById(id string) (*DefaultNetwork, error) { - resp := &DefaultNetwork{} - err := c.rancherClient.doById(DEFAULT_NETWORK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DefaultNetworkClient) Delete(container *DefaultNetwork) error { - return c.rancherClient.doResourceDelete(DEFAULT_NETWORK_TYPE, &container.Resource) -} - -func (c *DefaultNetworkClient) ActionActivate(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionCreate(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionDeactivate(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionPurge(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionRemove(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DefaultNetworkClient) ActionUpdate(resource *DefaultNetwork) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(DEFAULT_NETWORK_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go deleted file mode 100644 index b03c8a058..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_digitalocean_config.go +++ /dev/null @@ -1,101 +0,0 @@ -package client - -const ( - DIGITALOCEAN_CONFIG_TYPE = "digitaloceanConfig" -) - -type DigitaloceanConfig struct { - Resource - - AccessToken string `json:"accessToken,omitempty" yaml:"access_token,omitempty"` - - Backups bool `json:"backups,omitempty" yaml:"backups,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - Ipv6 bool `json:"ipv6,omitempty" yaml:"ipv6,omitempty"` - - PrivateNetworking bool `json:"privateNetworking,omitempty" yaml:"private_networking,omitempty"` - - Region string `json:"region,omitempty" yaml:"region,omitempty"` - - Size string `json:"size,omitempty" yaml:"size,omitempty"` - - SshKeyFingerprint string `json:"sshKeyFingerprint,omitempty" yaml:"ssh_key_fingerprint,omitempty"` - - SshKeyPath string `json:"sshKeyPath,omitempty" yaml:"ssh_key_path,omitempty"` - - SshPort string `json:"sshPort,omitempty" yaml:"ssh_port,omitempty"` - - SshUser string `json:"sshUser,omitempty" yaml:"ssh_user,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` -} - -type DigitaloceanConfigCollection struct { - Collection - Data []DigitaloceanConfig `json:"data,omitempty"` - client *DigitaloceanConfigClient -} - -type DigitaloceanConfigClient struct { - rancherClient *RancherClient -} - -type DigitaloceanConfigOperations interface { - List(opts *ListOpts) (*DigitaloceanConfigCollection, error) - Create(opts *DigitaloceanConfig) (*DigitaloceanConfig, error) - Update(existing *DigitaloceanConfig, updates interface{}) (*DigitaloceanConfig, error) - ById(id string) (*DigitaloceanConfig, error) - Delete(container *DigitaloceanConfig) error -} - -func newDigitaloceanConfigClient(rancherClient *RancherClient) *DigitaloceanConfigClient { - return &DigitaloceanConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *DigitaloceanConfigClient) Create(container *DigitaloceanConfig) (*DigitaloceanConfig, error) { - resp := &DigitaloceanConfig{} - err := c.rancherClient.doCreate(DIGITALOCEAN_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *DigitaloceanConfigClient) Update(existing *DigitaloceanConfig, updates interface{}) (*DigitaloceanConfig, error) { - resp := &DigitaloceanConfig{} - err := c.rancherClient.doUpdate(DIGITALOCEAN_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DigitaloceanConfigClient) List(opts *ListOpts) (*DigitaloceanConfigCollection, error) { - resp := &DigitaloceanConfigCollection{} - err := c.rancherClient.doList(DIGITALOCEAN_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DigitaloceanConfigCollection) Next() (*DigitaloceanConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DigitaloceanConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DigitaloceanConfigClient) ById(id string) (*DigitaloceanConfig, error) { - resp := &DigitaloceanConfig{} - err := c.rancherClient.doById(DIGITALOCEAN_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DigitaloceanConfigClient) Delete(container *DigitaloceanConfig) error { - return c.rancherClient.doResourceDelete(DIGITALOCEAN_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go deleted file mode 100644 index d554562aa..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_dns_service.go +++ /dev/null @@ -1,285 +0,0 @@ -package client - -const ( - DNS_SERVICE_TYPE = "dnsService" -) - -type DnsService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type DnsServiceCollection struct { - Collection - Data []DnsService `json:"data,omitempty"` - client *DnsServiceClient -} - -type DnsServiceClient struct { - rancherClient *RancherClient -} - -type DnsServiceOperations interface { - List(opts *ListOpts) (*DnsServiceCollection, error) - Create(opts *DnsService) (*DnsService, error) - Update(existing *DnsService, updates interface{}) (*DnsService, error) - ById(id string) (*DnsService, error) - Delete(container *DnsService) error - - ActionActivate(*DnsService) (*Service, error) - - ActionAddservicelink(*DnsService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*DnsService) (*Service, error) - - ActionContinueupgrade(*DnsService) (*Service, error) - - ActionCreate(*DnsService) (*Service, error) - - ActionDeactivate(*DnsService) (*Service, error) - - ActionFinishupgrade(*DnsService) (*Service, error) - - ActionRemove(*DnsService) (*Service, error) - - ActionRemoveservicelink(*DnsService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*DnsService, *ServiceRestart) (*Service, error) - - ActionRollback(*DnsService) (*Service, error) - - ActionSetservicelinks(*DnsService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*DnsService) (*Service, error) - - ActionUpgrade(*DnsService, *ServiceUpgrade) (*Service, error) -} - -func newDnsServiceClient(rancherClient *RancherClient) *DnsServiceClient { - return &DnsServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *DnsServiceClient) Create(container *DnsService) (*DnsService, error) { - resp := &DnsService{} - err := c.rancherClient.doCreate(DNS_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *DnsServiceClient) Update(existing *DnsService, updates interface{}) (*DnsService, error) { - resp := &DnsService{} - err := c.rancherClient.doUpdate(DNS_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DnsServiceClient) List(opts *ListOpts) (*DnsServiceCollection, error) { - resp := &DnsServiceCollection{} - err := c.rancherClient.doList(DNS_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DnsServiceCollection) Next() (*DnsServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DnsServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DnsServiceClient) ById(id string) (*DnsService, error) { - resp := &DnsService{} - err := c.rancherClient.doById(DNS_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DnsServiceClient) Delete(container *DnsService) error { - return c.rancherClient.doResourceDelete(DNS_SERVICE_TYPE, &container.Resource) -} - -func (c *DnsServiceClient) ActionActivate(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionAddservicelink(resource *DnsService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionCancelupgrade(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionContinueupgrade(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionCreate(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionDeactivate(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionFinishupgrade(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionRemove(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionRemoveservicelink(resource *DnsService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionRestart(resource *DnsService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionRollback(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionSetservicelinks(resource *DnsService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionUpdate(resource *DnsService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *DnsServiceClient) ActionUpgrade(resource *DnsService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(DNS_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go b/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go deleted file mode 100644 index a1b1e371b..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_docker_build.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - DOCKER_BUILD_TYPE = "dockerBuild" -) - -type DockerBuild struct { - Resource - - Context string `json:"context,omitempty" yaml:"context,omitempty"` - - Dockerfile string `json:"dockerfile,omitempty" yaml:"dockerfile,omitempty"` - - Forcerm bool `json:"forcerm,omitempty" yaml:"forcerm,omitempty"` - - Nocache bool `json:"nocache,omitempty" yaml:"nocache,omitempty"` - - Remote string `json:"remote,omitempty" yaml:"remote,omitempty"` - - Rm bool `json:"rm,omitempty" yaml:"rm,omitempty"` -} - -type DockerBuildCollection struct { - Collection - Data []DockerBuild `json:"data,omitempty"` - client *DockerBuildClient -} - -type DockerBuildClient struct { - rancherClient *RancherClient -} - -type DockerBuildOperations interface { - List(opts *ListOpts) (*DockerBuildCollection, error) - Create(opts *DockerBuild) (*DockerBuild, error) - Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) - ById(id string) (*DockerBuild, error) - Delete(container *DockerBuild) error -} - -func newDockerBuildClient(rancherClient *RancherClient) *DockerBuildClient { - return &DockerBuildClient{ - rancherClient: rancherClient, - } -} - -func (c *DockerBuildClient) Create(container *DockerBuild) (*DockerBuild, error) { - resp := &DockerBuild{} - err := c.rancherClient.doCreate(DOCKER_BUILD_TYPE, container, resp) - return resp, err -} - -func (c *DockerBuildClient) Update(existing *DockerBuild, updates interface{}) (*DockerBuild, error) { - resp := &DockerBuild{} - err := c.rancherClient.doUpdate(DOCKER_BUILD_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *DockerBuildClient) List(opts *ListOpts) (*DockerBuildCollection, error) { - resp := &DockerBuildCollection{} - err := c.rancherClient.doList(DOCKER_BUILD_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *DockerBuildCollection) Next() (*DockerBuildCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &DockerBuildCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *DockerBuildClient) ById(id string) (*DockerBuild, error) { - resp := &DockerBuild{} - err := c.rancherClient.doById(DOCKER_BUILD_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *DockerBuildClient) Delete(container *DockerBuild) error { - return c.rancherClient.doResourceDelete(DOCKER_BUILD_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go deleted file mode 100644 index 216383386..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_extension_implementation.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - EXTENSION_IMPLEMENTATION_TYPE = "extensionImplementation" -) - -type ExtensionImplementation struct { - Resource - - ClassName string `json:"className,omitempty" yaml:"class_name,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Properties map[string]interface{} `json:"properties,omitempty" yaml:"properties,omitempty"` -} - -type ExtensionImplementationCollection struct { - Collection - Data []ExtensionImplementation `json:"data,omitempty"` - client *ExtensionImplementationClient -} - -type ExtensionImplementationClient struct { - rancherClient *RancherClient -} - -type ExtensionImplementationOperations interface { - List(opts *ListOpts) (*ExtensionImplementationCollection, error) - Create(opts *ExtensionImplementation) (*ExtensionImplementation, error) - Update(existing *ExtensionImplementation, updates interface{}) (*ExtensionImplementation, error) - ById(id string) (*ExtensionImplementation, error) - Delete(container *ExtensionImplementation) error -} - -func newExtensionImplementationClient(rancherClient *RancherClient) *ExtensionImplementationClient { - return &ExtensionImplementationClient{ - rancherClient: rancherClient, - } -} - -func (c *ExtensionImplementationClient) Create(container *ExtensionImplementation) (*ExtensionImplementation, error) { - resp := &ExtensionImplementation{} - err := c.rancherClient.doCreate(EXTENSION_IMPLEMENTATION_TYPE, container, resp) - return resp, err -} - -func (c *ExtensionImplementationClient) Update(existing *ExtensionImplementation, updates interface{}) (*ExtensionImplementation, error) { - resp := &ExtensionImplementation{} - err := c.rancherClient.doUpdate(EXTENSION_IMPLEMENTATION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExtensionImplementationClient) List(opts *ListOpts) (*ExtensionImplementationCollection, error) { - resp := &ExtensionImplementationCollection{} - err := c.rancherClient.doList(EXTENSION_IMPLEMENTATION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExtensionImplementationCollection) Next() (*ExtensionImplementationCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExtensionImplementationCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExtensionImplementationClient) ById(id string) (*ExtensionImplementation, error) { - resp := &ExtensionImplementation{} - err := c.rancherClient.doById(EXTENSION_IMPLEMENTATION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExtensionImplementationClient) Delete(container *ExtensionImplementation) error { - return c.rancherClient.doResourceDelete(EXTENSION_IMPLEMENTATION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go b/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go deleted file mode 100644 index e3c0b87ab..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_extension_point.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - EXTENSION_POINT_TYPE = "extensionPoint" -) - -type ExtensionPoint struct { - Resource - - ExcludeSetting string `json:"excludeSetting,omitempty" yaml:"exclude_setting,omitempty"` - - Implementations []ExtensionImplementation `json:"implementations,omitempty" yaml:"implementations,omitempty"` - - IncludeSetting string `json:"includeSetting,omitempty" yaml:"include_setting,omitempty"` - - ListSetting string `json:"listSetting,omitempty" yaml:"list_setting,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type ExtensionPointCollection struct { - Collection - Data []ExtensionPoint `json:"data,omitempty"` - client *ExtensionPointClient -} - -type ExtensionPointClient struct { - rancherClient *RancherClient -} - -type ExtensionPointOperations interface { - List(opts *ListOpts) (*ExtensionPointCollection, error) - Create(opts *ExtensionPoint) (*ExtensionPoint, error) - Update(existing *ExtensionPoint, updates interface{}) (*ExtensionPoint, error) - ById(id string) (*ExtensionPoint, error) - Delete(container *ExtensionPoint) error -} - -func newExtensionPointClient(rancherClient *RancherClient) *ExtensionPointClient { - return &ExtensionPointClient{ - rancherClient: rancherClient, - } -} - -func (c *ExtensionPointClient) Create(container *ExtensionPoint) (*ExtensionPoint, error) { - resp := &ExtensionPoint{} - err := c.rancherClient.doCreate(EXTENSION_POINT_TYPE, container, resp) - return resp, err -} - -func (c *ExtensionPointClient) Update(existing *ExtensionPoint, updates interface{}) (*ExtensionPoint, error) { - resp := &ExtensionPoint{} - err := c.rancherClient.doUpdate(EXTENSION_POINT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExtensionPointClient) List(opts *ListOpts) (*ExtensionPointCollection, error) { - resp := &ExtensionPointCollection{} - err := c.rancherClient.doList(EXTENSION_POINT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExtensionPointCollection) Next() (*ExtensionPointCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExtensionPointCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExtensionPointClient) ById(id string) (*ExtensionPoint, error) { - resp := &ExtensionPoint{} - err := c.rancherClient.doById(EXTENSION_POINT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExtensionPointClient) Delete(container *ExtensionPoint) error { - return c.rancherClient.doResourceDelete(EXTENSION_POINT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go deleted file mode 100644 index e4c6c929b..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_dns_event.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - EXTERNAL_DNS_EVENT_TYPE = "externalDnsEvent" -) - -type ExternalDnsEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - ServiceName string `json:"serviceName,omitempty" yaml:"service_name,omitempty"` - - StackName string `json:"stackName,omitempty" yaml:"stack_name,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalDnsEventCollection struct { - Collection - Data []ExternalDnsEvent `json:"data,omitempty"` - client *ExternalDnsEventClient -} - -type ExternalDnsEventClient struct { - rancherClient *RancherClient -} - -type ExternalDnsEventOperations interface { - List(opts *ListOpts) (*ExternalDnsEventCollection, error) - Create(opts *ExternalDnsEvent) (*ExternalDnsEvent, error) - Update(existing *ExternalDnsEvent, updates interface{}) (*ExternalDnsEvent, error) - ById(id string) (*ExternalDnsEvent, error) - Delete(container *ExternalDnsEvent) error - - ActionCreate(*ExternalDnsEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalDnsEvent) (*ExternalEvent, error) -} - -func newExternalDnsEventClient(rancherClient *RancherClient) *ExternalDnsEventClient { - return &ExternalDnsEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalDnsEventClient) Create(container *ExternalDnsEvent) (*ExternalDnsEvent, error) { - resp := &ExternalDnsEvent{} - err := c.rancherClient.doCreate(EXTERNAL_DNS_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalDnsEventClient) Update(existing *ExternalDnsEvent, updates interface{}) (*ExternalDnsEvent, error) { - resp := &ExternalDnsEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_DNS_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalDnsEventClient) List(opts *ListOpts) (*ExternalDnsEventCollection, error) { - resp := &ExternalDnsEventCollection{} - err := c.rancherClient.doList(EXTERNAL_DNS_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalDnsEventCollection) Next() (*ExternalDnsEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalDnsEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalDnsEventClient) ById(id string) (*ExternalDnsEvent, error) { - resp := &ExternalDnsEvent{} - err := c.rancherClient.doById(EXTERNAL_DNS_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalDnsEventClient) Delete(container *ExternalDnsEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_DNS_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalDnsEventClient) ActionCreate(resource *ExternalDnsEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_DNS_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalDnsEventClient) ActionRemove(resource *ExternalDnsEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_DNS_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go deleted file mode 100644 index 3b43545a5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_event.go +++ /dev/null @@ -1,123 +0,0 @@ -package client - -const ( - EXTERNAL_EVENT_TYPE = "externalEvent" -) - -type ExternalEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalEventCollection struct { - Collection - Data []ExternalEvent `json:"data,omitempty"` - client *ExternalEventClient -} - -type ExternalEventClient struct { - rancherClient *RancherClient -} - -type ExternalEventOperations interface { - List(opts *ListOpts) (*ExternalEventCollection, error) - Create(opts *ExternalEvent) (*ExternalEvent, error) - Update(existing *ExternalEvent, updates interface{}) (*ExternalEvent, error) - ById(id string) (*ExternalEvent, error) - Delete(container *ExternalEvent) error - - ActionCreate(*ExternalEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalEvent) (*ExternalEvent, error) -} - -func newExternalEventClient(rancherClient *RancherClient) *ExternalEventClient { - return &ExternalEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalEventClient) Create(container *ExternalEvent) (*ExternalEvent, error) { - resp := &ExternalEvent{} - err := c.rancherClient.doCreate(EXTERNAL_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalEventClient) Update(existing *ExternalEvent, updates interface{}) (*ExternalEvent, error) { - resp := &ExternalEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalEventClient) List(opts *ListOpts) (*ExternalEventCollection, error) { - resp := &ExternalEventCollection{} - err := c.rancherClient.doList(EXTERNAL_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalEventCollection) Next() (*ExternalEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalEventClient) ById(id string) (*ExternalEvent, error) { - resp := &ExternalEvent{} - err := c.rancherClient.doById(EXTERNAL_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalEventClient) Delete(container *ExternalEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalEventClient) ActionCreate(resource *ExternalEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalEventClient) ActionRemove(resource *ExternalEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go deleted file mode 100644 index d0162922d..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler.go +++ /dev/null @@ -1,175 +0,0 @@ -package client - -const ( - EXTERNAL_HANDLER_TYPE = "externalHandler" -) - -type ExternalHandler struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - - ProcessConfigs []ExternalHandlerProcessConfig `json:"processConfigs,omitempty" yaml:"process_configs,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Retries int64 `json:"retries,omitempty" yaml:"retries,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - TimeoutMillis int64 `json:"timeoutMillis,omitempty" yaml:"timeout_millis,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalHandlerCollection struct { - Collection - Data []ExternalHandler `json:"data,omitempty"` - client *ExternalHandlerClient -} - -type ExternalHandlerClient struct { - rancherClient *RancherClient -} - -type ExternalHandlerOperations interface { - List(opts *ListOpts) (*ExternalHandlerCollection, error) - Create(opts *ExternalHandler) (*ExternalHandler, error) - Update(existing *ExternalHandler, updates interface{}) (*ExternalHandler, error) - ById(id string) (*ExternalHandler, error) - Delete(container *ExternalHandler) error - - ActionActivate(*ExternalHandler) (*ExternalHandler, error) - - ActionCreate(*ExternalHandler) (*ExternalHandler, error) - - ActionDeactivate(*ExternalHandler) (*ExternalHandler, error) - - ActionPurge(*ExternalHandler) (*ExternalHandler, error) - - ActionRemove(*ExternalHandler) (*ExternalHandler, error) - - ActionUpdate(*ExternalHandler) (*ExternalHandler, error) -} - -func newExternalHandlerClient(rancherClient *RancherClient) *ExternalHandlerClient { - return &ExternalHandlerClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHandlerClient) Create(container *ExternalHandler) (*ExternalHandler, error) { - resp := &ExternalHandler{} - err := c.rancherClient.doCreate(EXTERNAL_HANDLER_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHandlerClient) Update(existing *ExternalHandler, updates interface{}) (*ExternalHandler, error) { - resp := &ExternalHandler{} - err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHandlerClient) List(opts *ListOpts) (*ExternalHandlerCollection, error) { - resp := &ExternalHandlerCollection{} - err := c.rancherClient.doList(EXTERNAL_HANDLER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHandlerCollection) Next() (*ExternalHandlerCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHandlerCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHandlerClient) ById(id string) (*ExternalHandler, error) { - resp := &ExternalHandler{} - err := c.rancherClient.doById(EXTERNAL_HANDLER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHandlerClient) Delete(container *ExternalHandler) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_TYPE, &container.Resource) -} - -func (c *ExternalHandlerClient) ActionActivate(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionCreate(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionDeactivate(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionPurge(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionRemove(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerClient) ActionUpdate(resource *ExternalHandler) (*ExternalHandler, error) { - - resp := &ExternalHandler{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go deleted file mode 100644 index b111264a2..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_external_handler_process_map.go +++ /dev/null @@ -1,175 +0,0 @@ -package client - -const ( - EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE = "externalHandlerExternalHandlerProcessMap" -) - -type ExternalHandlerExternalHandlerProcessMap struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - EventName string `json:"eventName,omitempty" yaml:"event_name,omitempty"` - - ExternalHandlerId string `json:"externalHandlerId,omitempty" yaml:"external_handler_id,omitempty"` - - ExternalHandlerProcessId string `json:"externalHandlerProcessId,omitempty" yaml:"external_handler_process_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - OnError string `json:"onError,omitempty" yaml:"on_error,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalHandlerExternalHandlerProcessMapCollection struct { - Collection - Data []ExternalHandlerExternalHandlerProcessMap `json:"data,omitempty"` - client *ExternalHandlerExternalHandlerProcessMapClient -} - -type ExternalHandlerExternalHandlerProcessMapClient struct { - rancherClient *RancherClient -} - -type ExternalHandlerExternalHandlerProcessMapOperations interface { - List(opts *ListOpts) (*ExternalHandlerExternalHandlerProcessMapCollection, error) - Create(opts *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - Update(existing *ExternalHandlerExternalHandlerProcessMap, updates interface{}) (*ExternalHandlerExternalHandlerProcessMap, error) - ById(id string) (*ExternalHandlerExternalHandlerProcessMap, error) - Delete(container *ExternalHandlerExternalHandlerProcessMap) error - - ActionActivate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionCreate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionDeactivate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionPurge(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionRemove(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) - - ActionUpdate(*ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) -} - -func newExternalHandlerExternalHandlerProcessMapClient(rancherClient *RancherClient) *ExternalHandlerExternalHandlerProcessMapClient { - return &ExternalHandlerExternalHandlerProcessMapClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) Create(container *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - resp := &ExternalHandlerExternalHandlerProcessMap{} - err := c.rancherClient.doCreate(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) Update(existing *ExternalHandlerExternalHandlerProcessMap, updates interface{}) (*ExternalHandlerExternalHandlerProcessMap, error) { - resp := &ExternalHandlerExternalHandlerProcessMap{} - err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) List(opts *ListOpts) (*ExternalHandlerExternalHandlerProcessMapCollection, error) { - resp := &ExternalHandlerExternalHandlerProcessMapCollection{} - err := c.rancherClient.doList(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHandlerExternalHandlerProcessMapCollection) Next() (*ExternalHandlerExternalHandlerProcessMapCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHandlerExternalHandlerProcessMapCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ById(id string) (*ExternalHandlerExternalHandlerProcessMap, error) { - resp := &ExternalHandlerExternalHandlerProcessMap{} - err := c.rancherClient.doById(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) Delete(container *ExternalHandlerExternalHandlerProcessMap) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, &container.Resource) -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionActivate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionCreate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionDeactivate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionPurge(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionRemove(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerExternalHandlerProcessMapClient) ActionUpdate(resource *ExternalHandlerExternalHandlerProcessMap) (*ExternalHandlerExternalHandlerProcessMap, error) { - - resp := &ExternalHandlerExternalHandlerProcessMap{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_EXTERNAL_HANDLER_PROCESS_MAP_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go deleted file mode 100644 index c9aedf82d..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process.go +++ /dev/null @@ -1,167 +0,0 @@ -package client - -const ( - EXTERNAL_HANDLER_PROCESS_TYPE = "externalHandlerProcess" -) - -type ExternalHandlerProcess struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalHandlerProcessCollection struct { - Collection - Data []ExternalHandlerProcess `json:"data,omitempty"` - client *ExternalHandlerProcessClient -} - -type ExternalHandlerProcessClient struct { - rancherClient *RancherClient -} - -type ExternalHandlerProcessOperations interface { - List(opts *ListOpts) (*ExternalHandlerProcessCollection, error) - Create(opts *ExternalHandlerProcess) (*ExternalHandlerProcess, error) - Update(existing *ExternalHandlerProcess, updates interface{}) (*ExternalHandlerProcess, error) - ById(id string) (*ExternalHandlerProcess, error) - Delete(container *ExternalHandlerProcess) error - - ActionActivate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionCreate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionDeactivate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionPurge(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionRemove(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) - - ActionUpdate(*ExternalHandlerProcess) (*ExternalHandlerProcess, error) -} - -func newExternalHandlerProcessClient(rancherClient *RancherClient) *ExternalHandlerProcessClient { - return &ExternalHandlerProcessClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHandlerProcessClient) Create(container *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - resp := &ExternalHandlerProcess{} - err := c.rancherClient.doCreate(EXTERNAL_HANDLER_PROCESS_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHandlerProcessClient) Update(existing *ExternalHandlerProcess, updates interface{}) (*ExternalHandlerProcess, error) { - resp := &ExternalHandlerProcess{} - err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_PROCESS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHandlerProcessClient) List(opts *ListOpts) (*ExternalHandlerProcessCollection, error) { - resp := &ExternalHandlerProcessCollection{} - err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHandlerProcessCollection) Next() (*ExternalHandlerProcessCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHandlerProcessCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHandlerProcessClient) ById(id string) (*ExternalHandlerProcess, error) { - resp := &ExternalHandlerProcess{} - err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHandlerProcessClient) Delete(container *ExternalHandlerProcess) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_PROCESS_TYPE, &container.Resource) -} - -func (c *ExternalHandlerProcessClient) ActionActivate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionCreate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionDeactivate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionPurge(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionRemove(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHandlerProcessClient) ActionUpdate(resource *ExternalHandlerProcess) (*ExternalHandlerProcess, error) { - - resp := &ExternalHandlerProcess{} - - err := c.rancherClient.doAction(EXTERNAL_HANDLER_PROCESS_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go deleted file mode 100644 index 08d4ab066..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_handler_process_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE = "externalHandlerProcessConfig" -) - -type ExternalHandlerProcessConfig struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - OnError string `json:"onError,omitempty" yaml:"on_error,omitempty"` -} - -type ExternalHandlerProcessConfigCollection struct { - Collection - Data []ExternalHandlerProcessConfig `json:"data,omitempty"` - client *ExternalHandlerProcessConfigClient -} - -type ExternalHandlerProcessConfigClient struct { - rancherClient *RancherClient -} - -type ExternalHandlerProcessConfigOperations interface { - List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error) - Create(opts *ExternalHandlerProcessConfig) (*ExternalHandlerProcessConfig, error) - Update(existing *ExternalHandlerProcessConfig, updates interface{}) (*ExternalHandlerProcessConfig, error) - ById(id string) (*ExternalHandlerProcessConfig, error) - Delete(container *ExternalHandlerProcessConfig) error -} - -func newExternalHandlerProcessConfigClient(rancherClient *RancherClient) *ExternalHandlerProcessConfigClient { - return &ExternalHandlerProcessConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHandlerProcessConfigClient) Create(container *ExternalHandlerProcessConfig) (*ExternalHandlerProcessConfig, error) { - resp := &ExternalHandlerProcessConfig{} - err := c.rancherClient.doCreate(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHandlerProcessConfigClient) Update(existing *ExternalHandlerProcessConfig, updates interface{}) (*ExternalHandlerProcessConfig, error) { - resp := &ExternalHandlerProcessConfig{} - err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHandlerProcessConfigClient) List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error) { - resp := &ExternalHandlerProcessConfigCollection{} - err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHandlerProcessConfigCollection) Next() (*ExternalHandlerProcessConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHandlerProcessConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHandlerProcessConfigClient) ById(id string) (*ExternalHandlerProcessConfig, error) { - resp := &ExternalHandlerProcessConfig{} - err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHandlerProcessConfigClient) Delete(container *ExternalHandlerProcessConfig) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go deleted file mode 100644 index e35425eb7..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_host_event.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - EXTERNAL_HOST_EVENT_TYPE = "externalHostEvent" -) - -type ExternalHostEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DeleteHost bool `json:"deleteHost,omitempty" yaml:"delete_host,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - HostLabel string `json:"hostLabel,omitempty" yaml:"host_label,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalHostEventCollection struct { - Collection - Data []ExternalHostEvent `json:"data,omitempty"` - client *ExternalHostEventClient -} - -type ExternalHostEventClient struct { - rancherClient *RancherClient -} - -type ExternalHostEventOperations interface { - List(opts *ListOpts) (*ExternalHostEventCollection, error) - Create(opts *ExternalHostEvent) (*ExternalHostEvent, error) - Update(existing *ExternalHostEvent, updates interface{}) (*ExternalHostEvent, error) - ById(id string) (*ExternalHostEvent, error) - Delete(container *ExternalHostEvent) error - - ActionCreate(*ExternalHostEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalHostEvent) (*ExternalEvent, error) -} - -func newExternalHostEventClient(rancherClient *RancherClient) *ExternalHostEventClient { - return &ExternalHostEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalHostEventClient) Create(container *ExternalHostEvent) (*ExternalHostEvent, error) { - resp := &ExternalHostEvent{} - err := c.rancherClient.doCreate(EXTERNAL_HOST_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalHostEventClient) Update(existing *ExternalHostEvent, updates interface{}) (*ExternalHostEvent, error) { - resp := &ExternalHostEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_HOST_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalHostEventClient) List(opts *ListOpts) (*ExternalHostEventCollection, error) { - resp := &ExternalHostEventCollection{} - err := c.rancherClient.doList(EXTERNAL_HOST_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalHostEventCollection) Next() (*ExternalHostEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalHostEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalHostEventClient) ById(id string) (*ExternalHostEvent, error) { - resp := &ExternalHostEvent{} - err := c.rancherClient.doById(EXTERNAL_HOST_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalHostEventClient) Delete(container *ExternalHostEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_HOST_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalHostEventClient) ActionCreate(resource *ExternalHostEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_HOST_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalHostEventClient) ActionRemove(resource *ExternalHostEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_HOST_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go deleted file mode 100644 index cc9cf4f31..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_service.go +++ /dev/null @@ -1,252 +0,0 @@ -package client - -const ( - EXTERNAL_SERVICE_TYPE = "externalService" -) - -type ExternalService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalIpAddresses []string `json:"externalIpAddresses,omitempty" yaml:"external_ip_addresses,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalServiceCollection struct { - Collection - Data []ExternalService `json:"data,omitempty"` - client *ExternalServiceClient -} - -type ExternalServiceClient struct { - rancherClient *RancherClient -} - -type ExternalServiceOperations interface { - List(opts *ListOpts) (*ExternalServiceCollection, error) - Create(opts *ExternalService) (*ExternalService, error) - Update(existing *ExternalService, updates interface{}) (*ExternalService, error) - ById(id string) (*ExternalService, error) - Delete(container *ExternalService) error - - ActionActivate(*ExternalService) (*Service, error) - - ActionCancelupgrade(*ExternalService) (*Service, error) - - ActionContinueupgrade(*ExternalService) (*Service, error) - - ActionCreate(*ExternalService) (*Service, error) - - ActionDeactivate(*ExternalService) (*Service, error) - - ActionFinishupgrade(*ExternalService) (*Service, error) - - ActionRemove(*ExternalService) (*Service, error) - - ActionRestart(*ExternalService, *ServiceRestart) (*Service, error) - - ActionRollback(*ExternalService) (*Service, error) - - ActionUpdate(*ExternalService) (*Service, error) - - ActionUpgrade(*ExternalService, *ServiceUpgrade) (*Service, error) -} - -func newExternalServiceClient(rancherClient *RancherClient) *ExternalServiceClient { - return &ExternalServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalServiceClient) Create(container *ExternalService) (*ExternalService, error) { - resp := &ExternalService{} - err := c.rancherClient.doCreate(EXTERNAL_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *ExternalServiceClient) Update(existing *ExternalService, updates interface{}) (*ExternalService, error) { - resp := &ExternalService{} - err := c.rancherClient.doUpdate(EXTERNAL_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalServiceClient) List(opts *ListOpts) (*ExternalServiceCollection, error) { - resp := &ExternalServiceCollection{} - err := c.rancherClient.doList(EXTERNAL_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalServiceCollection) Next() (*ExternalServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalServiceClient) ById(id string) (*ExternalService, error) { - resp := &ExternalService{} - err := c.rancherClient.doById(EXTERNAL_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalServiceClient) Delete(container *ExternalService) error { - return c.rancherClient.doResourceDelete(EXTERNAL_SERVICE_TYPE, &container.Resource) -} - -func (c *ExternalServiceClient) ActionActivate(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionCancelupgrade(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionContinueupgrade(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionCreate(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionDeactivate(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionFinishupgrade(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionRemove(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionRestart(resource *ExternalService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionRollback(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionUpdate(resource *ExternalService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceClient) ActionUpgrade(resource *ExternalService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go deleted file mode 100644 index 59913d208..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_service_event.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - EXTERNAL_SERVICE_EVENT_TYPE = "externalServiceEvent" -) - -type ExternalServiceEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Environment interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - Service interface{} `json:"service,omitempty" yaml:"service,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalServiceEventCollection struct { - Collection - Data []ExternalServiceEvent `json:"data,omitempty"` - client *ExternalServiceEventClient -} - -type ExternalServiceEventClient struct { - rancherClient *RancherClient -} - -type ExternalServiceEventOperations interface { - List(opts *ListOpts) (*ExternalServiceEventCollection, error) - Create(opts *ExternalServiceEvent) (*ExternalServiceEvent, error) - Update(existing *ExternalServiceEvent, updates interface{}) (*ExternalServiceEvent, error) - ById(id string) (*ExternalServiceEvent, error) - Delete(container *ExternalServiceEvent) error - - ActionCreate(*ExternalServiceEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalServiceEvent) (*ExternalEvent, error) -} - -func newExternalServiceEventClient(rancherClient *RancherClient) *ExternalServiceEventClient { - return &ExternalServiceEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalServiceEventClient) Create(container *ExternalServiceEvent) (*ExternalServiceEvent, error) { - resp := &ExternalServiceEvent{} - err := c.rancherClient.doCreate(EXTERNAL_SERVICE_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalServiceEventClient) Update(existing *ExternalServiceEvent, updates interface{}) (*ExternalServiceEvent, error) { - resp := &ExternalServiceEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_SERVICE_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalServiceEventClient) List(opts *ListOpts) (*ExternalServiceEventCollection, error) { - resp := &ExternalServiceEventCollection{} - err := c.rancherClient.doList(EXTERNAL_SERVICE_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalServiceEventCollection) Next() (*ExternalServiceEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalServiceEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalServiceEventClient) ById(id string) (*ExternalServiceEvent, error) { - resp := &ExternalServiceEvent{} - err := c.rancherClient.doById(EXTERNAL_SERVICE_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalServiceEventClient) Delete(container *ExternalServiceEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_SERVICE_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalServiceEventClient) ActionCreate(resource *ExternalServiceEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalServiceEventClient) ActionRemove(resource *ExternalServiceEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_SERVICE_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go deleted file mode 100644 index 30b8ca17d..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_storage_pool_event.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - EXTERNAL_STORAGE_POOL_EVENT_TYPE = "externalStoragePoolEvent" -) - -type ExternalStoragePoolEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostUuids []string `json:"hostUuids,omitempty" yaml:"host_uuids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StoragePool StoragePool `json:"storagePool,omitempty" yaml:"storage_pool,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ExternalStoragePoolEventCollection struct { - Collection - Data []ExternalStoragePoolEvent `json:"data,omitempty"` - client *ExternalStoragePoolEventClient -} - -type ExternalStoragePoolEventClient struct { - rancherClient *RancherClient -} - -type ExternalStoragePoolEventOperations interface { - List(opts *ListOpts) (*ExternalStoragePoolEventCollection, error) - Create(opts *ExternalStoragePoolEvent) (*ExternalStoragePoolEvent, error) - Update(existing *ExternalStoragePoolEvent, updates interface{}) (*ExternalStoragePoolEvent, error) - ById(id string) (*ExternalStoragePoolEvent, error) - Delete(container *ExternalStoragePoolEvent) error - - ActionCreate(*ExternalStoragePoolEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalStoragePoolEvent) (*ExternalEvent, error) -} - -func newExternalStoragePoolEventClient(rancherClient *RancherClient) *ExternalStoragePoolEventClient { - return &ExternalStoragePoolEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalStoragePoolEventClient) Create(container *ExternalStoragePoolEvent) (*ExternalStoragePoolEvent, error) { - resp := &ExternalStoragePoolEvent{} - err := c.rancherClient.doCreate(EXTERNAL_STORAGE_POOL_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalStoragePoolEventClient) Update(existing *ExternalStoragePoolEvent, updates interface{}) (*ExternalStoragePoolEvent, error) { - resp := &ExternalStoragePoolEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_STORAGE_POOL_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalStoragePoolEventClient) List(opts *ListOpts) (*ExternalStoragePoolEventCollection, error) { - resp := &ExternalStoragePoolEventCollection{} - err := c.rancherClient.doList(EXTERNAL_STORAGE_POOL_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalStoragePoolEventCollection) Next() (*ExternalStoragePoolEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalStoragePoolEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalStoragePoolEventClient) ById(id string) (*ExternalStoragePoolEvent, error) { - resp := &ExternalStoragePoolEvent{} - err := c.rancherClient.doById(EXTERNAL_STORAGE_POOL_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalStoragePoolEventClient) Delete(container *ExternalStoragePoolEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_STORAGE_POOL_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalStoragePoolEventClient) ActionCreate(resource *ExternalStoragePoolEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_STORAGE_POOL_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalStoragePoolEventClient) ActionRemove(resource *ExternalStoragePoolEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_STORAGE_POOL_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go deleted file mode 100644 index 785efb153..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_external_volume_event.go +++ /dev/null @@ -1,125 +0,0 @@ -package client - -const ( - EXTERNAL_VOLUME_EVENT_TYPE = "externalVolumeEvent" -) - -type ExternalVolumeEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Volume Volume `json:"volume,omitempty" yaml:"volume,omitempty"` -} - -type ExternalVolumeEventCollection struct { - Collection - Data []ExternalVolumeEvent `json:"data,omitempty"` - client *ExternalVolumeEventClient -} - -type ExternalVolumeEventClient struct { - rancherClient *RancherClient -} - -type ExternalVolumeEventOperations interface { - List(opts *ListOpts) (*ExternalVolumeEventCollection, error) - Create(opts *ExternalVolumeEvent) (*ExternalVolumeEvent, error) - Update(existing *ExternalVolumeEvent, updates interface{}) (*ExternalVolumeEvent, error) - ById(id string) (*ExternalVolumeEvent, error) - Delete(container *ExternalVolumeEvent) error - - ActionCreate(*ExternalVolumeEvent) (*ExternalEvent, error) - - ActionRemove(*ExternalVolumeEvent) (*ExternalEvent, error) -} - -func newExternalVolumeEventClient(rancherClient *RancherClient) *ExternalVolumeEventClient { - return &ExternalVolumeEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ExternalVolumeEventClient) Create(container *ExternalVolumeEvent) (*ExternalVolumeEvent, error) { - resp := &ExternalVolumeEvent{} - err := c.rancherClient.doCreate(EXTERNAL_VOLUME_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ExternalVolumeEventClient) Update(existing *ExternalVolumeEvent, updates interface{}) (*ExternalVolumeEvent, error) { - resp := &ExternalVolumeEvent{} - err := c.rancherClient.doUpdate(EXTERNAL_VOLUME_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ExternalVolumeEventClient) List(opts *ListOpts) (*ExternalVolumeEventCollection, error) { - resp := &ExternalVolumeEventCollection{} - err := c.rancherClient.doList(EXTERNAL_VOLUME_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ExternalVolumeEventCollection) Next() (*ExternalVolumeEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ExternalVolumeEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ExternalVolumeEventClient) ById(id string) (*ExternalVolumeEvent, error) { - resp := &ExternalVolumeEvent{} - err := c.rancherClient.doById(EXTERNAL_VOLUME_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ExternalVolumeEventClient) Delete(container *ExternalVolumeEvent) error { - return c.rancherClient.doResourceDelete(EXTERNAL_VOLUME_EVENT_TYPE, &container.Resource) -} - -func (c *ExternalVolumeEventClient) ActionCreate(resource *ExternalVolumeEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_VOLUME_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ExternalVolumeEventClient) ActionRemove(resource *ExternalVolumeEvent) (*ExternalEvent, error) { - - resp := &ExternalEvent{} - - err := c.rancherClient.doAction(EXTERNAL_VOLUME_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go deleted file mode 100644 index 511d33bec..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_field_documentation.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - FIELD_DOCUMENTATION_TYPE = "fieldDocumentation" -) - -type FieldDocumentation struct { - Resource - - Description string `json:"description,omitempty" yaml:"description,omitempty"` -} - -type FieldDocumentationCollection struct { - Collection - Data []FieldDocumentation `json:"data,omitempty"` - client *FieldDocumentationClient -} - -type FieldDocumentationClient struct { - rancherClient *RancherClient -} - -type FieldDocumentationOperations interface { - List(opts *ListOpts) (*FieldDocumentationCollection, error) - Create(opts *FieldDocumentation) (*FieldDocumentation, error) - Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) - ById(id string) (*FieldDocumentation, error) - Delete(container *FieldDocumentation) error -} - -func newFieldDocumentationClient(rancherClient *RancherClient) *FieldDocumentationClient { - return &FieldDocumentationClient{ - rancherClient: rancherClient, - } -} - -func (c *FieldDocumentationClient) Create(container *FieldDocumentation) (*FieldDocumentation, error) { - resp := &FieldDocumentation{} - err := c.rancherClient.doCreate(FIELD_DOCUMENTATION_TYPE, container, resp) - return resp, err -} - -func (c *FieldDocumentationClient) Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) { - resp := &FieldDocumentation{} - err := c.rancherClient.doUpdate(FIELD_DOCUMENTATION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *FieldDocumentationClient) List(opts *ListOpts) (*FieldDocumentationCollection, error) { - resp := &FieldDocumentationCollection{} - err := c.rancherClient.doList(FIELD_DOCUMENTATION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *FieldDocumentationCollection) Next() (*FieldDocumentationCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &FieldDocumentationCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *FieldDocumentationClient) ById(id string) (*FieldDocumentation, error) { - resp := &FieldDocumentation{} - err := c.rancherClient.doById(FIELD_DOCUMENTATION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *FieldDocumentationClient) Delete(container *FieldDocumentation) error { - return c.rancherClient.doResourceDelete(FIELD_DOCUMENTATION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go b/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go deleted file mode 100644 index 4cfd367b3..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_generic_object.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - GENERIC_OBJECT_TYPE = "genericObject" -) - -type GenericObject struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ResourceData map[string]interface{} `json:"resourceData,omitempty" yaml:"resource_data,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type GenericObjectCollection struct { - Collection - Data []GenericObject `json:"data,omitempty"` - client *GenericObjectClient -} - -type GenericObjectClient struct { - rancherClient *RancherClient -} - -type GenericObjectOperations interface { - List(opts *ListOpts) (*GenericObjectCollection, error) - Create(opts *GenericObject) (*GenericObject, error) - Update(existing *GenericObject, updates interface{}) (*GenericObject, error) - ById(id string) (*GenericObject, error) - Delete(container *GenericObject) error - - ActionCreate(*GenericObject) (*GenericObject, error) - - ActionRemove(*GenericObject) (*GenericObject, error) -} - -func newGenericObjectClient(rancherClient *RancherClient) *GenericObjectClient { - return &GenericObjectClient{ - rancherClient: rancherClient, - } -} - -func (c *GenericObjectClient) Create(container *GenericObject) (*GenericObject, error) { - resp := &GenericObject{} - err := c.rancherClient.doCreate(GENERIC_OBJECT_TYPE, container, resp) - return resp, err -} - -func (c *GenericObjectClient) Update(existing *GenericObject, updates interface{}) (*GenericObject, error) { - resp := &GenericObject{} - err := c.rancherClient.doUpdate(GENERIC_OBJECT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *GenericObjectClient) List(opts *ListOpts) (*GenericObjectCollection, error) { - resp := &GenericObjectCollection{} - err := c.rancherClient.doList(GENERIC_OBJECT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *GenericObjectCollection) Next() (*GenericObjectCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &GenericObjectCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *GenericObjectClient) ById(id string) (*GenericObject, error) { - resp := &GenericObject{} - err := c.rancherClient.doById(GENERIC_OBJECT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *GenericObjectClient) Delete(container *GenericObject) error { - return c.rancherClient.doResourceDelete(GENERIC_OBJECT_TYPE, &container.Resource) -} - -func (c *GenericObjectClient) ActionCreate(resource *GenericObject) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(GENERIC_OBJECT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *GenericObjectClient) ActionRemove(resource *GenericObject) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(GENERIC_OBJECT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go deleted file mode 100644 index f5bb82f2c..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - HA_CONFIG_TYPE = "haConfig" -) - -type HaConfig struct { - Resource - - ClusterSize int64 `json:"clusterSize,omitempty" yaml:"cluster_size,omitempty"` - - DbHost string `json:"dbHost,omitempty" yaml:"db_host,omitempty"` - - DbSize int64 `json:"dbSize,omitempty" yaml:"db_size,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` -} - -type HaConfigCollection struct { - Collection - Data []HaConfig `json:"data,omitempty"` - client *HaConfigClient -} - -type HaConfigClient struct { - rancherClient *RancherClient -} - -type HaConfigOperations interface { - List(opts *ListOpts) (*HaConfigCollection, error) - Create(opts *HaConfig) (*HaConfig, error) - Update(existing *HaConfig, updates interface{}) (*HaConfig, error) - ById(id string) (*HaConfig, error) - Delete(container *HaConfig) error -} - -func newHaConfigClient(rancherClient *RancherClient) *HaConfigClient { - return &HaConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *HaConfigClient) Create(container *HaConfig) (*HaConfig, error) { - resp := &HaConfig{} - err := c.rancherClient.doCreate(HA_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *HaConfigClient) Update(existing *HaConfig, updates interface{}) (*HaConfig, error) { - resp := &HaConfig{} - err := c.rancherClient.doUpdate(HA_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HaConfigClient) List(opts *ListOpts) (*HaConfigCollection, error) { - resp := &HaConfigCollection{} - err := c.rancherClient.doList(HA_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HaConfigCollection) Next() (*HaConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HaConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HaConfigClient) ById(id string) (*HaConfig, error) { - resp := &HaConfig{} - err := c.rancherClient.doById(HA_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HaConfigClient) Delete(container *HaConfig) error { - return c.rancherClient.doResourceDelete(HA_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go deleted file mode 100644 index ce869369c..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_ha_config_input.go +++ /dev/null @@ -1,109 +0,0 @@ -package client - -const ( - HA_CONFIG_INPUT_TYPE = "haConfigInput" -) - -type HaConfigInput struct { - Resource - - Cert string `json:"cert,omitempty" yaml:"cert,omitempty"` - - CertChain string `json:"certChain,omitempty" yaml:"cert_chain,omitempty"` - - ClusterSize int64 `json:"clusterSize,omitempty" yaml:"cluster_size,omitempty"` - - HostRegistrationUrl string `json:"hostRegistrationUrl,omitempty" yaml:"host_registration_url,omitempty"` - - HttpEnabled bool `json:"httpEnabled,omitempty" yaml:"http_enabled,omitempty"` - - HttpPort int64 `json:"httpPort,omitempty" yaml:"http_port,omitempty"` - - HttpsPort int64 `json:"httpsPort,omitempty" yaml:"https_port,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - PpHttpPort int64 `json:"ppHttpPort,omitempty" yaml:"pp_http_port,omitempty"` - - PpHttpsPort int64 `json:"ppHttpsPort,omitempty" yaml:"pp_https_port,omitempty"` - - RedisPort int64 `json:"redisPort,omitempty" yaml:"redis_port,omitempty"` - - SwarmEnabled bool `json:"swarmEnabled,omitempty" yaml:"swarm_enabled,omitempty"` - - SwarmPort int64 `json:"swarmPort,omitempty" yaml:"swarm_port,omitempty"` - - ZookeeperClientPort int64 `json:"zookeeperClientPort,omitempty" yaml:"zookeeper_client_port,omitempty"` - - ZookeeperLeaderPort int64 `json:"zookeeperLeaderPort,omitempty" yaml:"zookeeper_leader_port,omitempty"` - - ZookeeperQuorumPort int64 `json:"zookeeperQuorumPort,omitempty" yaml:"zookeeper_quorum_port,omitempty"` -} - -type HaConfigInputCollection struct { - Collection - Data []HaConfigInput `json:"data,omitempty"` - client *HaConfigInputClient -} - -type HaConfigInputClient struct { - rancherClient *RancherClient -} - -type HaConfigInputOperations interface { - List(opts *ListOpts) (*HaConfigInputCollection, error) - Create(opts *HaConfigInput) (*HaConfigInput, error) - Update(existing *HaConfigInput, updates interface{}) (*HaConfigInput, error) - ById(id string) (*HaConfigInput, error) - Delete(container *HaConfigInput) error -} - -func newHaConfigInputClient(rancherClient *RancherClient) *HaConfigInputClient { - return &HaConfigInputClient{ - rancherClient: rancherClient, - } -} - -func (c *HaConfigInputClient) Create(container *HaConfigInput) (*HaConfigInput, error) { - resp := &HaConfigInput{} - err := c.rancherClient.doCreate(HA_CONFIG_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *HaConfigInputClient) Update(existing *HaConfigInput, updates interface{}) (*HaConfigInput, error) { - resp := &HaConfigInput{} - err := c.rancherClient.doUpdate(HA_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HaConfigInputClient) List(opts *ListOpts) (*HaConfigInputCollection, error) { - resp := &HaConfigInputCollection{} - err := c.rancherClient.doList(HA_CONFIG_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HaConfigInputCollection) Next() (*HaConfigInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HaConfigInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HaConfigInputClient) ById(id string) (*HaConfigInput, error) { - resp := &HaConfigInput{} - err := c.rancherClient.doById(HA_CONFIG_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HaConfigInputClient) Delete(container *HaConfigInput) error { - return c.rancherClient.doResourceDelete(HA_CONFIG_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go deleted file mode 100644 index b30b9d869..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_healthcheck_instance_host_map.go +++ /dev/null @@ -1,131 +0,0 @@ -package client - -const ( - HEALTHCHECK_INSTANCE_HOST_MAP_TYPE = "healthcheckInstanceHostMap" -) - -type HealthcheckInstanceHostMap struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type HealthcheckInstanceHostMapCollection struct { - Collection - Data []HealthcheckInstanceHostMap `json:"data,omitempty"` - client *HealthcheckInstanceHostMapClient -} - -type HealthcheckInstanceHostMapClient struct { - rancherClient *RancherClient -} - -type HealthcheckInstanceHostMapOperations interface { - List(opts *ListOpts) (*HealthcheckInstanceHostMapCollection, error) - Create(opts *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) - Update(existing *HealthcheckInstanceHostMap, updates interface{}) (*HealthcheckInstanceHostMap, error) - ById(id string) (*HealthcheckInstanceHostMap, error) - Delete(container *HealthcheckInstanceHostMap) error - - ActionCreate(*HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) - - ActionRemove(*HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) -} - -func newHealthcheckInstanceHostMapClient(rancherClient *RancherClient) *HealthcheckInstanceHostMapClient { - return &HealthcheckInstanceHostMapClient{ - rancherClient: rancherClient, - } -} - -func (c *HealthcheckInstanceHostMapClient) Create(container *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { - resp := &HealthcheckInstanceHostMap{} - err := c.rancherClient.doCreate(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, container, resp) - return resp, err -} - -func (c *HealthcheckInstanceHostMapClient) Update(existing *HealthcheckInstanceHostMap, updates interface{}) (*HealthcheckInstanceHostMap, error) { - resp := &HealthcheckInstanceHostMap{} - err := c.rancherClient.doUpdate(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HealthcheckInstanceHostMapClient) List(opts *ListOpts) (*HealthcheckInstanceHostMapCollection, error) { - resp := &HealthcheckInstanceHostMapCollection{} - err := c.rancherClient.doList(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HealthcheckInstanceHostMapCollection) Next() (*HealthcheckInstanceHostMapCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HealthcheckInstanceHostMapCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HealthcheckInstanceHostMapClient) ById(id string) (*HealthcheckInstanceHostMap, error) { - resp := &HealthcheckInstanceHostMap{} - err := c.rancherClient.doById(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HealthcheckInstanceHostMapClient) Delete(container *HealthcheckInstanceHostMap) error { - return c.rancherClient.doResourceDelete(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, &container.Resource) -} - -func (c *HealthcheckInstanceHostMapClient) ActionCreate(resource *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { - - resp := &HealthcheckInstanceHostMap{} - - err := c.rancherClient.doAction(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HealthcheckInstanceHostMapClient) ActionRemove(resource *HealthcheckInstanceHostMap) (*HealthcheckInstanceHostMap, error) { - - resp := &HealthcheckInstanceHostMap{} - - err := c.rancherClient.doAction(HEALTHCHECK_INSTANCE_HOST_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_host.go deleted file mode 100644 index 801b330b9..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_host.go +++ /dev/null @@ -1,275 +0,0 @@ -package client - -const ( - HOST_TYPE = "host" -) - -type Host struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AgentIpAddress string `json:"agentIpAddress,omitempty" yaml:"agent_ip_address,omitempty"` - - AgentState string `json:"agentState,omitempty" yaml:"agent_state,omitempty"` - - Amazonec2Config *Amazonec2Config `json:"amazonec2Config,omitempty" yaml:"amazonec2config,omitempty"` - - ApiProxy string `json:"apiProxy,omitempty" yaml:"api_proxy,omitempty"` - - AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"auth_certificate_authority,omitempty"` - - AuthKey string `json:"authKey,omitempty" yaml:"auth_key,omitempty"` - - AzureConfig *AzureConfig `json:"azureConfig,omitempty" yaml:"azure_config,omitempty"` - - ComputeTotal int64 `json:"computeTotal,omitempty" yaml:"compute_total,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DigitaloceanConfig *DigitaloceanConfig `json:"digitaloceanConfig,omitempty" yaml:"digitalocean_config,omitempty"` - - DockerVersion string `json:"dockerVersion,omitempty" yaml:"docker_version,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - EngineEnv map[string]interface{} `json:"engineEnv,omitempty" yaml:"engine_env,omitempty"` - - EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engine_insecure_registry,omitempty"` - - EngineInstallUrl string `json:"engineInstallUrl,omitempty" yaml:"engine_install_url,omitempty"` - - EngineLabel map[string]interface{} `json:"engineLabel,omitempty" yaml:"engine_label,omitempty"` - - EngineOpt map[string]interface{} `json:"engineOpt,omitempty" yaml:"engine_opt,omitempty"` - - EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engine_registry_mirror,omitempty"` - - EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engine_storage_driver,omitempty"` - - HostTemplateId string `json:"hostTemplateId,omitempty" yaml:"host_template_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - Info interface{} `json:"info,omitempty" yaml:"info,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LocalStorageMb int64 `json:"localStorageMb,omitempty" yaml:"local_storage_mb,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MilliCpu int64 `json:"milliCpu,omitempty" yaml:"milli_cpu,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PacketConfig *PacketConfig `json:"packetConfig,omitempty" yaml:"packet_config,omitempty"` - - PhysicalHostId string `json:"physicalHostId,omitempty" yaml:"physical_host_id,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type HostCollection struct { - Collection - Data []Host `json:"data,omitempty"` - client *HostClient -} - -type HostClient struct { - rancherClient *RancherClient -} - -type HostOperations interface { - List(opts *ListOpts) (*HostCollection, error) - Create(opts *Host) (*Host, error) - Update(existing *Host, updates interface{}) (*Host, error) - ById(id string) (*Host, error) - Delete(container *Host) error - - ActionActivate(*Host) (*Host, error) - - ActionCreate(*Host) (*Host, error) - - ActionDeactivate(*Host) (*Host, error) - - ActionDockersocket(*Host) (*HostAccess, error) - - ActionError(*Host) (*Host, error) - - ActionEvacuate(*Host) (*Host, error) - - ActionProvision(*Host) (*Host, error) - - ActionPurge(*Host) (*Host, error) - - ActionRemove(*Host) (*Host, error) - - ActionUpdate(*Host) (*Host, error) -} - -func newHostClient(rancherClient *RancherClient) *HostClient { - return &HostClient{ - rancherClient: rancherClient, - } -} - -func (c *HostClient) Create(container *Host) (*Host, error) { - resp := &Host{} - err := c.rancherClient.doCreate(HOST_TYPE, container, resp) - return resp, err -} - -func (c *HostClient) Update(existing *Host, updates interface{}) (*Host, error) { - resp := &Host{} - err := c.rancherClient.doUpdate(HOST_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HostClient) List(opts *ListOpts) (*HostCollection, error) { - resp := &HostCollection{} - err := c.rancherClient.doList(HOST_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HostCollection) Next() (*HostCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HostCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HostClient) ById(id string) (*Host, error) { - resp := &Host{} - err := c.rancherClient.doById(HOST_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HostClient) Delete(container *Host) error { - return c.rancherClient.doResourceDelete(HOST_TYPE, &container.Resource) -} - -func (c *HostClient) ActionActivate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionCreate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionDeactivate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionDockersocket(resource *Host) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(HOST_TYPE, "dockersocket", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionError(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionEvacuate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "evacuate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionProvision(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "provision", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionPurge(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionRemove(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostClient) ActionUpdate(resource *Host) (*Host, error) { - - resp := &Host{} - - err := c.rancherClient.doAction(HOST_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go deleted file mode 100644 index 7ebc586b5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_host_access.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - HOST_ACCESS_TYPE = "hostAccess" -) - -type HostAccess struct { - Resource - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type HostAccessCollection struct { - Collection - Data []HostAccess `json:"data,omitempty"` - client *HostAccessClient -} - -type HostAccessClient struct { - rancherClient *RancherClient -} - -type HostAccessOperations interface { - List(opts *ListOpts) (*HostAccessCollection, error) - Create(opts *HostAccess) (*HostAccess, error) - Update(existing *HostAccess, updates interface{}) (*HostAccess, error) - ById(id string) (*HostAccess, error) - Delete(container *HostAccess) error -} - -func newHostAccessClient(rancherClient *RancherClient) *HostAccessClient { - return &HostAccessClient{ - rancherClient: rancherClient, - } -} - -func (c *HostAccessClient) Create(container *HostAccess) (*HostAccess, error) { - resp := &HostAccess{} - err := c.rancherClient.doCreate(HOST_ACCESS_TYPE, container, resp) - return resp, err -} - -func (c *HostAccessClient) Update(existing *HostAccess, updates interface{}) (*HostAccess, error) { - resp := &HostAccess{} - err := c.rancherClient.doUpdate(HOST_ACCESS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HostAccessClient) List(opts *ListOpts) (*HostAccessCollection, error) { - resp := &HostAccessCollection{} - err := c.rancherClient.doList(HOST_ACCESS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HostAccessCollection) Next() (*HostAccessCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HostAccessCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HostAccessClient) ById(id string) (*HostAccess, error) { - resp := &HostAccess{} - err := c.rancherClient.doById(HOST_ACCESS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HostAccessClient) Delete(container *HostAccess) error { - return c.rancherClient.doResourceDelete(HOST_ACCESS_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go deleted file mode 100644 index 1517b79bf..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_host_api_proxy_token.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - HOST_API_PROXY_TOKEN_TYPE = "hostApiProxyToken" -) - -type HostApiProxyToken struct { - Resource - - ReportedUuid string `json:"reportedUuid,omitempty" yaml:"reported_uuid,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type HostApiProxyTokenCollection struct { - Collection - Data []HostApiProxyToken `json:"data,omitempty"` - client *HostApiProxyTokenClient -} - -type HostApiProxyTokenClient struct { - rancherClient *RancherClient -} - -type HostApiProxyTokenOperations interface { - List(opts *ListOpts) (*HostApiProxyTokenCollection, error) - Create(opts *HostApiProxyToken) (*HostApiProxyToken, error) - Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) - ById(id string) (*HostApiProxyToken, error) - Delete(container *HostApiProxyToken) error -} - -func newHostApiProxyTokenClient(rancherClient *RancherClient) *HostApiProxyTokenClient { - return &HostApiProxyTokenClient{ - rancherClient: rancherClient, - } -} - -func (c *HostApiProxyTokenClient) Create(container *HostApiProxyToken) (*HostApiProxyToken, error) { - resp := &HostApiProxyToken{} - err := c.rancherClient.doCreate(HOST_API_PROXY_TOKEN_TYPE, container, resp) - return resp, err -} - -func (c *HostApiProxyTokenClient) Update(existing *HostApiProxyToken, updates interface{}) (*HostApiProxyToken, error) { - resp := &HostApiProxyToken{} - err := c.rancherClient.doUpdate(HOST_API_PROXY_TOKEN_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HostApiProxyTokenClient) List(opts *ListOpts) (*HostApiProxyTokenCollection, error) { - resp := &HostApiProxyTokenCollection{} - err := c.rancherClient.doList(HOST_API_PROXY_TOKEN_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HostApiProxyTokenCollection) Next() (*HostApiProxyTokenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HostApiProxyTokenCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HostApiProxyTokenClient) ById(id string) (*HostApiProxyToken, error) { - resp := &HostApiProxyToken{} - err := c.rancherClient.doById(HOST_API_PROXY_TOKEN_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HostApiProxyTokenClient) Delete(container *HostApiProxyToken) error { - return c.rancherClient.doResourceDelete(HOST_API_PROXY_TOKEN_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go deleted file mode 100644 index 42ec654ee..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_host_template.go +++ /dev/null @@ -1,133 +0,0 @@ -package client - -const ( - HOST_TEMPLATE_TYPE = "hostTemplate" -) - -type HostTemplate struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - FlavorPrefix string `json:"flavorPrefix,omitempty" yaml:"flavor_prefix,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValues map[string]interface{} `json:"publicValues,omitempty" yaml:"public_values,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValues map[string]interface{} `json:"secretValues,omitempty" yaml:"secret_values,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type HostTemplateCollection struct { - Collection - Data []HostTemplate `json:"data,omitempty"` - client *HostTemplateClient -} - -type HostTemplateClient struct { - rancherClient *RancherClient -} - -type HostTemplateOperations interface { - List(opts *ListOpts) (*HostTemplateCollection, error) - Create(opts *HostTemplate) (*HostTemplate, error) - Update(existing *HostTemplate, updates interface{}) (*HostTemplate, error) - ById(id string) (*HostTemplate, error) - Delete(container *HostTemplate) error - - ActionCreate(*HostTemplate) (*HostTemplate, error) - - ActionRemove(*HostTemplate) (*HostTemplate, error) -} - -func newHostTemplateClient(rancherClient *RancherClient) *HostTemplateClient { - return &HostTemplateClient{ - rancherClient: rancherClient, - } -} - -func (c *HostTemplateClient) Create(container *HostTemplate) (*HostTemplate, error) { - resp := &HostTemplate{} - err := c.rancherClient.doCreate(HOST_TEMPLATE_TYPE, container, resp) - return resp, err -} - -func (c *HostTemplateClient) Update(existing *HostTemplate, updates interface{}) (*HostTemplate, error) { - resp := &HostTemplate{} - err := c.rancherClient.doUpdate(HOST_TEMPLATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *HostTemplateClient) List(opts *ListOpts) (*HostTemplateCollection, error) { - resp := &HostTemplateCollection{} - err := c.rancherClient.doList(HOST_TEMPLATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *HostTemplateCollection) Next() (*HostTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &HostTemplateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *HostTemplateClient) ById(id string) (*HostTemplate, error) { - resp := &HostTemplate{} - err := c.rancherClient.doById(HOST_TEMPLATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *HostTemplateClient) Delete(container *HostTemplate) error { - return c.rancherClient.doResourceDelete(HOST_TEMPLATE_TYPE, &container.Resource) -} - -func (c *HostTemplateClient) ActionCreate(resource *HostTemplate) (*HostTemplate, error) { - - resp := &HostTemplate{} - - err := c.rancherClient.doAction(HOST_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *HostTemplateClient) ActionRemove(resource *HostTemplate) (*HostTemplate, error) { - - resp := &HostTemplate{} - - err := c.rancherClient.doAction(HOST_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_identity.go b/vendor/github.com/rancher/go-rancher/v2/generated_identity.go deleted file mode 100644 index 1e5d1d302..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_identity.go +++ /dev/null @@ -1,97 +0,0 @@ -package client - -const ( - IDENTITY_TYPE = "identity" -) - -type Identity struct { - Resource - - All string `json:"all,omitempty" yaml:"all,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` - - Login string `json:"login,omitempty" yaml:"login,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - ProfilePicture string `json:"profilePicture,omitempty" yaml:"profile_picture,omitempty"` - - ProfileUrl string `json:"profileUrl,omitempty" yaml:"profile_url,omitempty"` - - ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` - - Role string `json:"role,omitempty" yaml:"role,omitempty"` - - User bool `json:"user,omitempty" yaml:"user,omitempty"` -} - -type IdentityCollection struct { - Collection - Data []Identity `json:"data,omitempty"` - client *IdentityClient -} - -type IdentityClient struct { - rancherClient *RancherClient -} - -type IdentityOperations interface { - List(opts *ListOpts) (*IdentityCollection, error) - Create(opts *Identity) (*Identity, error) - Update(existing *Identity, updates interface{}) (*Identity, error) - ById(id string) (*Identity, error) - Delete(container *Identity) error -} - -func newIdentityClient(rancherClient *RancherClient) *IdentityClient { - return &IdentityClient{ - rancherClient: rancherClient, - } -} - -func (c *IdentityClient) Create(container *Identity) (*Identity, error) { - resp := &Identity{} - err := c.rancherClient.doCreate(IDENTITY_TYPE, container, resp) - return resp, err -} - -func (c *IdentityClient) Update(existing *Identity, updates interface{}) (*Identity, error) { - resp := &Identity{} - err := c.rancherClient.doUpdate(IDENTITY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *IdentityClient) List(opts *ListOpts) (*IdentityCollection, error) { - resp := &IdentityCollection{} - err := c.rancherClient.doList(IDENTITY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *IdentityCollection) Next() (*IdentityCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &IdentityCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *IdentityClient) ById(id string) (*Identity, error) { - resp := &Identity{} - err := c.rancherClient.doById(IDENTITY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *IdentityClient) Delete(container *Identity) error { - return c.rancherClient.doResourceDelete(IDENTITY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_image.go b/vendor/github.com/rancher/go-rancher/v2/generated_image.go deleted file mode 100644 index 2e0c02df1..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_image.go +++ /dev/null @@ -1,169 +0,0 @@ -package client - -const ( - IMAGE_TYPE = "image" -) - -type Image struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ImageCollection struct { - Collection - Data []Image `json:"data,omitempty"` - client *ImageClient -} - -type ImageClient struct { - rancherClient *RancherClient -} - -type ImageOperations interface { - List(opts *ListOpts) (*ImageCollection, error) - Create(opts *Image) (*Image, error) - Update(existing *Image, updates interface{}) (*Image, error) - ById(id string) (*Image, error) - Delete(container *Image) error - - ActionActivate(*Image) (*Image, error) - - ActionCreate(*Image) (*Image, error) - - ActionDeactivate(*Image) (*Image, error) - - ActionPurge(*Image) (*Image, error) - - ActionRemove(*Image) (*Image, error) - - ActionUpdate(*Image) (*Image, error) -} - -func newImageClient(rancherClient *RancherClient) *ImageClient { - return &ImageClient{ - rancherClient: rancherClient, - } -} - -func (c *ImageClient) Create(container *Image) (*Image, error) { - resp := &Image{} - err := c.rancherClient.doCreate(IMAGE_TYPE, container, resp) - return resp, err -} - -func (c *ImageClient) Update(existing *Image, updates interface{}) (*Image, error) { - resp := &Image{} - err := c.rancherClient.doUpdate(IMAGE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ImageClient) List(opts *ListOpts) (*ImageCollection, error) { - resp := &ImageCollection{} - err := c.rancherClient.doList(IMAGE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ImageCollection) Next() (*ImageCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ImageCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ImageClient) ById(id string) (*Image, error) { - resp := &Image{} - err := c.rancherClient.doById(IMAGE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ImageClient) Delete(container *Image) error { - return c.rancherClient.doResourceDelete(IMAGE_TYPE, &container.Resource) -} - -func (c *ImageClient) ActionActivate(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionCreate(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionDeactivate(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionPurge(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionRemove(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ImageClient) ActionUpdate(resource *Image) (*Image, error) { - - resp := &Image{} - - err := c.rancherClient.doAction(IMAGE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go deleted file mode 100644 index 3e93a776b..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_in_service_upgrade_strategy.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - IN_SERVICE_UPGRADE_STRATEGY_TYPE = "inServiceUpgradeStrategy" -) - -type InServiceUpgradeStrategy struct { - Resource - - BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` - - IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - PreviousLaunchConfig *LaunchConfig `json:"previousLaunchConfig,omitempty" yaml:"previous_launch_config,omitempty"` - - PreviousSecondaryLaunchConfigs []SecondaryLaunchConfig `json:"previousSecondaryLaunchConfigs,omitempty" yaml:"previous_secondary_launch_configs,omitempty"` - - SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` - - StartFirst bool `json:"startFirst,omitempty" yaml:"start_first,omitempty"` -} - -type InServiceUpgradeStrategyCollection struct { - Collection - Data []InServiceUpgradeStrategy `json:"data,omitempty"` - client *InServiceUpgradeStrategyClient -} - -type InServiceUpgradeStrategyClient struct { - rancherClient *RancherClient -} - -type InServiceUpgradeStrategyOperations interface { - List(opts *ListOpts) (*InServiceUpgradeStrategyCollection, error) - Create(opts *InServiceUpgradeStrategy) (*InServiceUpgradeStrategy, error) - Update(existing *InServiceUpgradeStrategy, updates interface{}) (*InServiceUpgradeStrategy, error) - ById(id string) (*InServiceUpgradeStrategy, error) - Delete(container *InServiceUpgradeStrategy) error -} - -func newInServiceUpgradeStrategyClient(rancherClient *RancherClient) *InServiceUpgradeStrategyClient { - return &InServiceUpgradeStrategyClient{ - rancherClient: rancherClient, - } -} - -func (c *InServiceUpgradeStrategyClient) Create(container *InServiceUpgradeStrategy) (*InServiceUpgradeStrategy, error) { - resp := &InServiceUpgradeStrategy{} - err := c.rancherClient.doCreate(IN_SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) - return resp, err -} - -func (c *InServiceUpgradeStrategyClient) Update(existing *InServiceUpgradeStrategy, updates interface{}) (*InServiceUpgradeStrategy, error) { - resp := &InServiceUpgradeStrategy{} - err := c.rancherClient.doUpdate(IN_SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InServiceUpgradeStrategyClient) List(opts *ListOpts) (*InServiceUpgradeStrategyCollection, error) { - resp := &InServiceUpgradeStrategyCollection{} - err := c.rancherClient.doList(IN_SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InServiceUpgradeStrategyCollection) Next() (*InServiceUpgradeStrategyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InServiceUpgradeStrategyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InServiceUpgradeStrategyClient) ById(id string) (*InServiceUpgradeStrategy, error) { - resp := &InServiceUpgradeStrategy{} - err := c.rancherClient.doById(IN_SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InServiceUpgradeStrategyClient) Delete(container *InServiceUpgradeStrategy) error { - return c.rancherClient.doResourceDelete(IN_SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance.go deleted file mode 100644 index cee9a2ea4..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance.go +++ /dev/null @@ -1,272 +0,0 @@ -package client - -const ( - INSTANCE_TYPE = "instance" -) - -type Instance struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type InstanceCollection struct { - Collection - Data []Instance `json:"data,omitempty"` - client *InstanceClient -} - -type InstanceClient struct { - rancherClient *RancherClient -} - -type InstanceOperations interface { - List(opts *ListOpts) (*InstanceCollection, error) - Create(opts *Instance) (*Instance, error) - Update(existing *Instance, updates interface{}) (*Instance, error) - ById(id string) (*Instance, error) - Delete(container *Instance) error - - ActionAllocate(*Instance) (*Instance, error) - - ActionConsole(*Instance, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*Instance) (*Instance, error) - - ActionDeallocate(*Instance) (*Instance, error) - - ActionError(*Instance) (*Instance, error) - - ActionMigrate(*Instance) (*Instance, error) - - ActionPurge(*Instance) (*Instance, error) - - ActionRemove(*Instance) (*Instance, error) - - ActionRestart(*Instance) (*Instance, error) - - ActionStart(*Instance) (*Instance, error) - - ActionStop(*Instance, *InstanceStop) (*Instance, error) - - ActionUpdate(*Instance) (*Instance, error) - - ActionUpdatehealthy(*Instance) (*Instance, error) - - ActionUpdatereinitializing(*Instance) (*Instance, error) - - ActionUpdateunhealthy(*Instance) (*Instance, error) -} - -func newInstanceClient(rancherClient *RancherClient) *InstanceClient { - return &InstanceClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceClient) Create(container *Instance) (*Instance, error) { - resp := &Instance{} - err := c.rancherClient.doCreate(INSTANCE_TYPE, container, resp) - return resp, err -} - -func (c *InstanceClient) Update(existing *Instance, updates interface{}) (*Instance, error) { - resp := &Instance{} - err := c.rancherClient.doUpdate(INSTANCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceClient) List(opts *ListOpts) (*InstanceCollection, error) { - resp := &InstanceCollection{} - err := c.rancherClient.doList(INSTANCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceCollection) Next() (*InstanceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceClient) ById(id string) (*Instance, error) { - resp := &Instance{} - err := c.rancherClient.doById(INSTANCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceClient) Delete(container *Instance) error { - return c.rancherClient.doResourceDelete(INSTANCE_TYPE, &container.Resource) -} - -func (c *InstanceClient) ActionAllocate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionConsole(resource *Instance, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *InstanceClient) ActionCreate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionDeallocate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionError(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionMigrate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionPurge(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionRemove(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionRestart(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionStart(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionStop(resource *Instance, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *InstanceClient) ActionUpdate(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionUpdatehealthy(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionUpdatereinitializing(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceClient) ActionUpdateunhealthy(resource *Instance) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(INSTANCE_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go deleted file mode 100644 index 85746058d..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - INSTANCE_CONSOLE_TYPE = "instanceConsole" -) - -type InstanceConsole struct { - Resource - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Password string `json:"password,omitempty" yaml:"password,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type InstanceConsoleCollection struct { - Collection - Data []InstanceConsole `json:"data,omitempty"` - client *InstanceConsoleClient -} - -type InstanceConsoleClient struct { - rancherClient *RancherClient -} - -type InstanceConsoleOperations interface { - List(opts *ListOpts) (*InstanceConsoleCollection, error) - Create(opts *InstanceConsole) (*InstanceConsole, error) - Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) - ById(id string) (*InstanceConsole, error) - Delete(container *InstanceConsole) error -} - -func newInstanceConsoleClient(rancherClient *RancherClient) *InstanceConsoleClient { - return &InstanceConsoleClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceConsoleClient) Create(container *InstanceConsole) (*InstanceConsole, error) { - resp := &InstanceConsole{} - err := c.rancherClient.doCreate(INSTANCE_CONSOLE_TYPE, container, resp) - return resp, err -} - -func (c *InstanceConsoleClient) Update(existing *InstanceConsole, updates interface{}) (*InstanceConsole, error) { - resp := &InstanceConsole{} - err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceConsoleClient) List(opts *ListOpts) (*InstanceConsoleCollection, error) { - resp := &InstanceConsoleCollection{} - err := c.rancherClient.doList(INSTANCE_CONSOLE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceConsoleCollection) Next() (*InstanceConsoleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceConsoleCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceConsoleClient) ById(id string) (*InstanceConsole, error) { - resp := &InstanceConsole{} - err := c.rancherClient.doById(INSTANCE_CONSOLE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceConsoleClient) Delete(container *InstanceConsole) error { - return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go deleted file mode 100644 index 5bfbe81f2..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_console_input.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - INSTANCE_CONSOLE_INPUT_TYPE = "instanceConsoleInput" -) - -type InstanceConsoleInput struct { - Resource -} - -type InstanceConsoleInputCollection struct { - Collection - Data []InstanceConsoleInput `json:"data,omitempty"` - client *InstanceConsoleInputClient -} - -type InstanceConsoleInputClient struct { - rancherClient *RancherClient -} - -type InstanceConsoleInputOperations interface { - List(opts *ListOpts) (*InstanceConsoleInputCollection, error) - Create(opts *InstanceConsoleInput) (*InstanceConsoleInput, error) - Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) - ById(id string) (*InstanceConsoleInput, error) - Delete(container *InstanceConsoleInput) error -} - -func newInstanceConsoleInputClient(rancherClient *RancherClient) *InstanceConsoleInputClient { - return &InstanceConsoleInputClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceConsoleInputClient) Create(container *InstanceConsoleInput) (*InstanceConsoleInput, error) { - resp := &InstanceConsoleInput{} - err := c.rancherClient.doCreate(INSTANCE_CONSOLE_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *InstanceConsoleInputClient) Update(existing *InstanceConsoleInput, updates interface{}) (*InstanceConsoleInput, error) { - resp := &InstanceConsoleInput{} - err := c.rancherClient.doUpdate(INSTANCE_CONSOLE_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceConsoleInputClient) List(opts *ListOpts) (*InstanceConsoleInputCollection, error) { - resp := &InstanceConsoleInputCollection{} - err := c.rancherClient.doList(INSTANCE_CONSOLE_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceConsoleInputCollection) Next() (*InstanceConsoleInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceConsoleInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceConsoleInputClient) ById(id string) (*InstanceConsoleInput, error) { - resp := &InstanceConsoleInput{} - err := c.rancherClient.doById(INSTANCE_CONSOLE_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceConsoleInputClient) Delete(container *InstanceConsoleInput) error { - return c.rancherClient.doResourceDelete(INSTANCE_CONSOLE_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go deleted file mode 100644 index 4f2ce46c4..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_health_check.go +++ /dev/null @@ -1,99 +0,0 @@ -package client - -const ( - INSTANCE_HEALTH_CHECK_TYPE = "instanceHealthCheck" -) - -type InstanceHealthCheck struct { - Resource - - HealthyThreshold int64 `json:"healthyThreshold,omitempty" yaml:"healthy_threshold,omitempty"` - - InitializingTimeout int64 `json:"initializingTimeout,omitempty" yaml:"initializing_timeout,omitempty"` - - Interval int64 `json:"interval,omitempty" yaml:"interval,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - RecreateOnQuorumStrategyConfig *RecreateOnQuorumStrategyConfig `json:"recreateOnQuorumStrategyConfig,omitempty" yaml:"recreate_on_quorum_strategy_config,omitempty"` - - ReinitializingTimeout int64 `json:"reinitializingTimeout,omitempty" yaml:"reinitializing_timeout,omitempty"` - - RequestLine string `json:"requestLine,omitempty" yaml:"request_line,omitempty"` - - ResponseTimeout int64 `json:"responseTimeout,omitempty" yaml:"response_timeout,omitempty"` - - Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"` - - UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty" yaml:"unhealthy_threshold,omitempty"` -} - -type InstanceHealthCheckCollection struct { - Collection - Data []InstanceHealthCheck `json:"data,omitempty"` - client *InstanceHealthCheckClient -} - -type InstanceHealthCheckClient struct { - rancherClient *RancherClient -} - -type InstanceHealthCheckOperations interface { - List(opts *ListOpts) (*InstanceHealthCheckCollection, error) - Create(opts *InstanceHealthCheck) (*InstanceHealthCheck, error) - Update(existing *InstanceHealthCheck, updates interface{}) (*InstanceHealthCheck, error) - ById(id string) (*InstanceHealthCheck, error) - Delete(container *InstanceHealthCheck) error -} - -func newInstanceHealthCheckClient(rancherClient *RancherClient) *InstanceHealthCheckClient { - return &InstanceHealthCheckClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceHealthCheckClient) Create(container *InstanceHealthCheck) (*InstanceHealthCheck, error) { - resp := &InstanceHealthCheck{} - err := c.rancherClient.doCreate(INSTANCE_HEALTH_CHECK_TYPE, container, resp) - return resp, err -} - -func (c *InstanceHealthCheckClient) Update(existing *InstanceHealthCheck, updates interface{}) (*InstanceHealthCheck, error) { - resp := &InstanceHealthCheck{} - err := c.rancherClient.doUpdate(INSTANCE_HEALTH_CHECK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceHealthCheckClient) List(opts *ListOpts) (*InstanceHealthCheckCollection, error) { - resp := &InstanceHealthCheckCollection{} - err := c.rancherClient.doList(INSTANCE_HEALTH_CHECK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceHealthCheckCollection) Next() (*InstanceHealthCheckCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceHealthCheckCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceHealthCheckClient) ById(id string) (*InstanceHealthCheck, error) { - resp := &InstanceHealthCheck{} - err := c.rancherClient.doById(INSTANCE_HEALTH_CHECK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceHealthCheckClient) Delete(container *InstanceHealthCheck) error { - return c.rancherClient.doResourceDelete(INSTANCE_HEALTH_CHECK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go deleted file mode 100644 index 4aa86e3b3..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_link.go +++ /dev/null @@ -1,177 +0,0 @@ -package client - -const ( - INSTANCE_LINK_TYPE = "instanceLink" -) - -type InstanceLink struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LinkName string `json:"linkName,omitempty" yaml:"link_name,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Ports []interface{} `json:"ports,omitempty" yaml:"ports,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - TargetInstanceId string `json:"targetInstanceId,omitempty" yaml:"target_instance_id,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type InstanceLinkCollection struct { - Collection - Data []InstanceLink `json:"data,omitempty"` - client *InstanceLinkClient -} - -type InstanceLinkClient struct { - rancherClient *RancherClient -} - -type InstanceLinkOperations interface { - List(opts *ListOpts) (*InstanceLinkCollection, error) - Create(opts *InstanceLink) (*InstanceLink, error) - Update(existing *InstanceLink, updates interface{}) (*InstanceLink, error) - ById(id string) (*InstanceLink, error) - Delete(container *InstanceLink) error - - ActionActivate(*InstanceLink) (*InstanceLink, error) - - ActionCreate(*InstanceLink) (*InstanceLink, error) - - ActionDeactivate(*InstanceLink) (*InstanceLink, error) - - ActionPurge(*InstanceLink) (*InstanceLink, error) - - ActionRemove(*InstanceLink) (*InstanceLink, error) - - ActionUpdate(*InstanceLink) (*InstanceLink, error) -} - -func newInstanceLinkClient(rancherClient *RancherClient) *InstanceLinkClient { - return &InstanceLinkClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceLinkClient) Create(container *InstanceLink) (*InstanceLink, error) { - resp := &InstanceLink{} - err := c.rancherClient.doCreate(INSTANCE_LINK_TYPE, container, resp) - return resp, err -} - -func (c *InstanceLinkClient) Update(existing *InstanceLink, updates interface{}) (*InstanceLink, error) { - resp := &InstanceLink{} - err := c.rancherClient.doUpdate(INSTANCE_LINK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceLinkClient) List(opts *ListOpts) (*InstanceLinkCollection, error) { - resp := &InstanceLinkCollection{} - err := c.rancherClient.doList(INSTANCE_LINK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceLinkCollection) Next() (*InstanceLinkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceLinkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceLinkClient) ById(id string) (*InstanceLink, error) { - resp := &InstanceLink{} - err := c.rancherClient.doById(INSTANCE_LINK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceLinkClient) Delete(container *InstanceLink) error { - return c.rancherClient.doResourceDelete(INSTANCE_LINK_TYPE, &container.Resource) -} - -func (c *InstanceLinkClient) ActionActivate(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionCreate(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionDeactivate(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionPurge(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionRemove(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *InstanceLinkClient) ActionUpdate(resource *InstanceLink) (*InstanceLink, error) { - - resp := &InstanceLink{} - - err := c.rancherClient.doAction(INSTANCE_LINK_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go b/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go deleted file mode 100644 index 2e3b2b67f..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_instance_stop.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - INSTANCE_STOP_TYPE = "instanceStop" -) - -type InstanceStop struct { - Resource - - Remove bool `json:"remove,omitempty" yaml:"remove,omitempty"` - - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` -} - -type InstanceStopCollection struct { - Collection - Data []InstanceStop `json:"data,omitempty"` - client *InstanceStopClient -} - -type InstanceStopClient struct { - rancherClient *RancherClient -} - -type InstanceStopOperations interface { - List(opts *ListOpts) (*InstanceStopCollection, error) - Create(opts *InstanceStop) (*InstanceStop, error) - Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) - ById(id string) (*InstanceStop, error) - Delete(container *InstanceStop) error -} - -func newInstanceStopClient(rancherClient *RancherClient) *InstanceStopClient { - return &InstanceStopClient{ - rancherClient: rancherClient, - } -} - -func (c *InstanceStopClient) Create(container *InstanceStop) (*InstanceStop, error) { - resp := &InstanceStop{} - err := c.rancherClient.doCreate(INSTANCE_STOP_TYPE, container, resp) - return resp, err -} - -func (c *InstanceStopClient) Update(existing *InstanceStop, updates interface{}) (*InstanceStop, error) { - resp := &InstanceStop{} - err := c.rancherClient.doUpdate(INSTANCE_STOP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *InstanceStopClient) List(opts *ListOpts) (*InstanceStopCollection, error) { - resp := &InstanceStopCollection{} - err := c.rancherClient.doList(INSTANCE_STOP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *InstanceStopCollection) Next() (*InstanceStopCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &InstanceStopCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *InstanceStopClient) ById(id string) (*InstanceStop, error) { - resp := &InstanceStop{} - err := c.rancherClient.doById(INSTANCE_STOP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *InstanceStopClient) Delete(container *InstanceStop) error { - return c.rancherClient.doResourceDelete(INSTANCE_STOP_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go b/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go deleted file mode 100644 index a41d2c757..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_ip_address.go +++ /dev/null @@ -1,195 +0,0 @@ -package client - -const ( - IP_ADDRESS_TYPE = "ipAddress" -) - -type IpAddress struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Address string `json:"address,omitempty" yaml:"address,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkId string `json:"networkId,omitempty" yaml:"network_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type IpAddressCollection struct { - Collection - Data []IpAddress `json:"data,omitempty"` - client *IpAddressClient -} - -type IpAddressClient struct { - rancherClient *RancherClient -} - -type IpAddressOperations interface { - List(opts *ListOpts) (*IpAddressCollection, error) - Create(opts *IpAddress) (*IpAddress, error) - Update(existing *IpAddress, updates interface{}) (*IpAddress, error) - ById(id string) (*IpAddress, error) - Delete(container *IpAddress) error - - ActionActivate(*IpAddress) (*IpAddress, error) - - ActionAssociate(*IpAddress) (*IpAddress, error) - - ActionCreate(*IpAddress) (*IpAddress, error) - - ActionDeactivate(*IpAddress) (*IpAddress, error) - - ActionDisassociate(*IpAddress) (*IpAddress, error) - - ActionPurge(*IpAddress) (*IpAddress, error) - - ActionRemove(*IpAddress) (*IpAddress, error) - - ActionUpdate(*IpAddress) (*IpAddress, error) -} - -func newIpAddressClient(rancherClient *RancherClient) *IpAddressClient { - return &IpAddressClient{ - rancherClient: rancherClient, - } -} - -func (c *IpAddressClient) Create(container *IpAddress) (*IpAddress, error) { - resp := &IpAddress{} - err := c.rancherClient.doCreate(IP_ADDRESS_TYPE, container, resp) - return resp, err -} - -func (c *IpAddressClient) Update(existing *IpAddress, updates interface{}) (*IpAddress, error) { - resp := &IpAddress{} - err := c.rancherClient.doUpdate(IP_ADDRESS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *IpAddressClient) List(opts *ListOpts) (*IpAddressCollection, error) { - resp := &IpAddressCollection{} - err := c.rancherClient.doList(IP_ADDRESS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *IpAddressCollection) Next() (*IpAddressCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &IpAddressCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *IpAddressClient) ById(id string) (*IpAddress, error) { - resp := &IpAddress{} - err := c.rancherClient.doById(IP_ADDRESS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *IpAddressClient) Delete(container *IpAddress) error { - return c.rancherClient.doResourceDelete(IP_ADDRESS_TYPE, &container.Resource) -} - -func (c *IpAddressClient) ActionActivate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionAssociate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "associate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionCreate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionDeactivate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionDisassociate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "disassociate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionPurge(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionRemove(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *IpAddressClient) ActionUpdate(resource *IpAddress) (*IpAddress, error) { - - resp := &IpAddress{} - - err := c.rancherClient.doAction(IP_ADDRESS_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go deleted file mode 100644 index 15fa37804..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_service.go +++ /dev/null @@ -1,275 +0,0 @@ -package client - -const ( - KUBERNETES_SERVICE_TYPE = "kubernetesService" -) - -type KubernetesService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Template interface{} `json:"template,omitempty" yaml:"template,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type KubernetesServiceCollection struct { - Collection - Data []KubernetesService `json:"data,omitempty"` - client *KubernetesServiceClient -} - -type KubernetesServiceClient struct { - rancherClient *RancherClient -} - -type KubernetesServiceOperations interface { - List(opts *ListOpts) (*KubernetesServiceCollection, error) - Create(opts *KubernetesService) (*KubernetesService, error) - Update(existing *KubernetesService, updates interface{}) (*KubernetesService, error) - ById(id string) (*KubernetesService, error) - Delete(container *KubernetesService) error - - ActionActivate(*KubernetesService) (*Service, error) - - ActionAddservicelink(*KubernetesService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*KubernetesService) (*Service, error) - - ActionContinueupgrade(*KubernetesService) (*Service, error) - - ActionCreate(*KubernetesService) (*Service, error) - - ActionDeactivate(*KubernetesService) (*Service, error) - - ActionFinishupgrade(*KubernetesService) (*Service, error) - - ActionRemove(*KubernetesService) (*Service, error) - - ActionRemoveservicelink(*KubernetesService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*KubernetesService, *ServiceRestart) (*Service, error) - - ActionRollback(*KubernetesService) (*Service, error) - - ActionSetservicelinks(*KubernetesService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*KubernetesService) (*Service, error) - - ActionUpgrade(*KubernetesService, *ServiceUpgrade) (*Service, error) -} - -func newKubernetesServiceClient(rancherClient *RancherClient) *KubernetesServiceClient { - return &KubernetesServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *KubernetesServiceClient) Create(container *KubernetesService) (*KubernetesService, error) { - resp := &KubernetesService{} - err := c.rancherClient.doCreate(KUBERNETES_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *KubernetesServiceClient) Update(existing *KubernetesService, updates interface{}) (*KubernetesService, error) { - resp := &KubernetesService{} - err := c.rancherClient.doUpdate(KUBERNETES_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *KubernetesServiceClient) List(opts *ListOpts) (*KubernetesServiceCollection, error) { - resp := &KubernetesServiceCollection{} - err := c.rancherClient.doList(KUBERNETES_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *KubernetesServiceCollection) Next() (*KubernetesServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &KubernetesServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *KubernetesServiceClient) ById(id string) (*KubernetesService, error) { - resp := &KubernetesService{} - err := c.rancherClient.doById(KUBERNETES_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *KubernetesServiceClient) Delete(container *KubernetesService) error { - return c.rancherClient.doResourceDelete(KUBERNETES_SERVICE_TYPE, &container.Resource) -} - -func (c *KubernetesServiceClient) ActionActivate(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionAddservicelink(resource *KubernetesService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionCancelupgrade(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionContinueupgrade(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionCreate(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionDeactivate(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionFinishupgrade(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionRemove(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionRemoveservicelink(resource *KubernetesService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionRestart(resource *KubernetesService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionRollback(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionSetservicelinks(resource *KubernetesService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionUpdate(resource *KubernetesService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesServiceClient) ActionUpgrade(resource *KubernetesService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(KUBERNETES_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go deleted file mode 100644 index ef8eaa3bb..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack.go +++ /dev/null @@ -1,204 +0,0 @@ -package client - -const ( - KUBERNETES_STACK_TYPE = "kubernetesStack" -) - -type KubernetesStack struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Group string `json:"group,omitempty" yaml:"group,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"` - - PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` - - PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type KubernetesStackCollection struct { - Collection - Data []KubernetesStack `json:"data,omitempty"` - client *KubernetesStackClient -} - -type KubernetesStackClient struct { - rancherClient *RancherClient -} - -type KubernetesStackOperations interface { - List(opts *ListOpts) (*KubernetesStackCollection, error) - Create(opts *KubernetesStack) (*KubernetesStack, error) - Update(existing *KubernetesStack, updates interface{}) (*KubernetesStack, error) - ById(id string) (*KubernetesStack, error) - Delete(container *KubernetesStack) error - - ActionCancelupgrade(*KubernetesStack) (*Stack, error) - - ActionCreate(*KubernetesStack) (*Stack, error) - - ActionError(*KubernetesStack) (*Stack, error) - - ActionFinishupgrade(*KubernetesStack) (*Stack, error) - - ActionRemove(*KubernetesStack) (*Stack, error) - - ActionRollback(*KubernetesStack) (*Stack, error) - - ActionUpgrade(*KubernetesStack, *KubernetesStackUpgrade) (*KubernetesStack, error) -} - -func newKubernetesStackClient(rancherClient *RancherClient) *KubernetesStackClient { - return &KubernetesStackClient{ - rancherClient: rancherClient, - } -} - -func (c *KubernetesStackClient) Create(container *KubernetesStack) (*KubernetesStack, error) { - resp := &KubernetesStack{} - err := c.rancherClient.doCreate(KUBERNETES_STACK_TYPE, container, resp) - return resp, err -} - -func (c *KubernetesStackClient) Update(existing *KubernetesStack, updates interface{}) (*KubernetesStack, error) { - resp := &KubernetesStack{} - err := c.rancherClient.doUpdate(KUBERNETES_STACK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *KubernetesStackClient) List(opts *ListOpts) (*KubernetesStackCollection, error) { - resp := &KubernetesStackCollection{} - err := c.rancherClient.doList(KUBERNETES_STACK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *KubernetesStackCollection) Next() (*KubernetesStackCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &KubernetesStackCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *KubernetesStackClient) ById(id string) (*KubernetesStack, error) { - resp := &KubernetesStack{} - err := c.rancherClient.doById(KUBERNETES_STACK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *KubernetesStackClient) Delete(container *KubernetesStack) error { - return c.rancherClient.doResourceDelete(KUBERNETES_STACK_TYPE, &container.Resource) -} - -func (c *KubernetesStackClient) ActionCancelupgrade(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionCreate(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionError(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionFinishupgrade(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionRemove(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionRollback(resource *KubernetesStack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *KubernetesStackClient) ActionUpgrade(resource *KubernetesStack, input *KubernetesStackUpgrade) (*KubernetesStack, error) { - - resp := &KubernetesStack{} - - err := c.rancherClient.doAction(KUBERNETES_STACK_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go deleted file mode 100644 index 793b10ede..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_kubernetes_stack_upgrade.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - KUBERNETES_STACK_UPGRADE_TYPE = "kubernetesStackUpgrade" -) - -type KubernetesStackUpgrade struct { - Resource - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` -} - -type KubernetesStackUpgradeCollection struct { - Collection - Data []KubernetesStackUpgrade `json:"data,omitempty"` - client *KubernetesStackUpgradeClient -} - -type KubernetesStackUpgradeClient struct { - rancherClient *RancherClient -} - -type KubernetesStackUpgradeOperations interface { - List(opts *ListOpts) (*KubernetesStackUpgradeCollection, error) - Create(opts *KubernetesStackUpgrade) (*KubernetesStackUpgrade, error) - Update(existing *KubernetesStackUpgrade, updates interface{}) (*KubernetesStackUpgrade, error) - ById(id string) (*KubernetesStackUpgrade, error) - Delete(container *KubernetesStackUpgrade) error -} - -func newKubernetesStackUpgradeClient(rancherClient *RancherClient) *KubernetesStackUpgradeClient { - return &KubernetesStackUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *KubernetesStackUpgradeClient) Create(container *KubernetesStackUpgrade) (*KubernetesStackUpgrade, error) { - resp := &KubernetesStackUpgrade{} - err := c.rancherClient.doCreate(KUBERNETES_STACK_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *KubernetesStackUpgradeClient) Update(existing *KubernetesStackUpgrade, updates interface{}) (*KubernetesStackUpgrade, error) { - resp := &KubernetesStackUpgrade{} - err := c.rancherClient.doUpdate(KUBERNETES_STACK_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *KubernetesStackUpgradeClient) List(opts *ListOpts) (*KubernetesStackUpgradeCollection, error) { - resp := &KubernetesStackUpgradeCollection{} - err := c.rancherClient.doList(KUBERNETES_STACK_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *KubernetesStackUpgradeCollection) Next() (*KubernetesStackUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &KubernetesStackUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *KubernetesStackUpgradeClient) ById(id string) (*KubernetesStackUpgrade, error) { - resp := &KubernetesStackUpgrade{} - err := c.rancherClient.doById(KUBERNETES_STACK_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *KubernetesStackUpgradeClient) Delete(container *KubernetesStackUpgrade) error { - return c.rancherClient.doResourceDelete(KUBERNETES_STACK_UPGRADE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_label.go b/vendor/github.com/rancher/go-rancher/v2/generated_label.go deleted file mode 100644 index 6b67a2e84..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_label.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - LABEL_TYPE = "label" -) - -type Label struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type LabelCollection struct { - Collection - Data []Label `json:"data,omitempty"` - client *LabelClient -} - -type LabelClient struct { - rancherClient *RancherClient -} - -type LabelOperations interface { - List(opts *ListOpts) (*LabelCollection, error) - Create(opts *Label) (*Label, error) - Update(existing *Label, updates interface{}) (*Label, error) - ById(id string) (*Label, error) - Delete(container *Label) error - - ActionCreate(*Label) (*Label, error) - - ActionRemove(*Label) (*Label, error) -} - -func newLabelClient(rancherClient *RancherClient) *LabelClient { - return &LabelClient{ - rancherClient: rancherClient, - } -} - -func (c *LabelClient) Create(container *Label) (*Label, error) { - resp := &Label{} - err := c.rancherClient.doCreate(LABEL_TYPE, container, resp) - return resp, err -} - -func (c *LabelClient) Update(existing *Label, updates interface{}) (*Label, error) { - resp := &Label{} - err := c.rancherClient.doUpdate(LABEL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LabelClient) List(opts *ListOpts) (*LabelCollection, error) { - resp := &LabelCollection{} - err := c.rancherClient.doList(LABEL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LabelCollection) Next() (*LabelCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LabelCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LabelClient) ById(id string) (*Label, error) { - resp := &Label{} - err := c.rancherClient.doById(LABEL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LabelClient) Delete(container *Label) error { - return c.rancherClient.doResourceDelete(LABEL_TYPE, &container.Resource) -} - -func (c *LabelClient) ActionCreate(resource *Label) (*Label, error) { - - resp := &Label{} - - err := c.rancherClient.doAction(LABEL_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LabelClient) ActionRemove(resource *Label) (*Label, error) { - - resp := &Label{} - - err := c.rancherClient.doAction(LABEL_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go deleted file mode 100644 index adbb6b1b5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_launch_config.go +++ /dev/null @@ -1,518 +0,0 @@ -package client - -const ( - LAUNCH_CONFIG_TYPE = "launchConfig" -) - -type LaunchConfig struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` - - BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` - - BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` - - Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` - - CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` - - CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` - - CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` - - CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` - - CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` - - CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` - - CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` - - CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` - - CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` - - CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` - - CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` - - DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` - - DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` - - DataVolumesFromLaunchConfigs []string `json:"dataVolumesFromLaunchConfigs,omitempty" yaml:"data_volumes_from_launch_configs,omitempty"` - - DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - - DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` - - Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - DrainTimeoutMs int64 `json:"drainTimeoutMs,omitempty" yaml:"drain_timeout_ms,omitempty"` - - EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` - - FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` - - GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` - - HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` - - HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` - - InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` - - InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` - - IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` - - IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` - - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - - Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` - - IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` - - Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` - - KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` - - LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` - - MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` - - MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` - - MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` - - MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` - - NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` - - NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` - - NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` - - NetworkLaunchConfig string `json:"networkLaunchConfig,omitempty" yaml:"network_launch_config,omitempty"` - - NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` - - OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` - - OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` - - PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` - - PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` - - PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` - - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - - PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` - - RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` - - RequestedIpAddress string `json:"requestedIpAddress,omitempty" yaml:"requested_ip_address,omitempty"` - - RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` - - Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` - - SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - - StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` - - StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` - - StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` - - Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` - - Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` - - User string `json:"user,omitempty" yaml:"user,omitempty"` - - UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - - UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` - - Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` - - WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` -} - -type LaunchConfigCollection struct { - Collection - Data []LaunchConfig `json:"data,omitempty"` - client *LaunchConfigClient -} - -type LaunchConfigClient struct { - rancherClient *RancherClient -} - -type LaunchConfigOperations interface { - List(opts *ListOpts) (*LaunchConfigCollection, error) - Create(opts *LaunchConfig) (*LaunchConfig, error) - Update(existing *LaunchConfig, updates interface{}) (*LaunchConfig, error) - ById(id string) (*LaunchConfig, error) - Delete(container *LaunchConfig) error - - ActionAllocate(*LaunchConfig) (*Instance, error) - - ActionConsole(*LaunchConfig, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*LaunchConfig) (*Instance, error) - - ActionDeallocate(*LaunchConfig) (*Instance, error) - - ActionError(*LaunchConfig) (*Instance, error) - - ActionExecute(*LaunchConfig, *ContainerExec) (*HostAccess, error) - - ActionMigrate(*LaunchConfig) (*Instance, error) - - ActionProxy(*LaunchConfig, *ContainerProxy) (*HostAccess, error) - - ActionPurge(*LaunchConfig) (*Instance, error) - - ActionRemove(*LaunchConfig) (*Instance, error) - - ActionRestart(*LaunchConfig) (*Instance, error) - - ActionStart(*LaunchConfig) (*Instance, error) - - ActionStop(*LaunchConfig, *InstanceStop) (*Instance, error) - - ActionUpdate(*LaunchConfig) (*Instance, error) - - ActionUpdatehealthy(*LaunchConfig) (*Instance, error) - - ActionUpdatereinitializing(*LaunchConfig) (*Instance, error) - - ActionUpdateunhealthy(*LaunchConfig) (*Instance, error) -} - -func newLaunchConfigClient(rancherClient *RancherClient) *LaunchConfigClient { - return &LaunchConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LaunchConfigClient) Create(container *LaunchConfig) (*LaunchConfig, error) { - resp := &LaunchConfig{} - err := c.rancherClient.doCreate(LAUNCH_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LaunchConfigClient) Update(existing *LaunchConfig, updates interface{}) (*LaunchConfig, error) { - resp := &LaunchConfig{} - err := c.rancherClient.doUpdate(LAUNCH_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LaunchConfigClient) List(opts *ListOpts) (*LaunchConfigCollection, error) { - resp := &LaunchConfigCollection{} - err := c.rancherClient.doList(LAUNCH_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LaunchConfigCollection) Next() (*LaunchConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LaunchConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LaunchConfigClient) ById(id string) (*LaunchConfig, error) { - resp := &LaunchConfig{} - err := c.rancherClient.doById(LAUNCH_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LaunchConfigClient) Delete(container *LaunchConfig) error { - return c.rancherClient.doResourceDelete(LAUNCH_CONFIG_TYPE, &container.Resource) -} - -func (c *LaunchConfigClient) ActionAllocate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionConsole(resource *LaunchConfig, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionCreate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionDeallocate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionError(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionExecute(resource *LaunchConfig, input *ContainerExec) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "execute", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionMigrate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionProxy(resource *LaunchConfig, input *ContainerProxy) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "proxy", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionPurge(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionRemove(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionRestart(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionStart(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionStop(resource *LaunchConfig, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionUpdate(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionUpdatehealthy(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionUpdatereinitializing(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LaunchConfigClient) ActionUpdateunhealthy(resource *LaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(LAUNCH_CONFIG_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go deleted file mode 100644 index 80edbdf78..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_lb_config.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - LB_CONFIG_TYPE = "lbConfig" -) - -type LbConfig struct { - Resource - - CertificateIds []string `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"` - - Config string `json:"config,omitempty" yaml:"config,omitempty"` - - DefaultCertificateId string `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"` - - PortRules []PortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` - - StickinessPolicy *LoadBalancerCookieStickinessPolicy `json:"stickinessPolicy,omitempty" yaml:"stickiness_policy,omitempty"` -} - -type LbConfigCollection struct { - Collection - Data []LbConfig `json:"data,omitempty"` - client *LbConfigClient -} - -type LbConfigClient struct { - rancherClient *RancherClient -} - -type LbConfigOperations interface { - List(opts *ListOpts) (*LbConfigCollection, error) - Create(opts *LbConfig) (*LbConfig, error) - Update(existing *LbConfig, updates interface{}) (*LbConfig, error) - ById(id string) (*LbConfig, error) - Delete(container *LbConfig) error -} - -func newLbConfigClient(rancherClient *RancherClient) *LbConfigClient { - return &LbConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LbConfigClient) Create(container *LbConfig) (*LbConfig, error) { - resp := &LbConfig{} - err := c.rancherClient.doCreate(LB_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LbConfigClient) Update(existing *LbConfig, updates interface{}) (*LbConfig, error) { - resp := &LbConfig{} - err := c.rancherClient.doUpdate(LB_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LbConfigClient) List(opts *ListOpts) (*LbConfigCollection, error) { - resp := &LbConfigCollection{} - err := c.rancherClient.doList(LB_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LbConfigCollection) Next() (*LbConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LbConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LbConfigClient) ById(id string) (*LbConfig, error) { - resp := &LbConfig{} - err := c.rancherClient.doById(LB_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LbConfigClient) Delete(container *LbConfig) error { - return c.rancherClient.doResourceDelete(LB_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go deleted file mode 100644 index 93088a6f4..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_lb_target_config.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - LB_TARGET_CONFIG_TYPE = "lbTargetConfig" -) - -type LbTargetConfig struct { - Resource - - PortRules []TargetPortRule `json:"portRules,omitempty" yaml:"port_rules,omitempty"` -} - -type LbTargetConfigCollection struct { - Collection - Data []LbTargetConfig `json:"data,omitempty"` - client *LbTargetConfigClient -} - -type LbTargetConfigClient struct { - rancherClient *RancherClient -} - -type LbTargetConfigOperations interface { - List(opts *ListOpts) (*LbTargetConfigCollection, error) - Create(opts *LbTargetConfig) (*LbTargetConfig, error) - Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) - ById(id string) (*LbTargetConfig, error) - Delete(container *LbTargetConfig) error -} - -func newLbTargetConfigClient(rancherClient *RancherClient) *LbTargetConfigClient { - return &LbTargetConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LbTargetConfigClient) Create(container *LbTargetConfig) (*LbTargetConfig, error) { - resp := &LbTargetConfig{} - err := c.rancherClient.doCreate(LB_TARGET_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LbTargetConfigClient) Update(existing *LbTargetConfig, updates interface{}) (*LbTargetConfig, error) { - resp := &LbTargetConfig{} - err := c.rancherClient.doUpdate(LB_TARGET_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LbTargetConfigClient) List(opts *ListOpts) (*LbTargetConfigCollection, error) { - resp := &LbTargetConfigCollection{} - err := c.rancherClient.doList(LB_TARGET_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LbTargetConfigCollection) Next() (*LbTargetConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LbTargetConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LbTargetConfigClient) ById(id string) (*LbTargetConfig, error) { - resp := &LbTargetConfig{} - err := c.rancherClient.doById(LB_TARGET_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LbTargetConfigClient) Delete(container *LbTargetConfig) error { - return c.rancherClient.doResourceDelete(LB_TARGET_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go deleted file mode 100644 index 4a8d69893..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_cookie_stickiness_policy.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE = "loadBalancerCookieStickinessPolicy" -) - -type LoadBalancerCookieStickinessPolicy struct { - Resource - - Cookie string `json:"cookie,omitempty" yaml:"cookie,omitempty"` - - Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` - - Indirect bool `json:"indirect,omitempty" yaml:"indirect,omitempty"` - - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Nocache bool `json:"nocache,omitempty" yaml:"nocache,omitempty"` - - Postonly bool `json:"postonly,omitempty" yaml:"postonly,omitempty"` -} - -type LoadBalancerCookieStickinessPolicyCollection struct { - Collection - Data []LoadBalancerCookieStickinessPolicy `json:"data,omitempty"` - client *LoadBalancerCookieStickinessPolicyClient -} - -type LoadBalancerCookieStickinessPolicyClient struct { - rancherClient *RancherClient -} - -type LoadBalancerCookieStickinessPolicyOperations interface { - List(opts *ListOpts) (*LoadBalancerCookieStickinessPolicyCollection, error) - Create(opts *LoadBalancerCookieStickinessPolicy) (*LoadBalancerCookieStickinessPolicy, error) - Update(existing *LoadBalancerCookieStickinessPolicy, updates interface{}) (*LoadBalancerCookieStickinessPolicy, error) - ById(id string) (*LoadBalancerCookieStickinessPolicy, error) - Delete(container *LoadBalancerCookieStickinessPolicy) error -} - -func newLoadBalancerCookieStickinessPolicyClient(rancherClient *RancherClient) *LoadBalancerCookieStickinessPolicyClient { - return &LoadBalancerCookieStickinessPolicyClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerCookieStickinessPolicyClient) Create(container *LoadBalancerCookieStickinessPolicy) (*LoadBalancerCookieStickinessPolicy, error) { - resp := &LoadBalancerCookieStickinessPolicy{} - err := c.rancherClient.doCreate(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerCookieStickinessPolicyClient) Update(existing *LoadBalancerCookieStickinessPolicy, updates interface{}) (*LoadBalancerCookieStickinessPolicy, error) { - resp := &LoadBalancerCookieStickinessPolicy{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerCookieStickinessPolicyClient) List(opts *ListOpts) (*LoadBalancerCookieStickinessPolicyCollection, error) { - resp := &LoadBalancerCookieStickinessPolicyCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LoadBalancerCookieStickinessPolicyCollection) Next() (*LoadBalancerCookieStickinessPolicyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LoadBalancerCookieStickinessPolicyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LoadBalancerCookieStickinessPolicyClient) ById(id string) (*LoadBalancerCookieStickinessPolicy, error) { - resp := &LoadBalancerCookieStickinessPolicy{} - err := c.rancherClient.doById(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerCookieStickinessPolicyClient) Delete(container *LoadBalancerCookieStickinessPolicy) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_COOKIE_STICKINESS_POLICY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go deleted file mode 100644 index 941ccb087..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_load_balancer_service.go +++ /dev/null @@ -1,297 +0,0 @@ -package client - -const ( - LOAD_BALANCER_SERVICE_TYPE = "loadBalancerService" -) - -type LoadBalancerService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LbConfig *LbConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type LoadBalancerServiceCollection struct { - Collection - Data []LoadBalancerService `json:"data,omitempty"` - client *LoadBalancerServiceClient -} - -type LoadBalancerServiceClient struct { - rancherClient *RancherClient -} - -type LoadBalancerServiceOperations interface { - List(opts *ListOpts) (*LoadBalancerServiceCollection, error) - Create(opts *LoadBalancerService) (*LoadBalancerService, error) - Update(existing *LoadBalancerService, updates interface{}) (*LoadBalancerService, error) - ById(id string) (*LoadBalancerService, error) - Delete(container *LoadBalancerService) error - - ActionActivate(*LoadBalancerService) (*Service, error) - - ActionAddservicelink(*LoadBalancerService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*LoadBalancerService) (*Service, error) - - ActionContinueupgrade(*LoadBalancerService) (*Service, error) - - ActionCreate(*LoadBalancerService) (*Service, error) - - ActionDeactivate(*LoadBalancerService) (*Service, error) - - ActionFinishupgrade(*LoadBalancerService) (*Service, error) - - ActionRemove(*LoadBalancerService) (*Service, error) - - ActionRemoveservicelink(*LoadBalancerService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*LoadBalancerService, *ServiceRestart) (*Service, error) - - ActionRollback(*LoadBalancerService) (*Service, error) - - ActionSetservicelinks(*LoadBalancerService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*LoadBalancerService) (*Service, error) - - ActionUpgrade(*LoadBalancerService, *ServiceUpgrade) (*Service, error) -} - -func newLoadBalancerServiceClient(rancherClient *RancherClient) *LoadBalancerServiceClient { - return &LoadBalancerServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *LoadBalancerServiceClient) Create(container *LoadBalancerService) (*LoadBalancerService, error) { - resp := &LoadBalancerService{} - err := c.rancherClient.doCreate(LOAD_BALANCER_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *LoadBalancerServiceClient) Update(existing *LoadBalancerService, updates interface{}) (*LoadBalancerService, error) { - resp := &LoadBalancerService{} - err := c.rancherClient.doUpdate(LOAD_BALANCER_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LoadBalancerServiceClient) List(opts *ListOpts) (*LoadBalancerServiceCollection, error) { - resp := &LoadBalancerServiceCollection{} - err := c.rancherClient.doList(LOAD_BALANCER_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LoadBalancerServiceCollection) Next() (*LoadBalancerServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LoadBalancerServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LoadBalancerServiceClient) ById(id string) (*LoadBalancerService, error) { - resp := &LoadBalancerService{} - err := c.rancherClient.doById(LOAD_BALANCER_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LoadBalancerServiceClient) Delete(container *LoadBalancerService) error { - return c.rancherClient.doResourceDelete(LOAD_BALANCER_SERVICE_TYPE, &container.Resource) -} - -func (c *LoadBalancerServiceClient) ActionActivate(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionAddservicelink(resource *LoadBalancerService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionCancelupgrade(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionContinueupgrade(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionCreate(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionDeactivate(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionFinishupgrade(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionRemove(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionRemoveservicelink(resource *LoadBalancerService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionRestart(resource *LoadBalancerService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionRollback(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionSetservicelinks(resource *LoadBalancerService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionUpdate(resource *LoadBalancerService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *LoadBalancerServiceClient) ActionUpgrade(resource *LoadBalancerService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(LOAD_BALANCER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go deleted file mode 100644 index 664f137c1..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_local_auth_config.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - LOCAL_AUTH_CONFIG_TYPE = "localAuthConfig" -) - -type LocalAuthConfig struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Password string `json:"password,omitempty" yaml:"password,omitempty"` - - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type LocalAuthConfigCollection struct { - Collection - Data []LocalAuthConfig `json:"data,omitempty"` - client *LocalAuthConfigClient -} - -type LocalAuthConfigClient struct { - rancherClient *RancherClient -} - -type LocalAuthConfigOperations interface { - List(opts *ListOpts) (*LocalAuthConfigCollection, error) - Create(opts *LocalAuthConfig) (*LocalAuthConfig, error) - Update(existing *LocalAuthConfig, updates interface{}) (*LocalAuthConfig, error) - ById(id string) (*LocalAuthConfig, error) - Delete(container *LocalAuthConfig) error -} - -func newLocalAuthConfigClient(rancherClient *RancherClient) *LocalAuthConfigClient { - return &LocalAuthConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LocalAuthConfigClient) Create(container *LocalAuthConfig) (*LocalAuthConfig, error) { - resp := &LocalAuthConfig{} - err := c.rancherClient.doCreate(LOCAL_AUTH_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LocalAuthConfigClient) Update(existing *LocalAuthConfig, updates interface{}) (*LocalAuthConfig, error) { - resp := &LocalAuthConfig{} - err := c.rancherClient.doUpdate(LOCAL_AUTH_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LocalAuthConfigClient) List(opts *ListOpts) (*LocalAuthConfigCollection, error) { - resp := &LocalAuthConfigCollection{} - err := c.rancherClient.doList(LOCAL_AUTH_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LocalAuthConfigCollection) Next() (*LocalAuthConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LocalAuthConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LocalAuthConfigClient) ById(id string) (*LocalAuthConfig, error) { - resp := &LocalAuthConfig{} - err := c.rancherClient.doById(LOCAL_AUTH_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LocalAuthConfigClient) Delete(container *LocalAuthConfig) error { - return c.rancherClient.doResourceDelete(LOCAL_AUTH_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go deleted file mode 100644 index 3f799aac9..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_log_config.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - LOG_CONFIG_TYPE = "logConfig" -) - -type LogConfig struct { - Resource - - Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` -} - -type LogConfigCollection struct { - Collection - Data []LogConfig `json:"data,omitempty"` - client *LogConfigClient -} - -type LogConfigClient struct { - rancherClient *RancherClient -} - -type LogConfigOperations interface { - List(opts *ListOpts) (*LogConfigCollection, error) - Create(opts *LogConfig) (*LogConfig, error) - Update(existing *LogConfig, updates interface{}) (*LogConfig, error) - ById(id string) (*LogConfig, error) - Delete(container *LogConfig) error -} - -func newLogConfigClient(rancherClient *RancherClient) *LogConfigClient { - return &LogConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *LogConfigClient) Create(container *LogConfig) (*LogConfig, error) { - resp := &LogConfig{} - err := c.rancherClient.doCreate(LOG_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *LogConfigClient) Update(existing *LogConfig, updates interface{}) (*LogConfig, error) { - resp := &LogConfig{} - err := c.rancherClient.doUpdate(LOG_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *LogConfigClient) List(opts *ListOpts) (*LogConfigCollection, error) { - resp := &LogConfigCollection{} - err := c.rancherClient.doList(LOG_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *LogConfigCollection) Next() (*LogConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &LogConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *LogConfigClient) ById(id string) (*LogConfig, error) { - resp := &LogConfig{} - err := c.rancherClient.doById(LOG_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *LogConfigClient) Delete(container *LogConfig) error { - return c.rancherClient.doResourceDelete(LOG_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine.go deleted file mode 100644 index 5931b982e..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_machine.go +++ /dev/null @@ -1,194 +0,0 @@ -package client - -const ( - MACHINE_TYPE = "machine" -) - -type Machine struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Amazonec2Config *Amazonec2Config `json:"amazonec2Config,omitempty" yaml:"amazonec2config,omitempty"` - - AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"auth_certificate_authority,omitempty"` - - AuthKey string `json:"authKey,omitempty" yaml:"auth_key,omitempty"` - - AzureConfig *AzureConfig `json:"azureConfig,omitempty" yaml:"azure_config,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DigitaloceanConfig *DigitaloceanConfig `json:"digitaloceanConfig,omitempty" yaml:"digitalocean_config,omitempty"` - - DockerVersion string `json:"dockerVersion,omitempty" yaml:"docker_version,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - EngineEnv map[string]interface{} `json:"engineEnv,omitempty" yaml:"engine_env,omitempty"` - - EngineInsecureRegistry []string `json:"engineInsecureRegistry,omitempty" yaml:"engine_insecure_registry,omitempty"` - - EngineInstallUrl string `json:"engineInstallUrl,omitempty" yaml:"engine_install_url,omitempty"` - - EngineLabel map[string]interface{} `json:"engineLabel,omitempty" yaml:"engine_label,omitempty"` - - EngineOpt map[string]interface{} `json:"engineOpt,omitempty" yaml:"engine_opt,omitempty"` - - EngineRegistryMirror []string `json:"engineRegistryMirror,omitempty" yaml:"engine_registry_mirror,omitempty"` - - EngineStorageDriver string `json:"engineStorageDriver,omitempty" yaml:"engine_storage_driver,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostTemplateId string `json:"hostTemplateId,omitempty" yaml:"host_template_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PacketConfig *PacketConfig `json:"packetConfig,omitempty" yaml:"packet_config,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type MachineCollection struct { - Collection - Data []Machine `json:"data,omitempty"` - client *MachineClient -} - -type MachineClient struct { - rancherClient *RancherClient -} - -type MachineOperations interface { - List(opts *ListOpts) (*MachineCollection, error) - Create(opts *Machine) (*Machine, error) - Update(existing *Machine, updates interface{}) (*Machine, error) - ById(id string) (*Machine, error) - Delete(container *Machine) error - - ActionBootstrap(*Machine) (*PhysicalHost, error) - - ActionCreate(*Machine) (*PhysicalHost, error) - - ActionError(*Machine) (*PhysicalHost, error) - - ActionRemove(*Machine) (*PhysicalHost, error) - - ActionUpdate(*Machine) (*PhysicalHost, error) -} - -func newMachineClient(rancherClient *RancherClient) *MachineClient { - return &MachineClient{ - rancherClient: rancherClient, - } -} - -func (c *MachineClient) Create(container *Machine) (*Machine, error) { - resp := &Machine{} - err := c.rancherClient.doCreate(MACHINE_TYPE, container, resp) - return resp, err -} - -func (c *MachineClient) Update(existing *Machine, updates interface{}) (*Machine, error) { - resp := &Machine{} - err := c.rancherClient.doUpdate(MACHINE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MachineClient) List(opts *ListOpts) (*MachineCollection, error) { - resp := &MachineCollection{} - err := c.rancherClient.doList(MACHINE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *MachineCollection) Next() (*MachineCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MachineCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MachineClient) ById(id string) (*Machine, error) { - resp := &Machine{} - err := c.rancherClient.doById(MACHINE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MachineClient) Delete(container *Machine) error { - return c.rancherClient.doResourceDelete(MACHINE_TYPE, &container.Resource) -} - -func (c *MachineClient) ActionBootstrap(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "bootstrap", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineClient) ActionCreate(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineClient) ActionError(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineClient) ActionRemove(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineClient) ActionUpdate(resource *Machine) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(MACHINE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go deleted file mode 100644 index a0b70653c..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_machine_driver.go +++ /dev/null @@ -1,192 +0,0 @@ -package client - -const ( - MACHINE_DRIVER_TYPE = "machineDriver" -) - -type MachineDriver struct { - Resource - - ActivateOnCreate bool `json:"activateOnCreate,omitempty" yaml:"activate_on_create,omitempty"` - - Builtin bool `json:"builtin,omitempty" yaml:"builtin,omitempty"` - - Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultActive bool `json:"defaultActive,omitempty" yaml:"default_active,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - UiUrl string `json:"uiUrl,omitempty" yaml:"ui_url,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type MachineDriverCollection struct { - Collection - Data []MachineDriver `json:"data,omitempty"` - client *MachineDriverClient -} - -type MachineDriverClient struct { - rancherClient *RancherClient -} - -type MachineDriverOperations interface { - List(opts *ListOpts) (*MachineDriverCollection, error) - Create(opts *MachineDriver) (*MachineDriver, error) - Update(existing *MachineDriver, updates interface{}) (*MachineDriver, error) - ById(id string) (*MachineDriver, error) - Delete(container *MachineDriver) error - - ActionActivate(*MachineDriver) (*MachineDriver, error) - - ActionCreate(*MachineDriver) (*MachineDriver, error) - - ActionDeactivate(*MachineDriver) (*MachineDriver, error) - - ActionError(*MachineDriver) (*MachineDriver, error) - - ActionReactivate(*MachineDriver) (*MachineDriver, error) - - ActionRemove(*MachineDriver) (*MachineDriver, error) - - ActionUpdate(*MachineDriver) (*MachineDriver, error) -} - -func newMachineDriverClient(rancherClient *RancherClient) *MachineDriverClient { - return &MachineDriverClient{ - rancherClient: rancherClient, - } -} - -func (c *MachineDriverClient) Create(container *MachineDriver) (*MachineDriver, error) { - resp := &MachineDriver{} - err := c.rancherClient.doCreate(MACHINE_DRIVER_TYPE, container, resp) - return resp, err -} - -func (c *MachineDriverClient) Update(existing *MachineDriver, updates interface{}) (*MachineDriver, error) { - resp := &MachineDriver{} - err := c.rancherClient.doUpdate(MACHINE_DRIVER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MachineDriverClient) List(opts *ListOpts) (*MachineDriverCollection, error) { - resp := &MachineDriverCollection{} - err := c.rancherClient.doList(MACHINE_DRIVER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *MachineDriverCollection) Next() (*MachineDriverCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MachineDriverCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MachineDriverClient) ById(id string) (*MachineDriver, error) { - resp := &MachineDriver{} - err := c.rancherClient.doById(MACHINE_DRIVER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MachineDriverClient) Delete(container *MachineDriver) error { - return c.rancherClient.doResourceDelete(MACHINE_DRIVER_TYPE, &container.Resource) -} - -func (c *MachineDriverClient) ActionActivate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionCreate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionDeactivate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionError(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionReactivate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "reactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionRemove(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MachineDriverClient) ActionUpdate(resource *MachineDriver) (*MachineDriver, error) { - - resp := &MachineDriver{} - - err := c.rancherClient.doAction(MACHINE_DRIVER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_mount.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount.go deleted file mode 100644 index efa68a501..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_mount.go +++ /dev/null @@ -1,144 +0,0 @@ -package client - -const ( - MOUNT_TYPE = "mount" -) - -type Mount struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - Permissions string `json:"permissions,omitempty" yaml:"permissions,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` -} - -type MountCollection struct { - Collection - Data []Mount `json:"data,omitempty"` - client *MountClient -} - -type MountClient struct { - rancherClient *RancherClient -} - -type MountOperations interface { - List(opts *ListOpts) (*MountCollection, error) - Create(opts *Mount) (*Mount, error) - Update(existing *Mount, updates interface{}) (*Mount, error) - ById(id string) (*Mount, error) - Delete(container *Mount) error - - ActionCreate(*Mount) (*Mount, error) - - ActionDeactivate(*Mount) (*Mount, error) - - ActionRemove(*Mount) (*Mount, error) -} - -func newMountClient(rancherClient *RancherClient) *MountClient { - return &MountClient{ - rancherClient: rancherClient, - } -} - -func (c *MountClient) Create(container *Mount) (*Mount, error) { - resp := &Mount{} - err := c.rancherClient.doCreate(MOUNT_TYPE, container, resp) - return resp, err -} - -func (c *MountClient) Update(existing *Mount, updates interface{}) (*Mount, error) { - resp := &Mount{} - err := c.rancherClient.doUpdate(MOUNT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MountClient) List(opts *ListOpts) (*MountCollection, error) { - resp := &MountCollection{} - err := c.rancherClient.doList(MOUNT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *MountCollection) Next() (*MountCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MountCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MountClient) ById(id string) (*Mount, error) { - resp := &Mount{} - err := c.rancherClient.doById(MOUNT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MountClient) Delete(container *Mount) error { - return c.rancherClient.doResourceDelete(MOUNT_TYPE, &container.Resource) -} - -func (c *MountClient) ActionCreate(resource *Mount) (*Mount, error) { - - resp := &Mount{} - - err := c.rancherClient.doAction(MOUNT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MountClient) ActionDeactivate(resource *Mount) (*Mount, error) { - - resp := &Mount{} - - err := c.rancherClient.doAction(MOUNT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *MountClient) ActionRemove(resource *Mount) (*Mount, error) { - - resp := &Mount{} - - err := c.rancherClient.doAction(MOUNT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go b/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go deleted file mode 100644 index 62d4f4fa1..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_mount_entry.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - MOUNT_ENTRY_TYPE = "mountEntry" -) - -type MountEntry struct { - Resource - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - InstanceName string `json:"instanceName,omitempty" yaml:"instance_name,omitempty"` - - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` - - VolumeName string `json:"volumeName,omitempty" yaml:"volume_name,omitempty"` -} - -type MountEntryCollection struct { - Collection - Data []MountEntry `json:"data,omitempty"` - client *MountEntryClient -} - -type MountEntryClient struct { - rancherClient *RancherClient -} - -type MountEntryOperations interface { - List(opts *ListOpts) (*MountEntryCollection, error) - Create(opts *MountEntry) (*MountEntry, error) - Update(existing *MountEntry, updates interface{}) (*MountEntry, error) - ById(id string) (*MountEntry, error) - Delete(container *MountEntry) error -} - -func newMountEntryClient(rancherClient *RancherClient) *MountEntryClient { - return &MountEntryClient{ - rancherClient: rancherClient, - } -} - -func (c *MountEntryClient) Create(container *MountEntry) (*MountEntry, error) { - resp := &MountEntry{} - err := c.rancherClient.doCreate(MOUNT_ENTRY_TYPE, container, resp) - return resp, err -} - -func (c *MountEntryClient) Update(existing *MountEntry, updates interface{}) (*MountEntry, error) { - resp := &MountEntry{} - err := c.rancherClient.doUpdate(MOUNT_ENTRY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MountEntryClient) List(opts *ListOpts) (*MountEntryCollection, error) { - resp := &MountEntryCollection{} - err := c.rancherClient.doList(MOUNT_ENTRY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *MountEntryCollection) Next() (*MountEntryCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MountEntryCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MountEntryClient) ById(id string) (*MountEntry, error) { - resp := &MountEntry{} - err := c.rancherClient.doById(MOUNT_ENTRY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *MountEntryClient) Delete(container *MountEntry) error { - return c.rancherClient.doResourceDelete(MOUNT_ENTRY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network.go b/vendor/github.com/rancher/go-rancher/v2/generated_network.go deleted file mode 100644 index ce77246dc..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network.go +++ /dev/null @@ -1,185 +0,0 @@ -package client - -const ( - NETWORK_TYPE = "network" -) - -type Network struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultPolicyAction string `json:"defaultPolicyAction,omitempty" yaml:"default_policy_action,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - HostPorts bool `json:"hostPorts,omitempty" yaml:"host_ports,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkDriverId string `json:"networkDriverId,omitempty" yaml:"network_driver_id,omitempty"` - - Policy []NetworkPolicyRule `json:"policy,omitempty" yaml:"policy,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Subnets []Subnet `json:"subnets,omitempty" yaml:"subnets,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type NetworkCollection struct { - Collection - Data []Network `json:"data,omitempty"` - client *NetworkClient -} - -type NetworkClient struct { - rancherClient *RancherClient -} - -type NetworkOperations interface { - List(opts *ListOpts) (*NetworkCollection, error) - Create(opts *Network) (*Network, error) - Update(existing *Network, updates interface{}) (*Network, error) - ById(id string) (*Network, error) - Delete(container *Network) error - - ActionActivate(*Network) (*Network, error) - - ActionCreate(*Network) (*Network, error) - - ActionDeactivate(*Network) (*Network, error) - - ActionPurge(*Network) (*Network, error) - - ActionRemove(*Network) (*Network, error) - - ActionUpdate(*Network) (*Network, error) -} - -func newNetworkClient(rancherClient *RancherClient) *NetworkClient { - return &NetworkClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkClient) Create(container *Network) (*Network, error) { - resp := &Network{} - err := c.rancherClient.doCreate(NETWORK_TYPE, container, resp) - return resp, err -} - -func (c *NetworkClient) Update(existing *Network, updates interface{}) (*Network, error) { - resp := &Network{} - err := c.rancherClient.doUpdate(NETWORK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkClient) List(opts *ListOpts) (*NetworkCollection, error) { - resp := &NetworkCollection{} - err := c.rancherClient.doList(NETWORK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkCollection) Next() (*NetworkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkClient) ById(id string) (*Network, error) { - resp := &Network{} - err := c.rancherClient.doById(NETWORK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkClient) Delete(container *Network) error { - return c.rancherClient.doResourceDelete(NETWORK_TYPE, &container.Resource) -} - -func (c *NetworkClient) ActionActivate(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionCreate(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionDeactivate(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionPurge(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionRemove(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkClient) ActionUpdate(resource *Network) (*Network, error) { - - resp := &Network{} - - err := c.rancherClient.doAction(NETWORK_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go deleted file mode 100644 index ea35cfebb..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver.go +++ /dev/null @@ -1,166 +0,0 @@ -package client - -const ( - NETWORK_DRIVER_TYPE = "networkDriver" -) - -type NetworkDriver struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - CniConfig map[string]interface{} `json:"cniConfig,omitempty" yaml:"cni_config,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultNetwork DefaultNetwork `json:"defaultNetwork,omitempty" yaml:"default_network,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkMetadata map[string]interface{} `json:"networkMetadata,omitempty" yaml:"network_metadata,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type NetworkDriverCollection struct { - Collection - Data []NetworkDriver `json:"data,omitempty"` - client *NetworkDriverClient -} - -type NetworkDriverClient struct { - rancherClient *RancherClient -} - -type NetworkDriverOperations interface { - List(opts *ListOpts) (*NetworkDriverCollection, error) - Create(opts *NetworkDriver) (*NetworkDriver, error) - Update(existing *NetworkDriver, updates interface{}) (*NetworkDriver, error) - ById(id string) (*NetworkDriver, error) - Delete(container *NetworkDriver) error - - ActionActivate(*NetworkDriver) (*NetworkDriver, error) - - ActionCreate(*NetworkDriver) (*NetworkDriver, error) - - ActionDeactivate(*NetworkDriver) (*NetworkDriver, error) - - ActionRemove(*NetworkDriver) (*NetworkDriver, error) - - ActionUpdate(*NetworkDriver) (*NetworkDriver, error) -} - -func newNetworkDriverClient(rancherClient *RancherClient) *NetworkDriverClient { - return &NetworkDriverClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkDriverClient) Create(container *NetworkDriver) (*NetworkDriver, error) { - resp := &NetworkDriver{} - err := c.rancherClient.doCreate(NETWORK_DRIVER_TYPE, container, resp) - return resp, err -} - -func (c *NetworkDriverClient) Update(existing *NetworkDriver, updates interface{}) (*NetworkDriver, error) { - resp := &NetworkDriver{} - err := c.rancherClient.doUpdate(NETWORK_DRIVER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkDriverClient) List(opts *ListOpts) (*NetworkDriverCollection, error) { - resp := &NetworkDriverCollection{} - err := c.rancherClient.doList(NETWORK_DRIVER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkDriverCollection) Next() (*NetworkDriverCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkDriverCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkDriverClient) ById(id string) (*NetworkDriver, error) { - resp := &NetworkDriver{} - err := c.rancherClient.doById(NETWORK_DRIVER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkDriverClient) Delete(container *NetworkDriver) error { - return c.rancherClient.doResourceDelete(NETWORK_DRIVER_TYPE, &container.Resource) -} - -func (c *NetworkDriverClient) ActionActivate(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverClient) ActionCreate(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverClient) ActionDeactivate(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverClient) ActionRemove(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverClient) ActionUpdate(resource *NetworkDriver) (*NetworkDriver, error) { - - resp := &NetworkDriver{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go deleted file mode 100644 index 9317af3f4..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_driver_service.go +++ /dev/null @@ -1,305 +0,0 @@ -package client - -const ( - NETWORK_DRIVER_SERVICE_TYPE = "networkDriverService" -) - -type NetworkDriverService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkDriver NetworkDriver `json:"networkDriver,omitempty" yaml:"network_driver,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type NetworkDriverServiceCollection struct { - Collection - Data []NetworkDriverService `json:"data,omitempty"` - client *NetworkDriverServiceClient -} - -type NetworkDriverServiceClient struct { - rancherClient *RancherClient -} - -type NetworkDriverServiceOperations interface { - List(opts *ListOpts) (*NetworkDriverServiceCollection, error) - Create(opts *NetworkDriverService) (*NetworkDriverService, error) - Update(existing *NetworkDriverService, updates interface{}) (*NetworkDriverService, error) - ById(id string) (*NetworkDriverService, error) - Delete(container *NetworkDriverService) error - - ActionActivate(*NetworkDriverService) (*Service, error) - - ActionAddservicelink(*NetworkDriverService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*NetworkDriverService) (*Service, error) - - ActionContinueupgrade(*NetworkDriverService) (*Service, error) - - ActionCreate(*NetworkDriverService) (*Service, error) - - ActionDeactivate(*NetworkDriverService) (*Service, error) - - ActionFinishupgrade(*NetworkDriverService) (*Service, error) - - ActionRemove(*NetworkDriverService) (*Service, error) - - ActionRemoveservicelink(*NetworkDriverService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*NetworkDriverService, *ServiceRestart) (*Service, error) - - ActionRollback(*NetworkDriverService) (*Service, error) - - ActionSetservicelinks(*NetworkDriverService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*NetworkDriverService) (*Service, error) - - ActionUpgrade(*NetworkDriverService, *ServiceUpgrade) (*Service, error) -} - -func newNetworkDriverServiceClient(rancherClient *RancherClient) *NetworkDriverServiceClient { - return &NetworkDriverServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkDriverServiceClient) Create(container *NetworkDriverService) (*NetworkDriverService, error) { - resp := &NetworkDriverService{} - err := c.rancherClient.doCreate(NETWORK_DRIVER_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *NetworkDriverServiceClient) Update(existing *NetworkDriverService, updates interface{}) (*NetworkDriverService, error) { - resp := &NetworkDriverService{} - err := c.rancherClient.doUpdate(NETWORK_DRIVER_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkDriverServiceClient) List(opts *ListOpts) (*NetworkDriverServiceCollection, error) { - resp := &NetworkDriverServiceCollection{} - err := c.rancherClient.doList(NETWORK_DRIVER_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkDriverServiceCollection) Next() (*NetworkDriverServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkDriverServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkDriverServiceClient) ById(id string) (*NetworkDriverService, error) { - resp := &NetworkDriverService{} - err := c.rancherClient.doById(NETWORK_DRIVER_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkDriverServiceClient) Delete(container *NetworkDriverService) error { - return c.rancherClient.doResourceDelete(NETWORK_DRIVER_SERVICE_TYPE, &container.Resource) -} - -func (c *NetworkDriverServiceClient) ActionActivate(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionAddservicelink(resource *NetworkDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionCancelupgrade(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionContinueupgrade(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionCreate(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionDeactivate(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionFinishupgrade(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionRemove(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionRemoveservicelink(resource *NetworkDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionRestart(resource *NetworkDriverService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionRollback(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionSetservicelinks(resource *NetworkDriverService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionUpdate(resource *NetworkDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *NetworkDriverServiceClient) ActionUpgrade(resource *NetworkDriverService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(NETWORK_DRIVER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go deleted file mode 100644 index 6f62f2815..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - NETWORK_POLICY_RULE_TYPE = "networkPolicyRule" -) - -type NetworkPolicyRule struct { - Resource - - Action string `json:"action,omitempty" yaml:"action,omitempty"` - - Between NetworkPolicyRuleBetween `json:"between,omitempty" yaml:"between,omitempty"` - - From NetworkPolicyRuleMember `json:"from,omitempty" yaml:"from,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - To NetworkPolicyRuleMember `json:"to,omitempty" yaml:"to,omitempty"` - - Within string `json:"within,omitempty" yaml:"within,omitempty"` -} - -type NetworkPolicyRuleCollection struct { - Collection - Data []NetworkPolicyRule `json:"data,omitempty"` - client *NetworkPolicyRuleClient -} - -type NetworkPolicyRuleClient struct { - rancherClient *RancherClient -} - -type NetworkPolicyRuleOperations interface { - List(opts *ListOpts) (*NetworkPolicyRuleCollection, error) - Create(opts *NetworkPolicyRule) (*NetworkPolicyRule, error) - Update(existing *NetworkPolicyRule, updates interface{}) (*NetworkPolicyRule, error) - ById(id string) (*NetworkPolicyRule, error) - Delete(container *NetworkPolicyRule) error -} - -func newNetworkPolicyRuleClient(rancherClient *RancherClient) *NetworkPolicyRuleClient { - return &NetworkPolicyRuleClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkPolicyRuleClient) Create(container *NetworkPolicyRule) (*NetworkPolicyRule, error) { - resp := &NetworkPolicyRule{} - err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_TYPE, container, resp) - return resp, err -} - -func (c *NetworkPolicyRuleClient) Update(existing *NetworkPolicyRule, updates interface{}) (*NetworkPolicyRule, error) { - resp := &NetworkPolicyRule{} - err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkPolicyRuleClient) List(opts *ListOpts) (*NetworkPolicyRuleCollection, error) { - resp := &NetworkPolicyRuleCollection{} - err := c.rancherClient.doList(NETWORK_POLICY_RULE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkPolicyRuleCollection) Next() (*NetworkPolicyRuleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkPolicyRuleCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkPolicyRuleClient) ById(id string) (*NetworkPolicyRule, error) { - resp := &NetworkPolicyRule{} - err := c.rancherClient.doById(NETWORK_POLICY_RULE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkPolicyRuleClient) Delete(container *NetworkPolicyRule) error { - return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go deleted file mode 100644 index 77e17662b..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_between.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - NETWORK_POLICY_RULE_BETWEEN_TYPE = "networkPolicyRuleBetween" -) - -type NetworkPolicyRuleBetween struct { - Resource - - GroupBy string `json:"groupBy,omitempty" yaml:"group_by,omitempty"` - - Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` -} - -type NetworkPolicyRuleBetweenCollection struct { - Collection - Data []NetworkPolicyRuleBetween `json:"data,omitempty"` - client *NetworkPolicyRuleBetweenClient -} - -type NetworkPolicyRuleBetweenClient struct { - rancherClient *RancherClient -} - -type NetworkPolicyRuleBetweenOperations interface { - List(opts *ListOpts) (*NetworkPolicyRuleBetweenCollection, error) - Create(opts *NetworkPolicyRuleBetween) (*NetworkPolicyRuleBetween, error) - Update(existing *NetworkPolicyRuleBetween, updates interface{}) (*NetworkPolicyRuleBetween, error) - ById(id string) (*NetworkPolicyRuleBetween, error) - Delete(container *NetworkPolicyRuleBetween) error -} - -func newNetworkPolicyRuleBetweenClient(rancherClient *RancherClient) *NetworkPolicyRuleBetweenClient { - return &NetworkPolicyRuleBetweenClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkPolicyRuleBetweenClient) Create(container *NetworkPolicyRuleBetween) (*NetworkPolicyRuleBetween, error) { - resp := &NetworkPolicyRuleBetween{} - err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_BETWEEN_TYPE, container, resp) - return resp, err -} - -func (c *NetworkPolicyRuleBetweenClient) Update(existing *NetworkPolicyRuleBetween, updates interface{}) (*NetworkPolicyRuleBetween, error) { - resp := &NetworkPolicyRuleBetween{} - err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_BETWEEN_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkPolicyRuleBetweenClient) List(opts *ListOpts) (*NetworkPolicyRuleBetweenCollection, error) { - resp := &NetworkPolicyRuleBetweenCollection{} - err := c.rancherClient.doList(NETWORK_POLICY_RULE_BETWEEN_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkPolicyRuleBetweenCollection) Next() (*NetworkPolicyRuleBetweenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkPolicyRuleBetweenCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkPolicyRuleBetweenClient) ById(id string) (*NetworkPolicyRuleBetween, error) { - resp := &NetworkPolicyRuleBetween{} - err := c.rancherClient.doById(NETWORK_POLICY_RULE_BETWEEN_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkPolicyRuleBetweenClient) Delete(container *NetworkPolicyRuleBetween) error { - return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_BETWEEN_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go deleted file mode 100644 index e8e34e108..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_member.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - NETWORK_POLICY_RULE_MEMBER_TYPE = "networkPolicyRuleMember" -) - -type NetworkPolicyRuleMember struct { - Resource - - Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` -} - -type NetworkPolicyRuleMemberCollection struct { - Collection - Data []NetworkPolicyRuleMember `json:"data,omitempty"` - client *NetworkPolicyRuleMemberClient -} - -type NetworkPolicyRuleMemberClient struct { - rancherClient *RancherClient -} - -type NetworkPolicyRuleMemberOperations interface { - List(opts *ListOpts) (*NetworkPolicyRuleMemberCollection, error) - Create(opts *NetworkPolicyRuleMember) (*NetworkPolicyRuleMember, error) - Update(existing *NetworkPolicyRuleMember, updates interface{}) (*NetworkPolicyRuleMember, error) - ById(id string) (*NetworkPolicyRuleMember, error) - Delete(container *NetworkPolicyRuleMember) error -} - -func newNetworkPolicyRuleMemberClient(rancherClient *RancherClient) *NetworkPolicyRuleMemberClient { - return &NetworkPolicyRuleMemberClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkPolicyRuleMemberClient) Create(container *NetworkPolicyRuleMember) (*NetworkPolicyRuleMember, error) { - resp := &NetworkPolicyRuleMember{} - err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_MEMBER_TYPE, container, resp) - return resp, err -} - -func (c *NetworkPolicyRuleMemberClient) Update(existing *NetworkPolicyRuleMember, updates interface{}) (*NetworkPolicyRuleMember, error) { - resp := &NetworkPolicyRuleMember{} - err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_MEMBER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkPolicyRuleMemberClient) List(opts *ListOpts) (*NetworkPolicyRuleMemberCollection, error) { - resp := &NetworkPolicyRuleMemberCollection{} - err := c.rancherClient.doList(NETWORK_POLICY_RULE_MEMBER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkPolicyRuleMemberCollection) Next() (*NetworkPolicyRuleMemberCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkPolicyRuleMemberCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkPolicyRuleMemberClient) ById(id string) (*NetworkPolicyRuleMember, error) { - resp := &NetworkPolicyRuleMember{} - err := c.rancherClient.doById(NETWORK_POLICY_RULE_MEMBER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkPolicyRuleMemberClient) Delete(container *NetworkPolicyRuleMember) error { - return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_MEMBER_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go b/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go deleted file mode 100644 index 0472ee678..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_network_policy_rule_within.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - NETWORK_POLICY_RULE_WITHIN_TYPE = "networkPolicyRuleWithin" -) - -type NetworkPolicyRuleWithin struct { - Resource -} - -type NetworkPolicyRuleWithinCollection struct { - Collection - Data []NetworkPolicyRuleWithin `json:"data,omitempty"` - client *NetworkPolicyRuleWithinClient -} - -type NetworkPolicyRuleWithinClient struct { - rancherClient *RancherClient -} - -type NetworkPolicyRuleWithinOperations interface { - List(opts *ListOpts) (*NetworkPolicyRuleWithinCollection, error) - Create(opts *NetworkPolicyRuleWithin) (*NetworkPolicyRuleWithin, error) - Update(existing *NetworkPolicyRuleWithin, updates interface{}) (*NetworkPolicyRuleWithin, error) - ById(id string) (*NetworkPolicyRuleWithin, error) - Delete(container *NetworkPolicyRuleWithin) error -} - -func newNetworkPolicyRuleWithinClient(rancherClient *RancherClient) *NetworkPolicyRuleWithinClient { - return &NetworkPolicyRuleWithinClient{ - rancherClient: rancherClient, - } -} - -func (c *NetworkPolicyRuleWithinClient) Create(container *NetworkPolicyRuleWithin) (*NetworkPolicyRuleWithin, error) { - resp := &NetworkPolicyRuleWithin{} - err := c.rancherClient.doCreate(NETWORK_POLICY_RULE_WITHIN_TYPE, container, resp) - return resp, err -} - -func (c *NetworkPolicyRuleWithinClient) Update(existing *NetworkPolicyRuleWithin, updates interface{}) (*NetworkPolicyRuleWithin, error) { - resp := &NetworkPolicyRuleWithin{} - err := c.rancherClient.doUpdate(NETWORK_POLICY_RULE_WITHIN_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NetworkPolicyRuleWithinClient) List(opts *ListOpts) (*NetworkPolicyRuleWithinCollection, error) { - resp := &NetworkPolicyRuleWithinCollection{} - err := c.rancherClient.doList(NETWORK_POLICY_RULE_WITHIN_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NetworkPolicyRuleWithinCollection) Next() (*NetworkPolicyRuleWithinCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NetworkPolicyRuleWithinCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NetworkPolicyRuleWithinClient) ById(id string) (*NetworkPolicyRuleWithin, error) { - resp := &NetworkPolicyRuleWithin{} - err := c.rancherClient.doById(NETWORK_POLICY_RULE_WITHIN_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NetworkPolicyRuleWithinClient) Delete(container *NetworkPolicyRuleWithin) error { - return c.rancherClient.doResourceDelete(NETWORK_POLICY_RULE_WITHIN_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go deleted file mode 100644 index 1c0143fbf..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_nfs_config.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - NFS_CONFIG_TYPE = "nfsConfig" -) - -type NfsConfig struct { - Resource - - MountOptions string `json:"mountOptions,omitempty" yaml:"mount_options,omitempty"` - - Server string `json:"server,omitempty" yaml:"server,omitempty"` - - Share string `json:"share,omitempty" yaml:"share,omitempty"` -} - -type NfsConfigCollection struct { - Collection - Data []NfsConfig `json:"data,omitempty"` - client *NfsConfigClient -} - -type NfsConfigClient struct { - rancherClient *RancherClient -} - -type NfsConfigOperations interface { - List(opts *ListOpts) (*NfsConfigCollection, error) - Create(opts *NfsConfig) (*NfsConfig, error) - Update(existing *NfsConfig, updates interface{}) (*NfsConfig, error) - ById(id string) (*NfsConfig, error) - Delete(container *NfsConfig) error -} - -func newNfsConfigClient(rancherClient *RancherClient) *NfsConfigClient { - return &NfsConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *NfsConfigClient) Create(container *NfsConfig) (*NfsConfig, error) { - resp := &NfsConfig{} - err := c.rancherClient.doCreate(NFS_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *NfsConfigClient) Update(existing *NfsConfig, updates interface{}) (*NfsConfig, error) { - resp := &NfsConfig{} - err := c.rancherClient.doUpdate(NFS_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *NfsConfigClient) List(opts *ListOpts) (*NfsConfigCollection, error) { - resp := &NfsConfigCollection{} - err := c.rancherClient.doList(NFS_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *NfsConfigCollection) Next() (*NfsConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &NfsConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *NfsConfigClient) ById(id string) (*NfsConfig, error) { - resp := &NfsConfig{} - err := c.rancherClient.doById(NFS_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *NfsConfigClient) Delete(container *NfsConfig) error { - return c.rancherClient.doResourceDelete(NFS_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go b/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go deleted file mode 100644 index baf672aed..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_openldapconfig.go +++ /dev/null @@ -1,129 +0,0 @@ -package client - -const ( - OPENLDAPCONFIG_TYPE = "openldapconfig" -) - -type Openldapconfig struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - AllowedIdentities []Identity `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"` - - ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connection_timeout,omitempty"` - - Domain string `json:"domain,omitempty" yaml:"domain,omitempty"` - - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - - GroupDNField string `json:"groupDNField,omitempty" yaml:"group_dnfield,omitempty"` - - GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"group_member_mapping_attribute,omitempty"` - - GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"group_member_user_attribute,omitempty"` - - GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"` - - GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,omitempty"` - - GroupSearchDomain string `json:"groupSearchDomain,omitempty" yaml:"group_search_domain,omitempty"` - - GroupSearchField string `json:"groupSearchField,omitempty" yaml:"group_search_field,omitempty"` - - LoginDomain string `json:"loginDomain,omitempty" yaml:"login_domain,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - Server string `json:"server,omitempty" yaml:"server,omitempty"` - - ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"service_account_password,omitempty"` - - ServiceAccountUsername string `json:"serviceAccountUsername,omitempty" yaml:"service_account_username,omitempty"` - - Tls bool `json:"tls,omitempty" yaml:"tls,omitempty"` - - UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"user_disabled_bit_mask,omitempty"` - - UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"user_enabled_attribute,omitempty"` - - UserLoginField string `json:"userLoginField,omitempty" yaml:"user_login_field,omitempty"` - - UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"user_member_attribute,omitempty"` - - UserNameField string `json:"userNameField,omitempty" yaml:"user_name_field,omitempty"` - - UserObjectClass string `json:"userObjectClass,omitempty" yaml:"user_object_class,omitempty"` - - UserSearchField string `json:"userSearchField,omitempty" yaml:"user_search_field,omitempty"` -} - -type OpenldapconfigCollection struct { - Collection - Data []Openldapconfig `json:"data,omitempty"` - client *OpenldapconfigClient -} - -type OpenldapconfigClient struct { - rancherClient *RancherClient -} - -type OpenldapconfigOperations interface { - List(opts *ListOpts) (*OpenldapconfigCollection, error) - Create(opts *Openldapconfig) (*Openldapconfig, error) - Update(existing *Openldapconfig, updates interface{}) (*Openldapconfig, error) - ById(id string) (*Openldapconfig, error) - Delete(container *Openldapconfig) error -} - -func newOpenldapconfigClient(rancherClient *RancherClient) *OpenldapconfigClient { - return &OpenldapconfigClient{ - rancherClient: rancherClient, - } -} - -func (c *OpenldapconfigClient) Create(container *Openldapconfig) (*Openldapconfig, error) { - resp := &Openldapconfig{} - err := c.rancherClient.doCreate(OPENLDAPCONFIG_TYPE, container, resp) - return resp, err -} - -func (c *OpenldapconfigClient) Update(existing *Openldapconfig, updates interface{}) (*Openldapconfig, error) { - resp := &Openldapconfig{} - err := c.rancherClient.doUpdate(OPENLDAPCONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *OpenldapconfigClient) List(opts *ListOpts) (*OpenldapconfigCollection, error) { - resp := &OpenldapconfigCollection{} - err := c.rancherClient.doList(OPENLDAPCONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *OpenldapconfigCollection) Next() (*OpenldapconfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &OpenldapconfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *OpenldapconfigClient) ById(id string) (*Openldapconfig, error) { - resp := &Openldapconfig{} - err := c.rancherClient.doById(OPENLDAPCONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *OpenldapconfigClient) Delete(container *Openldapconfig) error { - return c.rancherClient.doResourceDelete(OPENLDAPCONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go deleted file mode 100644 index 3f3c4ff31..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_packet_config.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - PACKET_CONFIG_TYPE = "packetConfig" -) - -type PacketConfig struct { - Resource - - ApiKey string `json:"apiKey,omitempty" yaml:"api_key,omitempty"` - - BillingCycle string `json:"billingCycle,omitempty" yaml:"billing_cycle,omitempty"` - - FacilityCode string `json:"facilityCode,omitempty" yaml:"facility_code,omitempty"` - - Os string `json:"os,omitempty" yaml:"os,omitempty"` - - Plan string `json:"plan,omitempty" yaml:"plan,omitempty"` - - ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` -} - -type PacketConfigCollection struct { - Collection - Data []PacketConfig `json:"data,omitempty"` - client *PacketConfigClient -} - -type PacketConfigClient struct { - rancherClient *RancherClient -} - -type PacketConfigOperations interface { - List(opts *ListOpts) (*PacketConfigCollection, error) - Create(opts *PacketConfig) (*PacketConfig, error) - Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) - ById(id string) (*PacketConfig, error) - Delete(container *PacketConfig) error -} - -func newPacketConfigClient(rancherClient *RancherClient) *PacketConfigClient { - return &PacketConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *PacketConfigClient) Create(container *PacketConfig) (*PacketConfig, error) { - resp := &PacketConfig{} - err := c.rancherClient.doCreate(PACKET_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *PacketConfigClient) Update(existing *PacketConfig, updates interface{}) (*PacketConfig, error) { - resp := &PacketConfig{} - err := c.rancherClient.doUpdate(PACKET_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PacketConfigClient) List(opts *ListOpts) (*PacketConfigCollection, error) { - resp := &PacketConfigCollection{} - err := c.rancherClient.doList(PACKET_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PacketConfigCollection) Next() (*PacketConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PacketConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PacketConfigClient) ById(id string) (*PacketConfig, error) { - resp := &PacketConfig{} - err := c.rancherClient.doById(PACKET_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PacketConfigClient) Delete(container *PacketConfig) error { - return c.rancherClient.doResourceDelete(PACKET_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_password.go b/vendor/github.com/rancher/go-rancher/v2/generated_password.go deleted file mode 100644 index 5fb0d358d..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_password.go +++ /dev/null @@ -1,184 +0,0 @@ -package client - -const ( - PASSWORD_TYPE = "password" -) - -type Password struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PasswordCollection struct { - Collection - Data []Password `json:"data,omitempty"` - client *PasswordClient -} - -type PasswordClient struct { - rancherClient *RancherClient -} - -type PasswordOperations interface { - List(opts *ListOpts) (*PasswordCollection, error) - Create(opts *Password) (*Password, error) - Update(existing *Password, updates interface{}) (*Password, error) - ById(id string) (*Password, error) - Delete(container *Password) error - - ActionActivate(*Password) (*Credential, error) - - ActionChangesecret(*Password, *ChangeSecretInput) (*ChangeSecretInput, error) - - ActionCreate(*Password) (*Credential, error) - - ActionDeactivate(*Password) (*Credential, error) - - ActionPurge(*Password) (*Credential, error) - - ActionRemove(*Password) (*Credential, error) - - ActionUpdate(*Password) (*Credential, error) -} - -func newPasswordClient(rancherClient *RancherClient) *PasswordClient { - return &PasswordClient{ - rancherClient: rancherClient, - } -} - -func (c *PasswordClient) Create(container *Password) (*Password, error) { - resp := &Password{} - err := c.rancherClient.doCreate(PASSWORD_TYPE, container, resp) - return resp, err -} - -func (c *PasswordClient) Update(existing *Password, updates interface{}) (*Password, error) { - resp := &Password{} - err := c.rancherClient.doUpdate(PASSWORD_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PasswordClient) List(opts *ListOpts) (*PasswordCollection, error) { - resp := &PasswordCollection{} - err := c.rancherClient.doList(PASSWORD_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PasswordCollection) Next() (*PasswordCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PasswordCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PasswordClient) ById(id string) (*Password, error) { - resp := &Password{} - err := c.rancherClient.doById(PASSWORD_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PasswordClient) Delete(container *Password) error { - return c.rancherClient.doResourceDelete(PASSWORD_TYPE, &container.Resource) -} - -func (c *PasswordClient) ActionActivate(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionChangesecret(resource *Password, input *ChangeSecretInput) (*ChangeSecretInput, error) { - - resp := &ChangeSecretInput{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "changesecret", &resource.Resource, input, resp) - - return resp, err -} - -func (c *PasswordClient) ActionCreate(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionDeactivate(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionPurge(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionRemove(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PasswordClient) ActionUpdate(resource *Password) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(PASSWORD_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go b/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go deleted file mode 100644 index 30039c490..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_physical_host.go +++ /dev/null @@ -1,162 +0,0 @@ -package client - -const ( - PHYSICAL_HOST_TYPE = "physicalHost" -) - -type PhysicalHost struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PhysicalHostCollection struct { - Collection - Data []PhysicalHost `json:"data,omitempty"` - client *PhysicalHostClient -} - -type PhysicalHostClient struct { - rancherClient *RancherClient -} - -type PhysicalHostOperations interface { - List(opts *ListOpts) (*PhysicalHostCollection, error) - Create(opts *PhysicalHost) (*PhysicalHost, error) - Update(existing *PhysicalHost, updates interface{}) (*PhysicalHost, error) - ById(id string) (*PhysicalHost, error) - Delete(container *PhysicalHost) error - - ActionBootstrap(*PhysicalHost) (*PhysicalHost, error) - - ActionCreate(*PhysicalHost) (*PhysicalHost, error) - - ActionError(*PhysicalHost) (*PhysicalHost, error) - - ActionRemove(*PhysicalHost) (*PhysicalHost, error) - - ActionUpdate(*PhysicalHost) (*PhysicalHost, error) -} - -func newPhysicalHostClient(rancherClient *RancherClient) *PhysicalHostClient { - return &PhysicalHostClient{ - rancherClient: rancherClient, - } -} - -func (c *PhysicalHostClient) Create(container *PhysicalHost) (*PhysicalHost, error) { - resp := &PhysicalHost{} - err := c.rancherClient.doCreate(PHYSICAL_HOST_TYPE, container, resp) - return resp, err -} - -func (c *PhysicalHostClient) Update(existing *PhysicalHost, updates interface{}) (*PhysicalHost, error) { - resp := &PhysicalHost{} - err := c.rancherClient.doUpdate(PHYSICAL_HOST_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PhysicalHostClient) List(opts *ListOpts) (*PhysicalHostCollection, error) { - resp := &PhysicalHostCollection{} - err := c.rancherClient.doList(PHYSICAL_HOST_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PhysicalHostCollection) Next() (*PhysicalHostCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PhysicalHostCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PhysicalHostClient) ById(id string) (*PhysicalHost, error) { - resp := &PhysicalHost{} - err := c.rancherClient.doById(PHYSICAL_HOST_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PhysicalHostClient) Delete(container *PhysicalHost) error { - return c.rancherClient.doResourceDelete(PHYSICAL_HOST_TYPE, &container.Resource) -} - -func (c *PhysicalHostClient) ActionBootstrap(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "bootstrap", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PhysicalHostClient) ActionCreate(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PhysicalHostClient) ActionError(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PhysicalHostClient) ActionRemove(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PhysicalHostClient) ActionUpdate(resource *PhysicalHost) (*PhysicalHost, error) { - - resp := &PhysicalHost{} - - err := c.rancherClient.doAction(PHYSICAL_HOST_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_port.go b/vendor/github.com/rancher/go-rancher/v2/generated_port.go deleted file mode 100644 index 1d7a1a977..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_port.go +++ /dev/null @@ -1,183 +0,0 @@ -package client - -const ( - PORT_TYPE = "port" -) - -type Port struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BindAddress string `json:"bindAddress,omitempty" yaml:"bind_address,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PrivateIpAddressId string `json:"privateIpAddressId,omitempty" yaml:"private_ip_address_id,omitempty"` - - PrivatePort int64 `json:"privatePort,omitempty" yaml:"private_port,omitempty"` - - Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` - - PublicIpAddressId string `json:"publicIpAddressId,omitempty" yaml:"public_ip_address_id,omitempty"` - - PublicPort int64 `json:"publicPort,omitempty" yaml:"public_port,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PortCollection struct { - Collection - Data []Port `json:"data,omitempty"` - client *PortClient -} - -type PortClient struct { - rancherClient *RancherClient -} - -type PortOperations interface { - List(opts *ListOpts) (*PortCollection, error) - Create(opts *Port) (*Port, error) - Update(existing *Port, updates interface{}) (*Port, error) - ById(id string) (*Port, error) - Delete(container *Port) error - - ActionActivate(*Port) (*Port, error) - - ActionCreate(*Port) (*Port, error) - - ActionDeactivate(*Port) (*Port, error) - - ActionPurge(*Port) (*Port, error) - - ActionRemove(*Port) (*Port, error) - - ActionUpdate(*Port) (*Port, error) -} - -func newPortClient(rancherClient *RancherClient) *PortClient { - return &PortClient{ - rancherClient: rancherClient, - } -} - -func (c *PortClient) Create(container *Port) (*Port, error) { - resp := &Port{} - err := c.rancherClient.doCreate(PORT_TYPE, container, resp) - return resp, err -} - -func (c *PortClient) Update(existing *Port, updates interface{}) (*Port, error) { - resp := &Port{} - err := c.rancherClient.doUpdate(PORT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PortClient) List(opts *ListOpts) (*PortCollection, error) { - resp := &PortCollection{} - err := c.rancherClient.doList(PORT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PortCollection) Next() (*PortCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PortCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PortClient) ById(id string) (*Port, error) { - resp := &Port{} - err := c.rancherClient.doById(PORT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PortClient) Delete(container *Port) error { - return c.rancherClient.doResourceDelete(PORT_TYPE, &container.Resource) -} - -func (c *PortClient) ActionActivate(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionCreate(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionDeactivate(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionPurge(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionRemove(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PortClient) ActionUpdate(resource *Port) (*Port, error) { - - resp := &Port{} - - err := c.rancherClient.doAction(PORT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go deleted file mode 100644 index 0e03656da..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_port_rule.go +++ /dev/null @@ -1,95 +0,0 @@ -package client - -const ( - PORT_RULE_TYPE = "portRule" -) - -type PortRule struct { - Resource - - BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - - Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` - - Selector string `json:"selector,omitempty" yaml:"selector,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - SourcePort int64 `json:"sourcePort,omitempty" yaml:"source_port,omitempty"` - - TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` -} - -type PortRuleCollection struct { - Collection - Data []PortRule `json:"data,omitempty"` - client *PortRuleClient -} - -type PortRuleClient struct { - rancherClient *RancherClient -} - -type PortRuleOperations interface { - List(opts *ListOpts) (*PortRuleCollection, error) - Create(opts *PortRule) (*PortRule, error) - Update(existing *PortRule, updates interface{}) (*PortRule, error) - ById(id string) (*PortRule, error) - Delete(container *PortRule) error -} - -func newPortRuleClient(rancherClient *RancherClient) *PortRuleClient { - return &PortRuleClient{ - rancherClient: rancherClient, - } -} - -func (c *PortRuleClient) Create(container *PortRule) (*PortRule, error) { - resp := &PortRule{} - err := c.rancherClient.doCreate(PORT_RULE_TYPE, container, resp) - return resp, err -} - -func (c *PortRuleClient) Update(existing *PortRule, updates interface{}) (*PortRule, error) { - resp := &PortRule{} - err := c.rancherClient.doUpdate(PORT_RULE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PortRuleClient) List(opts *ListOpts) (*PortRuleCollection, error) { - resp := &PortRuleCollection{} - err := c.rancherClient.doList(PORT_RULE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PortRuleCollection) Next() (*PortRuleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PortRuleCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PortRuleClient) ById(id string) (*PortRule, error) { - resp := &PortRule{} - err := c.rancherClient.doById(PORT_RULE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PortRuleClient) Delete(container *PortRule) error { - return c.rancherClient.doResourceDelete(PORT_RULE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go deleted file mode 100644 index 9da63d81f..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_definition.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - PROCESS_DEFINITION_TYPE = "processDefinition" -) - -type ProcessDefinition struct { - Resource - - ExtensionBased bool `json:"extensionBased,omitempty" yaml:"extension_based,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PostProcessListeners interface{} `json:"postProcessListeners,omitempty" yaml:"post_process_listeners,omitempty"` - - PreProcessListeners interface{} `json:"preProcessListeners,omitempty" yaml:"pre_process_listeners,omitempty"` - - ProcessHandlers interface{} `json:"processHandlers,omitempty" yaml:"process_handlers,omitempty"` - - ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - - StateTransitions []StateTransition `json:"stateTransitions,omitempty" yaml:"state_transitions,omitempty"` -} - -type ProcessDefinitionCollection struct { - Collection - Data []ProcessDefinition `json:"data,omitempty"` - client *ProcessDefinitionClient -} - -type ProcessDefinitionClient struct { - rancherClient *RancherClient -} - -type ProcessDefinitionOperations interface { - List(opts *ListOpts) (*ProcessDefinitionCollection, error) - Create(opts *ProcessDefinition) (*ProcessDefinition, error) - Update(existing *ProcessDefinition, updates interface{}) (*ProcessDefinition, error) - ById(id string) (*ProcessDefinition, error) - Delete(container *ProcessDefinition) error -} - -func newProcessDefinitionClient(rancherClient *RancherClient) *ProcessDefinitionClient { - return &ProcessDefinitionClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessDefinitionClient) Create(container *ProcessDefinition) (*ProcessDefinition, error) { - resp := &ProcessDefinition{} - err := c.rancherClient.doCreate(PROCESS_DEFINITION_TYPE, container, resp) - return resp, err -} - -func (c *ProcessDefinitionClient) Update(existing *ProcessDefinition, updates interface{}) (*ProcessDefinition, error) { - resp := &ProcessDefinition{} - err := c.rancherClient.doUpdate(PROCESS_DEFINITION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessDefinitionClient) List(opts *ListOpts) (*ProcessDefinitionCollection, error) { - resp := &ProcessDefinitionCollection{} - err := c.rancherClient.doList(PROCESS_DEFINITION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessDefinitionCollection) Next() (*ProcessDefinitionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessDefinitionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessDefinitionClient) ById(id string) (*ProcessDefinition, error) { - resp := &ProcessDefinition{} - err := c.rancherClient.doById(PROCESS_DEFINITION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessDefinitionClient) Delete(container *ProcessDefinition) error { - return c.rancherClient.doResourceDelete(PROCESS_DEFINITION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go deleted file mode 100644 index 7356dce8d..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_execution.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - PROCESS_EXECUTION_TYPE = "processExecution" -) - -type ProcessExecution struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Log map[string]interface{} `json:"log,omitempty" yaml:"log,omitempty"` - - ProcessInstanceId string `json:"processInstanceId,omitempty" yaml:"process_instance_id,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProcessExecutionCollection struct { - Collection - Data []ProcessExecution `json:"data,omitempty"` - client *ProcessExecutionClient -} - -type ProcessExecutionClient struct { - rancherClient *RancherClient -} - -type ProcessExecutionOperations interface { - List(opts *ListOpts) (*ProcessExecutionCollection, error) - Create(opts *ProcessExecution) (*ProcessExecution, error) - Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) - ById(id string) (*ProcessExecution, error) - Delete(container *ProcessExecution) error -} - -func newProcessExecutionClient(rancherClient *RancherClient) *ProcessExecutionClient { - return &ProcessExecutionClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessExecutionClient) Create(container *ProcessExecution) (*ProcessExecution, error) { - resp := &ProcessExecution{} - err := c.rancherClient.doCreate(PROCESS_EXECUTION_TYPE, container, resp) - return resp, err -} - -func (c *ProcessExecutionClient) Update(existing *ProcessExecution, updates interface{}) (*ProcessExecution, error) { - resp := &ProcessExecution{} - err := c.rancherClient.doUpdate(PROCESS_EXECUTION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessExecutionClient) List(opts *ListOpts) (*ProcessExecutionCollection, error) { - resp := &ProcessExecutionCollection{} - err := c.rancherClient.doList(PROCESS_EXECUTION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessExecutionCollection) Next() (*ProcessExecutionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessExecutionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessExecutionClient) ById(id string) (*ProcessExecution, error) { - resp := &ProcessExecution{} - err := c.rancherClient.doById(PROCESS_EXECUTION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessExecutionClient) Delete(container *ProcessExecution) error { - return c.rancherClient.doResourceDelete(PROCESS_EXECUTION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go deleted file mode 100644 index deae1af97..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_instance.go +++ /dev/null @@ -1,118 +0,0 @@ -package client - -const ( - PROCESS_INSTANCE_TYPE = "processInstance" -) - -type ProcessInstance struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` - - ExecutionCount int64 `json:"executionCount,omitempty" yaml:"execution_count,omitempty"` - - ExitReason string `json:"exitReason,omitempty" yaml:"exit_reason,omitempty"` - - Phase string `json:"phase,omitempty" yaml:"phase,omitempty"` - - Priority int64 `json:"priority,omitempty" yaml:"priority,omitempty"` - - ProcessName string `json:"processName,omitempty" yaml:"process_name,omitempty"` - - ResourceId string `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` - - ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - - Result string `json:"result,omitempty" yaml:"result,omitempty"` - - RunAfter string `json:"runAfter,omitempty" yaml:"run_after,omitempty"` - - RunningProcessServerId string `json:"runningProcessServerId,omitempty" yaml:"running_process_server_id,omitempty"` - - StartProcessServerId string `json:"startProcessServerId,omitempty" yaml:"start_process_server_id,omitempty"` - - StartTime string `json:"startTime,omitempty" yaml:"start_time,omitempty"` -} - -type ProcessInstanceCollection struct { - Collection - Data []ProcessInstance `json:"data,omitempty"` - client *ProcessInstanceClient -} - -type ProcessInstanceClient struct { - rancherClient *RancherClient -} - -type ProcessInstanceOperations interface { - List(opts *ListOpts) (*ProcessInstanceCollection, error) - Create(opts *ProcessInstance) (*ProcessInstance, error) - Update(existing *ProcessInstance, updates interface{}) (*ProcessInstance, error) - ById(id string) (*ProcessInstance, error) - Delete(container *ProcessInstance) error - - ActionReplay(*ProcessInstance) (*ProcessInstance, error) -} - -func newProcessInstanceClient(rancherClient *RancherClient) *ProcessInstanceClient { - return &ProcessInstanceClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessInstanceClient) Create(container *ProcessInstance) (*ProcessInstance, error) { - resp := &ProcessInstance{} - err := c.rancherClient.doCreate(PROCESS_INSTANCE_TYPE, container, resp) - return resp, err -} - -func (c *ProcessInstanceClient) Update(existing *ProcessInstance, updates interface{}) (*ProcessInstance, error) { - resp := &ProcessInstance{} - err := c.rancherClient.doUpdate(PROCESS_INSTANCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessInstanceClient) List(opts *ListOpts) (*ProcessInstanceCollection, error) { - resp := &ProcessInstanceCollection{} - err := c.rancherClient.doList(PROCESS_INSTANCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessInstanceCollection) Next() (*ProcessInstanceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessInstanceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessInstanceClient) ById(id string) (*ProcessInstance, error) { - resp := &ProcessInstance{} - err := c.rancherClient.doById(PROCESS_INSTANCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessInstanceClient) Delete(container *ProcessInstance) error { - return c.rancherClient.doResourceDelete(PROCESS_INSTANCE_TYPE, &container.Resource) -} - -func (c *ProcessInstanceClient) ActionReplay(resource *ProcessInstance) (*ProcessInstance, error) { - - resp := &ProcessInstance{} - - err := c.rancherClient.doAction(PROCESS_INSTANCE_TYPE, "replay", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go deleted file mode 100644 index 1fbff0b0f..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_pool.go +++ /dev/null @@ -1,95 +0,0 @@ -package client - -const ( - PROCESS_POOL_TYPE = "processPool" -) - -type ProcessPool struct { - Resource - - ActiveTasks int64 `json:"activeTasks,omitempty" yaml:"active_tasks,omitempty"` - - CompletedTasks int64 `json:"completedTasks,omitempty" yaml:"completed_tasks,omitempty"` - - MaxPoolSize int64 `json:"maxPoolSize,omitempty" yaml:"max_pool_size,omitempty"` - - MinPoolSize int64 `json:"minPoolSize,omitempty" yaml:"min_pool_size,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PoolSize int64 `json:"poolSize,omitempty" yaml:"pool_size,omitempty"` - - QueueRemainingCapacity int64 `json:"queueRemainingCapacity,omitempty" yaml:"queue_remaining_capacity,omitempty"` - - QueueSize int64 `json:"queueSize,omitempty" yaml:"queue_size,omitempty"` - - RejectedTasks int64 `json:"rejectedTasks,omitempty" yaml:"rejected_tasks,omitempty"` -} - -type ProcessPoolCollection struct { - Collection - Data []ProcessPool `json:"data,omitempty"` - client *ProcessPoolClient -} - -type ProcessPoolClient struct { - rancherClient *RancherClient -} - -type ProcessPoolOperations interface { - List(opts *ListOpts) (*ProcessPoolCollection, error) - Create(opts *ProcessPool) (*ProcessPool, error) - Update(existing *ProcessPool, updates interface{}) (*ProcessPool, error) - ById(id string) (*ProcessPool, error) - Delete(container *ProcessPool) error -} - -func newProcessPoolClient(rancherClient *RancherClient) *ProcessPoolClient { - return &ProcessPoolClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessPoolClient) Create(container *ProcessPool) (*ProcessPool, error) { - resp := &ProcessPool{} - err := c.rancherClient.doCreate(PROCESS_POOL_TYPE, container, resp) - return resp, err -} - -func (c *ProcessPoolClient) Update(existing *ProcessPool, updates interface{}) (*ProcessPool, error) { - resp := &ProcessPool{} - err := c.rancherClient.doUpdate(PROCESS_POOL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessPoolClient) List(opts *ListOpts) (*ProcessPoolCollection, error) { - resp := &ProcessPoolCollection{} - err := c.rancherClient.doList(PROCESS_POOL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessPoolCollection) Next() (*ProcessPoolCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessPoolCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessPoolClient) ById(id string) (*ProcessPool, error) { - resp := &ProcessPool{} - err := c.rancherClient.doById(PROCESS_POOL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessPoolClient) Delete(container *ProcessPool) error { - return c.rancherClient.doResourceDelete(PROCESS_POOL_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go b/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go deleted file mode 100644 index aed14d743..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_process_summary.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - PROCESS_SUMMARY_TYPE = "processSummary" -) - -type ProcessSummary struct { - Resource - - Delay int64 `json:"delay,omitempty" yaml:"delay,omitempty"` - - ProcessName string `json:"processName,omitempty" yaml:"process_name,omitempty"` - - Ready int64 `json:"ready,omitempty" yaml:"ready,omitempty"` - - Running int64 `json:"running,omitempty" yaml:"running,omitempty"` -} - -type ProcessSummaryCollection struct { - Collection - Data []ProcessSummary `json:"data,omitempty"` - client *ProcessSummaryClient -} - -type ProcessSummaryClient struct { - rancherClient *RancherClient -} - -type ProcessSummaryOperations interface { - List(opts *ListOpts) (*ProcessSummaryCollection, error) - Create(opts *ProcessSummary) (*ProcessSummary, error) - Update(existing *ProcessSummary, updates interface{}) (*ProcessSummary, error) - ById(id string) (*ProcessSummary, error) - Delete(container *ProcessSummary) error -} - -func newProcessSummaryClient(rancherClient *RancherClient) *ProcessSummaryClient { - return &ProcessSummaryClient{ - rancherClient: rancherClient, - } -} - -func (c *ProcessSummaryClient) Create(container *ProcessSummary) (*ProcessSummary, error) { - resp := &ProcessSummary{} - err := c.rancherClient.doCreate(PROCESS_SUMMARY_TYPE, container, resp) - return resp, err -} - -func (c *ProcessSummaryClient) Update(existing *ProcessSummary, updates interface{}) (*ProcessSummary, error) { - resp := &ProcessSummary{} - err := c.rancherClient.doUpdate(PROCESS_SUMMARY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProcessSummaryClient) List(opts *ListOpts) (*ProcessSummaryCollection, error) { - resp := &ProcessSummaryCollection{} - err := c.rancherClient.doList(PROCESS_SUMMARY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProcessSummaryCollection) Next() (*ProcessSummaryCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProcessSummaryCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProcessSummaryClient) ById(id string) (*ProcessSummary, error) { - resp := &ProcessSummary{} - err := c.rancherClient.doById(PROCESS_SUMMARY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProcessSummaryClient) Delete(container *ProcessSummary) error { - return c.rancherClient.doResourceDelete(PROCESS_SUMMARY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project.go b/vendor/github.com/rancher/go-rancher/v2/generated_project.go deleted file mode 100644 index 8abc198e6..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_project.go +++ /dev/null @@ -1,211 +0,0 @@ -package client - -const ( - PROJECT_TYPE = "project" -) - -type Project struct { - Resource - - AllowSystemRole bool `json:"allowSystemRole,omitempty" yaml:"allow_system_role,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DefaultNetworkId string `json:"defaultNetworkId,omitempty" yaml:"default_network_id,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HostRemoveDelaySeconds int64 `json:"hostRemoveDelaySeconds,omitempty" yaml:"host_remove_delay_seconds,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Members []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Orchestration string `json:"orchestration,omitempty" yaml:"orchestration,omitempty"` - - ProjectLinks []string `json:"projectLinks,omitempty" yaml:"project_links,omitempty"` - - ProjectTemplateId string `json:"projectTemplateId,omitempty" yaml:"project_template_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServicesPortRange *ServicesPortRange `json:"servicesPortRange,omitempty" yaml:"services_port_range,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VirtualMachine bool `json:"virtualMachine,omitempty" yaml:"virtual_machine,omitempty"` -} - -type ProjectCollection struct { - Collection - Data []Project `json:"data,omitempty"` - client *ProjectClient -} - -type ProjectClient struct { - rancherClient *RancherClient -} - -type ProjectOperations interface { - List(opts *ListOpts) (*ProjectCollection, error) - Create(opts *Project) (*Project, error) - Update(existing *Project, updates interface{}) (*Project, error) - ById(id string) (*Project, error) - Delete(container *Project) error - - ActionActivate(*Project) (*Account, error) - - ActionCreate(*Project) (*Account, error) - - ActionDeactivate(*Project) (*Account, error) - - ActionPurge(*Project) (*Account, error) - - ActionRemove(*Project) (*Account, error) - - ActionSetmembers(*Project, *SetProjectMembersInput) (*SetProjectMembersInput, error) - - ActionUpdate(*Project) (*Account, error) - - ActionUpgrade(*Project) (*Account, error) -} - -func newProjectClient(rancherClient *RancherClient) *ProjectClient { - return &ProjectClient{ - rancherClient: rancherClient, - } -} - -func (c *ProjectClient) Create(container *Project) (*Project, error) { - resp := &Project{} - err := c.rancherClient.doCreate(PROJECT_TYPE, container, resp) - return resp, err -} - -func (c *ProjectClient) Update(existing *Project, updates interface{}) (*Project, error) { - resp := &Project{} - err := c.rancherClient.doUpdate(PROJECT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectClient) List(opts *ListOpts) (*ProjectCollection, error) { - resp := &ProjectCollection{} - err := c.rancherClient.doList(PROJECT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProjectCollection) Next() (*ProjectCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectClient) ById(id string) (*Project, error) { - resp := &Project{} - err := c.rancherClient.doById(PROJECT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProjectClient) Delete(container *Project) error { - return c.rancherClient.doResourceDelete(PROJECT_TYPE, &container.Resource) -} - -func (c *ProjectClient) ActionActivate(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionCreate(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionDeactivate(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionPurge(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionRemove(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionSetmembers(resource *Project, input *SetProjectMembersInput) (*SetProjectMembersInput, error) { - - resp := &SetProjectMembersInput{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "setmembers", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ProjectClient) ActionUpdate(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectClient) ActionUpgrade(resource *Project) (*Account, error) { - - resp := &Account{} - - err := c.rancherClient.doAction(PROJECT_TYPE, "upgrade", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go deleted file mode 100644 index 569c5a2ed..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_project_member.go +++ /dev/null @@ -1,175 +0,0 @@ -package client - -const ( - PROJECT_MEMBER_TYPE = "projectMember" -) - -type ProjectMember struct { - Resource - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExternalIdType string `json:"externalIdType,omitempty" yaml:"external_id_type,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - ProjectId string `json:"projectId,omitempty" yaml:"project_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Role string `json:"role,omitempty" yaml:"role,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectMemberCollection struct { - Collection - Data []ProjectMember `json:"data,omitempty"` - client *ProjectMemberClient -} - -type ProjectMemberClient struct { - rancherClient *RancherClient -} - -type ProjectMemberOperations interface { - List(opts *ListOpts) (*ProjectMemberCollection, error) - Create(opts *ProjectMember) (*ProjectMember, error) - Update(existing *ProjectMember, updates interface{}) (*ProjectMember, error) - ById(id string) (*ProjectMember, error) - Delete(container *ProjectMember) error - - ActionActivate(*ProjectMember) (*ProjectMember, error) - - ActionCreate(*ProjectMember) (*ProjectMember, error) - - ActionDeactivate(*ProjectMember) (*ProjectMember, error) - - ActionPurge(*ProjectMember) (*ProjectMember, error) - - ActionRemove(*ProjectMember) (*ProjectMember, error) - - ActionUpdate(*ProjectMember) (*ProjectMember, error) -} - -func newProjectMemberClient(rancherClient *RancherClient) *ProjectMemberClient { - return &ProjectMemberClient{ - rancherClient: rancherClient, - } -} - -func (c *ProjectMemberClient) Create(container *ProjectMember) (*ProjectMember, error) { - resp := &ProjectMember{} - err := c.rancherClient.doCreate(PROJECT_MEMBER_TYPE, container, resp) - return resp, err -} - -func (c *ProjectMemberClient) Update(existing *ProjectMember, updates interface{}) (*ProjectMember, error) { - resp := &ProjectMember{} - err := c.rancherClient.doUpdate(PROJECT_MEMBER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectMemberClient) List(opts *ListOpts) (*ProjectMemberCollection, error) { - resp := &ProjectMemberCollection{} - err := c.rancherClient.doList(PROJECT_MEMBER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProjectMemberCollection) Next() (*ProjectMemberCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectMemberCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectMemberClient) ById(id string) (*ProjectMember, error) { - resp := &ProjectMember{} - err := c.rancherClient.doById(PROJECT_MEMBER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProjectMemberClient) Delete(container *ProjectMember) error { - return c.rancherClient.doResourceDelete(PROJECT_MEMBER_TYPE, &container.Resource) -} - -func (c *ProjectMemberClient) ActionActivate(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionCreate(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionDeactivate(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionPurge(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionRemove(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectMemberClient) ActionUpdate(resource *ProjectMember) (*ProjectMember, error) { - - resp := &ProjectMember{} - - err := c.rancherClient.doAction(PROJECT_MEMBER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go deleted file mode 100644 index 9c2088300..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_project_template.go +++ /dev/null @@ -1,131 +0,0 @@ -package client - -const ( - PROJECT_TEMPLATE_TYPE = "projectTemplate" -) - -type ProjectTemplate struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - IsPublic bool `json:"isPublic,omitempty" yaml:"is_public,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Stacks []CatalogTemplate `json:"stacks,omitempty" yaml:"stacks,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ProjectTemplateCollection struct { - Collection - Data []ProjectTemplate `json:"data,omitempty"` - client *ProjectTemplateClient -} - -type ProjectTemplateClient struct { - rancherClient *RancherClient -} - -type ProjectTemplateOperations interface { - List(opts *ListOpts) (*ProjectTemplateCollection, error) - Create(opts *ProjectTemplate) (*ProjectTemplate, error) - Update(existing *ProjectTemplate, updates interface{}) (*ProjectTemplate, error) - ById(id string) (*ProjectTemplate, error) - Delete(container *ProjectTemplate) error - - ActionCreate(*ProjectTemplate) (*ProjectTemplate, error) - - ActionRemove(*ProjectTemplate) (*ProjectTemplate, error) -} - -func newProjectTemplateClient(rancherClient *RancherClient) *ProjectTemplateClient { - return &ProjectTemplateClient{ - rancherClient: rancherClient, - } -} - -func (c *ProjectTemplateClient) Create(container *ProjectTemplate) (*ProjectTemplate, error) { - resp := &ProjectTemplate{} - err := c.rancherClient.doCreate(PROJECT_TEMPLATE_TYPE, container, resp) - return resp, err -} - -func (c *ProjectTemplateClient) Update(existing *ProjectTemplate, updates interface{}) (*ProjectTemplate, error) { - resp := &ProjectTemplate{} - err := c.rancherClient.doUpdate(PROJECT_TEMPLATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectTemplateClient) List(opts *ListOpts) (*ProjectTemplateCollection, error) { - resp := &ProjectTemplateCollection{} - err := c.rancherClient.doList(PROJECT_TEMPLATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ProjectTemplateCollection) Next() (*ProjectTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectTemplateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectTemplateClient) ById(id string) (*ProjectTemplate, error) { - resp := &ProjectTemplate{} - err := c.rancherClient.doById(PROJECT_TEMPLATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ProjectTemplateClient) Delete(container *ProjectTemplate) error { - return c.rancherClient.doResourceDelete(PROJECT_TEMPLATE_TYPE, &container.Resource) -} - -func (c *ProjectTemplateClient) ActionCreate(resource *ProjectTemplate) (*ProjectTemplate, error) { - - resp := &ProjectTemplate{} - - err := c.rancherClient.doAction(PROJECT_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ProjectTemplateClient) ActionRemove(resource *ProjectTemplate) (*ProjectTemplate, error) { - - resp := &ProjectTemplate{} - - err := c.rancherClient.doAction(PROJECT_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go b/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go deleted file mode 100644 index 14898e492..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_public_endpoint.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - PUBLIC_ENDPOINT_TYPE = "publicEndpoint" -) - -type PublicEndpoint struct { - Resource - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - IpAddress string `json:"ipAddress,omitempty" yaml:"ip_address,omitempty"` - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` -} - -type PublicEndpointCollection struct { - Collection - Data []PublicEndpoint `json:"data,omitempty"` - client *PublicEndpointClient -} - -type PublicEndpointClient struct { - rancherClient *RancherClient -} - -type PublicEndpointOperations interface { - List(opts *ListOpts) (*PublicEndpointCollection, error) - Create(opts *PublicEndpoint) (*PublicEndpoint, error) - Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) - ById(id string) (*PublicEndpoint, error) - Delete(container *PublicEndpoint) error -} - -func newPublicEndpointClient(rancherClient *RancherClient) *PublicEndpointClient { - return &PublicEndpointClient{ - rancherClient: rancherClient, - } -} - -func (c *PublicEndpointClient) Create(container *PublicEndpoint) (*PublicEndpoint, error) { - resp := &PublicEndpoint{} - err := c.rancherClient.doCreate(PUBLIC_ENDPOINT_TYPE, container, resp) - return resp, err -} - -func (c *PublicEndpointClient) Update(existing *PublicEndpoint, updates interface{}) (*PublicEndpoint, error) { - resp := &PublicEndpoint{} - err := c.rancherClient.doUpdate(PUBLIC_ENDPOINT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PublicEndpointClient) List(opts *ListOpts) (*PublicEndpointCollection, error) { - resp := &PublicEndpointCollection{} - err := c.rancherClient.doList(PUBLIC_ENDPOINT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PublicEndpointCollection) Next() (*PublicEndpointCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PublicEndpointCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PublicEndpointClient) ById(id string) (*PublicEndpoint, error) { - resp := &PublicEndpoint{} - err := c.rancherClient.doById(PUBLIC_ENDPOINT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PublicEndpointClient) Delete(container *PublicEndpoint) error { - return c.rancherClient.doResourceDelete(PUBLIC_ENDPOINT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_publish.go b/vendor/github.com/rancher/go-rancher/v2/generated_publish.go deleted file mode 100644 index af7f7cd50..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_publish.go +++ /dev/null @@ -1,99 +0,0 @@ -package client - -const ( - PUBLISH_TYPE = "publish" -) - -type Publish struct { - Resource - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PreviousIds []string `json:"previousIds,omitempty" yaml:"previous_ids,omitempty"` - - Publisher string `json:"publisher,omitempty" yaml:"publisher,omitempty"` - - ResourceId string `json:"resourceId,omitempty" yaml:"resource_id,omitempty"` - - ResourceType string `json:"resourceType,omitempty" yaml:"resource_type,omitempty"` - - Time int64 `json:"time,omitempty" yaml:"time,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningInternalMessage string `json:"transitioningInternalMessage,omitempty" yaml:"transitioning_internal_message,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` -} - -type PublishCollection struct { - Collection - Data []Publish `json:"data,omitempty"` - client *PublishClient -} - -type PublishClient struct { - rancherClient *RancherClient -} - -type PublishOperations interface { - List(opts *ListOpts) (*PublishCollection, error) - Create(opts *Publish) (*Publish, error) - Update(existing *Publish, updates interface{}) (*Publish, error) - ById(id string) (*Publish, error) - Delete(container *Publish) error -} - -func newPublishClient(rancherClient *RancherClient) *PublishClient { - return &PublishClient{ - rancherClient: rancherClient, - } -} - -func (c *PublishClient) Create(container *Publish) (*Publish, error) { - resp := &Publish{} - err := c.rancherClient.doCreate(PUBLISH_TYPE, container, resp) - return resp, err -} - -func (c *PublishClient) Update(existing *Publish, updates interface{}) (*Publish, error) { - resp := &Publish{} - err := c.rancherClient.doUpdate(PUBLISH_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PublishClient) List(opts *ListOpts) (*PublishCollection, error) { - resp := &PublishCollection{} - err := c.rancherClient.doList(PUBLISH_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PublishCollection) Next() (*PublishCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PublishCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PublishClient) ById(id string) (*Publish, error) { - resp := &Publish{} - err := c.rancherClient.doById(PUBLISH_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PublishClient) Delete(container *Publish) error { - return c.rancherClient.doResourceDelete(PUBLISH_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go deleted file mode 100644 index 3958091c5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_pull_task.go +++ /dev/null @@ -1,133 +0,0 @@ -package client - -const ( - PULL_TASK_TYPE = "pullTask" -) - -type PullTask struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Status map[string]interface{} `json:"status,omitempty" yaml:"status,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type PullTaskCollection struct { - Collection - Data []PullTask `json:"data,omitempty"` - client *PullTaskClient -} - -type PullTaskClient struct { - rancherClient *RancherClient -} - -type PullTaskOperations interface { - List(opts *ListOpts) (*PullTaskCollection, error) - Create(opts *PullTask) (*PullTask, error) - Update(existing *PullTask, updates interface{}) (*PullTask, error) - ById(id string) (*PullTask, error) - Delete(container *PullTask) error - - ActionCreate(*PullTask) (*GenericObject, error) - - ActionRemove(*PullTask) (*GenericObject, error) -} - -func newPullTaskClient(rancherClient *RancherClient) *PullTaskClient { - return &PullTaskClient{ - rancherClient: rancherClient, - } -} - -func (c *PullTaskClient) Create(container *PullTask) (*PullTask, error) { - resp := &PullTask{} - err := c.rancherClient.doCreate(PULL_TASK_TYPE, container, resp) - return resp, err -} - -func (c *PullTaskClient) Update(existing *PullTask, updates interface{}) (*PullTask, error) { - resp := &PullTask{} - err := c.rancherClient.doUpdate(PULL_TASK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *PullTaskClient) List(opts *ListOpts) (*PullTaskCollection, error) { - resp := &PullTaskCollection{} - err := c.rancherClient.doList(PULL_TASK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *PullTaskCollection) Next() (*PullTaskCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &PullTaskCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *PullTaskClient) ById(id string) (*PullTask, error) { - resp := &PullTask{} - err := c.rancherClient.doById(PULL_TASK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *PullTaskClient) Delete(container *PullTask) error { - return c.rancherClient.doResourceDelete(PULL_TASK_TYPE, &container.Resource) -} - -func (c *PullTaskClient) ActionCreate(resource *PullTask) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(PULL_TASK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *PullTaskClient) ActionRemove(resource *PullTask) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(PULL_TASK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go deleted file mode 100644 index ad1e7189c..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_recreate_on_quorum_strategy_config.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE = "recreateOnQuorumStrategyConfig" -) - -type RecreateOnQuorumStrategyConfig struct { - Resource - - Quorum int64 `json:"quorum,omitempty" yaml:"quorum,omitempty"` -} - -type RecreateOnQuorumStrategyConfigCollection struct { - Collection - Data []RecreateOnQuorumStrategyConfig `json:"data,omitempty"` - client *RecreateOnQuorumStrategyConfigClient -} - -type RecreateOnQuorumStrategyConfigClient struct { - rancherClient *RancherClient -} - -type RecreateOnQuorumStrategyConfigOperations interface { - List(opts *ListOpts) (*RecreateOnQuorumStrategyConfigCollection, error) - Create(opts *RecreateOnQuorumStrategyConfig) (*RecreateOnQuorumStrategyConfig, error) - Update(existing *RecreateOnQuorumStrategyConfig, updates interface{}) (*RecreateOnQuorumStrategyConfig, error) - ById(id string) (*RecreateOnQuorumStrategyConfig, error) - Delete(container *RecreateOnQuorumStrategyConfig) error -} - -func newRecreateOnQuorumStrategyConfigClient(rancherClient *RancherClient) *RecreateOnQuorumStrategyConfigClient { - return &RecreateOnQuorumStrategyConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *RecreateOnQuorumStrategyConfigClient) Create(container *RecreateOnQuorumStrategyConfig) (*RecreateOnQuorumStrategyConfig, error) { - resp := &RecreateOnQuorumStrategyConfig{} - err := c.rancherClient.doCreate(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *RecreateOnQuorumStrategyConfigClient) Update(existing *RecreateOnQuorumStrategyConfig, updates interface{}) (*RecreateOnQuorumStrategyConfig, error) { - resp := &RecreateOnQuorumStrategyConfig{} - err := c.rancherClient.doUpdate(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RecreateOnQuorumStrategyConfigClient) List(opts *ListOpts) (*RecreateOnQuorumStrategyConfigCollection, error) { - resp := &RecreateOnQuorumStrategyConfigCollection{} - err := c.rancherClient.doList(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RecreateOnQuorumStrategyConfigCollection) Next() (*RecreateOnQuorumStrategyConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RecreateOnQuorumStrategyConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RecreateOnQuorumStrategyConfigClient) ById(id string) (*RecreateOnQuorumStrategyConfig, error) { - resp := &RecreateOnQuorumStrategyConfig{} - err := c.rancherClient.doById(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RecreateOnQuorumStrategyConfigClient) Delete(container *RecreateOnQuorumStrategyConfig) error { - return c.rancherClient.doResourceDelete(RECREATE_ON_QUORUM_STRATEGY_CONFIG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_register.go b/vendor/github.com/rancher/go-rancher/v2/generated_register.go deleted file mode 100644 index abbdd80af..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_register.go +++ /dev/null @@ -1,144 +0,0 @@ -package client - -const ( - REGISTER_TYPE = "register" -) - -type Register struct { - Resource - - AccessKey string `json:"accessKey,omitempty" yaml:"access_key,omitempty"` - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Key string `json:"key,omitempty" yaml:"key,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ResourceData map[string]interface{} `json:"resourceData,omitempty" yaml:"resource_data,omitempty"` - - SecretKey string `json:"secretKey,omitempty" yaml:"secret_key,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RegisterCollection struct { - Collection - Data []Register `json:"data,omitempty"` - client *RegisterClient -} - -type RegisterClient struct { - rancherClient *RancherClient -} - -type RegisterOperations interface { - List(opts *ListOpts) (*RegisterCollection, error) - Create(opts *Register) (*Register, error) - Update(existing *Register, updates interface{}) (*Register, error) - ById(id string) (*Register, error) - Delete(container *Register) error - - ActionCreate(*Register) (*GenericObject, error) - - ActionRemove(*Register) (*GenericObject, error) - - ActionStop(*Register, *InstanceStop) (*Instance, error) -} - -func newRegisterClient(rancherClient *RancherClient) *RegisterClient { - return &RegisterClient{ - rancherClient: rancherClient, - } -} - -func (c *RegisterClient) Create(container *Register) (*Register, error) { - resp := &Register{} - err := c.rancherClient.doCreate(REGISTER_TYPE, container, resp) - return resp, err -} - -func (c *RegisterClient) Update(existing *Register, updates interface{}) (*Register, error) { - resp := &Register{} - err := c.rancherClient.doUpdate(REGISTER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RegisterClient) List(opts *ListOpts) (*RegisterCollection, error) { - resp := &RegisterCollection{} - err := c.rancherClient.doList(REGISTER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RegisterCollection) Next() (*RegisterCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RegisterCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RegisterClient) ById(id string) (*Register, error) { - resp := &Register{} - err := c.rancherClient.doById(REGISTER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RegisterClient) Delete(container *Register) error { - return c.rancherClient.doResourceDelete(REGISTER_TYPE, &container.Resource) -} - -func (c *RegisterClient) ActionCreate(resource *Register) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(REGISTER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegisterClient) ActionRemove(resource *Register) (*GenericObject, error) { - - resp := &GenericObject{} - - err := c.rancherClient.doAction(REGISTER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegisterClient) ActionStop(resource *Register, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(REGISTER_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go b/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go deleted file mode 100644 index 1cbf178ac..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_registration_token.go +++ /dev/null @@ -1,177 +0,0 @@ -package client - -const ( - REGISTRATION_TOKEN_TYPE = "registrationToken" -) - -type RegistrationToken struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Command string `json:"command,omitempty" yaml:"command,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Image string `json:"image,omitempty" yaml:"image,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RegistrationUrl string `json:"registrationUrl,omitempty" yaml:"registration_url,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RegistrationTokenCollection struct { - Collection - Data []RegistrationToken `json:"data,omitempty"` - client *RegistrationTokenClient -} - -type RegistrationTokenClient struct { - rancherClient *RancherClient -} - -type RegistrationTokenOperations interface { - List(opts *ListOpts) (*RegistrationTokenCollection, error) - Create(opts *RegistrationToken) (*RegistrationToken, error) - Update(existing *RegistrationToken, updates interface{}) (*RegistrationToken, error) - ById(id string) (*RegistrationToken, error) - Delete(container *RegistrationToken) error - - ActionActivate(*RegistrationToken) (*Credential, error) - - ActionCreate(*RegistrationToken) (*Credential, error) - - ActionDeactivate(*RegistrationToken) (*Credential, error) - - ActionPurge(*RegistrationToken) (*Credential, error) - - ActionRemove(*RegistrationToken) (*Credential, error) - - ActionUpdate(*RegistrationToken) (*Credential, error) -} - -func newRegistrationTokenClient(rancherClient *RancherClient) *RegistrationTokenClient { - return &RegistrationTokenClient{ - rancherClient: rancherClient, - } -} - -func (c *RegistrationTokenClient) Create(container *RegistrationToken) (*RegistrationToken, error) { - resp := &RegistrationToken{} - err := c.rancherClient.doCreate(REGISTRATION_TOKEN_TYPE, container, resp) - return resp, err -} - -func (c *RegistrationTokenClient) Update(existing *RegistrationToken, updates interface{}) (*RegistrationToken, error) { - resp := &RegistrationToken{} - err := c.rancherClient.doUpdate(REGISTRATION_TOKEN_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RegistrationTokenClient) List(opts *ListOpts) (*RegistrationTokenCollection, error) { - resp := &RegistrationTokenCollection{} - err := c.rancherClient.doList(REGISTRATION_TOKEN_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RegistrationTokenCollection) Next() (*RegistrationTokenCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RegistrationTokenCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RegistrationTokenClient) ById(id string) (*RegistrationToken, error) { - resp := &RegistrationToken{} - err := c.rancherClient.doById(REGISTRATION_TOKEN_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RegistrationTokenClient) Delete(container *RegistrationToken) error { - return c.rancherClient.doResourceDelete(REGISTRATION_TOKEN_TYPE, &container.Resource) -} - -func (c *RegistrationTokenClient) ActionActivate(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionCreate(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionDeactivate(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionPurge(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionRemove(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistrationTokenClient) ActionUpdate(resource *RegistrationToken) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRATION_TOKEN_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registry.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry.go deleted file mode 100644 index 240478914..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_registry.go +++ /dev/null @@ -1,181 +0,0 @@ -package client - -const ( - REGISTRY_TYPE = "registry" -) - -type Registry struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DriverName string `json:"driverName,omitempty" yaml:"driver_name,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServerAddress string `json:"serverAddress,omitempty" yaml:"server_address,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` - - VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` -} - -type RegistryCollection struct { - Collection - Data []Registry `json:"data,omitempty"` - client *RegistryClient -} - -type RegistryClient struct { - rancherClient *RancherClient -} - -type RegistryOperations interface { - List(opts *ListOpts) (*RegistryCollection, error) - Create(opts *Registry) (*Registry, error) - Update(existing *Registry, updates interface{}) (*Registry, error) - ById(id string) (*Registry, error) - Delete(container *Registry) error - - ActionActivate(*Registry) (*StoragePool, error) - - ActionCreate(*Registry) (*StoragePool, error) - - ActionDeactivate(*Registry) (*StoragePool, error) - - ActionPurge(*Registry) (*StoragePool, error) - - ActionRemove(*Registry) (*StoragePool, error) - - ActionUpdate(*Registry) (*StoragePool, error) -} - -func newRegistryClient(rancherClient *RancherClient) *RegistryClient { - return &RegistryClient{ - rancherClient: rancherClient, - } -} - -func (c *RegistryClient) Create(container *Registry) (*Registry, error) { - resp := &Registry{} - err := c.rancherClient.doCreate(REGISTRY_TYPE, container, resp) - return resp, err -} - -func (c *RegistryClient) Update(existing *Registry, updates interface{}) (*Registry, error) { - resp := &Registry{} - err := c.rancherClient.doUpdate(REGISTRY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RegistryClient) List(opts *ListOpts) (*RegistryCollection, error) { - resp := &RegistryCollection{} - err := c.rancherClient.doList(REGISTRY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RegistryCollection) Next() (*RegistryCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RegistryCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RegistryClient) ById(id string) (*Registry, error) { - resp := &Registry{} - err := c.rancherClient.doById(REGISTRY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RegistryClient) Delete(container *Registry) error { - return c.rancherClient.doResourceDelete(REGISTRY_TYPE, &container.Resource) -} - -func (c *RegistryClient) ActionActivate(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionCreate(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionDeactivate(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionPurge(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionRemove(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryClient) ActionUpdate(resource *Registry) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(REGISTRY_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go b/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go deleted file mode 100644 index 381fcd729..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_registry_credential.go +++ /dev/null @@ -1,175 +0,0 @@ -package client - -const ( - REGISTRY_CREDENTIAL_TYPE = "registryCredential" -) - -type RegistryCredential struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicValue string `json:"publicValue,omitempty" yaml:"public_value,omitempty"` - - RegistryId string `json:"registryId,omitempty" yaml:"registry_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SecretValue string `json:"secretValue,omitempty" yaml:"secret_value,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type RegistryCredentialCollection struct { - Collection - Data []RegistryCredential `json:"data,omitempty"` - client *RegistryCredentialClient -} - -type RegistryCredentialClient struct { - rancherClient *RancherClient -} - -type RegistryCredentialOperations interface { - List(opts *ListOpts) (*RegistryCredentialCollection, error) - Create(opts *RegistryCredential) (*RegistryCredential, error) - Update(existing *RegistryCredential, updates interface{}) (*RegistryCredential, error) - ById(id string) (*RegistryCredential, error) - Delete(container *RegistryCredential) error - - ActionActivate(*RegistryCredential) (*Credential, error) - - ActionCreate(*RegistryCredential) (*Credential, error) - - ActionDeactivate(*RegistryCredential) (*Credential, error) - - ActionPurge(*RegistryCredential) (*Credential, error) - - ActionRemove(*RegistryCredential) (*Credential, error) - - ActionUpdate(*RegistryCredential) (*Credential, error) -} - -func newRegistryCredentialClient(rancherClient *RancherClient) *RegistryCredentialClient { - return &RegistryCredentialClient{ - rancherClient: rancherClient, - } -} - -func (c *RegistryCredentialClient) Create(container *RegistryCredential) (*RegistryCredential, error) { - resp := &RegistryCredential{} - err := c.rancherClient.doCreate(REGISTRY_CREDENTIAL_TYPE, container, resp) - return resp, err -} - -func (c *RegistryCredentialClient) Update(existing *RegistryCredential, updates interface{}) (*RegistryCredential, error) { - resp := &RegistryCredential{} - err := c.rancherClient.doUpdate(REGISTRY_CREDENTIAL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RegistryCredentialClient) List(opts *ListOpts) (*RegistryCredentialCollection, error) { - resp := &RegistryCredentialCollection{} - err := c.rancherClient.doList(REGISTRY_CREDENTIAL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RegistryCredentialCollection) Next() (*RegistryCredentialCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RegistryCredentialCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RegistryCredentialClient) ById(id string) (*RegistryCredential, error) { - resp := &RegistryCredential{} - err := c.rancherClient.doById(REGISTRY_CREDENTIAL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RegistryCredentialClient) Delete(container *RegistryCredential) error { - return c.rancherClient.doResourceDelete(REGISTRY_CREDENTIAL_TYPE, &container.Resource) -} - -func (c *RegistryCredentialClient) ActionActivate(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionCreate(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionDeactivate(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionPurge(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionRemove(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *RegistryCredentialClient) ActionUpdate(resource *RegistryCredential) (*Credential, error) { - - resp := &Credential{} - - err := c.rancherClient.doAction(REGISTRY_CREDENTIAL_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go b/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go deleted file mode 100644 index bc65daab2..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_resource_definition.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - RESOURCE_DEFINITION_TYPE = "resourceDefinition" -) - -type ResourceDefinition struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type ResourceDefinitionCollection struct { - Collection - Data []ResourceDefinition `json:"data,omitempty"` - client *ResourceDefinitionClient -} - -type ResourceDefinitionClient struct { - rancherClient *RancherClient -} - -type ResourceDefinitionOperations interface { - List(opts *ListOpts) (*ResourceDefinitionCollection, error) - Create(opts *ResourceDefinition) (*ResourceDefinition, error) - Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) - ById(id string) (*ResourceDefinition, error) - Delete(container *ResourceDefinition) error -} - -func newResourceDefinitionClient(rancherClient *RancherClient) *ResourceDefinitionClient { - return &ResourceDefinitionClient{ - rancherClient: rancherClient, - } -} - -func (c *ResourceDefinitionClient) Create(container *ResourceDefinition) (*ResourceDefinition, error) { - resp := &ResourceDefinition{} - err := c.rancherClient.doCreate(RESOURCE_DEFINITION_TYPE, container, resp) - return resp, err -} - -func (c *ResourceDefinitionClient) Update(existing *ResourceDefinition, updates interface{}) (*ResourceDefinition, error) { - resp := &ResourceDefinition{} - err := c.rancherClient.doUpdate(RESOURCE_DEFINITION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ResourceDefinitionClient) List(opts *ListOpts) (*ResourceDefinitionCollection, error) { - resp := &ResourceDefinitionCollection{} - err := c.rancherClient.doList(RESOURCE_DEFINITION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ResourceDefinitionCollection) Next() (*ResourceDefinitionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ResourceDefinitionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ResourceDefinitionClient) ById(id string) (*ResourceDefinition, error) { - resp := &ResourceDefinition{} - err := c.rancherClient.doById(RESOURCE_DEFINITION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ResourceDefinitionClient) Delete(container *ResourceDefinition) error { - return c.rancherClient.doResourceDelete(RESOURCE_DEFINITION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go deleted file mode 100644 index 23c4d81fa..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_restart_policy.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - RESTART_POLICY_TYPE = "restartPolicy" -) - -type RestartPolicy struct { - Resource - - MaximumRetryCount int64 `json:"maximumRetryCount,omitempty" yaml:"maximum_retry_count,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type RestartPolicyCollection struct { - Collection - Data []RestartPolicy `json:"data,omitempty"` - client *RestartPolicyClient -} - -type RestartPolicyClient struct { - rancherClient *RancherClient -} - -type RestartPolicyOperations interface { - List(opts *ListOpts) (*RestartPolicyCollection, error) - Create(opts *RestartPolicy) (*RestartPolicy, error) - Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) - ById(id string) (*RestartPolicy, error) - Delete(container *RestartPolicy) error -} - -func newRestartPolicyClient(rancherClient *RancherClient) *RestartPolicyClient { - return &RestartPolicyClient{ - rancherClient: rancherClient, - } -} - -func (c *RestartPolicyClient) Create(container *RestartPolicy) (*RestartPolicy, error) { - resp := &RestartPolicy{} - err := c.rancherClient.doCreate(RESTART_POLICY_TYPE, container, resp) - return resp, err -} - -func (c *RestartPolicyClient) Update(existing *RestartPolicy, updates interface{}) (*RestartPolicy, error) { - resp := &RestartPolicy{} - err := c.rancherClient.doUpdate(RESTART_POLICY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RestartPolicyClient) List(opts *ListOpts) (*RestartPolicyCollection, error) { - resp := &RestartPolicyCollection{} - err := c.rancherClient.doList(RESTART_POLICY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RestartPolicyCollection) Next() (*RestartPolicyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RestartPolicyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RestartPolicyClient) ById(id string) (*RestartPolicy, error) { - resp := &RestartPolicy{} - err := c.rancherClient.doById(RESTART_POLICY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RestartPolicyClient) Delete(container *RestartPolicy) error { - return c.rancherClient.doResourceDelete(RESTART_POLICY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go deleted file mode 100644 index f4178081a..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_restore_from_backup_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - RESTORE_FROM_BACKUP_INPUT_TYPE = "restoreFromBackupInput" -) - -type RestoreFromBackupInput struct { - Resource - - BackupId string `json:"backupId,omitempty" yaml:"backup_id,omitempty"` -} - -type RestoreFromBackupInputCollection struct { - Collection - Data []RestoreFromBackupInput `json:"data,omitempty"` - client *RestoreFromBackupInputClient -} - -type RestoreFromBackupInputClient struct { - rancherClient *RancherClient -} - -type RestoreFromBackupInputOperations interface { - List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) - Create(opts *RestoreFromBackupInput) (*RestoreFromBackupInput, error) - Update(existing *RestoreFromBackupInput, updates interface{}) (*RestoreFromBackupInput, error) - ById(id string) (*RestoreFromBackupInput, error) - Delete(container *RestoreFromBackupInput) error -} - -func newRestoreFromBackupInputClient(rancherClient *RancherClient) *RestoreFromBackupInputClient { - return &RestoreFromBackupInputClient{ - rancherClient: rancherClient, - } -} - -func (c *RestoreFromBackupInputClient) Create(container *RestoreFromBackupInput) (*RestoreFromBackupInput, error) { - resp := &RestoreFromBackupInput{} - err := c.rancherClient.doCreate(RESTORE_FROM_BACKUP_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *RestoreFromBackupInputClient) Update(existing *RestoreFromBackupInput, updates interface{}) (*RestoreFromBackupInput, error) { - resp := &RestoreFromBackupInput{} - err := c.rancherClient.doUpdate(RESTORE_FROM_BACKUP_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RestoreFromBackupInputClient) List(opts *ListOpts) (*RestoreFromBackupInputCollection, error) { - resp := &RestoreFromBackupInputCollection{} - err := c.rancherClient.doList(RESTORE_FROM_BACKUP_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RestoreFromBackupInputCollection) Next() (*RestoreFromBackupInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RestoreFromBackupInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RestoreFromBackupInputClient) ById(id string) (*RestoreFromBackupInput, error) { - resp := &RestoreFromBackupInput{} - err := c.rancherClient.doById(RESTORE_FROM_BACKUP_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RestoreFromBackupInputClient) Delete(container *RestoreFromBackupInput) error { - return c.rancherClient.doResourceDelete(RESTORE_FROM_BACKUP_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go deleted file mode 100644 index 0612f8182..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_revert_to_snapshot_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - REVERT_TO_SNAPSHOT_INPUT_TYPE = "revertToSnapshotInput" -) - -type RevertToSnapshotInput struct { - Resource - - SnapshotId string `json:"snapshotId,omitempty" yaml:"snapshot_id,omitempty"` -} - -type RevertToSnapshotInputCollection struct { - Collection - Data []RevertToSnapshotInput `json:"data,omitempty"` - client *RevertToSnapshotInputClient -} - -type RevertToSnapshotInputClient struct { - rancherClient *RancherClient -} - -type RevertToSnapshotInputOperations interface { - List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) - Create(opts *RevertToSnapshotInput) (*RevertToSnapshotInput, error) - Update(existing *RevertToSnapshotInput, updates interface{}) (*RevertToSnapshotInput, error) - ById(id string) (*RevertToSnapshotInput, error) - Delete(container *RevertToSnapshotInput) error -} - -func newRevertToSnapshotInputClient(rancherClient *RancherClient) *RevertToSnapshotInputClient { - return &RevertToSnapshotInputClient{ - rancherClient: rancherClient, - } -} - -func (c *RevertToSnapshotInputClient) Create(container *RevertToSnapshotInput) (*RevertToSnapshotInput, error) { - resp := &RevertToSnapshotInput{} - err := c.rancherClient.doCreate(REVERT_TO_SNAPSHOT_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *RevertToSnapshotInputClient) Update(existing *RevertToSnapshotInput, updates interface{}) (*RevertToSnapshotInput, error) { - resp := &RevertToSnapshotInput{} - err := c.rancherClient.doUpdate(REVERT_TO_SNAPSHOT_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RevertToSnapshotInputClient) List(opts *ListOpts) (*RevertToSnapshotInputCollection, error) { - resp := &RevertToSnapshotInputCollection{} - err := c.rancherClient.doList(REVERT_TO_SNAPSHOT_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RevertToSnapshotInputCollection) Next() (*RevertToSnapshotInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RevertToSnapshotInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RevertToSnapshotInputClient) ById(id string) (*RevertToSnapshotInput, error) { - resp := &RevertToSnapshotInput{} - err := c.rancherClient.doById(REVERT_TO_SNAPSHOT_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RevertToSnapshotInputClient) Delete(container *RevertToSnapshotInput) error { - return c.rancherClient.doResourceDelete(REVERT_TO_SNAPSHOT_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go deleted file mode 100644 index f2384cdec..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_rolling_restart_strategy.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - ROLLING_RESTART_STRATEGY_TYPE = "rollingRestartStrategy" -) - -type RollingRestartStrategy struct { - Resource - - BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` - - IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` -} - -type RollingRestartStrategyCollection struct { - Collection - Data []RollingRestartStrategy `json:"data,omitempty"` - client *RollingRestartStrategyClient -} - -type RollingRestartStrategyClient struct { - rancherClient *RancherClient -} - -type RollingRestartStrategyOperations interface { - List(opts *ListOpts) (*RollingRestartStrategyCollection, error) - Create(opts *RollingRestartStrategy) (*RollingRestartStrategy, error) - Update(existing *RollingRestartStrategy, updates interface{}) (*RollingRestartStrategy, error) - ById(id string) (*RollingRestartStrategy, error) - Delete(container *RollingRestartStrategy) error -} - -func newRollingRestartStrategyClient(rancherClient *RancherClient) *RollingRestartStrategyClient { - return &RollingRestartStrategyClient{ - rancherClient: rancherClient, - } -} - -func (c *RollingRestartStrategyClient) Create(container *RollingRestartStrategy) (*RollingRestartStrategy, error) { - resp := &RollingRestartStrategy{} - err := c.rancherClient.doCreate(ROLLING_RESTART_STRATEGY_TYPE, container, resp) - return resp, err -} - -func (c *RollingRestartStrategyClient) Update(existing *RollingRestartStrategy, updates interface{}) (*RollingRestartStrategy, error) { - resp := &RollingRestartStrategy{} - err := c.rancherClient.doUpdate(ROLLING_RESTART_STRATEGY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *RollingRestartStrategyClient) List(opts *ListOpts) (*RollingRestartStrategyCollection, error) { - resp := &RollingRestartStrategyCollection{} - err := c.rancherClient.doList(ROLLING_RESTART_STRATEGY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *RollingRestartStrategyCollection) Next() (*RollingRestartStrategyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &RollingRestartStrategyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *RollingRestartStrategyClient) ById(id string) (*RollingRestartStrategy, error) { - resp := &RollingRestartStrategy{} - err := c.rancherClient.doById(ROLLING_RESTART_STRATEGY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *RollingRestartStrategyClient) Delete(container *RollingRestartStrategy) error { - return c.rancherClient.doResourceDelete(ROLLING_RESTART_STRATEGY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go b/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go deleted file mode 100644 index eb0ac83a5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_scale_policy.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - SCALE_POLICY_TYPE = "scalePolicy" -) - -type ScalePolicy struct { - Resource - - Increment int64 `json:"increment,omitempty" yaml:"increment,omitempty"` - - Max int64 `json:"max,omitempty" yaml:"max,omitempty"` - - Min int64 `json:"min,omitempty" yaml:"min,omitempty"` -} - -type ScalePolicyCollection struct { - Collection - Data []ScalePolicy `json:"data,omitempty"` - client *ScalePolicyClient -} - -type ScalePolicyClient struct { - rancherClient *RancherClient -} - -type ScalePolicyOperations interface { - List(opts *ListOpts) (*ScalePolicyCollection, error) - Create(opts *ScalePolicy) (*ScalePolicy, error) - Update(existing *ScalePolicy, updates interface{}) (*ScalePolicy, error) - ById(id string) (*ScalePolicy, error) - Delete(container *ScalePolicy) error -} - -func newScalePolicyClient(rancherClient *RancherClient) *ScalePolicyClient { - return &ScalePolicyClient{ - rancherClient: rancherClient, - } -} - -func (c *ScalePolicyClient) Create(container *ScalePolicy) (*ScalePolicy, error) { - resp := &ScalePolicy{} - err := c.rancherClient.doCreate(SCALE_POLICY_TYPE, container, resp) - return resp, err -} - -func (c *ScalePolicyClient) Update(existing *ScalePolicy, updates interface{}) (*ScalePolicy, error) { - resp := &ScalePolicy{} - err := c.rancherClient.doUpdate(SCALE_POLICY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ScalePolicyClient) List(opts *ListOpts) (*ScalePolicyCollection, error) { - resp := &ScalePolicyCollection{} - err := c.rancherClient.doList(SCALE_POLICY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ScalePolicyCollection) Next() (*ScalePolicyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ScalePolicyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ScalePolicyClient) ById(id string) (*ScalePolicy, error) { - resp := &ScalePolicy{} - err := c.rancherClient.doById(SCALE_POLICY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ScalePolicyClient) Delete(container *ScalePolicy) error { - return c.rancherClient.doResourceDelete(SCALE_POLICY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go deleted file mode 100644 index bfe0dfdd9..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_scheduled_upgrade.go +++ /dev/null @@ -1,136 +0,0 @@ -package client - -const ( - SCHEDULED_UPGRADE_TYPE = "scheduledUpgrade" -) - -type ScheduledUpgrade struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - Started string `json:"started,omitempty" yaml:"started,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ScheduledUpgradeCollection struct { - Collection - Data []ScheduledUpgrade `json:"data,omitempty"` - client *ScheduledUpgradeClient -} - -type ScheduledUpgradeClient struct { - rancherClient *RancherClient -} - -type ScheduledUpgradeOperations interface { - List(opts *ListOpts) (*ScheduledUpgradeCollection, error) - Create(opts *ScheduledUpgrade) (*ScheduledUpgrade, error) - Update(existing *ScheduledUpgrade, updates interface{}) (*ScheduledUpgrade, error) - ById(id string) (*ScheduledUpgrade, error) - Delete(container *ScheduledUpgrade) error - - ActionCreate(*ScheduledUpgrade) (*ScheduledUpgrade, error) - - ActionRemove(*ScheduledUpgrade) (*ScheduledUpgrade, error) - - ActionStart(*ScheduledUpgrade) (*ScheduledUpgrade, error) -} - -func newScheduledUpgradeClient(rancherClient *RancherClient) *ScheduledUpgradeClient { - return &ScheduledUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *ScheduledUpgradeClient) Create(container *ScheduledUpgrade) (*ScheduledUpgrade, error) { - resp := &ScheduledUpgrade{} - err := c.rancherClient.doCreate(SCHEDULED_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *ScheduledUpgradeClient) Update(existing *ScheduledUpgrade, updates interface{}) (*ScheduledUpgrade, error) { - resp := &ScheduledUpgrade{} - err := c.rancherClient.doUpdate(SCHEDULED_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ScheduledUpgradeClient) List(opts *ListOpts) (*ScheduledUpgradeCollection, error) { - resp := &ScheduledUpgradeCollection{} - err := c.rancherClient.doList(SCHEDULED_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ScheduledUpgradeCollection) Next() (*ScheduledUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ScheduledUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ScheduledUpgradeClient) ById(id string) (*ScheduledUpgrade, error) { - resp := &ScheduledUpgrade{} - err := c.rancherClient.doById(SCHEDULED_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ScheduledUpgradeClient) Delete(container *ScheduledUpgrade) error { - return c.rancherClient.doResourceDelete(SCHEDULED_UPGRADE_TYPE, &container.Resource) -} - -func (c *ScheduledUpgradeClient) ActionCreate(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { - - resp := &ScheduledUpgrade{} - - err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ScheduledUpgradeClient) ActionRemove(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { - - resp := &ScheduledUpgrade{} - - err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ScheduledUpgradeClient) ActionStart(resource *ScheduledUpgrade) (*ScheduledUpgrade, error) { - - resp := &ScheduledUpgrade{} - - err := c.rancherClient.doAction(SCHEDULED_UPGRADE_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go b/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go deleted file mode 100644 index b5653fa61..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_secondary_launch_config.go +++ /dev/null @@ -1,520 +0,0 @@ -package client - -const ( - SECONDARY_LAUNCH_CONFIG_TYPE = "secondaryLaunchConfig" -) - -type SecondaryLaunchConfig struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` - - BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` - - BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` - - Build *DockerBuild `json:"build,omitempty" yaml:"build,omitempty"` - - CapAdd []string `json:"capAdd,omitempty" yaml:"cap_add,omitempty"` - - CapDrop []string `json:"capDrop,omitempty" yaml:"cap_drop,omitempty"` - - CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` - - CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` - - CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` - - CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` - - CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` - - CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` - - CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` - - CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` - - CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DataVolumeMounts map[string]interface{} `json:"dataVolumeMounts,omitempty" yaml:"data_volume_mounts,omitempty"` - - DataVolumes []string `json:"dataVolumes,omitempty" yaml:"data_volumes,omitempty"` - - DataVolumesFrom []string `json:"dataVolumesFrom,omitempty" yaml:"data_volumes_from,omitempty"` - - DataVolumesFromLaunchConfigs []string `json:"dataVolumesFromLaunchConfigs,omitempty" yaml:"data_volumes_from_launch_configs,omitempty"` - - DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Devices []string `json:"devices,omitempty" yaml:"devices,omitempty"` - - DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` - - Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - DrainTimeoutMs int64 `json:"drainTimeoutMs,omitempty" yaml:"drain_timeout_ms,omitempty"` - - EntryPoint []string `json:"entryPoint,omitempty" yaml:"entry_point,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` - - FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` - - GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` - - HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` - - HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` - - InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` - - InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` - - IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` - - IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` - - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - - Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` - - IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` - - Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` - - KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` - - LxcConf map[string]interface{} `json:"lxcConf,omitempty" yaml:"lxc_conf,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` - - MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` - - MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` - - MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` - - MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` - - NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` - - NetworkContainerId string `json:"networkContainerId,omitempty" yaml:"network_container_id,omitempty"` - - NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` - - NetworkLaunchConfig string `json:"networkLaunchConfig,omitempty" yaml:"network_launch_config,omitempty"` - - NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` - - OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` - - OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` - - PidMode string `json:"pidMode,omitempty" yaml:"pid_mode,omitempty"` - - PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` - - PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` - - Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` - - PublishAllPorts bool `json:"publishAllPorts,omitempty" yaml:"publish_all_ports,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty" yaml:"read_only,omitempty"` - - RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` - - RequestedIpAddress string `json:"requestedIpAddress,omitempty" yaml:"requested_ip_address,omitempty"` - - RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` - - Secrets []SecretReference `json:"secrets,omitempty" yaml:"secrets,omitempty"` - - SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StdinOpen bool `json:"stdinOpen,omitempty" yaml:"stdin_open,omitempty"` - - StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` - - StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` - - StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` - - Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Tty bool `json:"tty,omitempty" yaml:"tty,omitempty"` - - Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` - - User string `json:"user,omitempty" yaml:"user,omitempty"` - - UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - - UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` - - Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` - - WorkingDir string `json:"workingDir,omitempty" yaml:"working_dir,omitempty"` -} - -type SecondaryLaunchConfigCollection struct { - Collection - Data []SecondaryLaunchConfig `json:"data,omitempty"` - client *SecondaryLaunchConfigClient -} - -type SecondaryLaunchConfigClient struct { - rancherClient *RancherClient -} - -type SecondaryLaunchConfigOperations interface { - List(opts *ListOpts) (*SecondaryLaunchConfigCollection, error) - Create(opts *SecondaryLaunchConfig) (*SecondaryLaunchConfig, error) - Update(existing *SecondaryLaunchConfig, updates interface{}) (*SecondaryLaunchConfig, error) - ById(id string) (*SecondaryLaunchConfig, error) - Delete(container *SecondaryLaunchConfig) error - - ActionAllocate(*SecondaryLaunchConfig) (*Instance, error) - - ActionConsole(*SecondaryLaunchConfig, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*SecondaryLaunchConfig) (*Instance, error) - - ActionDeallocate(*SecondaryLaunchConfig) (*Instance, error) - - ActionError(*SecondaryLaunchConfig) (*Instance, error) - - ActionExecute(*SecondaryLaunchConfig, *ContainerExec) (*HostAccess, error) - - ActionMigrate(*SecondaryLaunchConfig) (*Instance, error) - - ActionProxy(*SecondaryLaunchConfig, *ContainerProxy) (*HostAccess, error) - - ActionPurge(*SecondaryLaunchConfig) (*Instance, error) - - ActionRemove(*SecondaryLaunchConfig) (*Instance, error) - - ActionRestart(*SecondaryLaunchConfig) (*Instance, error) - - ActionStart(*SecondaryLaunchConfig) (*Instance, error) - - ActionStop(*SecondaryLaunchConfig, *InstanceStop) (*Instance, error) - - ActionUpdate(*SecondaryLaunchConfig) (*Instance, error) - - ActionUpdatehealthy(*SecondaryLaunchConfig) (*Instance, error) - - ActionUpdatereinitializing(*SecondaryLaunchConfig) (*Instance, error) - - ActionUpdateunhealthy(*SecondaryLaunchConfig) (*Instance, error) -} - -func newSecondaryLaunchConfigClient(rancherClient *RancherClient) *SecondaryLaunchConfigClient { - return &SecondaryLaunchConfigClient{ - rancherClient: rancherClient, - } -} - -func (c *SecondaryLaunchConfigClient) Create(container *SecondaryLaunchConfig) (*SecondaryLaunchConfig, error) { - resp := &SecondaryLaunchConfig{} - err := c.rancherClient.doCreate(SECONDARY_LAUNCH_CONFIG_TYPE, container, resp) - return resp, err -} - -func (c *SecondaryLaunchConfigClient) Update(existing *SecondaryLaunchConfig, updates interface{}) (*SecondaryLaunchConfig, error) { - resp := &SecondaryLaunchConfig{} - err := c.rancherClient.doUpdate(SECONDARY_LAUNCH_CONFIG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SecondaryLaunchConfigClient) List(opts *ListOpts) (*SecondaryLaunchConfigCollection, error) { - resp := &SecondaryLaunchConfigCollection{} - err := c.rancherClient.doList(SECONDARY_LAUNCH_CONFIG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SecondaryLaunchConfigCollection) Next() (*SecondaryLaunchConfigCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SecondaryLaunchConfigCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SecondaryLaunchConfigClient) ById(id string) (*SecondaryLaunchConfig, error) { - resp := &SecondaryLaunchConfig{} - err := c.rancherClient.doById(SECONDARY_LAUNCH_CONFIG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SecondaryLaunchConfigClient) Delete(container *SecondaryLaunchConfig) error { - return c.rancherClient.doResourceDelete(SECONDARY_LAUNCH_CONFIG_TYPE, &container.Resource) -} - -func (c *SecondaryLaunchConfigClient) ActionAllocate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionConsole(resource *SecondaryLaunchConfig, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionCreate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionDeallocate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionError(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionExecute(resource *SecondaryLaunchConfig, input *ContainerExec) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "execute", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionMigrate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionProxy(resource *SecondaryLaunchConfig, input *ContainerProxy) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "proxy", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionPurge(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionRemove(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionRestart(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionStart(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionStop(resource *SecondaryLaunchConfig, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionUpdate(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionUpdatehealthy(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionUpdatereinitializing(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecondaryLaunchConfigClient) ActionUpdateunhealthy(resource *SecondaryLaunchConfig) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(SECONDARY_LAUNCH_CONFIG_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secret.go b/vendor/github.com/rancher/go-rancher/v2/generated_secret.go deleted file mode 100644 index 0ae5737d8..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_secret.go +++ /dev/null @@ -1,127 +0,0 @@ -package client - -const ( - SECRET_TYPE = "secret" -) - -type Secret struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type SecretCollection struct { - Collection - Data []Secret `json:"data,omitempty"` - client *SecretClient -} - -type SecretClient struct { - rancherClient *RancherClient -} - -type SecretOperations interface { - List(opts *ListOpts) (*SecretCollection, error) - Create(opts *Secret) (*Secret, error) - Update(existing *Secret, updates interface{}) (*Secret, error) - ById(id string) (*Secret, error) - Delete(container *Secret) error - - ActionCreate(*Secret) (*Secret, error) - - ActionRemove(*Secret) (*Secret, error) -} - -func newSecretClient(rancherClient *RancherClient) *SecretClient { - return &SecretClient{ - rancherClient: rancherClient, - } -} - -func (c *SecretClient) Create(container *Secret) (*Secret, error) { - resp := &Secret{} - err := c.rancherClient.doCreate(SECRET_TYPE, container, resp) - return resp, err -} - -func (c *SecretClient) Update(existing *Secret, updates interface{}) (*Secret, error) { - resp := &Secret{} - err := c.rancherClient.doUpdate(SECRET_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SecretClient) List(opts *ListOpts) (*SecretCollection, error) { - resp := &SecretCollection{} - err := c.rancherClient.doList(SECRET_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SecretCollection) Next() (*SecretCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SecretCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SecretClient) ById(id string) (*Secret, error) { - resp := &Secret{} - err := c.rancherClient.doById(SECRET_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SecretClient) Delete(container *Secret) error { - return c.rancherClient.doResourceDelete(SECRET_TYPE, &container.Resource) -} - -func (c *SecretClient) ActionCreate(resource *Secret) (*Secret, error) { - - resp := &Secret{} - - err := c.rancherClient.doAction(SECRET_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SecretClient) ActionRemove(resource *Secret) (*Secret, error) { - - resp := &Secret{} - - err := c.rancherClient.doAction(SECRET_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go b/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go deleted file mode 100644 index fb6915f2e..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_secret_reference.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - SECRET_REFERENCE_TYPE = "secretReference" -) - -type SecretReference struct { - Resource - - Gid string `json:"gid,omitempty" yaml:"gid,omitempty"` - - Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - SecretId string `json:"secretId,omitempty" yaml:"secret_id,omitempty"` - - Uid string `json:"uid,omitempty" yaml:"uid,omitempty"` -} - -type SecretReferenceCollection struct { - Collection - Data []SecretReference `json:"data,omitempty"` - client *SecretReferenceClient -} - -type SecretReferenceClient struct { - rancherClient *RancherClient -} - -type SecretReferenceOperations interface { - List(opts *ListOpts) (*SecretReferenceCollection, error) - Create(opts *SecretReference) (*SecretReference, error) - Update(existing *SecretReference, updates interface{}) (*SecretReference, error) - ById(id string) (*SecretReference, error) - Delete(container *SecretReference) error -} - -func newSecretReferenceClient(rancherClient *RancherClient) *SecretReferenceClient { - return &SecretReferenceClient{ - rancherClient: rancherClient, - } -} - -func (c *SecretReferenceClient) Create(container *SecretReference) (*SecretReference, error) { - resp := &SecretReference{} - err := c.rancherClient.doCreate(SECRET_REFERENCE_TYPE, container, resp) - return resp, err -} - -func (c *SecretReferenceClient) Update(existing *SecretReference, updates interface{}) (*SecretReference, error) { - resp := &SecretReference{} - err := c.rancherClient.doUpdate(SECRET_REFERENCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SecretReferenceClient) List(opts *ListOpts) (*SecretReferenceCollection, error) { - resp := &SecretReferenceCollection{} - err := c.rancherClient.doList(SECRET_REFERENCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SecretReferenceCollection) Next() (*SecretReferenceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SecretReferenceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SecretReferenceClient) ById(id string) (*SecretReference, error) { - resp := &SecretReference{} - err := c.rancherClient.doById(SECRET_REFERENCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SecretReferenceClient) Delete(container *SecretReference) error { - return c.rancherClient.doResourceDelete(SECRET_REFERENCE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_service.go deleted file mode 100644 index 4cfb48076..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service.go +++ /dev/null @@ -1,303 +0,0 @@ -package client - -const ( - SERVICE_TYPE = "service" -) - -type Service struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type ServiceCollection struct { - Collection - Data []Service `json:"data,omitempty"` - client *ServiceClient -} - -type ServiceClient struct { - rancherClient *RancherClient -} - -type ServiceOperations interface { - List(opts *ListOpts) (*ServiceCollection, error) - Create(opts *Service) (*Service, error) - Update(existing *Service, updates interface{}) (*Service, error) - ById(id string) (*Service, error) - Delete(container *Service) error - - ActionActivate(*Service) (*Service, error) - - ActionAddservicelink(*Service, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*Service) (*Service, error) - - ActionContinueupgrade(*Service) (*Service, error) - - ActionCreate(*Service) (*Service, error) - - ActionDeactivate(*Service) (*Service, error) - - ActionFinishupgrade(*Service) (*Service, error) - - ActionRemove(*Service) (*Service, error) - - ActionRemoveservicelink(*Service, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*Service, *ServiceRestart) (*Service, error) - - ActionRollback(*Service) (*Service, error) - - ActionSetservicelinks(*Service, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*Service) (*Service, error) - - ActionUpgrade(*Service, *ServiceUpgrade) (*Service, error) -} - -func newServiceClient(rancherClient *RancherClient) *ServiceClient { - return &ServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceClient) Create(container *Service) (*Service, error) { - resp := &Service{} - err := c.rancherClient.doCreate(SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *ServiceClient) Update(existing *Service, updates interface{}) (*Service, error) { - resp := &Service{} - err := c.rancherClient.doUpdate(SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceClient) List(opts *ListOpts) (*ServiceCollection, error) { - resp := &ServiceCollection{} - err := c.rancherClient.doList(SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceCollection) Next() (*ServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceClient) ById(id string) (*Service, error) { - resp := &Service{} - err := c.rancherClient.doById(SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceClient) Delete(container *Service) error { - return c.rancherClient.doResourceDelete(SERVICE_TYPE, &container.Resource) -} - -func (c *ServiceClient) ActionActivate(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionAddservicelink(resource *Service, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ServiceClient) ActionCancelupgrade(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionContinueupgrade(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionCreate(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionDeactivate(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionFinishupgrade(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionRemove(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionRemoveservicelink(resource *Service, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ServiceClient) ActionRestart(resource *Service, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ServiceClient) ActionRollback(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionSetservicelinks(resource *Service, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *ServiceClient) ActionUpdate(resource *Service) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceClient) ActionUpgrade(resource *Service, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go deleted file mode 100644 index 362691742..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_binding.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SERVICE_BINDING_TYPE = "serviceBinding" -) - -type ServiceBinding struct { - Resource - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` -} - -type ServiceBindingCollection struct { - Collection - Data []ServiceBinding `json:"data,omitempty"` - client *ServiceBindingClient -} - -type ServiceBindingClient struct { - rancherClient *RancherClient -} - -type ServiceBindingOperations interface { - List(opts *ListOpts) (*ServiceBindingCollection, error) - Create(opts *ServiceBinding) (*ServiceBinding, error) - Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) - ById(id string) (*ServiceBinding, error) - Delete(container *ServiceBinding) error -} - -func newServiceBindingClient(rancherClient *RancherClient) *ServiceBindingClient { - return &ServiceBindingClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceBindingClient) Create(container *ServiceBinding) (*ServiceBinding, error) { - resp := &ServiceBinding{} - err := c.rancherClient.doCreate(SERVICE_BINDING_TYPE, container, resp) - return resp, err -} - -func (c *ServiceBindingClient) Update(existing *ServiceBinding, updates interface{}) (*ServiceBinding, error) { - resp := &ServiceBinding{} - err := c.rancherClient.doUpdate(SERVICE_BINDING_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceBindingClient) List(opts *ListOpts) (*ServiceBindingCollection, error) { - resp := &ServiceBindingCollection{} - err := c.rancherClient.doList(SERVICE_BINDING_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceBindingCollection) Next() (*ServiceBindingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceBindingCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceBindingClient) ById(id string) (*ServiceBinding, error) { - resp := &ServiceBinding{} - err := c.rancherClient.doById(SERVICE_BINDING_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceBindingClient) Delete(container *ServiceBinding) error { - return c.rancherClient.doResourceDelete(SERVICE_BINDING_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go deleted file mode 100644 index 138afde3c..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_consume_map.go +++ /dev/null @@ -1,142 +0,0 @@ -package client - -const ( - SERVICE_CONSUME_MAP_TYPE = "serviceConsumeMap" -) - -type ServiceConsumeMap struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - ConsumedServiceId string `json:"consumedServiceId,omitempty" yaml:"consumed_service_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ServiceConsumeMapCollection struct { - Collection - Data []ServiceConsumeMap `json:"data,omitempty"` - client *ServiceConsumeMapClient -} - -type ServiceConsumeMapClient struct { - rancherClient *RancherClient -} - -type ServiceConsumeMapOperations interface { - List(opts *ListOpts) (*ServiceConsumeMapCollection, error) - Create(opts *ServiceConsumeMap) (*ServiceConsumeMap, error) - Update(existing *ServiceConsumeMap, updates interface{}) (*ServiceConsumeMap, error) - ById(id string) (*ServiceConsumeMap, error) - Delete(container *ServiceConsumeMap) error - - ActionCreate(*ServiceConsumeMap) (*ServiceConsumeMap, error) - - ActionRemove(*ServiceConsumeMap) (*ServiceConsumeMap, error) - - ActionUpdate(*ServiceConsumeMap) (*ServiceConsumeMap, error) -} - -func newServiceConsumeMapClient(rancherClient *RancherClient) *ServiceConsumeMapClient { - return &ServiceConsumeMapClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceConsumeMapClient) Create(container *ServiceConsumeMap) (*ServiceConsumeMap, error) { - resp := &ServiceConsumeMap{} - err := c.rancherClient.doCreate(SERVICE_CONSUME_MAP_TYPE, container, resp) - return resp, err -} - -func (c *ServiceConsumeMapClient) Update(existing *ServiceConsumeMap, updates interface{}) (*ServiceConsumeMap, error) { - resp := &ServiceConsumeMap{} - err := c.rancherClient.doUpdate(SERVICE_CONSUME_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceConsumeMapClient) List(opts *ListOpts) (*ServiceConsumeMapCollection, error) { - resp := &ServiceConsumeMapCollection{} - err := c.rancherClient.doList(SERVICE_CONSUME_MAP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceConsumeMapCollection) Next() (*ServiceConsumeMapCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceConsumeMapCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceConsumeMapClient) ById(id string) (*ServiceConsumeMap, error) { - resp := &ServiceConsumeMap{} - err := c.rancherClient.doById(SERVICE_CONSUME_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceConsumeMapClient) Delete(container *ServiceConsumeMap) error { - return c.rancherClient.doResourceDelete(SERVICE_CONSUME_MAP_TYPE, &container.Resource) -} - -func (c *ServiceConsumeMapClient) ActionCreate(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { - - resp := &ServiceConsumeMap{} - - err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceConsumeMapClient) ActionRemove(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { - - resp := &ServiceConsumeMap{} - - err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceConsumeMapClient) ActionUpdate(resource *ServiceConsumeMap) (*ServiceConsumeMap, error) { - - resp := &ServiceConsumeMap{} - - err := c.rancherClient.doAction(SERVICE_CONSUME_MAP_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go deleted file mode 100644 index 71b3082f6..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_event.go +++ /dev/null @@ -1,135 +0,0 @@ -package client - -const ( - SERVICE_EVENT_TYPE = "serviceEvent" -) - -type ServiceEvent struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalTimestamp int64 `json:"externalTimestamp,omitempty" yaml:"external_timestamp,omitempty"` - - HealthcheckUuid string `json:"healthcheckUuid,omitempty" yaml:"healthcheck_uuid,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ReportedHealth string `json:"reportedHealth,omitempty" yaml:"reported_health,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ServiceEventCollection struct { - Collection - Data []ServiceEvent `json:"data,omitempty"` - client *ServiceEventClient -} - -type ServiceEventClient struct { - rancherClient *RancherClient -} - -type ServiceEventOperations interface { - List(opts *ListOpts) (*ServiceEventCollection, error) - Create(opts *ServiceEvent) (*ServiceEvent, error) - Update(existing *ServiceEvent, updates interface{}) (*ServiceEvent, error) - ById(id string) (*ServiceEvent, error) - Delete(container *ServiceEvent) error - - ActionCreate(*ServiceEvent) (*ServiceEvent, error) - - ActionRemove(*ServiceEvent) (*ServiceEvent, error) -} - -func newServiceEventClient(rancherClient *RancherClient) *ServiceEventClient { - return &ServiceEventClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceEventClient) Create(container *ServiceEvent) (*ServiceEvent, error) { - resp := &ServiceEvent{} - err := c.rancherClient.doCreate(SERVICE_EVENT_TYPE, container, resp) - return resp, err -} - -func (c *ServiceEventClient) Update(existing *ServiceEvent, updates interface{}) (*ServiceEvent, error) { - resp := &ServiceEvent{} - err := c.rancherClient.doUpdate(SERVICE_EVENT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceEventClient) List(opts *ListOpts) (*ServiceEventCollection, error) { - resp := &ServiceEventCollection{} - err := c.rancherClient.doList(SERVICE_EVENT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceEventCollection) Next() (*ServiceEventCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceEventCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceEventClient) ById(id string) (*ServiceEvent, error) { - resp := &ServiceEvent{} - err := c.rancherClient.doById(SERVICE_EVENT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceEventClient) Delete(container *ServiceEvent) error { - return c.rancherClient.doResourceDelete(SERVICE_EVENT_TYPE, &container.Resource) -} - -func (c *ServiceEventClient) ActionCreate(resource *ServiceEvent) (*ServiceEvent, error) { - - resp := &ServiceEvent{} - - err := c.rancherClient.doAction(SERVICE_EVENT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceEventClient) ActionRemove(resource *ServiceEvent) (*ServiceEvent, error) { - - resp := &ServiceEvent{} - - err := c.rancherClient.doAction(SERVICE_EVENT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go deleted file mode 100644 index 06453bf48..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_expose_map.go +++ /dev/null @@ -1,133 +0,0 @@ -package client - -const ( - SERVICE_EXPOSE_MAP_TYPE = "serviceExposeMap" -) - -type ServiceExposeMap struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - IpAddress string `json:"ipAddress,omitempty" yaml:"ip_address,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Managed bool `json:"managed,omitempty" yaml:"managed,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ServiceExposeMapCollection struct { - Collection - Data []ServiceExposeMap `json:"data,omitempty"` - client *ServiceExposeMapClient -} - -type ServiceExposeMapClient struct { - rancherClient *RancherClient -} - -type ServiceExposeMapOperations interface { - List(opts *ListOpts) (*ServiceExposeMapCollection, error) - Create(opts *ServiceExposeMap) (*ServiceExposeMap, error) - Update(existing *ServiceExposeMap, updates interface{}) (*ServiceExposeMap, error) - ById(id string) (*ServiceExposeMap, error) - Delete(container *ServiceExposeMap) error - - ActionCreate(*ServiceExposeMap) (*ServiceExposeMap, error) - - ActionRemove(*ServiceExposeMap) (*ServiceExposeMap, error) -} - -func newServiceExposeMapClient(rancherClient *RancherClient) *ServiceExposeMapClient { - return &ServiceExposeMapClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceExposeMapClient) Create(container *ServiceExposeMap) (*ServiceExposeMap, error) { - resp := &ServiceExposeMap{} - err := c.rancherClient.doCreate(SERVICE_EXPOSE_MAP_TYPE, container, resp) - return resp, err -} - -func (c *ServiceExposeMapClient) Update(existing *ServiceExposeMap, updates interface{}) (*ServiceExposeMap, error) { - resp := &ServiceExposeMap{} - err := c.rancherClient.doUpdate(SERVICE_EXPOSE_MAP_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceExposeMapClient) List(opts *ListOpts) (*ServiceExposeMapCollection, error) { - resp := &ServiceExposeMapCollection{} - err := c.rancherClient.doList(SERVICE_EXPOSE_MAP_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceExposeMapCollection) Next() (*ServiceExposeMapCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceExposeMapCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceExposeMapClient) ById(id string) (*ServiceExposeMap, error) { - resp := &ServiceExposeMap{} - err := c.rancherClient.doById(SERVICE_EXPOSE_MAP_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceExposeMapClient) Delete(container *ServiceExposeMap) error { - return c.rancherClient.doResourceDelete(SERVICE_EXPOSE_MAP_TYPE, &container.Resource) -} - -func (c *ServiceExposeMapClient) ActionCreate(resource *ServiceExposeMap) (*ServiceExposeMap, error) { - - resp := &ServiceExposeMap{} - - err := c.rancherClient.doAction(SERVICE_EXPOSE_MAP_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *ServiceExposeMapClient) ActionRemove(resource *ServiceExposeMap) (*ServiceExposeMap, error) { - - resp := &ServiceExposeMap{} - - err := c.rancherClient.doAction(SERVICE_EXPOSE_MAP_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go deleted file mode 100644 index 9532b2a36..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_link.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - SERVICE_LINK_TYPE = "serviceLink" -) - -type ServiceLink struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type ServiceLinkCollection struct { - Collection - Data []ServiceLink `json:"data,omitempty"` - client *ServiceLinkClient -} - -type ServiceLinkClient struct { - rancherClient *RancherClient -} - -type ServiceLinkOperations interface { - List(opts *ListOpts) (*ServiceLinkCollection, error) - Create(opts *ServiceLink) (*ServiceLink, error) - Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) - ById(id string) (*ServiceLink, error) - Delete(container *ServiceLink) error -} - -func newServiceLinkClient(rancherClient *RancherClient) *ServiceLinkClient { - return &ServiceLinkClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceLinkClient) Create(container *ServiceLink) (*ServiceLink, error) { - resp := &ServiceLink{} - err := c.rancherClient.doCreate(SERVICE_LINK_TYPE, container, resp) - return resp, err -} - -func (c *ServiceLinkClient) Update(existing *ServiceLink, updates interface{}) (*ServiceLink, error) { - resp := &ServiceLink{} - err := c.rancherClient.doUpdate(SERVICE_LINK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceLinkClient) List(opts *ListOpts) (*ServiceLinkCollection, error) { - resp := &ServiceLinkCollection{} - err := c.rancherClient.doList(SERVICE_LINK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceLinkCollection) Next() (*ServiceLinkCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceLinkCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceLinkClient) ById(id string) (*ServiceLink, error) { - resp := &ServiceLink{} - err := c.rancherClient.doById(SERVICE_LINK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceLinkClient) Delete(container *ServiceLink) error { - return c.rancherClient.doResourceDelete(SERVICE_LINK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go deleted file mode 100644 index 81c2236e7..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_log.go +++ /dev/null @@ -1,101 +0,0 @@ -package client - -const ( - SERVICE_LOG_TYPE = "serviceLog" -) - -type ServiceLog struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` - - EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Level string `json:"level,omitempty" yaml:"level,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - SubLog bool `json:"subLog,omitempty" yaml:"sub_log,omitempty"` - - TransactionId string `json:"transactionId,omitempty" yaml:"transaction_id,omitempty"` -} - -type ServiceLogCollection struct { - Collection - Data []ServiceLog `json:"data,omitempty"` - client *ServiceLogClient -} - -type ServiceLogClient struct { - rancherClient *RancherClient -} - -type ServiceLogOperations interface { - List(opts *ListOpts) (*ServiceLogCollection, error) - Create(opts *ServiceLog) (*ServiceLog, error) - Update(existing *ServiceLog, updates interface{}) (*ServiceLog, error) - ById(id string) (*ServiceLog, error) - Delete(container *ServiceLog) error -} - -func newServiceLogClient(rancherClient *RancherClient) *ServiceLogClient { - return &ServiceLogClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceLogClient) Create(container *ServiceLog) (*ServiceLog, error) { - resp := &ServiceLog{} - err := c.rancherClient.doCreate(SERVICE_LOG_TYPE, container, resp) - return resp, err -} - -func (c *ServiceLogClient) Update(existing *ServiceLog, updates interface{}) (*ServiceLog, error) { - resp := &ServiceLog{} - err := c.rancherClient.doUpdate(SERVICE_LOG_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceLogClient) List(opts *ListOpts) (*ServiceLogCollection, error) { - resp := &ServiceLogCollection{} - err := c.rancherClient.doList(SERVICE_LOG_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceLogCollection) Next() (*ServiceLogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceLogCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceLogClient) ById(id string) (*ServiceLog, error) { - resp := &ServiceLog{} - err := c.rancherClient.doById(SERVICE_LOG_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceLogClient) Delete(container *ServiceLog) error { - return c.rancherClient.doResourceDelete(SERVICE_LOG_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go deleted file mode 100644 index 2af160e9a..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_proxy.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - SERVICE_PROXY_TYPE = "serviceProxy" -) - -type ServiceProxy struct { - Resource - - Port int64 `json:"port,omitempty" yaml:"port,omitempty"` - - Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` - - Service string `json:"service,omitempty" yaml:"service,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type ServiceProxyCollection struct { - Collection - Data []ServiceProxy `json:"data,omitempty"` - client *ServiceProxyClient -} - -type ServiceProxyClient struct { - rancherClient *RancherClient -} - -type ServiceProxyOperations interface { - List(opts *ListOpts) (*ServiceProxyCollection, error) - Create(opts *ServiceProxy) (*ServiceProxy, error) - Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) - ById(id string) (*ServiceProxy, error) - Delete(container *ServiceProxy) error -} - -func newServiceProxyClient(rancherClient *RancherClient) *ServiceProxyClient { - return &ServiceProxyClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceProxyClient) Create(container *ServiceProxy) (*ServiceProxy, error) { - resp := &ServiceProxy{} - err := c.rancherClient.doCreate(SERVICE_PROXY_TYPE, container, resp) - return resp, err -} - -func (c *ServiceProxyClient) Update(existing *ServiceProxy, updates interface{}) (*ServiceProxy, error) { - resp := &ServiceProxy{} - err := c.rancherClient.doUpdate(SERVICE_PROXY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceProxyClient) List(opts *ListOpts) (*ServiceProxyCollection, error) { - resp := &ServiceProxyCollection{} - err := c.rancherClient.doList(SERVICE_PROXY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceProxyCollection) Next() (*ServiceProxyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceProxyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceProxyClient) ById(id string) (*ServiceProxy, error) { - resp := &ServiceProxy{} - err := c.rancherClient.doById(SERVICE_PROXY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceProxyClient) Delete(container *ServiceProxy) error { - return c.rancherClient.doResourceDelete(SERVICE_PROXY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go deleted file mode 100644 index 5a470186a..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_restart.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - SERVICE_RESTART_TYPE = "serviceRestart" -) - -type ServiceRestart struct { - Resource - - RollingRestartStrategy RollingRestartStrategy `json:"rollingRestartStrategy,omitempty" yaml:"rolling_restart_strategy,omitempty"` -} - -type ServiceRestartCollection struct { - Collection - Data []ServiceRestart `json:"data,omitempty"` - client *ServiceRestartClient -} - -type ServiceRestartClient struct { - rancherClient *RancherClient -} - -type ServiceRestartOperations interface { - List(opts *ListOpts) (*ServiceRestartCollection, error) - Create(opts *ServiceRestart) (*ServiceRestart, error) - Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) - ById(id string) (*ServiceRestart, error) - Delete(container *ServiceRestart) error -} - -func newServiceRestartClient(rancherClient *RancherClient) *ServiceRestartClient { - return &ServiceRestartClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceRestartClient) Create(container *ServiceRestart) (*ServiceRestart, error) { - resp := &ServiceRestart{} - err := c.rancherClient.doCreate(SERVICE_RESTART_TYPE, container, resp) - return resp, err -} - -func (c *ServiceRestartClient) Update(existing *ServiceRestart, updates interface{}) (*ServiceRestart, error) { - resp := &ServiceRestart{} - err := c.rancherClient.doUpdate(SERVICE_RESTART_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceRestartClient) List(opts *ListOpts) (*ServiceRestartCollection, error) { - resp := &ServiceRestartCollection{} - err := c.rancherClient.doList(SERVICE_RESTART_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceRestartCollection) Next() (*ServiceRestartCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceRestartCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceRestartClient) ById(id string) (*ServiceRestart, error) { - resp := &ServiceRestart{} - err := c.rancherClient.doById(SERVICE_RESTART_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceRestartClient) Delete(container *ServiceRestart) error { - return c.rancherClient.doResourceDelete(SERVICE_RESTART_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go deleted file mode 100644 index 1c9748168..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SERVICE_UPGRADE_TYPE = "serviceUpgrade" -) - -type ServiceUpgrade struct { - Resource - - InServiceStrategy *InServiceUpgradeStrategy `json:"inServiceStrategy,omitempty" yaml:"in_service_strategy,omitempty"` - - ToServiceStrategy *ToServiceUpgradeStrategy `json:"toServiceStrategy,omitempty" yaml:"to_service_strategy,omitempty"` -} - -type ServiceUpgradeCollection struct { - Collection - Data []ServiceUpgrade `json:"data,omitempty"` - client *ServiceUpgradeClient -} - -type ServiceUpgradeClient struct { - rancherClient *RancherClient -} - -type ServiceUpgradeOperations interface { - List(opts *ListOpts) (*ServiceUpgradeCollection, error) - Create(opts *ServiceUpgrade) (*ServiceUpgrade, error) - Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) - ById(id string) (*ServiceUpgrade, error) - Delete(container *ServiceUpgrade) error -} - -func newServiceUpgradeClient(rancherClient *RancherClient) *ServiceUpgradeClient { - return &ServiceUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceUpgradeClient) Create(container *ServiceUpgrade) (*ServiceUpgrade, error) { - resp := &ServiceUpgrade{} - err := c.rancherClient.doCreate(SERVICE_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *ServiceUpgradeClient) Update(existing *ServiceUpgrade, updates interface{}) (*ServiceUpgrade, error) { - resp := &ServiceUpgrade{} - err := c.rancherClient.doUpdate(SERVICE_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceUpgradeClient) List(opts *ListOpts) (*ServiceUpgradeCollection, error) { - resp := &ServiceUpgradeCollection{} - err := c.rancherClient.doList(SERVICE_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceUpgradeCollection) Next() (*ServiceUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceUpgradeClient) ById(id string) (*ServiceUpgrade, error) { - resp := &ServiceUpgrade{} - err := c.rancherClient.doById(SERVICE_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceUpgradeClient) Delete(container *ServiceUpgrade) error { - return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go deleted file mode 100644 index 621403d39..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_service_upgrade_strategy.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SERVICE_UPGRADE_STRATEGY_TYPE = "serviceUpgradeStrategy" -) - -type ServiceUpgradeStrategy struct { - Resource - - BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` - - IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` -} - -type ServiceUpgradeStrategyCollection struct { - Collection - Data []ServiceUpgradeStrategy `json:"data,omitempty"` - client *ServiceUpgradeStrategyClient -} - -type ServiceUpgradeStrategyClient struct { - rancherClient *RancherClient -} - -type ServiceUpgradeStrategyOperations interface { - List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error) - Create(opts *ServiceUpgradeStrategy) (*ServiceUpgradeStrategy, error) - Update(existing *ServiceUpgradeStrategy, updates interface{}) (*ServiceUpgradeStrategy, error) - ById(id string) (*ServiceUpgradeStrategy, error) - Delete(container *ServiceUpgradeStrategy) error -} - -func newServiceUpgradeStrategyClient(rancherClient *RancherClient) *ServiceUpgradeStrategyClient { - return &ServiceUpgradeStrategyClient{ - rancherClient: rancherClient, - } -} - -func (c *ServiceUpgradeStrategyClient) Create(container *ServiceUpgradeStrategy) (*ServiceUpgradeStrategy, error) { - resp := &ServiceUpgradeStrategy{} - err := c.rancherClient.doCreate(SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) - return resp, err -} - -func (c *ServiceUpgradeStrategyClient) Update(existing *ServiceUpgradeStrategy, updates interface{}) (*ServiceUpgradeStrategy, error) { - resp := &ServiceUpgradeStrategy{} - err := c.rancherClient.doUpdate(SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServiceUpgradeStrategyClient) List(opts *ListOpts) (*ServiceUpgradeStrategyCollection, error) { - resp := &ServiceUpgradeStrategyCollection{} - err := c.rancherClient.doList(SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServiceUpgradeStrategyCollection) Next() (*ServiceUpgradeStrategyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServiceUpgradeStrategyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServiceUpgradeStrategyClient) ById(id string) (*ServiceUpgradeStrategy, error) { - resp := &ServiceUpgradeStrategy{} - err := c.rancherClient.doById(SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServiceUpgradeStrategyClient) Delete(container *ServiceUpgradeStrategy) error { - return c.rancherClient.doResourceDelete(SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go b/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go deleted file mode 100644 index 1d112c7a7..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_services_port_range.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - SERVICES_PORT_RANGE_TYPE = "servicesPortRange" -) - -type ServicesPortRange struct { - Resource - - EndPort int64 `json:"endPort,omitempty" yaml:"end_port,omitempty"` - - StartPort int64 `json:"startPort,omitempty" yaml:"start_port,omitempty"` -} - -type ServicesPortRangeCollection struct { - Collection - Data []ServicesPortRange `json:"data,omitempty"` - client *ServicesPortRangeClient -} - -type ServicesPortRangeClient struct { - rancherClient *RancherClient -} - -type ServicesPortRangeOperations interface { - List(opts *ListOpts) (*ServicesPortRangeCollection, error) - Create(opts *ServicesPortRange) (*ServicesPortRange, error) - Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) - ById(id string) (*ServicesPortRange, error) - Delete(container *ServicesPortRange) error -} - -func newServicesPortRangeClient(rancherClient *RancherClient) *ServicesPortRangeClient { - return &ServicesPortRangeClient{ - rancherClient: rancherClient, - } -} - -func (c *ServicesPortRangeClient) Create(container *ServicesPortRange) (*ServicesPortRange, error) { - resp := &ServicesPortRange{} - err := c.rancherClient.doCreate(SERVICES_PORT_RANGE_TYPE, container, resp) - return resp, err -} - -func (c *ServicesPortRangeClient) Update(existing *ServicesPortRange, updates interface{}) (*ServicesPortRange, error) { - resp := &ServicesPortRange{} - err := c.rancherClient.doUpdate(SERVICES_PORT_RANGE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ServicesPortRangeClient) List(opts *ListOpts) (*ServicesPortRangeCollection, error) { - resp := &ServicesPortRangeCollection{} - err := c.rancherClient.doList(SERVICES_PORT_RANGE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ServicesPortRangeCollection) Next() (*ServicesPortRangeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ServicesPortRangeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ServicesPortRangeClient) ById(id string) (*ServicesPortRange, error) { - resp := &ServicesPortRange{} - err := c.rancherClient.doById(SERVICES_PORT_RANGE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ServicesPortRangeClient) Delete(container *ServicesPortRange) error { - return c.rancherClient.doResourceDelete(SERVICES_PORT_RANGE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go deleted file mode 100644 index 6d09c9c3b..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_set_project_members_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - SET_PROJECT_MEMBERS_INPUT_TYPE = "setProjectMembersInput" -) - -type SetProjectMembersInput struct { - Resource - - Members []ProjectMember `json:"members,omitempty" yaml:"members,omitempty"` -} - -type SetProjectMembersInputCollection struct { - Collection - Data []SetProjectMembersInput `json:"data,omitempty"` - client *SetProjectMembersInputClient -} - -type SetProjectMembersInputClient struct { - rancherClient *RancherClient -} - -type SetProjectMembersInputOperations interface { - List(opts *ListOpts) (*SetProjectMembersInputCollection, error) - Create(opts *SetProjectMembersInput) (*SetProjectMembersInput, error) - Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) - ById(id string) (*SetProjectMembersInput, error) - Delete(container *SetProjectMembersInput) error -} - -func newSetProjectMembersInputClient(rancherClient *RancherClient) *SetProjectMembersInputClient { - return &SetProjectMembersInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetProjectMembersInputClient) Create(container *SetProjectMembersInput) (*SetProjectMembersInput, error) { - resp := &SetProjectMembersInput{} - err := c.rancherClient.doCreate(SET_PROJECT_MEMBERS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetProjectMembersInputClient) Update(existing *SetProjectMembersInput, updates interface{}) (*SetProjectMembersInput, error) { - resp := &SetProjectMembersInput{} - err := c.rancherClient.doUpdate(SET_PROJECT_MEMBERS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetProjectMembersInputClient) List(opts *ListOpts) (*SetProjectMembersInputCollection, error) { - resp := &SetProjectMembersInputCollection{} - err := c.rancherClient.doList(SET_PROJECT_MEMBERS_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SetProjectMembersInputCollection) Next() (*SetProjectMembersInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SetProjectMembersInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SetProjectMembersInputClient) ById(id string) (*SetProjectMembersInput, error) { - resp := &SetProjectMembersInput{} - err := c.rancherClient.doById(SET_PROJECT_MEMBERS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetProjectMembersInputClient) Delete(container *SetProjectMembersInput) error { - return c.rancherClient.doResourceDelete(SET_PROJECT_MEMBERS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go deleted file mode 100644 index a67d8c4de..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_set_service_links_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - SET_SERVICE_LINKS_INPUT_TYPE = "setServiceLinksInput" -) - -type SetServiceLinksInput struct { - Resource - - ServiceLinks []ServiceLink `json:"serviceLinks,omitempty" yaml:"service_links,omitempty"` -} - -type SetServiceLinksInputCollection struct { - Collection - Data []SetServiceLinksInput `json:"data,omitempty"` - client *SetServiceLinksInputClient -} - -type SetServiceLinksInputClient struct { - rancherClient *RancherClient -} - -type SetServiceLinksInputOperations interface { - List(opts *ListOpts) (*SetServiceLinksInputCollection, error) - Create(opts *SetServiceLinksInput) (*SetServiceLinksInput, error) - Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) - ById(id string) (*SetServiceLinksInput, error) - Delete(container *SetServiceLinksInput) error -} - -func newSetServiceLinksInputClient(rancherClient *RancherClient) *SetServiceLinksInputClient { - return &SetServiceLinksInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SetServiceLinksInputClient) Create(container *SetServiceLinksInput) (*SetServiceLinksInput, error) { - resp := &SetServiceLinksInput{} - err := c.rancherClient.doCreate(SET_SERVICE_LINKS_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SetServiceLinksInputClient) Update(existing *SetServiceLinksInput, updates interface{}) (*SetServiceLinksInput, error) { - resp := &SetServiceLinksInput{} - err := c.rancherClient.doUpdate(SET_SERVICE_LINKS_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SetServiceLinksInputClient) List(opts *ListOpts) (*SetServiceLinksInputCollection, error) { - resp := &SetServiceLinksInputCollection{} - err := c.rancherClient.doList(SET_SERVICE_LINKS_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SetServiceLinksInputCollection) Next() (*SetServiceLinksInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SetServiceLinksInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SetServiceLinksInputClient) ById(id string) (*SetServiceLinksInput, error) { - resp := &SetServiceLinksInput{} - err := c.rancherClient.doById(SET_SERVICE_LINKS_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SetServiceLinksInputClient) Delete(container *SetServiceLinksInput) error { - return c.rancherClient.doResourceDelete(SET_SERVICE_LINKS_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_setting.go b/vendor/github.com/rancher/go-rancher/v2/generated_setting.go deleted file mode 100644 index 02dd2df9c..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_setting.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - SETTING_TYPE = "setting" -) - -type Setting struct { - Resource - - ActiveValue string `json:"activeValue,omitempty" yaml:"active_value,omitempty"` - - InDb bool `json:"inDb,omitempty" yaml:"in_db,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Source string `json:"source,omitempty" yaml:"source,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type SettingCollection struct { - Collection - Data []Setting `json:"data,omitempty"` - client *SettingClient -} - -type SettingClient struct { - rancherClient *RancherClient -} - -type SettingOperations interface { - List(opts *ListOpts) (*SettingCollection, error) - Create(opts *Setting) (*Setting, error) - Update(existing *Setting, updates interface{}) (*Setting, error) - ById(id string) (*Setting, error) - Delete(container *Setting) error -} - -func newSettingClient(rancherClient *RancherClient) *SettingClient { - return &SettingClient{ - rancherClient: rancherClient, - } -} - -func (c *SettingClient) Create(container *Setting) (*Setting, error) { - resp := &Setting{} - err := c.rancherClient.doCreate(SETTING_TYPE, container, resp) - return resp, err -} - -func (c *SettingClient) Update(existing *Setting, updates interface{}) (*Setting, error) { - resp := &Setting{} - err := c.rancherClient.doUpdate(SETTING_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SettingClient) List(opts *ListOpts) (*SettingCollection, error) { - resp := &SettingCollection{} - err := c.rancherClient.doList(SETTING_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SettingCollection) Next() (*SettingCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SettingCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SettingClient) ById(id string) (*Setting, error) { - resp := &Setting{} - err := c.rancherClient.doById(SETTING_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SettingClient) Delete(container *Setting) error { - return c.rancherClient.doResourceDelete(SETTING_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go deleted file mode 100644 index 1c4ea033a..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot.go +++ /dev/null @@ -1,138 +0,0 @@ -package client - -const ( - SNAPSHOT_TYPE = "snapshot" -) - -type Snapshot struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeId string `json:"volumeId,omitempty" yaml:"volume_id,omitempty"` -} - -type SnapshotCollection struct { - Collection - Data []Snapshot `json:"data,omitempty"` - client *SnapshotClient -} - -type SnapshotClient struct { - rancherClient *RancherClient -} - -type SnapshotOperations interface { - List(opts *ListOpts) (*SnapshotCollection, error) - Create(opts *Snapshot) (*Snapshot, error) - Update(existing *Snapshot, updates interface{}) (*Snapshot, error) - ById(id string) (*Snapshot, error) - Delete(container *Snapshot) error - - ActionBackup(*Snapshot, *SnapshotBackupInput) (*Backup, error) - - ActionCreate(*Snapshot) (*Snapshot, error) - - ActionRemove(*Snapshot) (*Snapshot, error) -} - -func newSnapshotClient(rancherClient *RancherClient) *SnapshotClient { - return &SnapshotClient{ - rancherClient: rancherClient, - } -} - -func (c *SnapshotClient) Create(container *Snapshot) (*Snapshot, error) { - resp := &Snapshot{} - err := c.rancherClient.doCreate(SNAPSHOT_TYPE, container, resp) - return resp, err -} - -func (c *SnapshotClient) Update(existing *Snapshot, updates interface{}) (*Snapshot, error) { - resp := &Snapshot{} - err := c.rancherClient.doUpdate(SNAPSHOT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SnapshotClient) List(opts *ListOpts) (*SnapshotCollection, error) { - resp := &SnapshotCollection{} - err := c.rancherClient.doList(SNAPSHOT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SnapshotCollection) Next() (*SnapshotCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SnapshotCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SnapshotClient) ById(id string) (*Snapshot, error) { - resp := &Snapshot{} - err := c.rancherClient.doById(SNAPSHOT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SnapshotClient) Delete(container *Snapshot) error { - return c.rancherClient.doResourceDelete(SNAPSHOT_TYPE, &container.Resource) -} - -func (c *SnapshotClient) ActionBackup(resource *Snapshot, input *SnapshotBackupInput) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(SNAPSHOT_TYPE, "backup", &resource.Resource, input, resp) - - return resp, err -} - -func (c *SnapshotClient) ActionCreate(resource *Snapshot) (*Snapshot, error) { - - resp := &Snapshot{} - - err := c.rancherClient.doAction(SNAPSHOT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SnapshotClient) ActionRemove(resource *Snapshot) (*Snapshot, error) { - - resp := &Snapshot{} - - err := c.rancherClient.doAction(SNAPSHOT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go deleted file mode 100644 index 9577ee6f5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_snapshot_backup_input.go +++ /dev/null @@ -1,107 +0,0 @@ -package client - -const ( - SNAPSHOT_BACKUP_INPUT_TYPE = "snapshotBackupInput" -) - -type SnapshotBackupInput struct { - Resource - - BackupTargetId string `json:"backupTargetId,omitempty" yaml:"backup_target_id,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` -} - -type SnapshotBackupInputCollection struct { - Collection - Data []SnapshotBackupInput `json:"data,omitempty"` - client *SnapshotBackupInputClient -} - -type SnapshotBackupInputClient struct { - rancherClient *RancherClient -} - -type SnapshotBackupInputOperations interface { - List(opts *ListOpts) (*SnapshotBackupInputCollection, error) - Create(opts *SnapshotBackupInput) (*SnapshotBackupInput, error) - Update(existing *SnapshotBackupInput, updates interface{}) (*SnapshotBackupInput, error) - ById(id string) (*SnapshotBackupInput, error) - Delete(container *SnapshotBackupInput) error - - ActionCreate(*SnapshotBackupInput) (*Backup, error) - - ActionRemove(*SnapshotBackupInput) (*Backup, error) -} - -func newSnapshotBackupInputClient(rancherClient *RancherClient) *SnapshotBackupInputClient { - return &SnapshotBackupInputClient{ - rancherClient: rancherClient, - } -} - -func (c *SnapshotBackupInputClient) Create(container *SnapshotBackupInput) (*SnapshotBackupInput, error) { - resp := &SnapshotBackupInput{} - err := c.rancherClient.doCreate(SNAPSHOT_BACKUP_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *SnapshotBackupInputClient) Update(existing *SnapshotBackupInput, updates interface{}) (*SnapshotBackupInput, error) { - resp := &SnapshotBackupInput{} - err := c.rancherClient.doUpdate(SNAPSHOT_BACKUP_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SnapshotBackupInputClient) List(opts *ListOpts) (*SnapshotBackupInputCollection, error) { - resp := &SnapshotBackupInputCollection{} - err := c.rancherClient.doList(SNAPSHOT_BACKUP_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SnapshotBackupInputCollection) Next() (*SnapshotBackupInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SnapshotBackupInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SnapshotBackupInputClient) ById(id string) (*SnapshotBackupInput, error) { - resp := &SnapshotBackupInput{} - err := c.rancherClient.doById(SNAPSHOT_BACKUP_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SnapshotBackupInputClient) Delete(container *SnapshotBackupInput) error { - return c.rancherClient.doResourceDelete(SNAPSHOT_BACKUP_INPUT_TYPE, &container.Resource) -} - -func (c *SnapshotBackupInputClient) ActionCreate(resource *SnapshotBackupInput) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(SNAPSHOT_BACKUP_INPUT_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SnapshotBackupInputClient) ActionRemove(resource *SnapshotBackupInput) (*Backup, error) { - - resp := &Backup{} - - err := c.rancherClient.doAction(SNAPSHOT_BACKUP_INPUT_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stack.go b/vendor/github.com/rancher/go-rancher/v2/generated_stack.go deleted file mode 100644 index f661218b9..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_stack.go +++ /dev/null @@ -1,265 +0,0 @@ -package client - -const ( - STACK_TYPE = "stack" -) - -type Stack struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - Binding *Binding `json:"binding,omitempty" yaml:"binding,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Group string `json:"group,omitempty" yaml:"group,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Outputs map[string]interface{} `json:"outputs,omitempty" yaml:"outputs,omitempty"` - - PreviousEnvironment map[string]interface{} `json:"previousEnvironment,omitempty" yaml:"previous_environment,omitempty"` - - PreviousExternalId string `json:"previousExternalId,omitempty" yaml:"previous_external_id,omitempty"` - - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type StackCollection struct { - Collection - Data []Stack `json:"data,omitempty"` - client *StackClient -} - -type StackClient struct { - rancherClient *RancherClient -} - -type StackOperations interface { - List(opts *ListOpts) (*StackCollection, error) - Create(opts *Stack) (*Stack, error) - Update(existing *Stack, updates interface{}) (*Stack, error) - ById(id string) (*Stack, error) - Delete(container *Stack) error - - ActionActivateservices(*Stack) (*Stack, error) - - ActionAddoutputs(*Stack, *AddOutputsInput) (*Stack, error) - - ActionCancelupgrade(*Stack) (*Stack, error) - - ActionCreate(*Stack) (*Stack, error) - - ActionDeactivateservices(*Stack) (*Stack, error) - - ActionError(*Stack) (*Stack, error) - - ActionExportconfig(*Stack, *ComposeConfigInput) (*ComposeConfig, error) - - ActionFinishupgrade(*Stack) (*Stack, error) - - ActionRemove(*Stack) (*Stack, error) - - ActionRollback(*Stack) (*Stack, error) - - ActionUpdate(*Stack) (*Stack, error) - - ActionUpgrade(*Stack, *StackUpgrade) (*Stack, error) -} - -func newStackClient(rancherClient *RancherClient) *StackClient { - return &StackClient{ - rancherClient: rancherClient, - } -} - -func (c *StackClient) Create(container *Stack) (*Stack, error) { - resp := &Stack{} - err := c.rancherClient.doCreate(STACK_TYPE, container, resp) - return resp, err -} - -func (c *StackClient) Update(existing *Stack, updates interface{}) (*Stack, error) { - resp := &Stack{} - err := c.rancherClient.doUpdate(STACK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StackClient) List(opts *ListOpts) (*StackCollection, error) { - resp := &StackCollection{} - err := c.rancherClient.doList(STACK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StackCollection) Next() (*StackCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StackCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StackClient) ById(id string) (*Stack, error) { - resp := &Stack{} - err := c.rancherClient.doById(STACK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StackClient) Delete(container *Stack) error { - return c.rancherClient.doResourceDelete(STACK_TYPE, &container.Resource) -} - -func (c *StackClient) ActionActivateservices(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "activateservices", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionAddoutputs(resource *Stack, input *AddOutputsInput) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "addoutputs", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StackClient) ActionCancelupgrade(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionCreate(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionDeactivateservices(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "deactivateservices", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionError(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionExportconfig(resource *Stack, input *ComposeConfigInput) (*ComposeConfig, error) { - - resp := &ComposeConfig{} - - err := c.rancherClient.doAction(STACK_TYPE, "exportconfig", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StackClient) ActionFinishupgrade(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionRemove(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionRollback(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionUpdate(resource *Stack) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StackClient) ActionUpgrade(resource *Stack, input *StackUpgrade) (*Stack, error) { - - resp := &Stack{} - - err := c.rancherClient.doAction(STACK_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go b/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go deleted file mode 100644 index f4f78185f..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_stack_upgrade.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - STACK_UPGRADE_TYPE = "stackUpgrade" -) - -type StackUpgrade struct { - Resource - - Answers map[string]interface{} `json:"answers,omitempty" yaml:"answers,omitempty"` - - DockerCompose string `json:"dockerCompose,omitempty" yaml:"docker_compose,omitempty"` - - Environment map[string]interface{} `json:"environment,omitempty" yaml:"environment,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancher_compose,omitempty"` - - Templates map[string]interface{} `json:"templates,omitempty" yaml:"templates,omitempty"` -} - -type StackUpgradeCollection struct { - Collection - Data []StackUpgrade `json:"data,omitempty"` - client *StackUpgradeClient -} - -type StackUpgradeClient struct { - rancherClient *RancherClient -} - -type StackUpgradeOperations interface { - List(opts *ListOpts) (*StackUpgradeCollection, error) - Create(opts *StackUpgrade) (*StackUpgrade, error) - Update(existing *StackUpgrade, updates interface{}) (*StackUpgrade, error) - ById(id string) (*StackUpgrade, error) - Delete(container *StackUpgrade) error -} - -func newStackUpgradeClient(rancherClient *RancherClient) *StackUpgradeClient { - return &StackUpgradeClient{ - rancherClient: rancherClient, - } -} - -func (c *StackUpgradeClient) Create(container *StackUpgrade) (*StackUpgrade, error) { - resp := &StackUpgrade{} - err := c.rancherClient.doCreate(STACK_UPGRADE_TYPE, container, resp) - return resp, err -} - -func (c *StackUpgradeClient) Update(existing *StackUpgrade, updates interface{}) (*StackUpgrade, error) { - resp := &StackUpgrade{} - err := c.rancherClient.doUpdate(STACK_UPGRADE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StackUpgradeClient) List(opts *ListOpts) (*StackUpgradeCollection, error) { - resp := &StackUpgradeCollection{} - err := c.rancherClient.doList(STACK_UPGRADE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StackUpgradeCollection) Next() (*StackUpgradeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StackUpgradeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StackUpgradeClient) ById(id string) (*StackUpgrade, error) { - resp := &StackUpgrade{} - err := c.rancherClient.doById(STACK_UPGRADE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StackUpgradeClient) Delete(container *StackUpgrade) error { - return c.rancherClient.doResourceDelete(STACK_UPGRADE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go b/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go deleted file mode 100644 index 4fb565537..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_state_transition.go +++ /dev/null @@ -1,77 +0,0 @@ -package client - -const ( - STATE_TRANSITION_TYPE = "stateTransition" -) - -type StateTransition struct { - Resource -} - -type StateTransitionCollection struct { - Collection - Data []StateTransition `json:"data,omitempty"` - client *StateTransitionClient -} - -type StateTransitionClient struct { - rancherClient *RancherClient -} - -type StateTransitionOperations interface { - List(opts *ListOpts) (*StateTransitionCollection, error) - Create(opts *StateTransition) (*StateTransition, error) - Update(existing *StateTransition, updates interface{}) (*StateTransition, error) - ById(id string) (*StateTransition, error) - Delete(container *StateTransition) error -} - -func newStateTransitionClient(rancherClient *RancherClient) *StateTransitionClient { - return &StateTransitionClient{ - rancherClient: rancherClient, - } -} - -func (c *StateTransitionClient) Create(container *StateTransition) (*StateTransition, error) { - resp := &StateTransition{} - err := c.rancherClient.doCreate(STATE_TRANSITION_TYPE, container, resp) - return resp, err -} - -func (c *StateTransitionClient) Update(existing *StateTransition, updates interface{}) (*StateTransition, error) { - resp := &StateTransition{} - err := c.rancherClient.doUpdate(STATE_TRANSITION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StateTransitionClient) List(opts *ListOpts) (*StateTransitionCollection, error) { - resp := &StateTransitionCollection{} - err := c.rancherClient.doList(STATE_TRANSITION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StateTransitionCollection) Next() (*StateTransitionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StateTransitionCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StateTransitionClient) ById(id string) (*StateTransition, error) { - resp := &StateTransition{} - err := c.rancherClient.doById(STATE_TRANSITION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StateTransitionClient) Delete(container *StateTransition) error { - return c.rancherClient.doResourceDelete(STATE_TRANSITION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go b/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go deleted file mode 100644 index 1b7d814f3..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_stats_access.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - STATS_ACCESS_TYPE = "statsAccess" -) - -type StatsAccess struct { - Resource - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Url string `json:"url,omitempty" yaml:"url,omitempty"` -} - -type StatsAccessCollection struct { - Collection - Data []StatsAccess `json:"data,omitempty"` - client *StatsAccessClient -} - -type StatsAccessClient struct { - rancherClient *RancherClient -} - -type StatsAccessOperations interface { - List(opts *ListOpts) (*StatsAccessCollection, error) - Create(opts *StatsAccess) (*StatsAccess, error) - Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) - ById(id string) (*StatsAccess, error) - Delete(container *StatsAccess) error -} - -func newStatsAccessClient(rancherClient *RancherClient) *StatsAccessClient { - return &StatsAccessClient{ - rancherClient: rancherClient, - } -} - -func (c *StatsAccessClient) Create(container *StatsAccess) (*StatsAccess, error) { - resp := &StatsAccess{} - err := c.rancherClient.doCreate(STATS_ACCESS_TYPE, container, resp) - return resp, err -} - -func (c *StatsAccessClient) Update(existing *StatsAccess, updates interface{}) (*StatsAccess, error) { - resp := &StatsAccess{} - err := c.rancherClient.doUpdate(STATS_ACCESS_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StatsAccessClient) List(opts *ListOpts) (*StatsAccessCollection, error) { - resp := &StatsAccessCollection{} - err := c.rancherClient.doList(STATS_ACCESS_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StatsAccessCollection) Next() (*StatsAccessCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StatsAccessCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StatsAccessClient) ById(id string) (*StatsAccess, error) { - resp := &StatsAccess{} - err := c.rancherClient.doById(STATS_ACCESS_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StatsAccessClient) Delete(container *StatsAccess) error { - return c.rancherClient.doResourceDelete(STATS_ACCESS_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go deleted file mode 100644 index bf54aa4f3..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver.go +++ /dev/null @@ -1,168 +0,0 @@ -package client - -const ( - STORAGE_DRIVER_TYPE = "storageDriver" -) - -type StorageDriver struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - Scope string `json:"scope,omitempty" yaml:"scope,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` - - VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` -} - -type StorageDriverCollection struct { - Collection - Data []StorageDriver `json:"data,omitempty"` - client *StorageDriverClient -} - -type StorageDriverClient struct { - rancherClient *RancherClient -} - -type StorageDriverOperations interface { - List(opts *ListOpts) (*StorageDriverCollection, error) - Create(opts *StorageDriver) (*StorageDriver, error) - Update(existing *StorageDriver, updates interface{}) (*StorageDriver, error) - ById(id string) (*StorageDriver, error) - Delete(container *StorageDriver) error - - ActionActivate(*StorageDriver) (*StorageDriver, error) - - ActionCreate(*StorageDriver) (*StorageDriver, error) - - ActionDeactivate(*StorageDriver) (*StorageDriver, error) - - ActionRemove(*StorageDriver) (*StorageDriver, error) - - ActionUpdate(*StorageDriver) (*StorageDriver, error) -} - -func newStorageDriverClient(rancherClient *RancherClient) *StorageDriverClient { - return &StorageDriverClient{ - rancherClient: rancherClient, - } -} - -func (c *StorageDriverClient) Create(container *StorageDriver) (*StorageDriver, error) { - resp := &StorageDriver{} - err := c.rancherClient.doCreate(STORAGE_DRIVER_TYPE, container, resp) - return resp, err -} - -func (c *StorageDriverClient) Update(existing *StorageDriver, updates interface{}) (*StorageDriver, error) { - resp := &StorageDriver{} - err := c.rancherClient.doUpdate(STORAGE_DRIVER_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StorageDriverClient) List(opts *ListOpts) (*StorageDriverCollection, error) { - resp := &StorageDriverCollection{} - err := c.rancherClient.doList(STORAGE_DRIVER_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StorageDriverCollection) Next() (*StorageDriverCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StorageDriverCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StorageDriverClient) ById(id string) (*StorageDriver, error) { - resp := &StorageDriver{} - err := c.rancherClient.doById(STORAGE_DRIVER_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StorageDriverClient) Delete(container *StorageDriver) error { - return c.rancherClient.doResourceDelete(STORAGE_DRIVER_TYPE, &container.Resource) -} - -func (c *StorageDriverClient) ActionActivate(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverClient) ActionCreate(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverClient) ActionDeactivate(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverClient) ActionRemove(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverClient) ActionUpdate(resource *StorageDriver) (*StorageDriver, error) { - - resp := &StorageDriver{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go deleted file mode 100644 index 9fbc365ea..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_storage_driver_service.go +++ /dev/null @@ -1,305 +0,0 @@ -package client - -const ( - STORAGE_DRIVER_SERVICE_TYPE = "storageDriverService" -) - -type StorageDriverService struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AssignServiceIpAddress bool `json:"assignServiceIpAddress,omitempty" yaml:"assign_service_ip_address,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - CurrentScale int64 `json:"currentScale,omitempty" yaml:"current_scale,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - Fqdn string `json:"fqdn,omitempty" yaml:"fqdn,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - InstanceIds []string `json:"instanceIds,omitempty" yaml:"instance_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - LaunchConfig *LaunchConfig `json:"launchConfig,omitempty" yaml:"launch_config,omitempty"` - - LbConfig *LbTargetConfig `json:"lbConfig,omitempty" yaml:"lb_config,omitempty"` - - LinkedServices map[string]interface{} `json:"linkedServices,omitempty" yaml:"linked_services,omitempty"` - - Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PublicEndpoints []PublicEndpoint `json:"publicEndpoints,omitempty" yaml:"public_endpoints,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RetainIp bool `json:"retainIp,omitempty" yaml:"retain_ip,omitempty"` - - Scale int64 `json:"scale,omitempty" yaml:"scale,omitempty"` - - ScalePolicy *ScalePolicy `json:"scalePolicy,omitempty" yaml:"scale_policy,omitempty"` - - SecondaryLaunchConfigs []SecondaryLaunchConfig `json:"secondaryLaunchConfigs,omitempty" yaml:"secondary_launch_configs,omitempty"` - - SelectorContainer string `json:"selectorContainer,omitempty" yaml:"selector_container,omitempty"` - - SelectorLink string `json:"selectorLink,omitempty" yaml:"selector_link,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StorageDriver StorageDriver `json:"storageDriver,omitempty" yaml:"storage_driver,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Upgrade *ServiceUpgrade `json:"upgrade,omitempty" yaml:"upgrade,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vip string `json:"vip,omitempty" yaml:"vip,omitempty"` -} - -type StorageDriverServiceCollection struct { - Collection - Data []StorageDriverService `json:"data,omitempty"` - client *StorageDriverServiceClient -} - -type StorageDriverServiceClient struct { - rancherClient *RancherClient -} - -type StorageDriverServiceOperations interface { - List(opts *ListOpts) (*StorageDriverServiceCollection, error) - Create(opts *StorageDriverService) (*StorageDriverService, error) - Update(existing *StorageDriverService, updates interface{}) (*StorageDriverService, error) - ById(id string) (*StorageDriverService, error) - Delete(container *StorageDriverService) error - - ActionActivate(*StorageDriverService) (*Service, error) - - ActionAddservicelink(*StorageDriverService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionCancelupgrade(*StorageDriverService) (*Service, error) - - ActionContinueupgrade(*StorageDriverService) (*Service, error) - - ActionCreate(*StorageDriverService) (*Service, error) - - ActionDeactivate(*StorageDriverService) (*Service, error) - - ActionFinishupgrade(*StorageDriverService) (*Service, error) - - ActionRemove(*StorageDriverService) (*Service, error) - - ActionRemoveservicelink(*StorageDriverService, *AddRemoveServiceLinkInput) (*Service, error) - - ActionRestart(*StorageDriverService, *ServiceRestart) (*Service, error) - - ActionRollback(*StorageDriverService) (*Service, error) - - ActionSetservicelinks(*StorageDriverService, *SetServiceLinksInput) (*Service, error) - - ActionUpdate(*StorageDriverService) (*Service, error) - - ActionUpgrade(*StorageDriverService, *ServiceUpgrade) (*Service, error) -} - -func newStorageDriverServiceClient(rancherClient *RancherClient) *StorageDriverServiceClient { - return &StorageDriverServiceClient{ - rancherClient: rancherClient, - } -} - -func (c *StorageDriverServiceClient) Create(container *StorageDriverService) (*StorageDriverService, error) { - resp := &StorageDriverService{} - err := c.rancherClient.doCreate(STORAGE_DRIVER_SERVICE_TYPE, container, resp) - return resp, err -} - -func (c *StorageDriverServiceClient) Update(existing *StorageDriverService, updates interface{}) (*StorageDriverService, error) { - resp := &StorageDriverService{} - err := c.rancherClient.doUpdate(STORAGE_DRIVER_SERVICE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StorageDriverServiceClient) List(opts *ListOpts) (*StorageDriverServiceCollection, error) { - resp := &StorageDriverServiceCollection{} - err := c.rancherClient.doList(STORAGE_DRIVER_SERVICE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StorageDriverServiceCollection) Next() (*StorageDriverServiceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StorageDriverServiceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StorageDriverServiceClient) ById(id string) (*StorageDriverService, error) { - resp := &StorageDriverService{} - err := c.rancherClient.doById(STORAGE_DRIVER_SERVICE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StorageDriverServiceClient) Delete(container *StorageDriverService) error { - return c.rancherClient.doResourceDelete(STORAGE_DRIVER_SERVICE_TYPE, &container.Resource) -} - -func (c *StorageDriverServiceClient) ActionActivate(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionAddservicelink(resource *StorageDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "addservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionCancelupgrade(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "cancelupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionContinueupgrade(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "continueupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionCreate(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionDeactivate(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionFinishupgrade(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "finishupgrade", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionRemove(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionRemoveservicelink(resource *StorageDriverService, input *AddRemoveServiceLinkInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "removeservicelink", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionRestart(resource *StorageDriverService, input *ServiceRestart) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "restart", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionRollback(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "rollback", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionSetservicelinks(resource *StorageDriverService, input *SetServiceLinksInput) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "setservicelinks", &resource.Resource, input, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionUpdate(resource *StorageDriverService) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StorageDriverServiceClient) ActionUpgrade(resource *StorageDriverService, input *ServiceUpgrade) (*Service, error) { - - resp := &Service{} - - err := c.rancherClient.doAction(STORAGE_DRIVER_SERVICE_TYPE, "upgrade", &resource.Resource, input, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go b/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go deleted file mode 100644 index e77c38211..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_storage_pool.go +++ /dev/null @@ -1,185 +0,0 @@ -package client - -const ( - STORAGE_POOL_TYPE = "storagePool" -) - -type StoragePool struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - BlockDevicePath string `json:"blockDevicePath,omitempty" yaml:"block_device_path,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DriverName string `json:"driverName,omitempty" yaml:"driver_name,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostIds []string `json:"hostIds,omitempty" yaml:"host_ids,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StorageDriverId string `json:"storageDriverId,omitempty" yaml:"storage_driver_id,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeAccessMode string `json:"volumeAccessMode,omitempty" yaml:"volume_access_mode,omitempty"` - - VolumeCapabilities []string `json:"volumeCapabilities,omitempty" yaml:"volume_capabilities,omitempty"` - - VolumeIds []string `json:"volumeIds,omitempty" yaml:"volume_ids,omitempty"` -} - -type StoragePoolCollection struct { - Collection - Data []StoragePool `json:"data,omitempty"` - client *StoragePoolClient -} - -type StoragePoolClient struct { - rancherClient *RancherClient -} - -type StoragePoolOperations interface { - List(opts *ListOpts) (*StoragePoolCollection, error) - Create(opts *StoragePool) (*StoragePool, error) - Update(existing *StoragePool, updates interface{}) (*StoragePool, error) - ById(id string) (*StoragePool, error) - Delete(container *StoragePool) error - - ActionActivate(*StoragePool) (*StoragePool, error) - - ActionCreate(*StoragePool) (*StoragePool, error) - - ActionDeactivate(*StoragePool) (*StoragePool, error) - - ActionPurge(*StoragePool) (*StoragePool, error) - - ActionRemove(*StoragePool) (*StoragePool, error) - - ActionUpdate(*StoragePool) (*StoragePool, error) -} - -func newStoragePoolClient(rancherClient *RancherClient) *StoragePoolClient { - return &StoragePoolClient{ - rancherClient: rancherClient, - } -} - -func (c *StoragePoolClient) Create(container *StoragePool) (*StoragePool, error) { - resp := &StoragePool{} - err := c.rancherClient.doCreate(STORAGE_POOL_TYPE, container, resp) - return resp, err -} - -func (c *StoragePoolClient) Update(existing *StoragePool, updates interface{}) (*StoragePool, error) { - resp := &StoragePool{} - err := c.rancherClient.doUpdate(STORAGE_POOL_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *StoragePoolClient) List(opts *ListOpts) (*StoragePoolCollection, error) { - resp := &StoragePoolCollection{} - err := c.rancherClient.doList(STORAGE_POOL_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *StoragePoolCollection) Next() (*StoragePoolCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &StoragePoolCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *StoragePoolClient) ById(id string) (*StoragePool, error) { - resp := &StoragePool{} - err := c.rancherClient.doById(STORAGE_POOL_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *StoragePoolClient) Delete(container *StoragePool) error { - return c.rancherClient.doResourceDelete(STORAGE_POOL_TYPE, &container.Resource) -} - -func (c *StoragePoolClient) ActionActivate(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionCreate(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionDeactivate(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionPurge(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionRemove(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *StoragePoolClient) ActionUpdate(resource *StoragePool) (*StoragePool, error) { - - resp := &StoragePool{} - - err := c.rancherClient.doAction(STORAGE_POOL_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go b/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go deleted file mode 100644 index f1a729700..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_subnet.go +++ /dev/null @@ -1,181 +0,0 @@ -package client - -const ( - SUBNET_TYPE = "subnet" -) - -type Subnet struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - CidrSize int64 `json:"cidrSize,omitempty" yaml:"cidr_size,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - EndAddress string `json:"endAddress,omitempty" yaml:"end_address,omitempty"` - - Gateway string `json:"gateway,omitempty" yaml:"gateway,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NetworkAddress string `json:"networkAddress,omitempty" yaml:"network_address,omitempty"` - - NetworkId string `json:"networkId,omitempty" yaml:"network_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StartAddress string `json:"startAddress,omitempty" yaml:"start_address,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type SubnetCollection struct { - Collection - Data []Subnet `json:"data,omitempty"` - client *SubnetClient -} - -type SubnetClient struct { - rancherClient *RancherClient -} - -type SubnetOperations interface { - List(opts *ListOpts) (*SubnetCollection, error) - Create(opts *Subnet) (*Subnet, error) - Update(existing *Subnet, updates interface{}) (*Subnet, error) - ById(id string) (*Subnet, error) - Delete(container *Subnet) error - - ActionActivate(*Subnet) (*Subnet, error) - - ActionCreate(*Subnet) (*Subnet, error) - - ActionDeactivate(*Subnet) (*Subnet, error) - - ActionPurge(*Subnet) (*Subnet, error) - - ActionRemove(*Subnet) (*Subnet, error) - - ActionUpdate(*Subnet) (*Subnet, error) -} - -func newSubnetClient(rancherClient *RancherClient) *SubnetClient { - return &SubnetClient{ - rancherClient: rancherClient, - } -} - -func (c *SubnetClient) Create(container *Subnet) (*Subnet, error) { - resp := &Subnet{} - err := c.rancherClient.doCreate(SUBNET_TYPE, container, resp) - return resp, err -} - -func (c *SubnetClient) Update(existing *Subnet, updates interface{}) (*Subnet, error) { - resp := &Subnet{} - err := c.rancherClient.doUpdate(SUBNET_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *SubnetClient) List(opts *ListOpts) (*SubnetCollection, error) { - resp := &SubnetCollection{} - err := c.rancherClient.doList(SUBNET_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *SubnetCollection) Next() (*SubnetCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &SubnetCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *SubnetClient) ById(id string) (*Subnet, error) { - resp := &Subnet{} - err := c.rancherClient.doById(SUBNET_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *SubnetClient) Delete(container *Subnet) error { - return c.rancherClient.doResourceDelete(SUBNET_TYPE, &container.Resource) -} - -func (c *SubnetClient) ActionActivate(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionCreate(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionDeactivate(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionPurge(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionRemove(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *SubnetClient) ActionUpdate(resource *Subnet) (*Subnet, error) { - - resp := &Subnet{} - - err := c.rancherClient.doAction(SUBNET_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go b/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go deleted file mode 100644 index 2acc18066..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_target_port_rule.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -const ( - TARGET_PORT_RULE_TYPE = "targetPortRule" -) - -type TargetPortRule struct { - Resource - - BackendName string `json:"backendName,omitempty" yaml:"backend_name,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - Path string `json:"path,omitempty" yaml:"path,omitempty"` - - TargetPort int64 `json:"targetPort,omitempty" yaml:"target_port,omitempty"` -} - -type TargetPortRuleCollection struct { - Collection - Data []TargetPortRule `json:"data,omitempty"` - client *TargetPortRuleClient -} - -type TargetPortRuleClient struct { - rancherClient *RancherClient -} - -type TargetPortRuleOperations interface { - List(opts *ListOpts) (*TargetPortRuleCollection, error) - Create(opts *TargetPortRule) (*TargetPortRule, error) - Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) - ById(id string) (*TargetPortRule, error) - Delete(container *TargetPortRule) error -} - -func newTargetPortRuleClient(rancherClient *RancherClient) *TargetPortRuleClient { - return &TargetPortRuleClient{ - rancherClient: rancherClient, - } -} - -func (c *TargetPortRuleClient) Create(container *TargetPortRule) (*TargetPortRule, error) { - resp := &TargetPortRule{} - err := c.rancherClient.doCreate(TARGET_PORT_RULE_TYPE, container, resp) - return resp, err -} - -func (c *TargetPortRuleClient) Update(existing *TargetPortRule, updates interface{}) (*TargetPortRule, error) { - resp := &TargetPortRule{} - err := c.rancherClient.doUpdate(TARGET_PORT_RULE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TargetPortRuleClient) List(opts *ListOpts) (*TargetPortRuleCollection, error) { - resp := &TargetPortRuleCollection{} - err := c.rancherClient.doList(TARGET_PORT_RULE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *TargetPortRuleCollection) Next() (*TargetPortRuleCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TargetPortRuleCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TargetPortRuleClient) ById(id string) (*TargetPortRule, error) { - resp := &TargetPortRule{} - err := c.rancherClient.doById(TARGET_PORT_RULE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *TargetPortRuleClient) Delete(container *TargetPortRule) error { - return c.rancherClient.doResourceDelete(TARGET_PORT_RULE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_task.go b/vendor/github.com/rancher/go-rancher/v2/generated_task.go deleted file mode 100644 index 8fa65e2db..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_task.go +++ /dev/null @@ -1,90 +0,0 @@ -package client - -const ( - TASK_TYPE = "task" -) - -type Task struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type TaskCollection struct { - Collection - Data []Task `json:"data,omitempty"` - client *TaskClient -} - -type TaskClient struct { - rancherClient *RancherClient -} - -type TaskOperations interface { - List(opts *ListOpts) (*TaskCollection, error) - Create(opts *Task) (*Task, error) - Update(existing *Task, updates interface{}) (*Task, error) - ById(id string) (*Task, error) - Delete(container *Task) error - - ActionExecute(*Task) (*Task, error) -} - -func newTaskClient(rancherClient *RancherClient) *TaskClient { - return &TaskClient{ - rancherClient: rancherClient, - } -} - -func (c *TaskClient) Create(container *Task) (*Task, error) { - resp := &Task{} - err := c.rancherClient.doCreate(TASK_TYPE, container, resp) - return resp, err -} - -func (c *TaskClient) Update(existing *Task, updates interface{}) (*Task, error) { - resp := &Task{} - err := c.rancherClient.doUpdate(TASK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TaskClient) List(opts *ListOpts) (*TaskCollection, error) { - resp := &TaskCollection{} - err := c.rancherClient.doList(TASK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *TaskCollection) Next() (*TaskCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TaskCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TaskClient) ById(id string) (*Task, error) { - resp := &Task{} - err := c.rancherClient.doById(TASK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *TaskClient) Delete(container *Task) error { - return c.rancherClient.doResourceDelete(TASK_TYPE, &container.Resource) -} - -func (c *TaskClient) ActionExecute(resource *Task) (*Task, error) { - - resp := &Task{} - - err := c.rancherClient.doAction(TASK_TYPE, "execute", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go b/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go deleted file mode 100644 index 5bb58273e..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_task_instance.go +++ /dev/null @@ -1,89 +0,0 @@ -package client - -const ( - TASK_INSTANCE_TYPE = "taskInstance" -) - -type TaskInstance struct { - Resource - - EndTime string `json:"endTime,omitempty" yaml:"end_time,omitempty"` - - Exception string `json:"exception,omitempty" yaml:"exception,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - ServerId string `json:"serverId,omitempty" yaml:"server_id,omitempty"` - - StartTime string `json:"startTime,omitempty" yaml:"start_time,omitempty"` - - TaskId string `json:"taskId,omitempty" yaml:"task_id,omitempty"` -} - -type TaskInstanceCollection struct { - Collection - Data []TaskInstance `json:"data,omitempty"` - client *TaskInstanceClient -} - -type TaskInstanceClient struct { - rancherClient *RancherClient -} - -type TaskInstanceOperations interface { - List(opts *ListOpts) (*TaskInstanceCollection, error) - Create(opts *TaskInstance) (*TaskInstance, error) - Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) - ById(id string) (*TaskInstance, error) - Delete(container *TaskInstance) error -} - -func newTaskInstanceClient(rancherClient *RancherClient) *TaskInstanceClient { - return &TaskInstanceClient{ - rancherClient: rancherClient, - } -} - -func (c *TaskInstanceClient) Create(container *TaskInstance) (*TaskInstance, error) { - resp := &TaskInstance{} - err := c.rancherClient.doCreate(TASK_INSTANCE_TYPE, container, resp) - return resp, err -} - -func (c *TaskInstanceClient) Update(existing *TaskInstance, updates interface{}) (*TaskInstance, error) { - resp := &TaskInstance{} - err := c.rancherClient.doUpdate(TASK_INSTANCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TaskInstanceClient) List(opts *ListOpts) (*TaskInstanceCollection, error) { - resp := &TaskInstanceCollection{} - err := c.rancherClient.doList(TASK_INSTANCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *TaskInstanceCollection) Next() (*TaskInstanceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TaskInstanceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TaskInstanceClient) ById(id string) (*TaskInstance, error) { - resp := &TaskInstance{} - err := c.rancherClient.doById(TASK_INSTANCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *TaskInstanceClient) Delete(container *TaskInstance) error { - return c.rancherClient.doResourceDelete(TASK_INSTANCE_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go b/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go deleted file mode 100644 index 3ed74115c..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_to_service_upgrade_strategy.go +++ /dev/null @@ -1,87 +0,0 @@ -package client - -const ( - TO_SERVICE_UPGRADE_STRATEGY_TYPE = "toServiceUpgradeStrategy" -) - -type ToServiceUpgradeStrategy struct { - Resource - - BatchSize int64 `json:"batchSize,omitempty" yaml:"batch_size,omitempty"` - - FinalScale int64 `json:"finalScale,omitempty" yaml:"final_scale,omitempty"` - - IntervalMillis int64 `json:"intervalMillis,omitempty" yaml:"interval_millis,omitempty"` - - ToServiceId string `json:"toServiceId,omitempty" yaml:"to_service_id,omitempty"` - - UpdateLinks bool `json:"updateLinks,omitempty" yaml:"update_links,omitempty"` -} - -type ToServiceUpgradeStrategyCollection struct { - Collection - Data []ToServiceUpgradeStrategy `json:"data,omitempty"` - client *ToServiceUpgradeStrategyClient -} - -type ToServiceUpgradeStrategyClient struct { - rancherClient *RancherClient -} - -type ToServiceUpgradeStrategyOperations interface { - List(opts *ListOpts) (*ToServiceUpgradeStrategyCollection, error) - Create(opts *ToServiceUpgradeStrategy) (*ToServiceUpgradeStrategy, error) - Update(existing *ToServiceUpgradeStrategy, updates interface{}) (*ToServiceUpgradeStrategy, error) - ById(id string) (*ToServiceUpgradeStrategy, error) - Delete(container *ToServiceUpgradeStrategy) error -} - -func newToServiceUpgradeStrategyClient(rancherClient *RancherClient) *ToServiceUpgradeStrategyClient { - return &ToServiceUpgradeStrategyClient{ - rancherClient: rancherClient, - } -} - -func (c *ToServiceUpgradeStrategyClient) Create(container *ToServiceUpgradeStrategy) (*ToServiceUpgradeStrategy, error) { - resp := &ToServiceUpgradeStrategy{} - err := c.rancherClient.doCreate(TO_SERVICE_UPGRADE_STRATEGY_TYPE, container, resp) - return resp, err -} - -func (c *ToServiceUpgradeStrategyClient) Update(existing *ToServiceUpgradeStrategy, updates interface{}) (*ToServiceUpgradeStrategy, error) { - resp := &ToServiceUpgradeStrategy{} - err := c.rancherClient.doUpdate(TO_SERVICE_UPGRADE_STRATEGY_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ToServiceUpgradeStrategyClient) List(opts *ListOpts) (*ToServiceUpgradeStrategyCollection, error) { - resp := &ToServiceUpgradeStrategyCollection{} - err := c.rancherClient.doList(TO_SERVICE_UPGRADE_STRATEGY_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ToServiceUpgradeStrategyCollection) Next() (*ToServiceUpgradeStrategyCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ToServiceUpgradeStrategyCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ToServiceUpgradeStrategyClient) ById(id string) (*ToServiceUpgradeStrategy, error) { - resp := &ToServiceUpgradeStrategy{} - err := c.rancherClient.doById(TO_SERVICE_UPGRADE_STRATEGY_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *ToServiceUpgradeStrategyClient) Delete(container *ToServiceUpgradeStrategy) error { - return c.rancherClient.doResourceDelete(TO_SERVICE_UPGRADE_STRATEGY_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go b/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go deleted file mode 100644 index cdfe18649..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_type_documentation.go +++ /dev/null @@ -1,81 +0,0 @@ -package client - -const ( - TYPE_DOCUMENTATION_TYPE = "typeDocumentation" -) - -type TypeDocumentation struct { - Resource - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - ResourceFields map[string]interface{} `json:"resourceFields,omitempty" yaml:"resource_fields,omitempty"` -} - -type TypeDocumentationCollection struct { - Collection - Data []TypeDocumentation `json:"data,omitempty"` - client *TypeDocumentationClient -} - -type TypeDocumentationClient struct { - rancherClient *RancherClient -} - -type TypeDocumentationOperations interface { - List(opts *ListOpts) (*TypeDocumentationCollection, error) - Create(opts *TypeDocumentation) (*TypeDocumentation, error) - Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) - ById(id string) (*TypeDocumentation, error) - Delete(container *TypeDocumentation) error -} - -func newTypeDocumentationClient(rancherClient *RancherClient) *TypeDocumentationClient { - return &TypeDocumentationClient{ - rancherClient: rancherClient, - } -} - -func (c *TypeDocumentationClient) Create(container *TypeDocumentation) (*TypeDocumentation, error) { - resp := &TypeDocumentation{} - err := c.rancherClient.doCreate(TYPE_DOCUMENTATION_TYPE, container, resp) - return resp, err -} - -func (c *TypeDocumentationClient) Update(existing *TypeDocumentation, updates interface{}) (*TypeDocumentation, error) { - resp := &TypeDocumentation{} - err := c.rancherClient.doUpdate(TYPE_DOCUMENTATION_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TypeDocumentationClient) List(opts *ListOpts) (*TypeDocumentationCollection, error) { - resp := &TypeDocumentationCollection{} - err := c.rancherClient.doList(TYPE_DOCUMENTATION_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *TypeDocumentationCollection) Next() (*TypeDocumentationCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TypeDocumentationCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TypeDocumentationClient) ById(id string) (*TypeDocumentation, error) { - resp := &TypeDocumentation{} - err := c.rancherClient.doById(TYPE_DOCUMENTATION_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *TypeDocumentationClient) Delete(container *TypeDocumentation) error { - return c.rancherClient.doResourceDelete(TYPE_DOCUMENTATION_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go b/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go deleted file mode 100644 index 7449c263b..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_ulimit.go +++ /dev/null @@ -1,83 +0,0 @@ -package client - -const ( - ULIMIT_TYPE = "ulimit" -) - -type Ulimit struct { - Resource - - Hard int64 `json:"hard,omitempty" yaml:"hard,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Soft int64 `json:"soft,omitempty" yaml:"soft,omitempty"` -} - -type UlimitCollection struct { - Collection - Data []Ulimit `json:"data,omitempty"` - client *UlimitClient -} - -type UlimitClient struct { - rancherClient *RancherClient -} - -type UlimitOperations interface { - List(opts *ListOpts) (*UlimitCollection, error) - Create(opts *Ulimit) (*Ulimit, error) - Update(existing *Ulimit, updates interface{}) (*Ulimit, error) - ById(id string) (*Ulimit, error) - Delete(container *Ulimit) error -} - -func newUlimitClient(rancherClient *RancherClient) *UlimitClient { - return &UlimitClient{ - rancherClient: rancherClient, - } -} - -func (c *UlimitClient) Create(container *Ulimit) (*Ulimit, error) { - resp := &Ulimit{} - err := c.rancherClient.doCreate(ULIMIT_TYPE, container, resp) - return resp, err -} - -func (c *UlimitClient) Update(existing *Ulimit, updates interface{}) (*Ulimit, error) { - resp := &Ulimit{} - err := c.rancherClient.doUpdate(ULIMIT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *UlimitClient) List(opts *ListOpts) (*UlimitCollection, error) { - resp := &UlimitCollection{} - err := c.rancherClient.doList(ULIMIT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *UlimitCollection) Next() (*UlimitCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &UlimitCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *UlimitClient) ById(id string) (*Ulimit, error) { - resp := &Ulimit{} - err := c.rancherClient.doById(ULIMIT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *UlimitClient) Delete(container *Ulimit) error { - return c.rancherClient.doResourceDelete(ULIMIT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go b/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go deleted file mode 100644 index 815b87ddf..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_user_preference.go +++ /dev/null @@ -1,173 +0,0 @@ -package client - -const ( - USER_PREFERENCE_TYPE = "userPreference" -) - -type UserPreference struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - All bool `json:"all,omitempty" yaml:"all,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Value string `json:"value,omitempty" yaml:"value,omitempty"` -} - -type UserPreferenceCollection struct { - Collection - Data []UserPreference `json:"data,omitempty"` - client *UserPreferenceClient -} - -type UserPreferenceClient struct { - rancherClient *RancherClient -} - -type UserPreferenceOperations interface { - List(opts *ListOpts) (*UserPreferenceCollection, error) - Create(opts *UserPreference) (*UserPreference, error) - Update(existing *UserPreference, updates interface{}) (*UserPreference, error) - ById(id string) (*UserPreference, error) - Delete(container *UserPreference) error - - ActionActivate(*UserPreference) (*UserPreference, error) - - ActionCreate(*UserPreference) (*UserPreference, error) - - ActionDeactivate(*UserPreference) (*UserPreference, error) - - ActionPurge(*UserPreference) (*UserPreference, error) - - ActionRemove(*UserPreference) (*UserPreference, error) - - ActionUpdate(*UserPreference) (*UserPreference, error) -} - -func newUserPreferenceClient(rancherClient *RancherClient) *UserPreferenceClient { - return &UserPreferenceClient{ - rancherClient: rancherClient, - } -} - -func (c *UserPreferenceClient) Create(container *UserPreference) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doCreate(USER_PREFERENCE_TYPE, container, resp) - return resp, err -} - -func (c *UserPreferenceClient) Update(existing *UserPreference, updates interface{}) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doUpdate(USER_PREFERENCE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *UserPreferenceClient) List(opts *ListOpts) (*UserPreferenceCollection, error) { - resp := &UserPreferenceCollection{} - err := c.rancherClient.doList(USER_PREFERENCE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *UserPreferenceCollection) Next() (*UserPreferenceCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &UserPreferenceCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *UserPreferenceClient) ById(id string) (*UserPreference, error) { - resp := &UserPreference{} - err := c.rancherClient.doById(USER_PREFERENCE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *UserPreferenceClient) Delete(container *UserPreference) error { - return c.rancherClient.doResourceDelete(USER_PREFERENCE_TYPE, &container.Resource) -} - -func (c *UserPreferenceClient) ActionActivate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionCreate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionDeactivate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionPurge(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionRemove(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *UserPreferenceClient) ActionUpdate(resource *UserPreference) (*UserPreference, error) { - - resp := &UserPreference{} - - err := c.rancherClient.doAction(USER_PREFERENCE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go deleted file mode 100644 index 69327b2f1..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine.go +++ /dev/null @@ -1,485 +0,0 @@ -package client - -const ( - VIRTUAL_MACHINE_TYPE = "virtualMachine" -) - -type VirtualMachine struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - AgentId string `json:"agentId,omitempty" yaml:"agent_id,omitempty"` - - AllocationState string `json:"allocationState,omitempty" yaml:"allocation_state,omitempty"` - - BlkioDeviceOptions map[string]interface{} `json:"blkioDeviceOptions,omitempty" yaml:"blkio_device_options,omitempty"` - - BlkioWeight int64 `json:"blkioWeight,omitempty" yaml:"blkio_weight,omitempty"` - - CgroupParent string `json:"cgroupParent,omitempty" yaml:"cgroup_parent,omitempty"` - - Command []string `json:"command,omitempty" yaml:"command,omitempty"` - - Count int64 `json:"count,omitempty" yaml:"count,omitempty"` - - CpuCount int64 `json:"cpuCount,omitempty" yaml:"cpu_count,omitempty"` - - CpuPercent int64 `json:"cpuPercent,omitempty" yaml:"cpu_percent,omitempty"` - - CpuPeriod int64 `json:"cpuPeriod,omitempty" yaml:"cpu_period,omitempty"` - - CpuQuota int64 `json:"cpuQuota,omitempty" yaml:"cpu_quota,omitempty"` - - CpuRealtimePeriod int64 `json:"cpuRealtimePeriod,omitempty" yaml:"cpu_realtime_period,omitempty"` - - CpuRealtimeRuntime int64 `json:"cpuRealtimeRuntime,omitempty" yaml:"cpu_realtime_runtime,omitempty"` - - CpuSet string `json:"cpuSet,omitempty" yaml:"cpu_set,omitempty"` - - CpuSetMems string `json:"cpuSetMems,omitempty" yaml:"cpu_set_mems,omitempty"` - - CpuShares int64 `json:"cpuShares,omitempty" yaml:"cpu_shares,omitempty"` - - CreateIndex int64 `json:"createIndex,omitempty" yaml:"create_index,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - DeploymentUnitUuid string `json:"deploymentUnitUuid,omitempty" yaml:"deployment_unit_uuid,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - DiskQuota int64 `json:"diskQuota,omitempty" yaml:"disk_quota,omitempty"` - - Disks []VirtualMachineDisk `json:"disks,omitempty" yaml:"disks,omitempty"` - - Dns []string `json:"dns,omitempty" yaml:"dns,omitempty"` - - DnsOpt []string `json:"dnsOpt,omitempty" yaml:"dns_opt,omitempty"` - - DnsSearch []string `json:"dnsSearch,omitempty" yaml:"dns_search,omitempty"` - - DomainName string `json:"domainName,omitempty" yaml:"domain_name,omitempty"` - - Expose []string `json:"expose,omitempty" yaml:"expose,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - ExtraHosts []string `json:"extraHosts,omitempty" yaml:"extra_hosts,omitempty"` - - FirstRunning string `json:"firstRunning,omitempty" yaml:"first_running,omitempty"` - - GroupAdd []string `json:"groupAdd,omitempty" yaml:"group_add,omitempty"` - - HealthCheck *InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"` - - HealthCmd []string `json:"healthCmd,omitempty" yaml:"health_cmd,omitempty"` - - HealthInterval int64 `json:"healthInterval,omitempty" yaml:"health_interval,omitempty"` - - HealthRetries int64 `json:"healthRetries,omitempty" yaml:"health_retries,omitempty"` - - HealthState string `json:"healthState,omitempty" yaml:"health_state,omitempty"` - - HealthTimeout int64 `json:"healthTimeout,omitempty" yaml:"health_timeout,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"` - - ImageUuid string `json:"imageUuid,omitempty" yaml:"image_uuid,omitempty"` - - InstanceLinks map[string]interface{} `json:"instanceLinks,omitempty" yaml:"instance_links,omitempty"` - - InstanceTriggeredStop string `json:"instanceTriggeredStop,omitempty" yaml:"instance_triggered_stop,omitempty"` - - IoMaximumBandwidth int64 `json:"ioMaximumBandwidth,omitempty" yaml:"io_maximum_bandwidth,omitempty"` - - IoMaximumIOps int64 `json:"ioMaximumIOps,omitempty" yaml:"io_maximum_iops,omitempty"` - - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - - Ip6 string `json:"ip6,omitempty" yaml:"ip6,omitempty"` - - IpcMode string `json:"ipcMode,omitempty" yaml:"ipc_mode,omitempty"` - - Isolation string `json:"isolation,omitempty" yaml:"isolation,omitempty"` - - KernelMemory int64 `json:"kernelMemory,omitempty" yaml:"kernel_memory,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Labels map[string]interface{} `json:"labels,omitempty" yaml:"labels,omitempty"` - - LogConfig *LogConfig `json:"logConfig,omitempty" yaml:"log_config,omitempty"` - - Memory int64 `json:"memory,omitempty" yaml:"memory,omitempty"` - - MemoryMb int64 `json:"memoryMb,omitempty" yaml:"memory_mb,omitempty"` - - MemoryReservation int64 `json:"memoryReservation,omitempty" yaml:"memory_reservation,omitempty"` - - MemorySwap int64 `json:"memorySwap,omitempty" yaml:"memory_swap,omitempty"` - - MemorySwappiness int64 `json:"memorySwappiness,omitempty" yaml:"memory_swappiness,omitempty"` - - MilliCpuReservation int64 `json:"milliCpuReservation,omitempty" yaml:"milli_cpu_reservation,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - NativeContainer bool `json:"nativeContainer,omitempty" yaml:"native_container,omitempty"` - - NetAlias []string `json:"netAlias,omitempty" yaml:"net_alias,omitempty"` - - NetworkIds []string `json:"networkIds,omitempty" yaml:"network_ids,omitempty"` - - NetworkMode string `json:"networkMode,omitempty" yaml:"network_mode,omitempty"` - - OomKillDisable bool `json:"oomKillDisable,omitempty" yaml:"oom_kill_disable,omitempty"` - - OomScoreAdj int64 `json:"oomScoreAdj,omitempty" yaml:"oom_score_adj,omitempty"` - - PidsLimit int64 `json:"pidsLimit,omitempty" yaml:"pids_limit,omitempty"` - - Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` - - PrimaryIpAddress string `json:"primaryIpAddress,omitempty" yaml:"primary_ip_address,omitempty"` - - PrimaryNetworkId string `json:"primaryNetworkId,omitempty" yaml:"primary_network_id,omitempty"` - - RegistryCredentialId string `json:"registryCredentialId,omitempty" yaml:"registry_credential_id,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - RequestedHostId string `json:"requestedHostId,omitempty" yaml:"requested_host_id,omitempty"` - - RestartPolicy *RestartPolicy `json:"restartPolicy,omitempty" yaml:"restart_policy,omitempty"` - - RunInit bool `json:"runInit,omitempty" yaml:"run_init,omitempty"` - - SecurityOpt []string `json:"securityOpt,omitempty" yaml:"security_opt,omitempty"` - - ServiceId string `json:"serviceId,omitempty" yaml:"service_id,omitempty"` - - ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"` - - ShmSize int64 `json:"shmSize,omitempty" yaml:"shm_size,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - StartCount int64 `json:"startCount,omitempty" yaml:"start_count,omitempty"` - - StartOnCreate bool `json:"startOnCreate,omitempty" yaml:"start_on_create,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StopSignal string `json:"stopSignal,omitempty" yaml:"stop_signal,omitempty"` - - StopTimeout int64 `json:"stopTimeout,omitempty" yaml:"stop_timeout,omitempty"` - - StorageOpt map[string]interface{} `json:"storageOpt,omitempty" yaml:"storage_opt,omitempty"` - - Sysctls map[string]interface{} `json:"sysctls,omitempty" yaml:"sysctls,omitempty"` - - System bool `json:"system,omitempty" yaml:"system,omitempty"` - - Tmpfs map[string]interface{} `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"` - - Token string `json:"token,omitempty" yaml:"token,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Ulimits []Ulimit `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` - - UserPorts []string `json:"userPorts,omitempty" yaml:"user_ports,omitempty"` - - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - - UsernsMode string `json:"usernsMode,omitempty" yaml:"userns_mode,omitempty"` - - Uts string `json:"uts,omitempty" yaml:"uts,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - Vcpu int64 `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - - VolumeDriver string `json:"volumeDriver,omitempty" yaml:"volume_driver,omitempty"` -} - -type VirtualMachineCollection struct { - Collection - Data []VirtualMachine `json:"data,omitempty"` - client *VirtualMachineClient -} - -type VirtualMachineClient struct { - rancherClient *RancherClient -} - -type VirtualMachineOperations interface { - List(opts *ListOpts) (*VirtualMachineCollection, error) - Create(opts *VirtualMachine) (*VirtualMachine, error) - Update(existing *VirtualMachine, updates interface{}) (*VirtualMachine, error) - ById(id string) (*VirtualMachine, error) - Delete(container *VirtualMachine) error - - ActionAllocate(*VirtualMachine) (*Instance, error) - - ActionConsole(*VirtualMachine, *InstanceConsoleInput) (*InstanceConsole, error) - - ActionCreate(*VirtualMachine) (*Instance, error) - - ActionDeallocate(*VirtualMachine) (*Instance, error) - - ActionError(*VirtualMachine) (*Instance, error) - - ActionExecute(*VirtualMachine, *ContainerExec) (*HostAccess, error) - - ActionLogs(*VirtualMachine, *ContainerLogs) (*HostAccess, error) - - ActionMigrate(*VirtualMachine) (*Instance, error) - - ActionProxy(*VirtualMachine, *ContainerProxy) (*HostAccess, error) - - ActionPurge(*VirtualMachine) (*Instance, error) - - ActionRemove(*VirtualMachine) (*Instance, error) - - ActionRestart(*VirtualMachine) (*Instance, error) - - ActionStart(*VirtualMachine) (*Instance, error) - - ActionStop(*VirtualMachine, *InstanceStop) (*Instance, error) - - ActionUpdate(*VirtualMachine) (*Instance, error) - - ActionUpdatehealthy(*VirtualMachine) (*Instance, error) - - ActionUpdatereinitializing(*VirtualMachine) (*Instance, error) - - ActionUpdateunhealthy(*VirtualMachine) (*Instance, error) -} - -func newVirtualMachineClient(rancherClient *RancherClient) *VirtualMachineClient { - return &VirtualMachineClient{ - rancherClient: rancherClient, - } -} - -func (c *VirtualMachineClient) Create(container *VirtualMachine) (*VirtualMachine, error) { - resp := &VirtualMachine{} - err := c.rancherClient.doCreate(VIRTUAL_MACHINE_TYPE, container, resp) - return resp, err -} - -func (c *VirtualMachineClient) Update(existing *VirtualMachine, updates interface{}) (*VirtualMachine, error) { - resp := &VirtualMachine{} - err := c.rancherClient.doUpdate(VIRTUAL_MACHINE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VirtualMachineClient) List(opts *ListOpts) (*VirtualMachineCollection, error) { - resp := &VirtualMachineCollection{} - err := c.rancherClient.doList(VIRTUAL_MACHINE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VirtualMachineCollection) Next() (*VirtualMachineCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VirtualMachineCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VirtualMachineClient) ById(id string) (*VirtualMachine, error) { - resp := &VirtualMachine{} - err := c.rancherClient.doById(VIRTUAL_MACHINE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VirtualMachineClient) Delete(container *VirtualMachine) error { - return c.rancherClient.doResourceDelete(VIRTUAL_MACHINE_TYPE, &container.Resource) -} - -func (c *VirtualMachineClient) ActionAllocate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionConsole(resource *VirtualMachine, input *InstanceConsoleInput) (*InstanceConsole, error) { - - resp := &InstanceConsole{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "console", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionCreate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionDeallocate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionError(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "error", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionExecute(resource *VirtualMachine, input *ContainerExec) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "execute", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionLogs(resource *VirtualMachine, input *ContainerLogs) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "logs", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionMigrate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "migrate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionProxy(resource *VirtualMachine, input *ContainerProxy) (*HostAccess, error) { - - resp := &HostAccess{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "proxy", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionPurge(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionRemove(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionRestart(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "restart", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionStart(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "start", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionStop(resource *VirtualMachine, input *InstanceStop) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "stop", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionUpdate(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionUpdatehealthy(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updatehealthy", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionUpdatereinitializing(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updatereinitializing", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VirtualMachineClient) ActionUpdateunhealthy(resource *VirtualMachine) (*Instance, error) { - - resp := &Instance{} - - err := c.rancherClient.doAction(VIRTUAL_MACHINE_TYPE, "updateunhealthy", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go b/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go deleted file mode 100644 index af52418d3..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_virtual_machine_disk.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -const ( - VIRTUAL_MACHINE_DISK_TYPE = "virtualMachineDisk" -) - -type VirtualMachineDisk struct { - Resource - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - Opts map[string]interface{} `json:"opts,omitempty" yaml:"opts,omitempty"` - - ReadIops int64 `json:"readIops,omitempty" yaml:"read_iops,omitempty"` - - Root bool `json:"root,omitempty" yaml:"root,omitempty"` - - Size string `json:"size,omitempty" yaml:"size,omitempty"` - - WriteIops int64 `json:"writeIops,omitempty" yaml:"write_iops,omitempty"` -} - -type VirtualMachineDiskCollection struct { - Collection - Data []VirtualMachineDisk `json:"data,omitempty"` - client *VirtualMachineDiskClient -} - -type VirtualMachineDiskClient struct { - rancherClient *RancherClient -} - -type VirtualMachineDiskOperations interface { - List(opts *ListOpts) (*VirtualMachineDiskCollection, error) - Create(opts *VirtualMachineDisk) (*VirtualMachineDisk, error) - Update(existing *VirtualMachineDisk, updates interface{}) (*VirtualMachineDisk, error) - ById(id string) (*VirtualMachineDisk, error) - Delete(container *VirtualMachineDisk) error -} - -func newVirtualMachineDiskClient(rancherClient *RancherClient) *VirtualMachineDiskClient { - return &VirtualMachineDiskClient{ - rancherClient: rancherClient, - } -} - -func (c *VirtualMachineDiskClient) Create(container *VirtualMachineDisk) (*VirtualMachineDisk, error) { - resp := &VirtualMachineDisk{} - err := c.rancherClient.doCreate(VIRTUAL_MACHINE_DISK_TYPE, container, resp) - return resp, err -} - -func (c *VirtualMachineDiskClient) Update(existing *VirtualMachineDisk, updates interface{}) (*VirtualMachineDisk, error) { - resp := &VirtualMachineDisk{} - err := c.rancherClient.doUpdate(VIRTUAL_MACHINE_DISK_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VirtualMachineDiskClient) List(opts *ListOpts) (*VirtualMachineDiskCollection, error) { - resp := &VirtualMachineDiskCollection{} - err := c.rancherClient.doList(VIRTUAL_MACHINE_DISK_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VirtualMachineDiskCollection) Next() (*VirtualMachineDiskCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VirtualMachineDiskCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VirtualMachineDiskClient) ById(id string) (*VirtualMachineDisk, error) { - resp := &VirtualMachineDisk{} - err := c.rancherClient.doById(VIRTUAL_MACHINE_DISK_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VirtualMachineDiskClient) Delete(container *VirtualMachineDisk) error { - return c.rancherClient.doResourceDelete(VIRTUAL_MACHINE_DISK_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume.go deleted file mode 100644 index 00b4e5dd4..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_volume.go +++ /dev/null @@ -1,230 +0,0 @@ -package client - -const ( - VOLUME_TYPE = "volume" -) - -type Volume struct { - Resource - - AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"` - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - DriverOpts map[string]interface{} `json:"driverOpts,omitempty" yaml:"driver_opts,omitempty"` - - ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` - - ImageId string `json:"imageId,omitempty" yaml:"image_id,omitempty"` - - InstanceId string `json:"instanceId,omitempty" yaml:"instance_id,omitempty"` - - IsHostPath bool `json:"isHostPath,omitempty" yaml:"is_host_path,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Mounts []MountEntry `json:"mounts,omitempty" yaml:"mounts,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - SizeMb int64 `json:"sizeMb,omitempty" yaml:"size_mb,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - StorageDriverId string `json:"storageDriverId,omitempty" yaml:"storage_driver_id,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uri string `json:"uri,omitempty" yaml:"uri,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - - VolumeTemplateId string `json:"volumeTemplateId,omitempty" yaml:"volume_template_id,omitempty"` -} - -type VolumeCollection struct { - Collection - Data []Volume `json:"data,omitempty"` - client *VolumeClient -} - -type VolumeClient struct { - rancherClient *RancherClient -} - -type VolumeOperations interface { - List(opts *ListOpts) (*VolumeCollection, error) - Create(opts *Volume) (*Volume, error) - Update(existing *Volume, updates interface{}) (*Volume, error) - ById(id string) (*Volume, error) - Delete(container *Volume) error - - ActionAllocate(*Volume) (*Volume, error) - - ActionCreate(*Volume) (*Volume, error) - - ActionDeallocate(*Volume) (*Volume, error) - - ActionPurge(*Volume) (*Volume, error) - - ActionRemove(*Volume) (*Volume, error) - - ActionRestorefrombackup(*Volume, *RestoreFromBackupInput) (*Volume, error) - - ActionReverttosnapshot(*Volume, *RevertToSnapshotInput) (*Volume, error) - - ActionSnapshot(*Volume, *VolumeSnapshotInput) (*Snapshot, error) - - ActionUpdate(*Volume) (*Volume, error) -} - -func newVolumeClient(rancherClient *RancherClient) *VolumeClient { - return &VolumeClient{ - rancherClient: rancherClient, - } -} - -func (c *VolumeClient) Create(container *Volume) (*Volume, error) { - resp := &Volume{} - err := c.rancherClient.doCreate(VOLUME_TYPE, container, resp) - return resp, err -} - -func (c *VolumeClient) Update(existing *Volume, updates interface{}) (*Volume, error) { - resp := &Volume{} - err := c.rancherClient.doUpdate(VOLUME_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VolumeClient) List(opts *ListOpts) (*VolumeCollection, error) { - resp := &VolumeCollection{} - err := c.rancherClient.doList(VOLUME_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VolumeCollection) Next() (*VolumeCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VolumeCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VolumeClient) ById(id string) (*Volume, error) { - resp := &Volume{} - err := c.rancherClient.doById(VOLUME_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VolumeClient) Delete(container *Volume) error { - return c.rancherClient.doResourceDelete(VOLUME_TYPE, &container.Resource) -} - -func (c *VolumeClient) ActionAllocate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "allocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionCreate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionDeallocate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "deallocate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionPurge(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionRemove(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeClient) ActionRestorefrombackup(resource *Volume, input *RestoreFromBackupInput) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "restorefrombackup", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VolumeClient) ActionReverttosnapshot(resource *Volume, input *RevertToSnapshotInput) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "reverttosnapshot", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VolumeClient) ActionSnapshot(resource *Volume, input *VolumeSnapshotInput) (*Snapshot, error) { - - resp := &Snapshot{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "snapshot", &resource.Resource, input, resp) - - return resp, err -} - -func (c *VolumeClient) ActionUpdate(resource *Volume) (*Volume, error) { - - resp := &Volume{} - - err := c.rancherClient.doAction(VOLUME_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go deleted file mode 100644 index be4269a6e..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_volume_activate_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - VOLUME_ACTIVATE_INPUT_TYPE = "volumeActivateInput" -) - -type VolumeActivateInput struct { - Resource - - HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` -} - -type VolumeActivateInputCollection struct { - Collection - Data []VolumeActivateInput `json:"data,omitempty"` - client *VolumeActivateInputClient -} - -type VolumeActivateInputClient struct { - rancherClient *RancherClient -} - -type VolumeActivateInputOperations interface { - List(opts *ListOpts) (*VolumeActivateInputCollection, error) - Create(opts *VolumeActivateInput) (*VolumeActivateInput, error) - Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) - ById(id string) (*VolumeActivateInput, error) - Delete(container *VolumeActivateInput) error -} - -func newVolumeActivateInputClient(rancherClient *RancherClient) *VolumeActivateInputClient { - return &VolumeActivateInputClient{ - rancherClient: rancherClient, - } -} - -func (c *VolumeActivateInputClient) Create(container *VolumeActivateInput) (*VolumeActivateInput, error) { - resp := &VolumeActivateInput{} - err := c.rancherClient.doCreate(VOLUME_ACTIVATE_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *VolumeActivateInputClient) Update(existing *VolumeActivateInput, updates interface{}) (*VolumeActivateInput, error) { - resp := &VolumeActivateInput{} - err := c.rancherClient.doUpdate(VOLUME_ACTIVATE_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VolumeActivateInputClient) List(opts *ListOpts) (*VolumeActivateInputCollection, error) { - resp := &VolumeActivateInputCollection{} - err := c.rancherClient.doList(VOLUME_ACTIVATE_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VolumeActivateInputCollection) Next() (*VolumeActivateInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VolumeActivateInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VolumeActivateInputClient) ById(id string) (*VolumeActivateInput, error) { - resp := &VolumeActivateInput{} - err := c.rancherClient.doById(VOLUME_ACTIVATE_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VolumeActivateInputClient) Delete(container *VolumeActivateInput) error { - return c.rancherClient.doResourceDelete(VOLUME_ACTIVATE_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go deleted file mode 100644 index 2e2425a26..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_volume_snapshot_input.go +++ /dev/null @@ -1,79 +0,0 @@ -package client - -const ( - VOLUME_SNAPSHOT_INPUT_TYPE = "volumeSnapshotInput" -) - -type VolumeSnapshotInput struct { - Resource - - Name string `json:"name,omitempty" yaml:"name,omitempty"` -} - -type VolumeSnapshotInputCollection struct { - Collection - Data []VolumeSnapshotInput `json:"data,omitempty"` - client *VolumeSnapshotInputClient -} - -type VolumeSnapshotInputClient struct { - rancherClient *RancherClient -} - -type VolumeSnapshotInputOperations interface { - List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) - Create(opts *VolumeSnapshotInput) (*VolumeSnapshotInput, error) - Update(existing *VolumeSnapshotInput, updates interface{}) (*VolumeSnapshotInput, error) - ById(id string) (*VolumeSnapshotInput, error) - Delete(container *VolumeSnapshotInput) error -} - -func newVolumeSnapshotInputClient(rancherClient *RancherClient) *VolumeSnapshotInputClient { - return &VolumeSnapshotInputClient{ - rancherClient: rancherClient, - } -} - -func (c *VolumeSnapshotInputClient) Create(container *VolumeSnapshotInput) (*VolumeSnapshotInput, error) { - resp := &VolumeSnapshotInput{} - err := c.rancherClient.doCreate(VOLUME_SNAPSHOT_INPUT_TYPE, container, resp) - return resp, err -} - -func (c *VolumeSnapshotInputClient) Update(existing *VolumeSnapshotInput, updates interface{}) (*VolumeSnapshotInput, error) { - resp := &VolumeSnapshotInput{} - err := c.rancherClient.doUpdate(VOLUME_SNAPSHOT_INPUT_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VolumeSnapshotInputClient) List(opts *ListOpts) (*VolumeSnapshotInputCollection, error) { - resp := &VolumeSnapshotInputCollection{} - err := c.rancherClient.doList(VOLUME_SNAPSHOT_INPUT_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VolumeSnapshotInputCollection) Next() (*VolumeSnapshotInputCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VolumeSnapshotInputCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VolumeSnapshotInputClient) ById(id string) (*VolumeSnapshotInput, error) { - resp := &VolumeSnapshotInput{} - err := c.rancherClient.doById(VOLUME_SNAPSHOT_INPUT_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VolumeSnapshotInputClient) Delete(container *VolumeSnapshotInput) error { - return c.rancherClient.doResourceDelete(VOLUME_SNAPSHOT_INPUT_TYPE, &container.Resource) -} diff --git a/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go b/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go deleted file mode 100644 index a7479127f..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/generated_volume_template.go +++ /dev/null @@ -1,179 +0,0 @@ -package client - -const ( - VOLUME_TEMPLATE_TYPE = "volumeTemplate" -) - -type VolumeTemplate struct { - Resource - - AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` - - Created string `json:"created,omitempty" yaml:"created,omitempty"` - - Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` - - Description string `json:"description,omitempty" yaml:"description,omitempty"` - - Driver string `json:"driver,omitempty" yaml:"driver,omitempty"` - - DriverOpts map[string]interface{} `json:"driverOpts,omitempty" yaml:"driver_opts,omitempty"` - - External bool `json:"external,omitempty" yaml:"external,omitempty"` - - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - - Name string `json:"name,omitempty" yaml:"name,omitempty"` - - PerContainer bool `json:"perContainer,omitempty" yaml:"per_container,omitempty"` - - RemoveTime string `json:"removeTime,omitempty" yaml:"remove_time,omitempty"` - - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - - StackId string `json:"stackId,omitempty" yaml:"stack_id,omitempty"` - - State string `json:"state,omitempty" yaml:"state,omitempty"` - - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` - - TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` - - Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type VolumeTemplateCollection struct { - Collection - Data []VolumeTemplate `json:"data,omitempty"` - client *VolumeTemplateClient -} - -type VolumeTemplateClient struct { - rancherClient *RancherClient -} - -type VolumeTemplateOperations interface { - List(opts *ListOpts) (*VolumeTemplateCollection, error) - Create(opts *VolumeTemplate) (*VolumeTemplate, error) - Update(existing *VolumeTemplate, updates interface{}) (*VolumeTemplate, error) - ById(id string) (*VolumeTemplate, error) - Delete(container *VolumeTemplate) error - - ActionActivate(*VolumeTemplate) (*VolumeTemplate, error) - - ActionCreate(*VolumeTemplate) (*VolumeTemplate, error) - - ActionDeactivate(*VolumeTemplate) (*VolumeTemplate, error) - - ActionPurge(*VolumeTemplate) (*VolumeTemplate, error) - - ActionRemove(*VolumeTemplate) (*VolumeTemplate, error) - - ActionUpdate(*VolumeTemplate) (*VolumeTemplate, error) -} - -func newVolumeTemplateClient(rancherClient *RancherClient) *VolumeTemplateClient { - return &VolumeTemplateClient{ - rancherClient: rancherClient, - } -} - -func (c *VolumeTemplateClient) Create(container *VolumeTemplate) (*VolumeTemplate, error) { - resp := &VolumeTemplate{} - err := c.rancherClient.doCreate(VOLUME_TEMPLATE_TYPE, container, resp) - return resp, err -} - -func (c *VolumeTemplateClient) Update(existing *VolumeTemplate, updates interface{}) (*VolumeTemplate, error) { - resp := &VolumeTemplate{} - err := c.rancherClient.doUpdate(VOLUME_TEMPLATE_TYPE, &existing.Resource, updates, resp) - return resp, err -} - -func (c *VolumeTemplateClient) List(opts *ListOpts) (*VolumeTemplateCollection, error) { - resp := &VolumeTemplateCollection{} - err := c.rancherClient.doList(VOLUME_TEMPLATE_TYPE, opts, resp) - resp.client = c - return resp, err -} - -func (cc *VolumeTemplateCollection) Next() (*VolumeTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &VolumeTemplateCollection{} - err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *VolumeTemplateClient) ById(id string) (*VolumeTemplate, error) { - resp := &VolumeTemplate{} - err := c.rancherClient.doById(VOLUME_TEMPLATE_TYPE, id, resp) - if apiError, ok := err.(*ApiError); ok { - if apiError.StatusCode == 404 { - return nil, nil - } - } - return resp, err -} - -func (c *VolumeTemplateClient) Delete(container *VolumeTemplate) error { - return c.rancherClient.doResourceDelete(VOLUME_TEMPLATE_TYPE, &container.Resource) -} - -func (c *VolumeTemplateClient) ActionActivate(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "activate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionCreate(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "create", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionDeactivate(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "deactivate", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionPurge(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "purge", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionRemove(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "remove", &resource.Resource, nil, resp) - - return resp, err -} - -func (c *VolumeTemplateClient) ActionUpdate(resource *VolumeTemplate) (*VolumeTemplate, error) { - - resp := &VolumeTemplate{} - - err := c.rancherClient.doAction(VOLUME_TEMPLATE_TYPE, "update", &resource.Resource, nil, resp) - - return resp, err -} diff --git a/vendor/github.com/rancher/go-rancher/v2/schemas.go b/vendor/github.com/rancher/go-rancher/v2/schemas.go deleted file mode 100644 index bcb6a7ec5..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/schemas.go +++ /dev/null @@ -1,131 +0,0 @@ -package client - -import ( - "reflect" - "strings" -) - -type Schemas struct { - Collection - Data []Schema `json:"data,omitempty"` - schemasByName map[string]*Schema -} - -func (s *Schema) CheckField(name string) (Field, bool) { - for fieldName := range s.ResourceFields { - if fieldName == name { - v, ok := s.ResourceFields[fieldName] - return v, ok - } - } - return Field{}, false -} - -func (s *Schema) Field(name string) Field { - f, _ := s.CheckField(name) - return f -} - -func (s *Schemas) CheckSchema(name string) (Schema, bool) { - for i := range s.Data { - if s.Data[i].Id == name { - return s.Data[i], true - } - } - return Schema{}, false -} - -func (s *Schemas) Schema(name string) Schema { - r, _ := s.CheckSchema(name) - return r -} - -func typeToFields(t reflect.Type) map[string]Field { - result := map[string]Field{} - - for i := 0; i < t.NumField(); i++ { - schemaField := Field{} - - typeField := t.Field(i) - if typeField.Anonymous && typeField.Type.Kind() == reflect.Struct { - parentFields := typeToFields(typeField.Type) - for k, v := range result { - parentFields[k] = v - } - result = parentFields - continue - } else if typeField.Anonymous { - continue - } else if privateFieldRegex.FindStringIndex(typeField.Name) != nil { - continue - } - - fieldString := strings.ToLower(typeField.Type.Kind().String()) - - switch { - case strings.HasPrefix(fieldString, "int") || strings.HasPrefix(fieldString, "uint"): - schemaField.Type = "int" - case fieldString == "bool": - schemaField.Type = fieldString - case fieldString == "float32" || fieldString == "float64": - schemaField.Type = "float" - case fieldString == "string": - schemaField.Type = "string" - case fieldString == "map": - // HACK - schemaField.Type = "map[string]" - case fieldString == "slice": - // HACK - schemaField.Type = "array[string]" - } - - name := strings.Split(typeField.Tag.Get("json"), ",")[0] - if name == "" && len(typeField.Name) > 1 { - name = strings.ToLower(typeField.Name[0:1]) + typeField.Name[1:] - } else if name == "" { - name = typeField.Name - } - - if schemaField.Type != "" { - result[name] = schemaField - } - } - - return result -} - -func (s *Schemas) AddType(schemaName string, obj interface{}) *Schema { - t := reflect.TypeOf(obj) - schema := Schema{ - Resource: Resource{ - Id: schemaName, - Type: "schema", - Links: map[string]string{}, - }, - PluralName: guessPluralName(schemaName), - ResourceFields: typeToFields(t), - CollectionMethods: []string{"GET"}, - ResourceMethods: []string{"GET"}, - } - - if s.Data == nil { - s.Data = []Schema{} - } - - s.Data = append(s.Data, schema) - - return &s.Data[len(s.Data)-1] -} - -func guessPluralName(name string) string { - if name == "" { - return "" - } - - if strings.HasSuffix(name, "s") || - strings.HasSuffix(name, "ch") || - strings.HasSuffix(name, "x") { - return name + "es" - } - return name + "s" -} diff --git a/vendor/github.com/rancher/go-rancher/v2/types.go b/vendor/github.com/rancher/go-rancher/v2/types.go deleted file mode 100644 index 905df87ff..000000000 --- a/vendor/github.com/rancher/go-rancher/v2/types.go +++ /dev/null @@ -1,95 +0,0 @@ -package client - -type Collection struct { - Type string `json:"type,omitempty"` - ResourceType string `json:"resourceType,omitempty"` - Links map[string]string `json:"links,omitempty"` - CreateTypes map[string]string `json:"createTypes,omitempty"` - Actions map[string]string `json:"actions,omitempty"` - SortLinks map[string]string `json:"sortLinks,omitempty"` - Pagination *Pagination `json:"pagination,omitempty"` - Sort *Sort `json:"sort,omitempty"` - Filters map[string][]Condition `json:"filters,omitempty"` -} - -type GenericCollection struct { - Collection - Data []interface{} `json:"data,omitempty"` -} - -type ResourceCollection struct { - Collection - Data []Resource `json:"data,omitempty"` -} - -type Sort struct { - Name string `json:"name,omitempty"` - Order string `json:"order,omitempty"` - Reverse string `json:"reverse,omitempty"` -} - -type Condition struct { - Modifier string `json:"modifier,omitempty"` - Value interface{} `json:"value,omitempty"` -} - -type Pagination struct { - Marker string `json:"marker,omitempty"` - First string `json:"first,omitempty"` - Previous string `json:"previous,omitempty"` - Next string `json:"next,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Total *int64 `json:"total,omitempty"` - Partial bool `json:"partial,omitempty"` -} - -type Resource struct { - Id string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Links map[string]string `json:"links"` - Actions map[string]string `json:"actions"` -} - -type Schema struct { - Resource - PluralName string `json:"pluralName,omitempty"` - ResourceMethods []string `json:"resourceMethods,omitempty"` - ResourceFields map[string]Field `json:"resourceFields,omitempty"` - ResourceActions map[string]Action `json:"resourceActions,omitempty"` - CollectionMethods []string `json:"collectionMethods,omitempty"` - CollectionFields map[string]Field `json:"collectionFields,omitempty"` - CollectionActions map[string]Action `json:"collectionActions,omitempty"` - CollectionFilters map[string]Filter `json:"collectionFilters,omitempty"` - IncludeableLinks []string `json:"includeableLinks,omitempty"` -} - -type Field struct { - Type string `json:"type,omitempty"` - Default interface{} `json:"default,omitempty"` - Unique bool `json:"unique,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Create bool `json:"create,omitempty"` - Required bool `json:"required,omitempty"` - Update bool `json:"update,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - Min *int64 `json:"min,omitempty"` - Max *int64 `json:"max,omitempty"` - Options []string `json:"options,omitempty"` - ValidChars string `json:"validChars,omitempty"` - InvalidChars string `json:"invalidChars,omitempty"` - Description string `json:"description,omitempty"` -} - -type Action struct { - Input string `json:"input,omitempty"` - Output string `json:"output,omitempty"` -} - -type Filter struct { - Modifiers []string `json:"modifiers,omitempty"` -} - -type ListOpts struct { - Filters map[string]interface{} -} diff --git a/vendor/github.com/samuel/go-zookeeper/LICENSE b/vendor/github.com/samuel/go-zookeeper/LICENSE deleted file mode 100644 index bc00498c5..000000000 --- a/vendor/github.com/samuel/go-zookeeper/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2013, Samuel Stauffer -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of the author nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/samuel/go-zookeeper/zk/conn.go b/vendor/github.com/samuel/go-zookeeper/zk/conn.go deleted file mode 100644 index b6b8dbc1a..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/conn.go +++ /dev/null @@ -1,1032 +0,0 @@ -// Package zk is a native Go client library for the ZooKeeper orchestration service. -package zk - -/* -TODO: -* make sure a ping response comes back in a reasonable time - -Possible watcher events: -* Event{Type: EventNotWatching, State: StateDisconnected, Path: path, Err: err} -*/ - -import ( - "crypto/rand" - "encoding/binary" - "errors" - "fmt" - "io" - "net" - "strconv" - "strings" - "sync" - "sync/atomic" - "time" -) - -// ErrNoServer indicates that an operation cannot be completed -// because attempts to connect to all servers in the list failed. -var ErrNoServer = errors.New("zk: could not connect to a server") - -// ErrInvalidPath indicates that an operation was being attempted on -// an invalid path. (e.g. empty path) -var ErrInvalidPath = errors.New("zk: invalid path") - -// DefaultLogger uses the stdlib log package for logging. -var DefaultLogger Logger = defaultLogger{} - -const ( - bufferSize = 1536 * 1024 - eventChanSize = 6 - sendChanSize = 16 - protectedPrefix = "_c_" -) - -type watchType int - -const ( - watchTypeData = iota - watchTypeExist - watchTypeChild -) - -type watchPathType struct { - path string - wType watchType -} - -type Dialer func(network, address string, timeout time.Duration) (net.Conn, error) - -// Logger is an interface that can be implemented to provide custom log output. -type Logger interface { - Printf(string, ...interface{}) -} - -type authCreds struct { - scheme string - auth []byte -} - -type Conn struct { - lastZxid int64 - sessionID int64 - state State // must be 32-bit aligned - xid uint32 - sessionTimeoutMs int32 // session timeout in milliseconds - passwd []byte - - dialer Dialer - hostProvider HostProvider - serverMu sync.Mutex // protects server - server string // remember the address/port of the current server - conn net.Conn - eventChan chan Event - eventCallback EventCallback // may be nil - shouldQuit chan struct{} - pingInterval time.Duration - recvTimeout time.Duration - connectTimeout time.Duration - - creds []authCreds - credsMu sync.Mutex // protects server - - sendChan chan *request - requests map[int32]*request // Xid -> pending request - requestsLock sync.Mutex - watchers map[watchPathType][]chan Event - watchersLock sync.Mutex - closeChan chan struct{} // channel to tell send loop stop - - // Debug (used by unit tests) - reconnectDelay time.Duration - - logger Logger - - buf []byte -} - -// connOption represents a connection option. -type connOption func(c *Conn) - -type request struct { - xid int32 - opcode int32 - pkt interface{} - recvStruct interface{} - recvChan chan response - - // Because sending and receiving happen in separate go routines, there's - // a possible race condition when creating watches from outside the read - // loop. We must ensure that a watcher gets added to the list synchronously - // with the response from the server on any request that creates a watch. - // In order to not hard code the watch logic for each opcode in the recv - // loop the caller can use recvFunc to insert some synchronously code - // after a response. - recvFunc func(*request, *responseHeader, error) -} - -type response struct { - zxid int64 - err error -} - -type Event struct { - Type EventType - State State - Path string // For non-session events, the path of the watched node. - Err error - Server string // For connection events -} - -// HostProvider is used to represent a set of hosts a ZooKeeper client should connect to. -// It is an analog of the Java equivalent: -// http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/client/HostProvider.java?view=markup -type HostProvider interface { - // Init is called first, with the servers specified in the connection string. - Init(servers []string) error - // Len returns the number of servers. - Len() int - // Next returns the next server to connect to. retryStart will be true if we've looped through - // all known servers without Connected() being called. - Next() (server string, retryStart bool) - // Notify the HostProvider of a successful connection. - Connected() -} - -// ConnectWithDialer establishes a new connection to a pool of zookeeper servers -// using a custom Dialer. See Connect for further information about session timeout. -// This method is deprecated and provided for compatibility: use the WithDialer option instead. -func ConnectWithDialer(servers []string, sessionTimeout time.Duration, dialer Dialer) (*Conn, <-chan Event, error) { - return Connect(servers, sessionTimeout, WithDialer(dialer)) -} - -// Connect establishes a new connection to a pool of zookeeper -// servers. The provided session timeout sets the amount of time for which -// a session is considered valid after losing connection to a server. Within -// the session timeout it's possible to reestablish a connection to a different -// server and keep the same session. This is means any ephemeral nodes and -// watches are maintained. -func Connect(servers []string, sessionTimeout time.Duration, options ...connOption) (*Conn, <-chan Event, error) { - if len(servers) == 0 { - return nil, nil, errors.New("zk: server list must not be empty") - } - - srvs := make([]string, len(servers)) - - for i, addr := range servers { - if strings.Contains(addr, ":") { - srvs[i] = addr - } else { - srvs[i] = addr + ":" + strconv.Itoa(DefaultPort) - } - } - - // Randomize the order of the servers to avoid creating hotspots - stringShuffle(srvs) - - ec := make(chan Event, eventChanSize) - conn := &Conn{ - dialer: net.DialTimeout, - hostProvider: &DNSHostProvider{}, - conn: nil, - state: StateDisconnected, - eventChan: ec, - shouldQuit: make(chan struct{}), - connectTimeout: 1 * time.Second, - sendChan: make(chan *request, sendChanSize), - requests: make(map[int32]*request), - watchers: make(map[watchPathType][]chan Event), - passwd: emptyPassword, - logger: DefaultLogger, - buf: make([]byte, bufferSize), - - // Debug - reconnectDelay: 0, - } - - // Set provided options. - for _, option := range options { - option(conn) - } - - if err := conn.hostProvider.Init(srvs); err != nil { - return nil, nil, err - } - - conn.setTimeouts(int32(sessionTimeout / time.Millisecond)) - - go func() { - conn.loop() - conn.flushRequests(ErrClosing) - conn.invalidateWatches(ErrClosing) - close(conn.eventChan) - }() - return conn, ec, nil -} - -// WithDialer returns a connection option specifying a non-default Dialer. -func WithDialer(dialer Dialer) connOption { - return func(c *Conn) { - c.dialer = dialer - } -} - -// WithHostProvider returns a connection option specifying a non-default HostProvider. -func WithHostProvider(hostProvider HostProvider) connOption { - return func(c *Conn) { - c.hostProvider = hostProvider - } -} - -// EventCallback is a function that is called when an Event occurs. -type EventCallback func(Event) - -// WithEventCallback returns a connection option that specifies an event -// callback. -// The callback must not block - doing so would delay the ZK go routines. -func WithEventCallback(cb EventCallback) connOption { - return func(c *Conn) { - c.eventCallback = cb - } -} - -func (c *Conn) Close() { - close(c.shouldQuit) - - select { - case <-c.queueRequest(opClose, &closeRequest{}, &closeResponse{}, nil): - case <-time.After(time.Second): - } -} - -// State returns the current state of the connection. -func (c *Conn) State() State { - return State(atomic.LoadInt32((*int32)(&c.state))) -} - -// SessionID returns the current session id of the connection. -func (c *Conn) SessionID() int64 { - return atomic.LoadInt64(&c.sessionID) -} - -// SetLogger sets the logger to be used for printing errors. -// Logger is an interface provided by this package. -func (c *Conn) SetLogger(l Logger) { - c.logger = l -} - -func (c *Conn) setTimeouts(sessionTimeoutMs int32) { - c.sessionTimeoutMs = sessionTimeoutMs - sessionTimeout := time.Duration(sessionTimeoutMs) * time.Millisecond - c.recvTimeout = sessionTimeout * 2 / 3 - c.pingInterval = c.recvTimeout / 2 -} - -func (c *Conn) setState(state State) { - atomic.StoreInt32((*int32)(&c.state), int32(state)) - c.sendEvent(Event{Type: EventSession, State: state, Server: c.Server()}) -} - -func (c *Conn) sendEvent(evt Event) { - if c.eventCallback != nil { - c.eventCallback(evt) - } - - select { - case c.eventChan <- evt: - default: - // panic("zk: event channel full - it must be monitored and never allowed to be full") - } -} - -func (c *Conn) connect() error { - var retryStart bool - for { - c.serverMu.Lock() - c.server, retryStart = c.hostProvider.Next() - c.serverMu.Unlock() - c.setState(StateConnecting) - if retryStart { - c.flushUnsentRequests(ErrNoServer) - select { - case <-time.After(time.Second): - // pass - case <-c.shouldQuit: - c.setState(StateDisconnected) - c.flushUnsentRequests(ErrClosing) - return ErrClosing - } - } - - zkConn, err := c.dialer("tcp", c.Server(), c.connectTimeout) - if err == nil { - c.conn = zkConn - c.setState(StateConnected) - c.logger.Printf("Connected to %s", c.Server()) - return nil - } - - c.logger.Printf("Failed to connect to %s: %+v", c.Server(), err) - } -} - -func (c *Conn) resendZkAuth(reauthReadyChan chan struct{}) { - c.credsMu.Lock() - defer c.credsMu.Unlock() - - defer close(reauthReadyChan) - - c.logger.Printf("Re-submitting `%d` credentials after reconnect", - len(c.creds)) - - for _, cred := range c.creds { - resChan, err := c.sendRequest( - opSetAuth, - &setAuthRequest{Type: 0, - Scheme: cred.scheme, - Auth: cred.auth, - }, - &setAuthResponse{}, - nil) - - if err != nil { - c.logger.Printf("Call to sendRequest failed during credential resubmit: %s", err) - // FIXME(prozlach): lets ignore errors for now - continue - } - - res := <-resChan - if res.err != nil { - c.logger.Printf("Credential re-submit failed: %s", res.err) - // FIXME(prozlach): lets ignore errors for now - continue - } - } -} - -func (c *Conn) sendRequest( - opcode int32, - req interface{}, - res interface{}, - recvFunc func(*request, *responseHeader, error), -) ( - <-chan response, - error, -) { - rq := &request{ - xid: c.nextXid(), - opcode: opcode, - pkt: req, - recvStruct: res, - recvChan: make(chan response, 1), - recvFunc: recvFunc, - } - - if err := c.sendData(rq); err != nil { - return nil, err - } - - return rq.recvChan, nil -} - -func (c *Conn) loop() { - for { - if err := c.connect(); err != nil { - // c.Close() was called - return - } - - err := c.authenticate() - switch { - case err == ErrSessionExpired: - c.logger.Printf("Authentication failed: %s", err) - c.invalidateWatches(err) - case err != nil && c.conn != nil: - c.logger.Printf("Authentication failed: %s", err) - c.conn.Close() - case err == nil: - c.logger.Printf("Authenticated: id=%d, timeout=%d", c.SessionID(), c.sessionTimeoutMs) - c.hostProvider.Connected() // mark success - c.closeChan = make(chan struct{}) // channel to tell send loop stop - reauthChan := make(chan struct{}) // channel to tell send loop that authdata has been resubmitted - - var wg sync.WaitGroup - wg.Add(1) - go func() { - <-reauthChan - err := c.sendLoop() - c.logger.Printf("Send loop terminated: err=%v", err) - c.conn.Close() // causes recv loop to EOF/exit - wg.Done() - }() - - wg.Add(1) - go func() { - err := c.recvLoop(c.conn) - c.logger.Printf("Recv loop terminated: err=%v", err) - if err == nil { - panic("zk: recvLoop should never return nil error") - } - close(c.closeChan) // tell send loop to exit - wg.Done() - }() - - c.resendZkAuth(reauthChan) - - c.sendSetWatches() - wg.Wait() - } - - c.setState(StateDisconnected) - - select { - case <-c.shouldQuit: - c.flushRequests(ErrClosing) - return - default: - } - - if err != ErrSessionExpired { - err = ErrConnectionClosed - } - c.flushRequests(err) - - if c.reconnectDelay > 0 { - select { - case <-c.shouldQuit: - return - case <-time.After(c.reconnectDelay): - } - } - } -} - -func (c *Conn) flushUnsentRequests(err error) { - for { - select { - default: - return - case req := <-c.sendChan: - req.recvChan <- response{-1, err} - } - } -} - -// Send error to all pending requests and clear request map -func (c *Conn) flushRequests(err error) { - c.requestsLock.Lock() - for _, req := range c.requests { - req.recvChan <- response{-1, err} - } - c.requests = make(map[int32]*request) - c.requestsLock.Unlock() -} - -// Send error to all watchers and clear watchers map -func (c *Conn) invalidateWatches(err error) { - c.watchersLock.Lock() - defer c.watchersLock.Unlock() - - if len(c.watchers) >= 0 { - for pathType, watchers := range c.watchers { - ev := Event{Type: EventNotWatching, State: StateDisconnected, Path: pathType.path, Err: err} - for _, ch := range watchers { - ch <- ev - close(ch) - } - } - c.watchers = make(map[watchPathType][]chan Event) - } -} - -func (c *Conn) sendSetWatches() { - c.watchersLock.Lock() - defer c.watchersLock.Unlock() - - if len(c.watchers) == 0 { - return - } - - req := &setWatchesRequest{ - RelativeZxid: c.lastZxid, - DataWatches: make([]string, 0), - ExistWatches: make([]string, 0), - ChildWatches: make([]string, 0), - } - n := 0 - for pathType, watchers := range c.watchers { - if len(watchers) == 0 { - continue - } - switch pathType.wType { - case watchTypeData: - req.DataWatches = append(req.DataWatches, pathType.path) - case watchTypeExist: - req.ExistWatches = append(req.ExistWatches, pathType.path) - case watchTypeChild: - req.ChildWatches = append(req.ChildWatches, pathType.path) - } - n++ - } - if n == 0 { - return - } - - go func() { - res := &setWatchesResponse{} - _, err := c.request(opSetWatches, req, res, nil) - if err != nil { - c.logger.Printf("Failed to set previous watches: %s", err.Error()) - } - }() -} - -func (c *Conn) authenticate() error { - buf := make([]byte, 256) - - // Encode and send a connect request. - n, err := encodePacket(buf[4:], &connectRequest{ - ProtocolVersion: protocolVersion, - LastZxidSeen: c.lastZxid, - TimeOut: c.sessionTimeoutMs, - SessionID: c.SessionID(), - Passwd: c.passwd, - }) - if err != nil { - return err - } - - binary.BigEndian.PutUint32(buf[:4], uint32(n)) - - c.conn.SetWriteDeadline(time.Now().Add(c.recvTimeout * 10)) - _, err = c.conn.Write(buf[:n+4]) - c.conn.SetWriteDeadline(time.Time{}) - if err != nil { - return err - } - - // Receive and decode a connect response. - c.conn.SetReadDeadline(time.Now().Add(c.recvTimeout * 10)) - _, err = io.ReadFull(c.conn, buf[:4]) - c.conn.SetReadDeadline(time.Time{}) - if err != nil { - return err - } - - blen := int(binary.BigEndian.Uint32(buf[:4])) - if cap(buf) < blen { - buf = make([]byte, blen) - } - - _, err = io.ReadFull(c.conn, buf[:blen]) - if err != nil { - return err - } - - r := connectResponse{} - _, err = decodePacket(buf[:blen], &r) - if err != nil { - return err - } - if r.SessionID == 0 { - atomic.StoreInt64(&c.sessionID, int64(0)) - c.passwd = emptyPassword - c.lastZxid = 0 - c.setState(StateExpired) - return ErrSessionExpired - } - - atomic.StoreInt64(&c.sessionID, r.SessionID) - c.setTimeouts(r.TimeOut) - c.passwd = r.Passwd - c.setState(StateHasSession) - - return nil -} - -func (c *Conn) sendData(req *request) error { - header := &requestHeader{req.xid, req.opcode} - n, err := encodePacket(c.buf[4:], header) - if err != nil { - req.recvChan <- response{-1, err} - return nil - } - - n2, err := encodePacket(c.buf[4+n:], req.pkt) - if err != nil { - req.recvChan <- response{-1, err} - return nil - } - - n += n2 - - binary.BigEndian.PutUint32(c.buf[:4], uint32(n)) - - c.requestsLock.Lock() - select { - case <-c.closeChan: - req.recvChan <- response{-1, ErrConnectionClosed} - c.requestsLock.Unlock() - return ErrConnectionClosed - default: - } - c.requests[req.xid] = req - c.requestsLock.Unlock() - - c.conn.SetWriteDeadline(time.Now().Add(c.recvTimeout)) - _, err = c.conn.Write(c.buf[:n+4]) - c.conn.SetWriteDeadline(time.Time{}) - if err != nil { - req.recvChan <- response{-1, err} - c.conn.Close() - return err - } - - return nil -} - -func (c *Conn) sendLoop() error { - pingTicker := time.NewTicker(c.pingInterval) - defer pingTicker.Stop() - - for { - select { - case req := <-c.sendChan: - if err := c.sendData(req); err != nil { - return err - } - case <-pingTicker.C: - n, err := encodePacket(c.buf[4:], &requestHeader{Xid: -2, Opcode: opPing}) - if err != nil { - panic("zk: opPing should never fail to serialize") - } - - binary.BigEndian.PutUint32(c.buf[:4], uint32(n)) - - c.conn.SetWriteDeadline(time.Now().Add(c.recvTimeout)) - _, err = c.conn.Write(c.buf[:n+4]) - c.conn.SetWriteDeadline(time.Time{}) - if err != nil { - c.conn.Close() - return err - } - case <-c.closeChan: - return nil - } - } -} - -func (c *Conn) recvLoop(conn net.Conn) error { - buf := make([]byte, bufferSize) - for { - // package length - conn.SetReadDeadline(time.Now().Add(c.recvTimeout)) - _, err := io.ReadFull(conn, buf[:4]) - if err != nil { - return err - } - - blen := int(binary.BigEndian.Uint32(buf[:4])) - if cap(buf) < blen { - buf = make([]byte, blen) - } - - _, err = io.ReadFull(conn, buf[:blen]) - conn.SetReadDeadline(time.Time{}) - if err != nil { - return err - } - - res := responseHeader{} - _, err = decodePacket(buf[:16], &res) - if err != nil { - return err - } - - if res.Xid == -1 { - res := &watcherEvent{} - _, err := decodePacket(buf[16:blen], res) - if err != nil { - return err - } - ev := Event{ - Type: res.Type, - State: res.State, - Path: res.Path, - Err: nil, - } - c.sendEvent(ev) - wTypes := make([]watchType, 0, 2) - switch res.Type { - case EventNodeCreated: - wTypes = append(wTypes, watchTypeExist) - case EventNodeDeleted, EventNodeDataChanged: - wTypes = append(wTypes, watchTypeExist, watchTypeData, watchTypeChild) - case EventNodeChildrenChanged: - wTypes = append(wTypes, watchTypeChild) - } - c.watchersLock.Lock() - for _, t := range wTypes { - wpt := watchPathType{res.Path, t} - if watchers := c.watchers[wpt]; watchers != nil && len(watchers) > 0 { - for _, ch := range watchers { - ch <- ev - close(ch) - } - delete(c.watchers, wpt) - } - } - c.watchersLock.Unlock() - } else if res.Xid == -2 { - // Ping response. Ignore. - } else if res.Xid < 0 { - c.logger.Printf("Xid < 0 (%d) but not ping or watcher event", res.Xid) - } else { - if res.Zxid > 0 { - c.lastZxid = res.Zxid - } - - c.requestsLock.Lock() - req, ok := c.requests[res.Xid] - if ok { - delete(c.requests, res.Xid) - } - c.requestsLock.Unlock() - - if !ok { - c.logger.Printf("Response for unknown request with xid %d", res.Xid) - } else { - if res.Err != 0 { - err = res.Err.toError() - } else { - _, err = decodePacket(buf[16:blen], req.recvStruct) - } - if req.recvFunc != nil { - req.recvFunc(req, &res, err) - } - req.recvChan <- response{res.Zxid, err} - if req.opcode == opClose { - return io.EOF - } - } - } - } -} - -func (c *Conn) nextXid() int32 { - return int32(atomic.AddUint32(&c.xid, 1) & 0x7fffffff) -} - -func (c *Conn) addWatcher(path string, watchType watchType) <-chan Event { - c.watchersLock.Lock() - defer c.watchersLock.Unlock() - - ch := make(chan Event, 1) - wpt := watchPathType{path, watchType} - c.watchers[wpt] = append(c.watchers[wpt], ch) - return ch -} - -func (c *Conn) queueRequest(opcode int32, req interface{}, res interface{}, recvFunc func(*request, *responseHeader, error)) <-chan response { - rq := &request{ - xid: c.nextXid(), - opcode: opcode, - pkt: req, - recvStruct: res, - recvChan: make(chan response, 1), - recvFunc: recvFunc, - } - c.sendChan <- rq - return rq.recvChan -} - -func (c *Conn) request(opcode int32, req interface{}, res interface{}, recvFunc func(*request, *responseHeader, error)) (int64, error) { - r := <-c.queueRequest(opcode, req, res, recvFunc) - return r.zxid, r.err -} - -func (c *Conn) AddAuth(scheme string, auth []byte) error { - _, err := c.request(opSetAuth, &setAuthRequest{Type: 0, Scheme: scheme, Auth: auth}, &setAuthResponse{}, nil) - - if err != nil { - return err - } - - // Remember authdata so that it can be re-submitted on reconnect - // - // FIXME(prozlach): For now we treat "userfoo:passbar" and "userfoo:passbar2" - // as two different entries, which will be re-submitted on reconnet. Some - // research is needed on how ZK treats these cases and - // then maybe switch to something like "map[username] = password" to allow - // only single password for given user with users being unique. - obj := authCreds{ - scheme: scheme, - auth: auth, - } - - c.credsMu.Lock() - c.creds = append(c.creds, obj) - c.credsMu.Unlock() - - return nil -} - -func (c *Conn) Children(path string) ([]string, *Stat, error) { - res := &getChildren2Response{} - _, err := c.request(opGetChildren2, &getChildren2Request{Path: path, Watch: false}, res, nil) - return res.Children, &res.Stat, err -} - -func (c *Conn) ChildrenW(path string) ([]string, *Stat, <-chan Event, error) { - var ech <-chan Event - res := &getChildren2Response{} - _, err := c.request(opGetChildren2, &getChildren2Request{Path: path, Watch: true}, res, func(req *request, res *responseHeader, err error) { - if err == nil { - ech = c.addWatcher(path, watchTypeChild) - } - }) - if err != nil { - return nil, nil, nil, err - } - return res.Children, &res.Stat, ech, err -} - -func (c *Conn) Get(path string) ([]byte, *Stat, error) { - res := &getDataResponse{} - _, err := c.request(opGetData, &getDataRequest{Path: path, Watch: false}, res, nil) - return res.Data, &res.Stat, err -} - -// GetW returns the contents of a znode and sets a watch -func (c *Conn) GetW(path string) ([]byte, *Stat, <-chan Event, error) { - var ech <-chan Event - res := &getDataResponse{} - _, err := c.request(opGetData, &getDataRequest{Path: path, Watch: true}, res, func(req *request, res *responseHeader, err error) { - if err == nil { - ech = c.addWatcher(path, watchTypeData) - } - }) - if err != nil { - return nil, nil, nil, err - } - return res.Data, &res.Stat, ech, err -} - -func (c *Conn) Set(path string, data []byte, version int32) (*Stat, error) { - if path == "" { - return nil, ErrInvalidPath - } - res := &setDataResponse{} - _, err := c.request(opSetData, &SetDataRequest{path, data, version}, res, nil) - return &res.Stat, err -} - -func (c *Conn) Create(path string, data []byte, flags int32, acl []ACL) (string, error) { - res := &createResponse{} - _, err := c.request(opCreate, &CreateRequest{path, data, acl, flags}, res, nil) - return res.Path, err -} - -// CreateProtectedEphemeralSequential fixes a race condition if the server crashes -// after it creates the node. On reconnect the session may still be valid so the -// ephemeral node still exists. Therefore, on reconnect we need to check if a node -// with a GUID generated on create exists. -func (c *Conn) CreateProtectedEphemeralSequential(path string, data []byte, acl []ACL) (string, error) { - var guid [16]byte - _, err := io.ReadFull(rand.Reader, guid[:16]) - if err != nil { - return "", err - } - guidStr := fmt.Sprintf("%x", guid) - - parts := strings.Split(path, "/") - parts[len(parts)-1] = fmt.Sprintf("%s%s-%s", protectedPrefix, guidStr, parts[len(parts)-1]) - rootPath := strings.Join(parts[:len(parts)-1], "/") - protectedPath := strings.Join(parts, "/") - - var newPath string - for i := 0; i < 3; i++ { - newPath, err = c.Create(protectedPath, data, FlagEphemeral|FlagSequence, acl) - switch err { - case ErrSessionExpired: - // No need to search for the node since it can't exist. Just try again. - case ErrConnectionClosed: - children, _, err := c.Children(rootPath) - if err != nil { - return "", err - } - for _, p := range children { - parts := strings.Split(p, "/") - if pth := parts[len(parts)-1]; strings.HasPrefix(pth, protectedPrefix) { - if g := pth[len(protectedPrefix) : len(protectedPrefix)+32]; g == guidStr { - return rootPath + "/" + p, nil - } - } - } - case nil: - return newPath, nil - default: - return "", err - } - } - return "", err -} - -func (c *Conn) Delete(path string, version int32) error { - _, err := c.request(opDelete, &DeleteRequest{path, version}, &deleteResponse{}, nil) - return err -} - -func (c *Conn) Exists(path string) (bool, *Stat, error) { - res := &existsResponse{} - _, err := c.request(opExists, &existsRequest{Path: path, Watch: false}, res, nil) - exists := true - if err == ErrNoNode { - exists = false - err = nil - } - return exists, &res.Stat, err -} - -func (c *Conn) ExistsW(path string) (bool, *Stat, <-chan Event, error) { - var ech <-chan Event - res := &existsResponse{} - _, err := c.request(opExists, &existsRequest{Path: path, Watch: true}, res, func(req *request, res *responseHeader, err error) { - if err == nil { - ech = c.addWatcher(path, watchTypeData) - } else if err == ErrNoNode { - ech = c.addWatcher(path, watchTypeExist) - } - }) - exists := true - if err == ErrNoNode { - exists = false - err = nil - } - if err != nil { - return false, nil, nil, err - } - return exists, &res.Stat, ech, err -} - -func (c *Conn) GetACL(path string) ([]ACL, *Stat, error) { - res := &getAclResponse{} - _, err := c.request(opGetAcl, &getAclRequest{Path: path}, res, nil) - return res.Acl, &res.Stat, err -} -func (c *Conn) SetACL(path string, acl []ACL, version int32) (*Stat, error) { - res := &setAclResponse{} - _, err := c.request(opSetAcl, &setAclRequest{Path: path, Acl: acl, Version: version}, res, nil) - return &res.Stat, err -} - -func (c *Conn) Sync(path string) (string, error) { - res := &syncResponse{} - _, err := c.request(opSync, &syncRequest{Path: path}, res, nil) - return res.Path, err -} - -type MultiResponse struct { - Stat *Stat - String string - Error error -} - -// Multi executes multiple ZooKeeper operations or none of them. The provided -// ops must be one of *CreateRequest, *DeleteRequest, *SetDataRequest, or -// *CheckVersionRequest. -func (c *Conn) Multi(ops ...interface{}) ([]MultiResponse, error) { - req := &multiRequest{ - Ops: make([]multiRequestOp, 0, len(ops)), - DoneHeader: multiHeader{Type: -1, Done: true, Err: -1}, - } - for _, op := range ops { - var opCode int32 - switch op.(type) { - case *CreateRequest: - opCode = opCreate - case *SetDataRequest: - opCode = opSetData - case *DeleteRequest: - opCode = opDelete - case *CheckVersionRequest: - opCode = opCheck - default: - return nil, fmt.Errorf("unknown operation type %T", op) - } - req.Ops = append(req.Ops, multiRequestOp{multiHeader{opCode, false, -1}, op}) - } - res := &multiResponse{} - _, err := c.request(opMulti, req, res, nil) - mr := make([]MultiResponse, len(res.Ops)) - for i, op := range res.Ops { - mr[i] = MultiResponse{Stat: op.Stat, String: op.String, Error: op.Err.toError()} - } - return mr, err -} - -// Server returns the current or last-connected server name. -func (c *Conn) Server() string { - c.serverMu.Lock() - defer c.serverMu.Unlock() - return c.server -} diff --git a/vendor/github.com/samuel/go-zookeeper/zk/constants.go b/vendor/github.com/samuel/go-zookeeper/zk/constants.go deleted file mode 100644 index 33b5563b9..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/constants.go +++ /dev/null @@ -1,240 +0,0 @@ -package zk - -import ( - "errors" -) - -const ( - protocolVersion = 0 - - DefaultPort = 2181 -) - -const ( - opNotify = 0 - opCreate = 1 - opDelete = 2 - opExists = 3 - opGetData = 4 - opSetData = 5 - opGetAcl = 6 - opSetAcl = 7 - opGetChildren = 8 - opSync = 9 - opPing = 11 - opGetChildren2 = 12 - opCheck = 13 - opMulti = 14 - opClose = -11 - opSetAuth = 100 - opSetWatches = 101 - opError = -1 - // Not in protocol, used internally - opWatcherEvent = -2 -) - -const ( - EventNodeCreated EventType = 1 - EventNodeDeleted EventType = 2 - EventNodeDataChanged EventType = 3 - EventNodeChildrenChanged EventType = 4 - - EventSession EventType = -1 - EventNotWatching EventType = -2 -) - -var ( - eventNames = map[EventType]string{ - EventNodeCreated: "EventNodeCreated", - EventNodeDeleted: "EventNodeDeleted", - EventNodeDataChanged: "EventNodeDataChanged", - EventNodeChildrenChanged: "EventNodeChildrenChanged", - EventSession: "EventSession", - EventNotWatching: "EventNotWatching", - } -) - -const ( - StateUnknown State = -1 - StateDisconnected State = 0 - StateConnecting State = 1 - StateAuthFailed State = 4 - StateConnectedReadOnly State = 5 - StateSaslAuthenticated State = 6 - StateExpired State = -112 - - StateConnected = State(100) - StateHasSession = State(101) -) - -const ( - FlagEphemeral = 1 - FlagSequence = 2 -) - -var ( - stateNames = map[State]string{ - StateUnknown: "StateUnknown", - StateDisconnected: "StateDisconnected", - StateConnectedReadOnly: "StateConnectedReadOnly", - StateSaslAuthenticated: "StateSaslAuthenticated", - StateExpired: "StateExpired", - StateAuthFailed: "StateAuthFailed", - StateConnecting: "StateConnecting", - StateConnected: "StateConnected", - StateHasSession: "StateHasSession", - } -) - -type State int32 - -func (s State) String() string { - if name := stateNames[s]; name != "" { - return name - } - return "Unknown" -} - -type ErrCode int32 - -var ( - ErrConnectionClosed = errors.New("zk: connection closed") - ErrUnknown = errors.New("zk: unknown error") - ErrAPIError = errors.New("zk: api error") - ErrNoNode = errors.New("zk: node does not exist") - ErrNoAuth = errors.New("zk: not authenticated") - ErrBadVersion = errors.New("zk: version conflict") - ErrNoChildrenForEphemerals = errors.New("zk: ephemeral nodes may not have children") - ErrNodeExists = errors.New("zk: node already exists") - ErrNotEmpty = errors.New("zk: node has children") - ErrSessionExpired = errors.New("zk: session has been expired by the server") - ErrInvalidACL = errors.New("zk: invalid ACL specified") - ErrAuthFailed = errors.New("zk: client authentication failed") - ErrClosing = errors.New("zk: zookeeper is closing") - ErrNothing = errors.New("zk: no server responsees to process") - ErrSessionMoved = errors.New("zk: session moved to another server, so operation is ignored") - - // ErrInvalidCallback = errors.New("zk: invalid callback specified") - errCodeToError = map[ErrCode]error{ - 0: nil, - errAPIError: ErrAPIError, - errNoNode: ErrNoNode, - errNoAuth: ErrNoAuth, - errBadVersion: ErrBadVersion, - errNoChildrenForEphemerals: ErrNoChildrenForEphemerals, - errNodeExists: ErrNodeExists, - errNotEmpty: ErrNotEmpty, - errSessionExpired: ErrSessionExpired, - // errInvalidCallback: ErrInvalidCallback, - errInvalidAcl: ErrInvalidACL, - errAuthFailed: ErrAuthFailed, - errClosing: ErrClosing, - errNothing: ErrNothing, - errSessionMoved: ErrSessionMoved, - } -) - -func (e ErrCode) toError() error { - if err, ok := errCodeToError[e]; ok { - return err - } - return ErrUnknown -} - -const ( - errOk = 0 - // System and server-side errors - errSystemError = -1 - errRuntimeInconsistency = -2 - errDataInconsistency = -3 - errConnectionLoss = -4 - errMarshallingError = -5 - errUnimplemented = -6 - errOperationTimeout = -7 - errBadArguments = -8 - errInvalidState = -9 - // API errors - errAPIError ErrCode = -100 - errNoNode ErrCode = -101 // * - errNoAuth ErrCode = -102 - errBadVersion ErrCode = -103 // * - errNoChildrenForEphemerals ErrCode = -108 - errNodeExists ErrCode = -110 // * - errNotEmpty ErrCode = -111 - errSessionExpired ErrCode = -112 - errInvalidCallback ErrCode = -113 - errInvalidAcl ErrCode = -114 - errAuthFailed ErrCode = -115 - errClosing ErrCode = -116 - errNothing ErrCode = -117 - errSessionMoved ErrCode = -118 -) - -// Constants for ACL permissions -const ( - PermRead = 1 << iota - PermWrite - PermCreate - PermDelete - PermAdmin - PermAll = 0x1f -) - -var ( - emptyPassword = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - opNames = map[int32]string{ - opNotify: "notify", - opCreate: "create", - opDelete: "delete", - opExists: "exists", - opGetData: "getData", - opSetData: "setData", - opGetAcl: "getACL", - opSetAcl: "setACL", - opGetChildren: "getChildren", - opSync: "sync", - opPing: "ping", - opGetChildren2: "getChildren2", - opCheck: "check", - opMulti: "multi", - opClose: "close", - opSetAuth: "setAuth", - opSetWatches: "setWatches", - - opWatcherEvent: "watcherEvent", - } -) - -type EventType int32 - -func (t EventType) String() string { - if name := eventNames[t]; name != "" { - return name - } - return "Unknown" -} - -// Mode is used to build custom server modes (leader|follower|standalone). -type Mode uint8 - -func (m Mode) String() string { - if name := modeNames[m]; name != "" { - return name - } - return "unknown" -} - -const ( - ModeUnknown Mode = iota - ModeLeader Mode = iota - ModeFollower Mode = iota - ModeStandalone Mode = iota -) - -var ( - modeNames = map[Mode]string{ - ModeLeader: "leader", - ModeFollower: "follower", - ModeStandalone: "standalone", - } -) diff --git a/vendor/github.com/samuel/go-zookeeper/zk/dnshostprovider.go b/vendor/github.com/samuel/go-zookeeper/zk/dnshostprovider.go deleted file mode 100644 index f4bba8d0b..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/dnshostprovider.go +++ /dev/null @@ -1,88 +0,0 @@ -package zk - -import ( - "fmt" - "net" - "sync" -) - -// DNSHostProvider is the default HostProvider. It currently matches -// the Java StaticHostProvider, resolving hosts from DNS once during -// the call to Init. It could be easily extended to re-query DNS -// periodically or if there is trouble connecting. -type DNSHostProvider struct { - mu sync.Mutex // Protects everything, so we can add asynchronous updates later. - servers []string - curr int - last int - lookupHost func(string) ([]string, error) // Override of net.LookupHost, for testing. -} - -// Init is called first, with the servers specified in the connection -// string. It uses DNS to look up addresses for each server, then -// shuffles them all together. -func (hp *DNSHostProvider) Init(servers []string) error { - hp.mu.Lock() - defer hp.mu.Unlock() - - lookupHost := hp.lookupHost - if lookupHost == nil { - lookupHost = net.LookupHost - } - - found := []string{} - for _, server := range servers { - host, port, err := net.SplitHostPort(server) - if err != nil { - return err - } - addrs, err := lookupHost(host) - if err != nil { - return err - } - for _, addr := range addrs { - found = append(found, net.JoinHostPort(addr, port)) - } - } - - if len(found) == 0 { - return fmt.Errorf("No hosts found for addresses %q", servers) - } - - // Randomize the order of the servers to avoid creating hotspots - stringShuffle(found) - - hp.servers = found - hp.curr = -1 - hp.last = -1 - - return nil -} - -// Len returns the number of servers available -func (hp *DNSHostProvider) Len() int { - hp.mu.Lock() - defer hp.mu.Unlock() - return len(hp.servers) -} - -// Next returns the next server to connect to. retryStart will be true -// if we've looped through all known servers without Connected() being -// called. -func (hp *DNSHostProvider) Next() (server string, retryStart bool) { - hp.mu.Lock() - defer hp.mu.Unlock() - hp.curr = (hp.curr + 1) % len(hp.servers) - retryStart = hp.curr == hp.last - if hp.last == -1 { - hp.last = 0 - } - return hp.servers[hp.curr], retryStart -} - -// Connected notifies the HostProvider of a successful connection. -func (hp *DNSHostProvider) Connected() { - hp.mu.Lock() - defer hp.mu.Unlock() - hp.last = hp.curr -} diff --git a/vendor/github.com/samuel/go-zookeeper/zk/flw.go b/vendor/github.com/samuel/go-zookeeper/zk/flw.go deleted file mode 100644 index 3e97f9687..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/flw.go +++ /dev/null @@ -1,266 +0,0 @@ -package zk - -import ( - "bufio" - "bytes" - "fmt" - "io/ioutil" - "net" - "regexp" - "strconv" - "strings" - "time" -) - -// FLWSrvr is a FourLetterWord helper function. In particular, this function pulls the srvr output -// from the zookeeper instances and parses the output. A slice of *ServerStats structs are returned -// as well as a boolean value to indicate whether this function processed successfully. -// -// If the boolean value is false there was a problem. If the *ServerStats slice is empty or nil, -// then the error happened before we started to obtain 'srvr' values. Otherwise, one of the -// servers had an issue and the "Error" value in the struct should be inspected to determine -// which server had the issue. -func FLWSrvr(servers []string, timeout time.Duration) ([]*ServerStats, bool) { - // different parts of the regular expression that are required to parse the srvr output - const ( - zrVer = `^Zookeeper version: ([A-Za-z0-9\.\-]+), built on (\d\d/\d\d/\d\d\d\d \d\d:\d\d [A-Za-z0-9:\+\-]+)` - zrLat = `^Latency min/avg/max: (\d+)/(\d+)/(\d+)` - zrNet = `^Received: (\d+).*\n^Sent: (\d+).*\n^Connections: (\d+).*\n^Outstanding: (\d+)` - zrState = `^Zxid: (0x[A-Za-z0-9]+).*\n^Mode: (\w+).*\n^Node count: (\d+)` - ) - - // build the regex from the pieces above - re, err := regexp.Compile(fmt.Sprintf(`(?m:\A%v.*\n%v.*\n%v.*\n%v)`, zrVer, zrLat, zrNet, zrState)) - if err != nil { - return nil, false - } - - imOk := true - servers = FormatServers(servers) - ss := make([]*ServerStats, len(servers)) - - for i := range ss { - response, err := fourLetterWord(servers[i], "srvr", timeout) - - if err != nil { - ss[i] = &ServerStats{Error: err} - imOk = false - continue - } - - matches := re.FindAllStringSubmatch(string(response), -1) - - if matches == nil { - err := fmt.Errorf("unable to parse fields from zookeeper response (no regex matches)") - ss[i] = &ServerStats{Error: err} - imOk = false - continue - } - - match := matches[0][1:] - - // determine current server - var srvrMode Mode - switch match[10] { - case "leader": - srvrMode = ModeLeader - case "follower": - srvrMode = ModeFollower - case "standalone": - srvrMode = ModeStandalone - default: - srvrMode = ModeUnknown - } - - buildTime, err := time.Parse("01/02/2006 15:04 MST", match[1]) - - if err != nil { - ss[i] = &ServerStats{Error: err} - imOk = false - continue - } - - parsedInt, err := strconv.ParseInt(match[9], 0, 64) - - if err != nil { - ss[i] = &ServerStats{Error: err} - imOk = false - continue - } - - // the ZxID value is an int64 with two int32s packed inside - // the high int32 is the epoch (i.e., number of leader elections) - // the low int32 is the counter - epoch := int32(parsedInt >> 32) - counter := int32(parsedInt & 0xFFFFFFFF) - - // within the regex above, these values must be numerical - // so we can avoid useless checking of the error return value - minLatency, _ := strconv.ParseInt(match[2], 0, 64) - avgLatency, _ := strconv.ParseInt(match[3], 0, 64) - maxLatency, _ := strconv.ParseInt(match[4], 0, 64) - recv, _ := strconv.ParseInt(match[5], 0, 64) - sent, _ := strconv.ParseInt(match[6], 0, 64) - cons, _ := strconv.ParseInt(match[7], 0, 64) - outs, _ := strconv.ParseInt(match[8], 0, 64) - ncnt, _ := strconv.ParseInt(match[11], 0, 64) - - ss[i] = &ServerStats{ - Sent: sent, - Received: recv, - NodeCount: ncnt, - MinLatency: minLatency, - AvgLatency: avgLatency, - MaxLatency: maxLatency, - Connections: cons, - Outstanding: outs, - Epoch: epoch, - Counter: counter, - BuildTime: buildTime, - Mode: srvrMode, - Version: match[0], - } - } - - return ss, imOk -} - -// FLWRuok is a FourLetterWord helper function. In particular, this function -// pulls the ruok output from each server. -func FLWRuok(servers []string, timeout time.Duration) []bool { - servers = FormatServers(servers) - oks := make([]bool, len(servers)) - - for i := range oks { - response, err := fourLetterWord(servers[i], "ruok", timeout) - - if err != nil { - continue - } - - if bytes.Equal(response[:4], []byte("imok")) { - oks[i] = true - } - } - return oks -} - -// FLWCons is a FourLetterWord helper function. In particular, this function -// pulls the ruok output from each server. -// -// As with FLWSrvr, the boolean value indicates whether one of the requests had -// an issue. The Clients struct has an Error value that can be checked. -func FLWCons(servers []string, timeout time.Duration) ([]*ServerClients, bool) { - const ( - zrAddr = `^ /((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):(?:\d+))\[\d+\]` - zrPac = `\(queued=(\d+),recved=(\d+),sent=(\d+),sid=(0x[A-Za-z0-9]+),lop=(\w+),est=(\d+),to=(\d+),` - zrSesh = `lcxid=(0x[A-Za-z0-9]+),lzxid=(0x[A-Za-z0-9]+),lresp=(\d+),llat=(\d+),minlat=(\d+),avglat=(\d+),maxlat=(\d+)\)` - ) - - re, err := regexp.Compile(fmt.Sprintf("%v%v%v", zrAddr, zrPac, zrSesh)) - if err != nil { - return nil, false - } - - servers = FormatServers(servers) - sc := make([]*ServerClients, len(servers)) - imOk := true - - for i := range sc { - response, err := fourLetterWord(servers[i], "cons", timeout) - - if err != nil { - sc[i] = &ServerClients{Error: err} - imOk = false - continue - } - - scan := bufio.NewScanner(bytes.NewReader(response)) - - var clients []*ServerClient - - for scan.Scan() { - line := scan.Bytes() - - if len(line) == 0 { - continue - } - - m := re.FindAllStringSubmatch(string(line), -1) - - if m == nil { - err := fmt.Errorf("unable to parse fields from zookeeper response (no regex matches)") - sc[i] = &ServerClients{Error: err} - imOk = false - continue - } - - match := m[0][1:] - - queued, _ := strconv.ParseInt(match[1], 0, 64) - recvd, _ := strconv.ParseInt(match[2], 0, 64) - sent, _ := strconv.ParseInt(match[3], 0, 64) - sid, _ := strconv.ParseInt(match[4], 0, 64) - est, _ := strconv.ParseInt(match[6], 0, 64) - timeout, _ := strconv.ParseInt(match[7], 0, 32) - lcxid, _ := parseInt64(match[8]) - lzxid, _ := parseInt64(match[9]) - lresp, _ := strconv.ParseInt(match[10], 0, 64) - llat, _ := strconv.ParseInt(match[11], 0, 32) - minlat, _ := strconv.ParseInt(match[12], 0, 32) - avglat, _ := strconv.ParseInt(match[13], 0, 32) - maxlat, _ := strconv.ParseInt(match[14], 0, 32) - - clients = append(clients, &ServerClient{ - Queued: queued, - Received: recvd, - Sent: sent, - SessionID: sid, - Lcxid: int64(lcxid), - Lzxid: int64(lzxid), - Timeout: int32(timeout), - LastLatency: int32(llat), - MinLatency: int32(minlat), - AvgLatency: int32(avglat), - MaxLatency: int32(maxlat), - Established: time.Unix(est, 0), - LastResponse: time.Unix(lresp, 0), - Addr: match[0], - LastOperation: match[5], - }) - } - - sc[i] = &ServerClients{Clients: clients} - } - - return sc, imOk -} - -// parseInt64 is similar to strconv.ParseInt, but it also handles hex values that represent negative numbers -func parseInt64(s string) (int64, error) { - if strings.HasPrefix(s, "0x") { - i, err := strconv.ParseUint(s, 0, 64) - return int64(i), err - } - return strconv.ParseInt(s, 0, 64) -} - -func fourLetterWord(server, command string, timeout time.Duration) ([]byte, error) { - conn, err := net.DialTimeout("tcp", server, timeout) - if err != nil { - return nil, err - } - - // the zookeeper server should automatically close this socket - // once the command has been processed, but better safe than sorry - defer conn.Close() - - conn.SetWriteDeadline(time.Now().Add(timeout)) - _, err = conn.Write([]byte(command)) - if err != nil { - return nil, err - } - - conn.SetReadDeadline(time.Now().Add(timeout)) - return ioutil.ReadAll(conn) -} diff --git a/vendor/github.com/samuel/go-zookeeper/zk/lock.go b/vendor/github.com/samuel/go-zookeeper/zk/lock.go deleted file mode 100644 index 3c35a427c..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/lock.go +++ /dev/null @@ -1,150 +0,0 @@ -package zk - -import ( - "errors" - "fmt" - "strconv" - "strings" -) - -var ( - // ErrDeadlock is returned by Lock when trying to lock twice without unlocking first - ErrDeadlock = errors.New("zk: trying to acquire a lock twice") - // ErrNotLocked is returned by Unlock when trying to release a lock that has not first be acquired. - ErrNotLocked = errors.New("zk: not locked") -) - -// Lock is a mutual exclusion lock. -type Lock struct { - c *Conn - path string - acl []ACL - lockPath string - seq int -} - -// NewLock creates a new lock instance using the provided connection, path, and acl. -// The path must be a node that is only used by this lock. A lock instances starts -// unlocked until Lock() is called. -func NewLock(c *Conn, path string, acl []ACL) *Lock { - return &Lock{ - c: c, - path: path, - acl: acl, - } -} - -func parseSeq(path string) (int, error) { - parts := strings.Split(path, "-") - return strconv.Atoi(parts[len(parts)-1]) -} - -// Lock attempts to acquire the lock. It will wait to return until the lock -// is acquired or an error occurs. If this instance already has the lock -// then ErrDeadlock is returned. -func (l *Lock) Lock() error { - if l.lockPath != "" { - return ErrDeadlock - } - - prefix := fmt.Sprintf("%s/lock-", l.path) - - path := "" - var err error - for i := 0; i < 3; i++ { - path, err = l.c.CreateProtectedEphemeralSequential(prefix, []byte{}, l.acl) - if err == ErrNoNode { - // Create parent node. - parts := strings.Split(l.path, "/") - pth := "" - for _, p := range parts[1:] { - var exists bool - pth += "/" + p - exists, _, err = l.c.Exists(pth) - if err != nil { - return err - } - if exists == true { - continue - } - _, err = l.c.Create(pth, []byte{}, 0, l.acl) - if err != nil && err != ErrNodeExists { - return err - } - } - } else if err == nil { - break - } else { - return err - } - } - if err != nil { - return err - } - - seq, err := parseSeq(path) - if err != nil { - return err - } - - for { - children, _, err := l.c.Children(l.path) - if err != nil { - return err - } - - lowestSeq := seq - prevSeq := -1 - prevSeqPath := "" - for _, p := range children { - s, err := parseSeq(p) - if err != nil { - return err - } - if s < lowestSeq { - lowestSeq = s - } - if s < seq && s > prevSeq { - prevSeq = s - prevSeqPath = p - } - } - - if seq == lowestSeq { - // Acquired the lock - break - } - - // Wait on the node next in line for the lock - _, _, ch, err := l.c.GetW(l.path + "/" + prevSeqPath) - if err != nil && err != ErrNoNode { - return err - } else if err != nil && err == ErrNoNode { - // try again - continue - } - - ev := <-ch - if ev.Err != nil { - return ev.Err - } - } - - l.seq = seq - l.lockPath = path - return nil -} - -// Unlock releases an acquired lock. If the lock is not currently acquired by -// this Lock instance than ErrNotLocked is returned. -func (l *Lock) Unlock() error { - if l.lockPath == "" { - return ErrNotLocked - } - if err := l.c.Delete(l.lockPath, -1); err != nil { - return err - } - l.lockPath = "" - l.seq = 0 - return nil -} diff --git a/vendor/github.com/samuel/go-zookeeper/zk/server_help.go b/vendor/github.com/samuel/go-zookeeper/zk/server_help.go deleted file mode 100644 index 3663064ca..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/server_help.go +++ /dev/null @@ -1,216 +0,0 @@ -package zk - -import ( - "fmt" - "io" - "io/ioutil" - "math/rand" - "os" - "path/filepath" - "strings" - "time" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -type TestServer struct { - Port int - Path string - Srv *Server -} - -type TestCluster struct { - Path string - Servers []TestServer -} - -func StartTestCluster(size int, stdout, stderr io.Writer) (*TestCluster, error) { - tmpPath, err := ioutil.TempDir("", "gozk") - if err != nil { - return nil, err - } - success := false - startPort := int(rand.Int31n(6000) + 10000) - cluster := &TestCluster{Path: tmpPath} - defer func() { - if !success { - cluster.Stop() - } - }() - for serverN := 0; serverN < size; serverN++ { - srvPath := filepath.Join(tmpPath, fmt.Sprintf("srv%d", serverN)) - if err := os.Mkdir(srvPath, 0700); err != nil { - return nil, err - } - port := startPort + serverN*3 - cfg := ServerConfig{ - ClientPort: port, - DataDir: srvPath, - } - for i := 0; i < size; i++ { - cfg.Servers = append(cfg.Servers, ServerConfigServer{ - ID: i + 1, - Host: "127.0.0.1", - PeerPort: startPort + i*3 + 1, - LeaderElectionPort: startPort + i*3 + 2, - }) - } - cfgPath := filepath.Join(srvPath, "zoo.cfg") - fi, err := os.Create(cfgPath) - if err != nil { - return nil, err - } - err = cfg.Marshall(fi) - fi.Close() - if err != nil { - return nil, err - } - - fi, err = os.Create(filepath.Join(srvPath, "myid")) - if err != nil { - return nil, err - } - _, err = fmt.Fprintf(fi, "%d\n", serverN+1) - fi.Close() - if err != nil { - return nil, err - } - - srv := &Server{ - ConfigPath: cfgPath, - Stdout: stdout, - Stderr: stderr, - } - if err := srv.Start(); err != nil { - return nil, err - } - cluster.Servers = append(cluster.Servers, TestServer{ - Path: srvPath, - Port: cfg.ClientPort, - Srv: srv, - }) - } - if err := cluster.waitForStart(10, time.Second); err != nil { - return nil, err - } - success = true - return cluster, nil -} - -func (tc *TestCluster) Connect(idx int) (*Conn, error) { - zk, _, err := Connect([]string{fmt.Sprintf("127.0.0.1:%d", tc.Servers[idx].Port)}, time.Second*15) - return zk, err -} - -func (tc *TestCluster) ConnectAll() (*Conn, <-chan Event, error) { - return tc.ConnectAllTimeout(time.Second * 15) -} - -func (tc *TestCluster) ConnectAllTimeout(sessionTimeout time.Duration) (*Conn, <-chan Event, error) { - return tc.ConnectWithOptions(sessionTimeout) -} - -func (tc *TestCluster) ConnectWithOptions(sessionTimeout time.Duration, options ...connOption) (*Conn, <-chan Event, error) { - hosts := make([]string, len(tc.Servers)) - for i, srv := range tc.Servers { - hosts[i] = fmt.Sprintf("127.0.0.1:%d", srv.Port) - } - zk, ch, err := Connect(hosts, sessionTimeout, options...) - return zk, ch, err -} - -func (tc *TestCluster) Stop() error { - for _, srv := range tc.Servers { - srv.Srv.Stop() - } - defer os.RemoveAll(tc.Path) - return tc.waitForStop(5, time.Second) -} - -// waitForStart blocks until the cluster is up -func (tc *TestCluster) waitForStart(maxRetry int, interval time.Duration) error { - // verify that the servers are up with SRVR - serverAddrs := make([]string, len(tc.Servers)) - for i, s := range tc.Servers { - serverAddrs[i] = fmt.Sprintf("127.0.0.1:%d", s.Port) - } - - for i := 0; i < maxRetry; i++ { - _, ok := FLWSrvr(serverAddrs, time.Second) - if ok { - return nil - } - time.Sleep(interval) - } - return fmt.Errorf("unable to verify health of servers") -} - -// waitForStop blocks until the cluster is down -func (tc *TestCluster) waitForStop(maxRetry int, interval time.Duration) error { - // verify that the servers are up with RUOK - serverAddrs := make([]string, len(tc.Servers)) - for i, s := range tc.Servers { - serverAddrs[i] = fmt.Sprintf("127.0.0.1:%d", s.Port) - } - - var success bool - for i := 0; i < maxRetry && !success; i++ { - success = true - for _, ok := range FLWRuok(serverAddrs, time.Second) { - if ok { - success = false - } - } - if !success { - time.Sleep(interval) - } - } - if !success { - return fmt.Errorf("unable to verify servers are down") - } - return nil -} - -func (tc *TestCluster) StartServer(server string) { - for _, s := range tc.Servers { - if strings.HasSuffix(server, fmt.Sprintf(":%d", s.Port)) { - s.Srv.Start() - return - } - } - panic(fmt.Sprintf("Unknown server: %s", server)) -} - -func (tc *TestCluster) StopServer(server string) { - for _, s := range tc.Servers { - if strings.HasSuffix(server, fmt.Sprintf(":%d", s.Port)) { - s.Srv.Stop() - return - } - } - panic(fmt.Sprintf("Unknown server: %s", server)) -} - -func (tc *TestCluster) StartAllServers() error { - for _, s := range tc.Servers { - if err := s.Srv.Start(); err != nil { - return fmt.Errorf( - "Failed to start server listening on port `%d` : %+v", s.Port, err) - } - } - - return nil -} - -func (tc *TestCluster) StopAllServers() error { - for _, s := range tc.Servers { - if err := s.Srv.Stop(); err != nil { - return fmt.Errorf( - "Failed to stop server listening on port `%d` : %+v", s.Port, err) - } - } - - return nil -} diff --git a/vendor/github.com/samuel/go-zookeeper/zk/server_java.go b/vendor/github.com/samuel/go-zookeeper/zk/server_java.go deleted file mode 100644 index e553ec1d9..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/server_java.go +++ /dev/null @@ -1,136 +0,0 @@ -package zk - -import ( - "fmt" - "io" - "os" - "os/exec" - "path/filepath" -) - -type ErrMissingServerConfigField string - -func (e ErrMissingServerConfigField) Error() string { - return fmt.Sprintf("zk: missing server config field '%s'", string(e)) -} - -const ( - DefaultServerTickTime = 2000 - DefaultServerInitLimit = 10 - DefaultServerSyncLimit = 5 - DefaultServerAutoPurgeSnapRetainCount = 3 - DefaultPeerPort = 2888 - DefaultLeaderElectionPort = 3888 -) - -type ServerConfigServer struct { - ID int - Host string - PeerPort int - LeaderElectionPort int -} - -type ServerConfig struct { - TickTime int // Number of milliseconds of each tick - InitLimit int // Number of ticks that the initial synchronization phase can take - SyncLimit int // Number of ticks that can pass between sending a request and getting an acknowledgement - DataDir string // Direcrory where the snapshot is stored - ClientPort int // Port at which clients will connect - AutoPurgeSnapRetainCount int // Number of snapshots to retain in dataDir - AutoPurgePurgeInterval int // Purge task internal in hours (0 to disable auto purge) - Servers []ServerConfigServer -} - -func (sc ServerConfig) Marshall(w io.Writer) error { - if sc.DataDir == "" { - return ErrMissingServerConfigField("dataDir") - } - fmt.Fprintf(w, "dataDir=%s\n", sc.DataDir) - if sc.TickTime <= 0 { - sc.TickTime = DefaultServerTickTime - } - fmt.Fprintf(w, "tickTime=%d\n", sc.TickTime) - if sc.InitLimit <= 0 { - sc.InitLimit = DefaultServerInitLimit - } - fmt.Fprintf(w, "initLimit=%d\n", sc.InitLimit) - if sc.SyncLimit <= 0 { - sc.SyncLimit = DefaultServerSyncLimit - } - fmt.Fprintf(w, "syncLimit=%d\n", sc.SyncLimit) - if sc.ClientPort <= 0 { - sc.ClientPort = DefaultPort - } - fmt.Fprintf(w, "clientPort=%d\n", sc.ClientPort) - if sc.AutoPurgePurgeInterval > 0 { - if sc.AutoPurgeSnapRetainCount <= 0 { - sc.AutoPurgeSnapRetainCount = DefaultServerAutoPurgeSnapRetainCount - } - fmt.Fprintf(w, "autopurge.snapRetainCount=%d\n", sc.AutoPurgeSnapRetainCount) - fmt.Fprintf(w, "autopurge.purgeInterval=%d\n", sc.AutoPurgePurgeInterval) - } - if len(sc.Servers) > 0 { - for _, srv := range sc.Servers { - if srv.PeerPort <= 0 { - srv.PeerPort = DefaultPeerPort - } - if srv.LeaderElectionPort <= 0 { - srv.LeaderElectionPort = DefaultLeaderElectionPort - } - fmt.Fprintf(w, "server.%d=%s:%d:%d\n", srv.ID, srv.Host, srv.PeerPort, srv.LeaderElectionPort) - } - } - return nil -} - -var jarSearchPaths = []string{ - "zookeeper-*/contrib/fatjar/zookeeper-*-fatjar.jar", - "../zookeeper-*/contrib/fatjar/zookeeper-*-fatjar.jar", - "/usr/share/java/zookeeper-*.jar", - "/usr/local/zookeeper-*/contrib/fatjar/zookeeper-*-fatjar.jar", - "/usr/local/Cellar/zookeeper/*/libexec/contrib/fatjar/zookeeper-*-fatjar.jar", -} - -func findZookeeperFatJar() string { - var paths []string - zkPath := os.Getenv("ZOOKEEPER_PATH") - if zkPath == "" { - paths = jarSearchPaths - } else { - paths = []string{filepath.Join(zkPath, "contrib/fatjar/zookeeper-*-fatjar.jar")} - } - for _, path := range paths { - matches, _ := filepath.Glob(path) - // TODO: could sort by version and pick latest - if len(matches) > 0 { - return matches[0] - } - } - return "" -} - -type Server struct { - JarPath string - ConfigPath string - Stdout, Stderr io.Writer - - cmd *exec.Cmd -} - -func (srv *Server) Start() error { - if srv.JarPath == "" { - srv.JarPath = findZookeeperFatJar() - if srv.JarPath == "" { - return fmt.Errorf("zk: unable to find server jar") - } - } - srv.cmd = exec.Command("java", "-jar", srv.JarPath, "server", srv.ConfigPath) - srv.cmd.Stdout = srv.Stdout - srv.cmd.Stderr = srv.Stderr - return srv.cmd.Start() -} - -func (srv *Server) Stop() error { - srv.cmd.Process.Signal(os.Kill) - return srv.cmd.Wait() -} diff --git a/vendor/github.com/samuel/go-zookeeper/zk/structs.go b/vendor/github.com/samuel/go-zookeeper/zk/structs.go deleted file mode 100644 index d4af27dea..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/structs.go +++ /dev/null @@ -1,609 +0,0 @@ -package zk - -import ( - "encoding/binary" - "errors" - "log" - "reflect" - "runtime" - "time" -) - -var ( - ErrUnhandledFieldType = errors.New("zk: unhandled field type") - ErrPtrExpected = errors.New("zk: encode/decode expect a non-nil pointer to struct") - ErrShortBuffer = errors.New("zk: buffer too small") -) - -type defaultLogger struct{} - -func (defaultLogger) Printf(format string, a ...interface{}) { - log.Printf(format, a...) -} - -type ACL struct { - Perms int32 - Scheme string - ID string -} - -type Stat struct { - Czxid int64 // The zxid of the change that caused this znode to be created. - Mzxid int64 // The zxid of the change that last modified this znode. - Ctime int64 // The time in milliseconds from epoch when this znode was created. - Mtime int64 // The time in milliseconds from epoch when this znode was last modified. - Version int32 // The number of changes to the data of this znode. - Cversion int32 // The number of changes to the children of this znode. - Aversion int32 // The number of changes to the ACL of this znode. - EphemeralOwner int64 // The session id of the owner of this znode if the znode is an ephemeral node. If it is not an ephemeral node, it will be zero. - DataLength int32 // The length of the data field of this znode. - NumChildren int32 // The number of children of this znode. - Pzxid int64 // last modified children -} - -// ServerClient is the information for a single Zookeeper client and its session. -// This is used to parse/extract the output fo the `cons` command. -type ServerClient struct { - Queued int64 - Received int64 - Sent int64 - SessionID int64 - Lcxid int64 - Lzxid int64 - Timeout int32 - LastLatency int32 - MinLatency int32 - AvgLatency int32 - MaxLatency int32 - Established time.Time - LastResponse time.Time - Addr string - LastOperation string // maybe? - Error error -} - -// ServerClients is a struct for the FLWCons() function. It's used to provide -// the list of Clients. -// -// This is needed because FLWCons() takes multiple servers. -type ServerClients struct { - Clients []*ServerClient - Error error -} - -// ServerStats is the information pulled from the Zookeeper `stat` command. -type ServerStats struct { - Sent int64 - Received int64 - NodeCount int64 - MinLatency int64 - AvgLatency int64 - MaxLatency int64 - Connections int64 - Outstanding int64 - Epoch int32 - Counter int32 - BuildTime time.Time - Mode Mode - Version string - Error error -} - -type requestHeader struct { - Xid int32 - Opcode int32 -} - -type responseHeader struct { - Xid int32 - Zxid int64 - Err ErrCode -} - -type multiHeader struct { - Type int32 - Done bool - Err ErrCode -} - -type auth struct { - Type int32 - Scheme string - Auth []byte -} - -// Generic request structs - -type pathRequest struct { - Path string -} - -type PathVersionRequest struct { - Path string - Version int32 -} - -type pathWatchRequest struct { - Path string - Watch bool -} - -type pathResponse struct { - Path string -} - -type statResponse struct { - Stat Stat -} - -// - -type CheckVersionRequest PathVersionRequest -type closeRequest struct{} -type closeResponse struct{} - -type connectRequest struct { - ProtocolVersion int32 - LastZxidSeen int64 - TimeOut int32 - SessionID int64 - Passwd []byte -} - -type connectResponse struct { - ProtocolVersion int32 - TimeOut int32 - SessionID int64 - Passwd []byte -} - -type CreateRequest struct { - Path string - Data []byte - Acl []ACL - Flags int32 -} - -type createResponse pathResponse -type DeleteRequest PathVersionRequest -type deleteResponse struct{} - -type errorResponse struct { - Err int32 -} - -type existsRequest pathWatchRequest -type existsResponse statResponse -type getAclRequest pathRequest - -type getAclResponse struct { - Acl []ACL - Stat Stat -} - -type getChildrenRequest pathRequest - -type getChildrenResponse struct { - Children []string -} - -type getChildren2Request pathWatchRequest - -type getChildren2Response struct { - Children []string - Stat Stat -} - -type getDataRequest pathWatchRequest - -type getDataResponse struct { - Data []byte - Stat Stat -} - -type getMaxChildrenRequest pathRequest - -type getMaxChildrenResponse struct { - Max int32 -} - -type getSaslRequest struct { - Token []byte -} - -type pingRequest struct{} -type pingResponse struct{} - -type setAclRequest struct { - Path string - Acl []ACL - Version int32 -} - -type setAclResponse statResponse - -type SetDataRequest struct { - Path string - Data []byte - Version int32 -} - -type setDataResponse statResponse - -type setMaxChildren struct { - Path string - Max int32 -} - -type setSaslRequest struct { - Token string -} - -type setSaslResponse struct { - Token string -} - -type setWatchesRequest struct { - RelativeZxid int64 - DataWatches []string - ExistWatches []string - ChildWatches []string -} - -type setWatchesResponse struct{} - -type syncRequest pathRequest -type syncResponse pathResponse - -type setAuthRequest auth -type setAuthResponse struct{} - -type multiRequestOp struct { - Header multiHeader - Op interface{} -} -type multiRequest struct { - Ops []multiRequestOp - DoneHeader multiHeader -} -type multiResponseOp struct { - Header multiHeader - String string - Stat *Stat - Err ErrCode -} -type multiResponse struct { - Ops []multiResponseOp - DoneHeader multiHeader -} - -func (r *multiRequest) Encode(buf []byte) (int, error) { - total := 0 - for _, op := range r.Ops { - op.Header.Done = false - n, err := encodePacketValue(buf[total:], reflect.ValueOf(op)) - if err != nil { - return total, err - } - total += n - } - r.DoneHeader.Done = true - n, err := encodePacketValue(buf[total:], reflect.ValueOf(r.DoneHeader)) - if err != nil { - return total, err - } - total += n - - return total, nil -} - -func (r *multiRequest) Decode(buf []byte) (int, error) { - r.Ops = make([]multiRequestOp, 0) - r.DoneHeader = multiHeader{-1, true, -1} - total := 0 - for { - header := &multiHeader{} - n, err := decodePacketValue(buf[total:], reflect.ValueOf(header)) - if err != nil { - return total, err - } - total += n - if header.Done { - r.DoneHeader = *header - break - } - - req := requestStructForOp(header.Type) - if req == nil { - return total, ErrAPIError - } - n, err = decodePacketValue(buf[total:], reflect.ValueOf(req)) - if err != nil { - return total, err - } - total += n - r.Ops = append(r.Ops, multiRequestOp{*header, req}) - } - return total, nil -} - -func (r *multiResponse) Decode(buf []byte) (int, error) { - var multiErr error - - r.Ops = make([]multiResponseOp, 0) - r.DoneHeader = multiHeader{-1, true, -1} - total := 0 - for { - header := &multiHeader{} - n, err := decodePacketValue(buf[total:], reflect.ValueOf(header)) - if err != nil { - return total, err - } - total += n - if header.Done { - r.DoneHeader = *header - break - } - - res := multiResponseOp{Header: *header} - var w reflect.Value - switch header.Type { - default: - return total, ErrAPIError - case opError: - w = reflect.ValueOf(&res.Err) - case opCreate: - w = reflect.ValueOf(&res.String) - case opSetData: - res.Stat = new(Stat) - w = reflect.ValueOf(res.Stat) - case opCheck, opDelete: - } - if w.IsValid() { - n, err := decodePacketValue(buf[total:], w) - if err != nil { - return total, err - } - total += n - } - r.Ops = append(r.Ops, res) - if multiErr == nil && res.Err != errOk { - // Use the first error as the error returned from Multi(). - multiErr = res.Err.toError() - } - } - return total, multiErr -} - -type watcherEvent struct { - Type EventType - State State - Path string -} - -type decoder interface { - Decode(buf []byte) (int, error) -} - -type encoder interface { - Encode(buf []byte) (int, error) -} - -func decodePacket(buf []byte, st interface{}) (n int, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok && e.Error() == "runtime error: slice bounds out of range" { - err = ErrShortBuffer - } else { - panic(r) - } - } - }() - - v := reflect.ValueOf(st) - if v.Kind() != reflect.Ptr || v.IsNil() { - return 0, ErrPtrExpected - } - return decodePacketValue(buf, v) -} - -func decodePacketValue(buf []byte, v reflect.Value) (int, error) { - rv := v - kind := v.Kind() - if kind == reflect.Ptr { - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - v = v.Elem() - kind = v.Kind() - } - - n := 0 - switch kind { - default: - return n, ErrUnhandledFieldType - case reflect.Struct: - if de, ok := rv.Interface().(decoder); ok { - return de.Decode(buf) - } else if de, ok := v.Interface().(decoder); ok { - return de.Decode(buf) - } else { - for i := 0; i < v.NumField(); i++ { - field := v.Field(i) - n2, err := decodePacketValue(buf[n:], field) - n += n2 - if err != nil { - return n, err - } - } - } - case reflect.Bool: - v.SetBool(buf[n] != 0) - n++ - case reflect.Int32: - v.SetInt(int64(binary.BigEndian.Uint32(buf[n : n+4]))) - n += 4 - case reflect.Int64: - v.SetInt(int64(binary.BigEndian.Uint64(buf[n : n+8]))) - n += 8 - case reflect.String: - ln := int(binary.BigEndian.Uint32(buf[n : n+4])) - v.SetString(string(buf[n+4 : n+4+ln])) - n += 4 + ln - case reflect.Slice: - switch v.Type().Elem().Kind() { - default: - count := int(binary.BigEndian.Uint32(buf[n : n+4])) - n += 4 - values := reflect.MakeSlice(v.Type(), count, count) - v.Set(values) - for i := 0; i < count; i++ { - n2, err := decodePacketValue(buf[n:], values.Index(i)) - n += n2 - if err != nil { - return n, err - } - } - case reflect.Uint8: - ln := int(int32(binary.BigEndian.Uint32(buf[n : n+4]))) - if ln < 0 { - n += 4 - v.SetBytes(nil) - } else { - bytes := make([]byte, ln) - copy(bytes, buf[n+4:n+4+ln]) - v.SetBytes(bytes) - n += 4 + ln - } - } - } - return n, nil -} - -func encodePacket(buf []byte, st interface{}) (n int, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok && e.Error() == "runtime error: slice bounds out of range" { - err = ErrShortBuffer - } else { - panic(r) - } - } - }() - - v := reflect.ValueOf(st) - if v.Kind() != reflect.Ptr || v.IsNil() { - return 0, ErrPtrExpected - } - return encodePacketValue(buf, v) -} - -func encodePacketValue(buf []byte, v reflect.Value) (int, error) { - rv := v - for v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface { - v = v.Elem() - } - - n := 0 - switch v.Kind() { - default: - return n, ErrUnhandledFieldType - case reflect.Struct: - if en, ok := rv.Interface().(encoder); ok { - return en.Encode(buf) - } else if en, ok := v.Interface().(encoder); ok { - return en.Encode(buf) - } else { - for i := 0; i < v.NumField(); i++ { - field := v.Field(i) - n2, err := encodePacketValue(buf[n:], field) - n += n2 - if err != nil { - return n, err - } - } - } - case reflect.Bool: - if v.Bool() { - buf[n] = 1 - } else { - buf[n] = 0 - } - n++ - case reflect.Int32: - binary.BigEndian.PutUint32(buf[n:n+4], uint32(v.Int())) - n += 4 - case reflect.Int64: - binary.BigEndian.PutUint64(buf[n:n+8], uint64(v.Int())) - n += 8 - case reflect.String: - str := v.String() - binary.BigEndian.PutUint32(buf[n:n+4], uint32(len(str))) - copy(buf[n+4:n+4+len(str)], []byte(str)) - n += 4 + len(str) - case reflect.Slice: - switch v.Type().Elem().Kind() { - default: - count := v.Len() - startN := n - n += 4 - for i := 0; i < count; i++ { - n2, err := encodePacketValue(buf[n:], v.Index(i)) - n += n2 - if err != nil { - return n, err - } - } - binary.BigEndian.PutUint32(buf[startN:startN+4], uint32(count)) - case reflect.Uint8: - if v.IsNil() { - binary.BigEndian.PutUint32(buf[n:n+4], uint32(0xffffffff)) - n += 4 - } else { - bytes := v.Bytes() - binary.BigEndian.PutUint32(buf[n:n+4], uint32(len(bytes))) - copy(buf[n+4:n+4+len(bytes)], bytes) - n += 4 + len(bytes) - } - } - } - return n, nil -} - -func requestStructForOp(op int32) interface{} { - switch op { - case opClose: - return &closeRequest{} - case opCreate: - return &CreateRequest{} - case opDelete: - return &DeleteRequest{} - case opExists: - return &existsRequest{} - case opGetAcl: - return &getAclRequest{} - case opGetChildren: - return &getChildrenRequest{} - case opGetChildren2: - return &getChildren2Request{} - case opGetData: - return &getDataRequest{} - case opPing: - return &pingRequest{} - case opSetAcl: - return &setAclRequest{} - case opSetData: - return &SetDataRequest{} - case opSetWatches: - return &setWatchesRequest{} - case opSync: - return &syncRequest{} - case opSetAuth: - return &setAuthRequest{} - case opCheck: - return &CheckVersionRequest{} - case opMulti: - return &multiRequest{} - } - return nil -} diff --git a/vendor/github.com/samuel/go-zookeeper/zk/util.go b/vendor/github.com/samuel/go-zookeeper/zk/util.go deleted file mode 100644 index 769bbe878..000000000 --- a/vendor/github.com/samuel/go-zookeeper/zk/util.go +++ /dev/null @@ -1,54 +0,0 @@ -package zk - -import ( - "crypto/sha1" - "encoding/base64" - "fmt" - "math/rand" - "strconv" - "strings" -) - -// AuthACL produces an ACL list containing a single ACL which uses the -// provided permissions, with the scheme "auth", and ID "", which is used -// by ZooKeeper to represent any authenticated user. -func AuthACL(perms int32) []ACL { - return []ACL{{perms, "auth", ""}} -} - -// WorldACL produces an ACL list containing a single ACL which uses the -// provided permissions, with the scheme "world", and ID "anyone", which -// is used by ZooKeeper to represent any user at all. -func WorldACL(perms int32) []ACL { - return []ACL{{perms, "world", "anyone"}} -} - -func DigestACL(perms int32, user, password string) []ACL { - userPass := []byte(fmt.Sprintf("%s:%s", user, password)) - h := sha1.New() - if n, err := h.Write(userPass); err != nil || n != len(userPass) { - panic("SHA1 failed") - } - digest := base64.StdEncoding.EncodeToString(h.Sum(nil)) - return []ACL{{perms, "digest", fmt.Sprintf("%s:%s", user, digest)}} -} - -// FormatServers takes a slice of addresses, and makes sure they are in a format -// that resembles :. If the server has no port provided, the -// DefaultPort constant is added to the end. -func FormatServers(servers []string) []string { - for i := range servers { - if !strings.Contains(servers[i], ":") { - servers[i] = servers[i] + ":" + strconv.Itoa(DefaultPort) - } - } - return servers -} - -// stringShuffle performs a Fisher-Yates shuffle on a slice of strings -func stringShuffle(s []string) { - for i := len(s) - 1; i > 0; i-- { - j := rand.Intn(i + 1) - s[i], s[j] = s[j], s[i] - } -} diff --git a/vendor/github.com/tv42/zbase32/LICENSE b/vendor/github.com/tv42/zbase32/LICENSE deleted file mode 100644 index e0085aaa3..000000000 --- a/vendor/github.com/tv42/zbase32/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 Tommi Virtanen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/tv42/zbase32/flag.go b/vendor/github.com/tv42/zbase32/flag.go deleted file mode 100644 index dc6d59b02..000000000 --- a/vendor/github.com/tv42/zbase32/flag.go +++ /dev/null @@ -1,30 +0,0 @@ -package zbase32 - -import "flag" - -// Value implements flag parsing for zbase32 values. -type Value []byte - -var _ flag.Value = (*Value)(nil) - -// String returns the z-base-32 encoding of the value. -func (v *Value) String() string { - return EncodeToString(*v) -} - -// Set the value to data encoded by string. -func (v *Value) Set(s string) error { - b, err := DecodeString(s) - if err != nil { - return err - } - *v = b - return nil -} - -var _ flag.Getter = (*Value)(nil) - -// Get the data stored in the value. Returns a value of type []byte. -func (v *Value) Get() interface{} { - return []byte(*v) -} diff --git a/vendor/github.com/tv42/zbase32/fuzz.go b/vendor/github.com/tv42/zbase32/fuzz.go deleted file mode 100644 index 2fa97fab4..000000000 --- a/vendor/github.com/tv42/zbase32/fuzz.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build gofuzz - -package zbase32 - -func Fuzz(data []byte) int { - if _, err := DecodeString(string(data)); err != nil { - return 0 - } - return 1 -} diff --git a/vendor/github.com/tv42/zbase32/zbase32.go b/vendor/github.com/tv42/zbase32/zbase32.go deleted file mode 100644 index beef77108..000000000 --- a/vendor/github.com/tv42/zbase32/zbase32.go +++ /dev/null @@ -1,222 +0,0 @@ -// Package zbase32 implements the z-base-32 encoding as specified in -// http://philzimmermann.com/docs/human-oriented-base-32-encoding.txt -// -// Note that this is NOT RFC 4648, for that see encoding/base32. -// z-base-32 is a variant that aims to be more human-friendly, and in -// some circumstances shorter. -// -// Bits -// -// When the amount of input is not a full number of bytes, encoding -// the data can lead to an unnecessary, non-information-carrying, -// trailing character in the encoded data. This package provides -// 'Bits' variants of the functions that can avoid outputting this -// unnecessary trailing character. For example, encoding a 20-bit -// message: -// -// EncodeToString([]byte{0x10, 0x11, 0x10}) == "nyety" -// EncodeBitsToString([]byte{0x10, 0x11, 0x10}, 20) == "nyet" -// -// Decoding such a message requires also using the 'Bits' variant -// function. -package zbase32 - -import ( - "errors" - "strconv" -) - -const alphabet = "ybndrfg8ejkmcpqxot1uwisza345h769" - -var decodeMap [256]byte - -func init() { - for i := 0; i < len(decodeMap); i++ { - decodeMap[i] = 0xFF - } - for i := 0; i < len(alphabet); i++ { - decodeMap[alphabet[i]] = byte(i) - } -} - -// CorruptInputError means that the byte at this offset was not a valid -// z-base-32 encoding byte. -type CorruptInputError int64 - -func (e CorruptInputError) Error() string { - return "illegal z-base-32 data at input byte " + strconv.FormatInt(int64(e), 10) -} - -// EncodedLen returns the maximum length in bytes of the z-base-32 -// encoding of an input buffer of length n. -func EncodedLen(n int) int { - return (n + 4) / 5 * 8 -} - -// DecodedLen returns the maximum length in bytes of the decoded data -// corresponding to n bytes of z-base-32-encoded data. -func DecodedLen(n int) int { - return (n + 7) / 8 * 5 -} - -func encode(dst, src []byte, bits int) int { - off := 0 - for i := 0; i < bits || (bits < 0 && len(src) > 0); i += 5 { - b0 := src[0] - b1 := byte(0) - - if len(src) > 1 { - b1 = src[1] - } - - char := byte(0) - offset := uint(i % 8) - - if offset < 4 { - char = b0 & (31 << (3 - offset)) >> (3 - offset) - } else { - char = b0 & (31 >> (offset - 3)) << (offset - 3) - char |= b1 & (255 << (11 - offset)) >> (11 - offset) - } - - // If src is longer than necessary, mask trailing bits to zero - if bits >= 0 && i+5 > bits { - char &= 255 << uint((i+5)-bits) - } - - dst[off] = alphabet[char] - off++ - - if offset > 2 { - src = src[1:] - } - } - return off -} - -// EncodeBits encodes the specified number of bits of src. It writes at -// most EncodedLen(len(src)) bytes to dst and returns the number of -// bytes written. -// -// EncodeBits is not appropriate for use on individual blocks of a -// large data stream. -func EncodeBits(dst, src []byte, bits int) int { - if bits < 0 { - return 0 - } - return encode(dst, src, bits) -} - -// Encode encodes src. It writes at most EncodedLen(len(src)) bytes to -// dst and returns the number of bytes written. -// -// Encode is not appropriate for use on individual blocks of a large -// data stream. -func Encode(dst, src []byte) int { - return encode(dst, src, -1) -} - -// EncodeToString returns the z-base-32 encoding of src. -func EncodeToString(src []byte) string { - dst := make([]byte, EncodedLen(len(src))) - n := Encode(dst, src) - return string(dst[:n]) -} - -// EncodeBitsToString returns the z-base-32 encoding of the specified -// number of bits of src. -func EncodeBitsToString(src []byte, bits int) string { - dst := make([]byte, EncodedLen(len(src))) - n := EncodeBits(dst, src, bits) - return string(dst[:n]) -} - -func decode(dst, src []byte, bits int) (int, error) { - olen := len(src) - off := 0 - for len(src) > 0 { - // Decode quantum using the z-base-32 alphabet - var dbuf [8]byte - - j := 0 - for ; j < 8; j++ { - if len(src) == 0 { - break - } - in := src[0] - src = src[1:] - dbuf[j] = decodeMap[in] - if dbuf[j] == 0xFF { - return off, CorruptInputError(olen - len(src) - 1) - } - } - - // 8x 5-bit source blocks, 5 byte destination quantum - dst[off+0] = dbuf[0]<<3 | dbuf[1]>>2 - dst[off+1] = dbuf[1]<<6 | dbuf[2]<<1 | dbuf[3]>>4 - dst[off+2] = dbuf[3]<<4 | dbuf[4]>>1 - dst[off+3] = dbuf[4]<<7 | dbuf[5]<<2 | dbuf[6]>>3 - dst[off+4] = dbuf[6]<<5 | dbuf[7] - - // bits < 0 means as many bits as there are in src - if bits < 0 { - var lookup = []int{0, 1, 1, 2, 2, 3, 4, 4, 5} - off += lookup[j] - continue - } - bitsInBlock := bits - if bitsInBlock > 40 { - bitsInBlock = 40 - } - off += (bitsInBlock + 7) / 8 - bits -= 40 - } - return off, nil -} - -// DecodeBits decodes the specified number of bits of z-base-32 -// encoded data from src. It writes at most DecodedLen(len(src)) bytes -// to dst and returns the number of bytes written. -// -// If src contains invalid z-base-32 data, it will return the number -// of bytes successfully written and CorruptInputError. -func DecodeBits(dst, src []byte, bits int) (int, error) { - if bits < 0 { - return 0, errors.New("cannot decode a negative bit count") - } - return decode(dst, src, bits) -} - -// Decode decodes z-base-32 encoded data from src. It writes at most -// DecodedLen(len(src)) bytes to dst and returns the number of bytes -// written. -// -// If src contains invalid z-base-32 data, it will return the number -// of bytes successfully written and CorruptInputError. -func Decode(dst, src []byte) (int, error) { - return decode(dst, src, -1) -} - -func decodeString(s string, bits int) ([]byte, error) { - dst := make([]byte, DecodedLen(len(s))) - n, err := decode(dst, []byte(s), bits) - if err != nil { - return nil, err - } - return dst[:n], nil -} - -// DecodeBitsString returns the bytes represented by the z-base-32 -// string s containing the specified number of bits. -func DecodeBitsString(s string, bits int) ([]byte, error) { - if bits < 0 { - return nil, errors.New("cannot decode a negative bit count") - } - return decodeString(s, bits) -} - -// DecodeString returns the bytes represented by the z-base-32 string -// s. -func DecodeString(s string) ([]byte, error) { - return decodeString(s, -1) -} diff --git a/vendor/github.com/urfave/negroni/LICENSE b/vendor/github.com/urfave/negroni/LICENSE deleted file mode 100644 index 08b5e20ac..000000000 --- a/vendor/github.com/urfave/negroni/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Jeremy Saenz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/urfave/negroni/doc.go b/vendor/github.com/urfave/negroni/doc.go deleted file mode 100644 index add1ed9f7..000000000 --- a/vendor/github.com/urfave/negroni/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -// Package negroni is an idiomatic approach to web middleware in Go. It is tiny, non-intrusive, and encourages use of net/http Handlers. -// -// If you like the idea of Martini, but you think it contains too much magic, then Negroni is a great fit. -// -// For a full guide visit http://github.com/urfave/negroni -// -// package main -// -// import ( -// "github.com/urfave/negroni" -// "net/http" -// "fmt" -// ) -// -// func main() { -// mux := http.NewServeMux() -// mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { -// fmt.Fprintf(w, "Welcome to the home page!") -// }) -// -// n := negroni.Classic() -// n.UseHandler(mux) -// n.Run(":3000") -// } -package negroni diff --git a/vendor/github.com/urfave/negroni/logger.go b/vendor/github.com/urfave/negroni/logger.go deleted file mode 100644 index 032909f5d..000000000 --- a/vendor/github.com/urfave/negroni/logger.go +++ /dev/null @@ -1,80 +0,0 @@ -package negroni - -import ( - "bytes" - - "log" - "net/http" - "os" - "text/template" - "time" -) - -// LoggerEntry is the structure -// passed to the template. -type LoggerEntry struct { - StartTime string - Status int - Duration time.Duration - Hostname string - Method string - Path string -} - -// LoggerDefaultFormat is the format -// logged used by the default Logger instance. -var LoggerDefaultFormat = "{{.StartTime}} | {{.Status}} | \t {{.Duration}} | {{.Hostname}} | {{.Method}} {{.Path}} \n" - -// LoggerDefaultDateFormat is the -// format used for date by the -// default Logger instance. -var LoggerDefaultDateFormat = time.RFC3339 - -// ALogger interface -type ALogger interface { - Println(v ...interface{}) - Printf(format string, v ...interface{}) -} - -// Logger is a middleware handler that logs the request as it goes in and the response as it goes out. -type Logger struct { - // ALogger implements just enough log.Logger interface to be compatible with other implementations - ALogger - dateFormat string - template *template.Template -} - -// NewLogger returns a new Logger instance -func NewLogger() *Logger { - logger := &Logger{ALogger: log.New(os.Stdout, "[negroni] ", 0), dateFormat: LoggerDefaultDateFormat} - logger.SetFormat(LoggerDefaultFormat) - return logger -} - -func (l *Logger) SetFormat(format string) { - l.template = template.Must(template.New("negroni_parser").Parse(format)) -} - -func (l *Logger) SetDateFormat(format string) { - l.dateFormat = format -} - -func (l *Logger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) { - start := time.Now() - - next(rw, r) - - res := rw.(ResponseWriter) - log := LoggerEntry{ - StartTime: start.Format(l.dateFormat), - Status: res.Status(), - Duration: time.Since(start), - Hostname: r.Host, - Method: r.Method, - Path: r.URL.Path, - } - - buff := &bytes.Buffer{} - l.template.Execute(buff, log) - l.Printf(buff.String()) -} diff --git a/vendor/github.com/urfave/negroni/negroni.go b/vendor/github.com/urfave/negroni/negroni.go deleted file mode 100644 index 7a00b38f6..000000000 --- a/vendor/github.com/urfave/negroni/negroni.go +++ /dev/null @@ -1,141 +0,0 @@ -package negroni - -import ( - "log" - "net/http" - "os" -) - -// Handler handler is an interface that objects can implement to be registered to serve as middleware -// in the Negroni middleware stack. -// ServeHTTP should yield to the next middleware in the chain by invoking the next http.HandlerFunc -// passed in. -// -// If the Handler writes to the ResponseWriter, the next http.HandlerFunc should not be invoked. -type Handler interface { - ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) -} - -// HandlerFunc is an adapter to allow the use of ordinary functions as Negroni handlers. -// If f is a function with the appropriate signature, HandlerFunc(f) is a Handler object that calls f. -type HandlerFunc func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) - -func (h HandlerFunc) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) { - h(rw, r, next) -} - -type middleware struct { - handler Handler - next *middleware -} - -func (m middleware) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - m.handler.ServeHTTP(rw, r, m.next.ServeHTTP) -} - -// Wrap converts a http.Handler into a negroni.Handler so it can be used as a Negroni -// middleware. The next http.HandlerFunc is automatically called after the Handler -// is executed. -func Wrap(handler http.Handler) Handler { - return HandlerFunc(func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) { - handler.ServeHTTP(rw, r) - next(rw, r) - }) -} - -// Negroni is a stack of Middleware Handlers that can be invoked as an http.Handler. -// Negroni middleware is evaluated in the order that they are added to the stack using -// the Use and UseHandler methods. -type Negroni struct { - middleware middleware - handlers []Handler -} - -// New returns a new Negroni instance with no middleware preconfigured. -func New(handlers ...Handler) *Negroni { - return &Negroni{ - handlers: handlers, - middleware: build(handlers), - } -} - -// With returns a new Negroni instance that is a combination of the negroni -// receiver's handlers and the provided handlers. -func (n *Negroni) With(handlers ...Handler) *Negroni { - return New( - append(n.handlers, handlers...)..., - ) -} - -// Classic returns a new Negroni instance with the default middleware already -// in the stack. -// -// Recovery - Panic Recovery Middleware -// Logger - Request/Response Logging -// Static - Static File Serving -func Classic() *Negroni { - return New(NewRecovery(), NewLogger(), NewStatic(http.Dir("public"))) -} - -func (n *Negroni) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - n.middleware.ServeHTTP(NewResponseWriter(rw), r) -} - -// Use adds a Handler onto the middleware stack. Handlers are invoked in the order they are added to a Negroni. -func (n *Negroni) Use(handler Handler) { - if handler == nil { - panic("handler cannot be nil") - } - - n.handlers = append(n.handlers, handler) - n.middleware = build(n.handlers) -} - -// UseFunc adds a Negroni-style handler function onto the middleware stack. -func (n *Negroni) UseFunc(handlerFunc func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)) { - n.Use(HandlerFunc(handlerFunc)) -} - -// UseHandler adds a http.Handler onto the middleware stack. Handlers are invoked in the order they are added to a Negroni. -func (n *Negroni) UseHandler(handler http.Handler) { - n.Use(Wrap(handler)) -} - -// UseHandler adds a http.HandlerFunc-style handler function onto the middleware stack. -func (n *Negroni) UseHandlerFunc(handlerFunc func(rw http.ResponseWriter, r *http.Request)) { - n.UseHandler(http.HandlerFunc(handlerFunc)) -} - -// Run is a convenience function that runs the negroni stack as an HTTP -// server. The addr string takes the same format as http.ListenAndServe. -func (n *Negroni) Run(addr string) { - l := log.New(os.Stdout, "[negroni] ", 0) - l.Printf("listening on %s", addr) - l.Fatal(http.ListenAndServe(addr, n)) -} - -// Returns a list of all the handlers in the current Negroni middleware chain. -func (n *Negroni) Handlers() []Handler { - return n.handlers -} - -func build(handlers []Handler) middleware { - var next middleware - - if len(handlers) == 0 { - return voidMiddleware() - } else if len(handlers) > 1 { - next = build(handlers[1:]) - } else { - next = voidMiddleware() - } - - return middleware{handlers[0], &next} -} - -func voidMiddleware() middleware { - return middleware{ - HandlerFunc(func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {}), - &middleware{}, - } -} diff --git a/vendor/github.com/urfave/negroni/recovery.go b/vendor/github.com/urfave/negroni/recovery.go deleted file mode 100644 index 8396cb1ed..000000000 --- a/vendor/github.com/urfave/negroni/recovery.go +++ /dev/null @@ -1,65 +0,0 @@ -package negroni - -import ( - "fmt" - "log" - "net/http" - "os" - "runtime" - "runtime/debug" -) - -// Recovery is a Negroni middleware that recovers from any panics and writes a 500 if there was one. -type Recovery struct { - Logger ALogger - PrintStack bool - ErrorHandlerFunc func(interface{}) - StackAll bool - StackSize int -} - -// NewRecovery returns a new instance of Recovery -func NewRecovery() *Recovery { - return &Recovery{ - Logger: log.New(os.Stdout, "[negroni] ", 0), - PrintStack: true, - StackAll: false, - StackSize: 1024 * 8, - } -} - -func (rec *Recovery) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) { - defer func() { - if err := recover(); err != nil { - if rw.Header().Get("Content-Type") == "" { - rw.Header().Set("Content-Type", "text/plain; charset=utf-8") - } - - rw.WriteHeader(http.StatusInternalServerError) - - stack := make([]byte, rec.StackSize) - stack = stack[:runtime.Stack(stack, rec.StackAll)] - - f := "PANIC: %s\n%s" - rec.Logger.Printf(f, err, stack) - - if rec.PrintStack { - fmt.Fprintf(rw, f, err, stack) - } - - if rec.ErrorHandlerFunc != nil { - func() { - defer func() { - if err := recover(); err != nil { - rec.Logger.Printf("provided ErrorHandlerFunc panic'd: %s, trace:\n%s", err, debug.Stack()) - rec.Logger.Printf("%s\n", debug.Stack()) - } - }() - rec.ErrorHandlerFunc(err) - }() - } - } - }() - - next(rw, r) -} diff --git a/vendor/github.com/urfave/negroni/response_writer.go b/vendor/github.com/urfave/negroni/response_writer.go deleted file mode 100644 index bfb83a6ef..000000000 --- a/vendor/github.com/urfave/negroni/response_writer.go +++ /dev/null @@ -1,113 +0,0 @@ -package negroni - -import ( - "bufio" - "fmt" - "net" - "net/http" -) - -// ResponseWriter is a wrapper around http.ResponseWriter that provides extra information about -// the response. It is recommended that middleware handlers use this construct to wrap a responsewriter -// if the functionality calls for it. -type ResponseWriter interface { - http.ResponseWriter - http.Flusher - // Status returns the status code of the response or 200 if the response has - // not been written (as this is the default response code in net/http) - Status() int - // Written returns whether or not the ResponseWriter has been written. - Written() bool - // Size returns the size of the response body. - Size() int - // Before allows for a function to be called before the ResponseWriter has been written to. This is - // useful for setting headers or any other operations that must happen before a response has been written. - Before(func(ResponseWriter)) -} - -type beforeFunc func(ResponseWriter) - -// NewResponseWriter creates a ResponseWriter that wraps an http.ResponseWriter -func NewResponseWriter(rw http.ResponseWriter) ResponseWriter { - nrw := &responseWriter{ - ResponseWriter: rw, - } - - if _, ok := rw.(http.CloseNotifier); ok { - return &responseWriterCloseNotifer{nrw} - } - - return nrw -} - -type responseWriter struct { - http.ResponseWriter - status int - size int - beforeFuncs []beforeFunc -} - -func (rw *responseWriter) WriteHeader(s int) { - rw.status = s - rw.callBefore() - rw.ResponseWriter.WriteHeader(s) -} - -func (rw *responseWriter) Write(b []byte) (int, error) { - if !rw.Written() { - // The status will be StatusOK if WriteHeader has not been called yet - rw.WriteHeader(http.StatusOK) - } - size, err := rw.ResponseWriter.Write(b) - rw.size += size - return size, err -} - -func (rw *responseWriter) Status() int { - return rw.status -} - -func (rw *responseWriter) Size() int { - return rw.size -} - -func (rw *responseWriter) Written() bool { - return rw.status != 0 -} - -func (rw *responseWriter) Before(before func(ResponseWriter)) { - rw.beforeFuncs = append(rw.beforeFuncs, before) -} - -func (rw *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { - hijacker, ok := rw.ResponseWriter.(http.Hijacker) - if !ok { - return nil, nil, fmt.Errorf("the ResponseWriter doesn't support the Hijacker interface") - } - return hijacker.Hijack() -} - -func (rw *responseWriter) callBefore() { - for i := len(rw.beforeFuncs) - 1; i >= 0; i-- { - rw.beforeFuncs[i](rw) - } -} - -func (rw *responseWriter) Flush() { - flusher, ok := rw.ResponseWriter.(http.Flusher) - if ok { - if !rw.Written() { - // The status will be StatusOK if WriteHeader has not been called yet - rw.WriteHeader(http.StatusOK) - } - flusher.Flush() - } -} - -type responseWriterCloseNotifer struct { - *responseWriter -} - -func (rw *responseWriterCloseNotifer) CloseNotify() <-chan bool { - return rw.ResponseWriter.(http.CloseNotifier).CloseNotify() -} diff --git a/vendor/github.com/urfave/negroni/static.go b/vendor/github.com/urfave/negroni/static.go deleted file mode 100644 index 34be967c0..000000000 --- a/vendor/github.com/urfave/negroni/static.go +++ /dev/null @@ -1,88 +0,0 @@ -package negroni - -import ( - "net/http" - "path" - "strings" -) - -// Static is a middleware handler that serves static files in the given -// directory/filesystem. If the file does not exist on the filesystem, it -// passes along to the next middleware in the chain. If you desire "fileserver" -// type behavior where it returns a 404 for unfound files, you should consider -// using http.FileServer from the Go stdlib. -type Static struct { - // Dir is the directory to serve static files from - Dir http.FileSystem - // Prefix is the optional prefix used to serve the static directory content - Prefix string - // IndexFile defines which file to serve as index if it exists. - IndexFile string -} - -// NewStatic returns a new instance of Static -func NewStatic(directory http.FileSystem) *Static { - return &Static{ - Dir: directory, - Prefix: "", - IndexFile: "index.html", - } -} - -func (s *Static) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) { - if r.Method != "GET" && r.Method != "HEAD" { - next(rw, r) - return - } - file := r.URL.Path - // if we have a prefix, filter requests by stripping the prefix - if s.Prefix != "" { - if !strings.HasPrefix(file, s.Prefix) { - next(rw, r) - return - } - file = file[len(s.Prefix):] - if file != "" && file[0] != '/' { - next(rw, r) - return - } - } - f, err := s.Dir.Open(file) - if err != nil { - // discard the error? - next(rw, r) - return - } - defer f.Close() - - fi, err := f.Stat() - if err != nil { - next(rw, r) - return - } - - // try to serve index file - if fi.IsDir() { - // redirect if missing trailing slash - if !strings.HasSuffix(r.URL.Path, "/") { - http.Redirect(rw, r, r.URL.Path+"/", http.StatusFound) - return - } - - file = path.Join(file, s.IndexFile) - f, err = s.Dir.Open(file) - if err != nil { - next(rw, r) - return - } - defer f.Close() - - fi, err = f.Stat() - if err != nil || fi.IsDir() { - next(rw, r) - return - } - } - - http.ServeContent(rw, r, file, fi.ModTime(), f) -} diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go deleted file mode 100644 index e5906de7d..000000000 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: grpc_health_v1/health.proto - -package grpc_health_v1 // import "google.golang.org/grpc/health/grpc_health_v1" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type HealthCheckResponse_ServingStatus int32 - -const ( - HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 - HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 - HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 -) - -var HealthCheckResponse_ServingStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SERVING", - 2: "NOT_SERVING", -} -var HealthCheckResponse_ServingStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SERVING": 1, - "NOT_SERVING": 2, -} - -func (x HealthCheckResponse_ServingStatus) String() string { - return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) -} -func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_health_8e5b8a3074428511, []int{1, 0} -} - -type HealthCheckRequest struct { - Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } -func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) } -func (*HealthCheckRequest) ProtoMessage() {} -func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_health_8e5b8a3074428511, []int{0} -} -func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HealthCheckRequest.Unmarshal(m, b) -} -func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HealthCheckRequest.Marshal(b, m, deterministic) -} -func (dst *HealthCheckRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckRequest.Merge(dst, src) -} -func (m *HealthCheckRequest) XXX_Size() int { - return xxx_messageInfo_HealthCheckRequest.Size(m) -} -func (m *HealthCheckRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckRequest proto.InternalMessageInfo - -func (m *HealthCheckRequest) GetService() string { - if m != nil { - return m.Service - } - return "" -} - -type HealthCheckResponse struct { - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } -func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } -func (*HealthCheckResponse) ProtoMessage() {} -func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_health_8e5b8a3074428511, []int{1} -} -func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HealthCheckResponse.Unmarshal(m, b) -} -func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic) -} -func (dst *HealthCheckResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckResponse.Merge(dst, src) -} -func (m *HealthCheckResponse) XXX_Size() int { - return xxx_messageInfo_HealthCheckResponse.Size(m) -} -func (m *HealthCheckResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckResponse proto.InternalMessageInfo - -func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { - if m != nil { - return m.Status - } - return HealthCheckResponse_UNKNOWN -} - -func init() { - proto.RegisterType((*HealthCheckRequest)(nil), "grpc.health.v1.HealthCheckRequest") - proto.RegisterType((*HealthCheckResponse)(nil), "grpc.health.v1.HealthCheckResponse") - proto.RegisterEnum("grpc.health.v1.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Health service - -type HealthClient interface { - Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) -} - -type healthClient struct { - cc *grpc.ClientConn -} - -func NewHealthClient(cc *grpc.ClientConn) HealthClient { - return &healthClient{cc} -} - -func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - out := new(HealthCheckResponse) - err := grpc.Invoke(ctx, "/grpc.health.v1.Health/Check", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Health service - -type HealthServer interface { - Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) -} - -func RegisterHealthServer(s *grpc.Server, srv HealthServer) { - s.RegisterService(&_Health_serviceDesc, srv) -} - -func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HealthServer).Check(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/grpc.health.v1.Health/Check", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Health_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.health.v1.Health", - HandlerType: (*HealthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Check", - Handler: _Health_Check_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "grpc_health_v1/health.proto", -} - -func init() { proto.RegisterFile("grpc_health_v1/health.proto", fileDescriptor_health_8e5b8a3074428511) } - -var fileDescriptor_health_8e5b8a3074428511 = []byte{ - // 269 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0x2f, 0x2a, 0x48, - 0x8e, 0xcf, 0x48, 0x4d, 0xcc, 0x29, 0xc9, 0x88, 0x2f, 0x33, 0xd4, 0x87, 0xb0, 0xf4, 0x0a, 0x8a, - 0xf2, 0x4b, 0xf2, 0x85, 0xf8, 0x40, 0x92, 0x7a, 0x50, 0xa1, 0x32, 0x43, 0x25, 0x3d, 0x2e, 0x21, - 0x0f, 0x30, 0xc7, 0x39, 0x23, 0x35, 0x39, 0x3b, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, - 0x82, 0x8b, 0xbd, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, - 0x08, 0xc6, 0x55, 0x9a, 0xc3, 0xc8, 0x25, 0x8c, 0xa2, 0xa1, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 0x55, - 0xc8, 0x93, 0x8b, 0xad, 0xb8, 0x24, 0xb1, 0xa4, 0xb4, 0x18, 0xac, 0x81, 0xcf, 0xc8, 0x50, 0x0f, - 0xd5, 0x22, 0x3d, 0x2c, 0x9a, 0xf4, 0x82, 0x41, 0x86, 0xe6, 0xa5, 0x07, 0x83, 0x35, 0x06, 0x41, - 0x0d, 0x50, 0xb2, 0xe2, 0xe2, 0x45, 0x91, 0x10, 0xe2, 0xe6, 0x62, 0x0f, 0xf5, 0xf3, 0xf6, 0xf3, - 0x0f, 0xf7, 0x13, 0x60, 0x00, 0x71, 0x82, 0x5d, 0x83, 0xc2, 0x3c, 0xfd, 0xdc, 0x05, 0x18, 0x85, - 0xf8, 0xb9, 0xb8, 0xfd, 0xfc, 0x43, 0xe2, 0x61, 0x02, 0x4c, 0x46, 0x51, 0x5c, 0x6c, 0x10, 0x8b, - 0x84, 0x02, 0xb8, 0x58, 0xc1, 0x96, 0x09, 0x29, 0xe1, 0x75, 0x09, 0xd8, 0xbf, 0x52, 0xca, 0x44, - 0xb8, 0xd6, 0x29, 0x91, 0x4b, 0x30, 0x33, 0x1f, 0x4d, 0xa1, 0x13, 0x37, 0x44, 0x65, 0x00, 0x28, - 0x70, 0x03, 0x18, 0xa3, 0x74, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xd2, 0xf3, 0x73, 0x12, - 0xf3, 0xd2, 0xf5, 0xf2, 0x8b, 0xd2, 0xf5, 0x41, 0x1a, 0xa0, 0x71, 0xa0, 0x8f, 0x1a, 0x33, 0xab, - 0x98, 0xf8, 0xdc, 0x41, 0xa6, 0x41, 0x8c, 0xd0, 0x0b, 0x33, 0x4c, 0x62, 0x03, 0x47, 0x92, 0x31, - 0x20, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x70, 0xc4, 0xa7, 0xc3, 0x01, 0x00, 0x00, -}